Hi, I'm building a scatter tool for maya that uses nparticles and an instancer to distribute geometry in the scene. I built my own sampler that basically returns a point array which gets fed into the particle system. Alongside the point array i also get a normal array which I can use to calculate rotation values that match to the surface normal direction. I achieve this my doing the following:
normal = n[i] # MVector, surfacenormal world = OpenMaya.MVector(0, 1, 0) rot_quat = OpenMaya.MQuaternion(world, n[i], normal_weight) rotation = OpenMaya.MVector(math.degrees(rot_quat.asEulerRotation().x), math .degrees(rot_quat.asEulerRotation().y), math.degrees(rot_quat. asEulerRotation().z)) self.rotation_pp.append(rotation) What I want to do now is to randomly rotate each instance by a certain amount of degree around its "local" x, y and z axis. Can somebody point me towards the right direction how I can get the desired result? thanks a lot, Anno -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/25c6b07d-5cba-4363-ac2e-1c6737ff7372%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
