michael.zhang Posted October 20, 2010 Share Posted October 20, 2010 Hello, I am referring to scripts in the: data/scripts/character/ directory. 1) CombinerSubstitute... judging by the code, there is no weight input. Documentation includes example code with weight input. Typo? 2) For the combiners that inherit from CombinerComplex, which of the operands are the primary/secondary? So far I've been assuming operands[0] would be the primary, and operands[1] would be the secondary. Why do I need to know this? Because,... if the weight is 0.75... which of the two operands is more heavily weighted? 3) the operands is a vector. Consequently, when you remove the operands[0], the vector is rearranged such that operands[1] moves into index 0. I have opted to set operands[0] = NULL. THough, this breaks makes usage of operands.check(0) a little confusing, since it will return 1 even though the value is NULL. Just thought I'd mention this, in case you consider modifying this. Along that line of thought... 4) What are your intentions with the character script? Are there any plans to... improve it? extend it? redesign it? Michael Link to comment
Guest extaliones Posted October 28, 2010 Share Posted October 28, 2010 1) CombinerSubstitute... judging by the code, there is no weight input. Documentation includes example code with weight input. Typo? We will fix documentation as soon as possible. 2) For the combiners that inherit from CombinerComplex, which of the operands are the primary/secondary? So far I've been assuming operands[0] would be the primary, and operands[1] would be the secondary. Why do I need to know this? Because,... if the weight is 0.75... which of the two operands is more heavily weighted? This operands take part in formula for blending two animation flows for example the CombinerAdd uses the following method: void ObjectMeshSkinned::mulBuffer(int dst,int src0,int src1,float weight) and fills the destination buffer by the following formulas (so in this case, primary/secondary terms do not apply): dst_pos = src0_pos + src1_pos * weight; dst_rot = slerp(src0_rot,src0_rot * src1_rot,weight); dst_scale = slerp(src0_scale,src0_scale * src1_scale,weight); int dst - Destination buffer. int src0 - Source0 buffer. int src1 - Source1 buffer. float weight - Interpolation weight. where the src0 is op[0], src1 is op[1] 3) the operands is a vector. Consequently, when you remove the operands[0], the vector is rearranged such that operands[1] moves into index 0. I have opted to set operands[0] = NULL. Though, this breaks makes usage of operands.check(0) a little confusing, since it will return 1 even though the value is NULL. Just thought I'd mention this, in case you consider modifying this. Along that line of thought... To delete an element from a container (vector) you have to use remove method. Syntax: container.remove(argument) where argument is an integer position or a key of an element, which is to be removed. 4) What are your intentions with the character script? Are there any plans to... improve it? extend it? redesign it? Unfortunately, we are not going to update the character system. Link to comment
binstream Posted November 1, 2010 Share Posted November 1, 2010 In fact, we plan to improve the system basing on generic flow graph solution, which is planned for the nearest future. Link to comment
michael.zhang Posted November 1, 2010 Author Share Posted November 1, 2010 dst_pos = src0_pos + src1_pos * weight; dst_rot = slerp(src0_rot,src0_rot * src1_rot,weight); dst_scale = slerp(src0_scale,src0_scale * src1_scale,weight); I see, so, this code would suggest that when weight = 0, the output is based on src 0. When weight = 1, output is based on src1. I guess I'm just calling that src0 primary, and src1 secondary, since src1 modifies src0 (by interpolation) by a given weight. Anyways, thanks for the answers. Are the improvements to generic flow graph going to completely alter the strucutre of the animation tree? Will I need to rewrite significant portions of my animation editor? :) wish I knew about this a week ago Link to comment
binstream Posted November 1, 2010 Share Posted November 1, 2010 Are the improvements to generic flow graph going to completely alter the strucutre of the animation tree? Will I need to rewrite significant portions of my animation editor? :) wish I knew about this a week ago We'll provide an upgrade script. Anyway animation system won't be changed in the next 2 months. Link to comment
michael.zhang Posted November 2, 2010 Author Share Posted November 2, 2010 We'll provide an upgrade script. Anyway animation system won't be changed in the next 2 months. Okay, thank you for the information. I look forward to the update! Link to comment
manguste Posted November 3, 2010 Share Posted November 3, 2010 1) CombinerSubstitute... judging by the code, there is no weight input. Documentation includes example code with weight input. Typo? A typo, fixed. Link to comment
Recommended Posts