Mon, Dec 2, 10:17 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Dec 02 5:01 am)



Subject: Centerpoint question


DigiCalimero ( ) posted Thu, 11 March 2004 at 4:16 PM · edited Sat, 30 November 2024 at 7:55 AM

I found out then when you parent a prop to a figures bodypart, the props centerpoint changes to whatever the centerpoint is for the figures bodypart. Is there a way to avoid this? Perhaps with a pythonscript that changes the props centerpoint back to what is was before it was parented?


ockham ( ) posted Thu, 11 March 2004 at 5:16 PM

file_102010.jpg

Well, it doesn't really lose its own centerpoint. In these images the box is the child, the ball is the parent. I moved the centerpoint of the box downward before parenting to make it more visible. In the image with this message, the box is Z-rotating with respect to its parent (ball). You can see that the rotation is around the box's own center.

My python page
My ShareCG freebies


ockham ( ) posted Thu, 11 March 2004 at 5:20 PM

file_102011.jpg

In this image, the ball is Z-rotating. You can see that the box's centerpoint itself is now moving around the center of the ball. So you could say that the box now has a new "second center". You might look at my Foster Parenting script if you want to tie two things together without this second rotation. I'm not sure if this is the same action you want, though... (Search freestuff for Foster to find it.)

My python page
My ShareCG freebies


DigiCalimero ( ) posted Thu, 11 March 2004 at 5:21 PM

Yes it doesn't loose it's centerpoint, but it snaps to whatever the centerpoint is of the figure you are parenting it too. You can always move it's centerpoint after you've parented it but I thought there would be a way so you don't have to do that. At least this snapping happens for me, maybe because I tick inherit bends? I have to have that ticked though.


DigiCalimero ( ) posted Thu, 11 March 2004 at 5:22 PM

I'll look at that script, thanks!


ockham ( ) posted Thu, 11 March 2004 at 5:28 PM

There is a hidden "realign" choice in parenting, which is only available through Python. To try it out, here's a SUPER-SIMPLE and hard-wired script. I haven't found that it makes any difference, but it might be what you want. import poser scene=poser.Scene() Parent=scene.Actor("ball_1") Child=scene.Actor("box_1") Child.SetParent(Parent,0,0) To try it with your real stuff, just fill in the actual names of actors in the quoted parts. The second zero in SetParent(Parent,0,0) is what turns off the "realign" option.

My python page
My ShareCG freebies


ockham ( ) posted Thu, 11 March 2004 at 5:30 PM

If this does what you want, tell me and I'll make a nicer script with listboxes for child and parent. (I have templates for this sort of stuff, so I can run it up in a few minutes.)

My python page
My ShareCG freebies


DigiCalimero ( ) posted Thu, 11 March 2004 at 6:05 PM

I have a problem running that script, it says it can't find the named actor of the parent. The figure I'm trying to parent to is called BASE, and I'm trying to parent to this figures leftFoot. I've tried BASE:lFoot, lFoot:2, lFoot:BASE...


ockham ( ) posted Thu, 11 March 2004 at 6:12 PM

Assuming your child thing is a free-standing prop named "whatever", this should do it...... import poser scene=poser.Scene() TheFig=scene.Figure("BASE") Parent=TheFig.ActorByInternalName("lFoot") Child=scene.Actor("whatever") Child.SetParent(Parent,0,0)

My python page
My ShareCG freebies


DigiCalimero ( ) posted Thu, 11 March 2004 at 6:32 PM

That seems to have done it:) The centerpoint didn't move and it's now parented. However is it possible to also specify in the script that the prop inherits bends, like in the Poser parenting pop up? One last question:) I understand that in a pose file you can tell it to load whatever you want, even a python script. Would it be possible to have a pose file that just loads this prop(perhaps also using python) and uses just those lines of script you wrote to parent it to the figure?


ockham ( ) posted Thu, 11 March 2004 at 6:45 PM

Sure. The first zero is for Inherit. If you write SetParent(Child,1,0) you'll get InheritBends=On and Realign=Off. On the pose file: I'll have to think about that. The "startup script" works in a CR2, but I haven't found how to make it work in a PZ2. It may or may not be possible. Stewer probably knows the answer to this one.

My python page
My ShareCG freebies


DigiCalimero ( ) posted Thu, 11 March 2004 at 6:51 PM

Ok, thanks a lot for your help ockham:) This is all kind of new to me but you have explained it very well. So happy this works it was driving me nuts.


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.