[Closed] Help with Scatter / ObjDetach, Please
Hey guys,
I am using scatter on a sphere to create a bunch of little boxes that follow the shape of the sphere.
I am then detaching them into individual objects again, and aligning objects to the boxes… essentially objReplacing them… but I had wrote a script to do this before I had found objReplace.
My only problem is the orientation.
The objects at the bottom of the sphere are standing straight up, just like the ones on the top of the sphere. They do not follow the orientation of the boxes, but the boxes don’t seem to have any kind of rotational information on them for me to match. Thus, orientation constraints do nothing for me as well.
Do you have any suggestions as to how I might match orientation on these guys?
I’m a little brain mushed and clueless at this point. I would really appreciate some reinforcements.
The reason it is not working is the objects are getting the pivot position/orientation from the object they are detached from. The best scripted way to do this is write a script that calculates the face normal and places the object there for you.
-Eric
Thanks for the prompt response, Pixel Monkey!
I did find this solution, and was coming back to post it in case anyone else ran into the same issue. It ended up being alot easier and simpler than I was going into…
(
s = sphere pos:[10,20,30]
t = teapot radius:5
theMesh = snapshotasmesh s
for f = 1 to theMesh.numfaces do
(
theClone = instance t
theClone.dir = getFaceNormal theMesh f
theClone.pos = meshop.getFaceCenter theMesh f
)
)
I got the general idea from this script of Bobo’s. Bobo… again you save the day. Hurray.
This script does more than what I needed, but I figured it would make the most sense posted in its fullest form.