Hi,
I would like to convert a particle mesh into a set of independent editable objects. Tools/Particle/Particle->Polygon converts the particle mesh into one object, splitting which would be a hard task. Is there a work around?
I have written a script that should do just what I want: it takes a particle mesh as a parameter, then it iterates through the particles, takes particle mesh children in order, copy them, and apply particle position, rotation and scale.
The only problem is that I can not make rotation work correctly: no matter what I do the meshes created with my script have correct position but incorrect orientation in 3d space. Could someone help me please?
I have attached the script and two files: one before script is used, one after.
PS the script should go int ~/Library/Application Support/Cheetah3D/Scripts/Tools When you run the script you should drop the particle mesh with at least one child on it.
Can't look at your code right now. Perhaps it's simply the wrong axis order. It's confusing with particles because they are XYZ whereas most objects (e.g. Meshes) are Heading (Y) pitch (X) bank (Z).
Thank you for your reply podperson! I have tried to switch X and Y rotation angles following your advice, and it almost worked: Some of the meshes are aligned properly, but some of them are still off (as you can see from the 'after.jas' in the attached archive). I wonder what I am missing?!
All right, I finally figured out the script: switching x and y rotation angles is not sufficient in general case, since z rotation is performed the last it is affected by the order of x and y rotation. The simple solution is to introduce an additional folder wrapping the instanciated object to perform z rotation correctly. Script and example are attached (in case if someone might need it). Thank you!
about rotation problem. from v6.0, new API is added for converting XYZ to HPB rotation. It seems to be undocumented at Help file. I used it BVH importer.js script.
Code:
Vec3D::convertEuler( int from_order, int to_order, [ rotation_hint ] );
// rot order constants: ROT_XYZ, ROT_XZY, ROT_YZX..., ROT_HPB
if you want convert XYZ to HPB, the codes will be..
Code:
var xyz_rot = new Vec3D( x, y, z );
var hpb_rot = xyz_rot.convertEuler( ROT_XYZ, ROT_HPB );
Hi, Hiroto,
thank you for the modified version. The new version of script looks very graceful, but it seems to have problems. In the attached test you can see that some of the cube particles orientation is correct, some of them are fine.
Martin and/or Hiroto (or whomever),
I've been wondering about this for a while. When converting a particle mesh, some parameters don't translate, and I'm wondering about, especially, a parameter like "Random" in the "Aligned Particle Spline" particle script. If I use the "Random" setting (which is the default) instead of "Repeat" or "Sorted", the Particle Mesh->Polygons scripts seem to ignore that setting and force even distribution. Is that random setting at all accessible via scripting? I find I am almost always using "Random" and not having this translate to the poly-groups makes it unusable, at least as a 3D export (which, for me, is ideal).
Thanks in advance...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.