On 18/07/2016 at 09:27, xxxxxxxx wrote:
I'm working on a Python Generator and I'm confused about what is happening when the object is scaled.
Here is the python generator simple setup:
The python generator has a user data float gadget set to meter with id = 1;
import c4d def main() : rad = op[c4d.ID_USERDATA, 1] cube = c4d.BaseObject(c4d.Ocube) cube[c4d.PRIM_CUBE_LEN, c4d.VECTOR_X] = rad * 2.0 cube[c4d.PRIM_CUBE_LEN, c4d.VECTOR_Y] = rad * 2.0 cube[c4d.PRIM_CUBE_LEN, c4d.VECTOR_Z] = rad *2.0 return cube
If the document is in 'Model' mode and I scale the python generator with the scale tool, the float gadget is updated and the object is scaled. The attribute manager coordinates for scale are not changed.
If the document is in 'Object' mode and I scale the python generator with the scale tool, the float gadget is not updated but the object is scaled. The attribute manager coordinates for scale are changed.
Scaling in 'Object' mode makes sense to me. I can see that the matrix has changed so the mesh generated by the generator should be changed accordingly.
Scaling in 'Model' mode is confusing to me. How does the python generator know what parameters to change when it is scaled in 'Model' mode? Is there some magic going on behind the scenes?