Don't DC to rotate even if parent component does
-
I have two children DC's that I want to always keep their orientation. So if someone rotates the model, I want my DC's to snap back to their original orientation. Kind of like face me, but instead of being tied to the camera, I want them tied to the model orientation.
Has anyone done this before?
-
Maybe something like this would work?
RotX: =-parent!RotX RotY: =-parent!RotY RotZ: =-parent!RotX
-
If their axis is not aligned to the parent's axis though, it is also going to require computing x,y,z values. Rotating the parent will change their rotation AND their location.
-
Thanks, that works great, although I'd love an auto-redraw. As is the user has to go back in and change an attribute to do this (or context click/redraw).
So if I add this component in through a ruby script, can I place an entity observer on it that will redraw it if it is moved rotated (vs. only when the component itself is changed.)
I need to learn more about observers. If they are global, or tagged to specific entities.
-
@unknownuser said:
If their axis is not aligned to the parent's axis though, it is also going to require computing x,y,z values. Rotating the parent will change their rotation AND their location.
Chris, I missed this as it was just about when I made my last post. I'm not too concerned about the location of the children moving. I am more concerned about keeping the child on the same rotX,rotY,rotZ rotation as the top level model axis; by this I mean rotX,Y,Z all = 0
So I have two big issue with my setup right now.
-
First is that this only works if my parent is a top level component/group. If someone places it inside of a group then I lose my bearings. If I know they need it inside a group I can setup a DC group that itself would pass information. So there would be a grandparent/parent/child setup. But I don't want to have to rely on this.
-
My second problem is that my child can handle rotations on any axis, but it has trouble with more than one. So I'm ok if I change rotX, or rotY, but not rotX & rotY.
I have attached a file with two instances of my component. One is top level one is inside of the group. So if you select all and rotate, only one will fix itself. And you have to use the interact tool or right click to REDRAW() for it to update.
OK, I take that back. This is where things get odd. I base my calcualtsion off what I think the parents rotX,Y,Z are based on, and the odd things is a "REDRAW" by clicking on the interact while the parent is nested in a grandparent, doesn't give the same results as when I REDERAW when I have gone into the grandparent.
-
Advertisement