Forum: Poser Python Scripting


Subject: Positional Script

Nebula opened this issue on Jan 01, 2007 · 10 posts


Nebula posted Mon, 01 January 2007 at 7:57 PM

Hello,

  I was wondering if a script might exist that would allow you position the selected object to a location that was click.  For instance, Victoria in a chair,  You want to place her hand on the arm of the chair.  Click to select her hand and then click on the chair arm.  Since pulling or pushing hand causes the arm and shoulder to bend accordingly, I was hoping it might these motions might occur when the hand is placed where desired.  Of course, the target point would have to be a reasonable distance.  My reason for this would be to get Poser to get the positioning close.  Then all you would have to do is tweak it a bit.  Is this possible?  Would something like this already exist?

Thanks for any thoughts you might have....

Nebula


svdl posted Mon, 01 January 2007 at 8:15 PM

VERY tricky. It's possible to catch selection clicks with Python, but it's not possible to determine what polygon of the target object has been clicked.
There is a fairly easy alternative: inverse kinematics and the orthogonal views. If you want to place Victoria's right hand on the armrest of a chair, do the following:

I usually turn off inverse kinematics for the final render; the joints seem to look somewhat better when IK is off. Turning IK off will usually make the hand/foot make a small "jump", you might have to turn on IK again (no "jump"), fix up the position, and turn it off again.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


Nebula posted Mon, 01 January 2007 at 8:36 PM

svdl,

  Ok, I can try that.  When you say "Fix the forearm, shoulder and collar orientations. They might react strangely to the dials, since the hand is pinned in place", how is the hand "pinned in place"?  Are you talking about doing a "lock actor" or parenting?  The reason I came up with this idea in the first place was because of a WIP I have.  V4 is sitting in a high back chair and I wanted to have her hands reaching back over her head and grasping the top of the back of the chair.  But getting her arms positioned right was a bit of a task.  I pretty much got there, but  I was thinking a script like this would have been helpful.  But I have never tried it like you described it.  I will certinally give it a shot.

 Since I have you here and you do wonders with dynamic cloth, I wanted to ask if you may be able to create a classy dynamic office blouse for V4.  A nice white silk blouse with front buttons that can be opened and a collar that can be make to stand up or down.  You made an awesome blouse and skirt combo for V3 a while back.  You also made a fantastic robe.  I have played with them both and they work great!  So I was just hoping you might be able to come up with a nice collared office blouse I could use.  In fact, it would go wonderfully with the WIP I mentioned above!

  Thanks for your time and you response!

Nebula


svdl posted Mon, 01 January 2007 at 11:51 PM

Inverse kinematics means that the hand will not move when you change joint parameters on another body part. You can only move the hand by selecting the hand itself and using the translate/rotate dials (or dragging).
It has nothing to do with locking an actor - a locked actor means that you cannot change its dials. 
When inverse kinematics is on, it's like the hand is glued to its location. Think of real life: if your hand is tied to the armrest of a chair, you can still move your body, but your hand must stay in place. Your joints will accomodate that requirement. 

By the way, it's a good idea to turn on "apply limits" when using inverse kinematics. If you don't the joints can go pretty weird!

About that office blouse, I was thinking about an office combo: blouse, pencil skirt, maybe a bra and stockings. Already did some modeling experiments with a bra - tough!

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


Nebula posted Tue, 02 January 2007 at 8:26 AM

I get what you mean now about the IK stuff.  If I had thought of how a freshly loaded character acts, move the body and the feet stay in place, doing this with the hand now makes sense.  And I typically run with limits on all the time.  Feel it gives a more realistic pose.  But it is certinally more work to get what you want!

I was thrilled to hear your working on a office outfit!  I can't wait to get ahold of it when your done.  My guess is the bra would be the toughest part to create... being a form-fitting article.  Would the bra be dynamic too??  Don't think I've ever seen that.

If you are able to, I'd love to know when you have it ready.

Take care and thanks a bunch!!  Best of luck on the modeling!

Nebula


svdl posted Tue, 02 January 2007 at 8:07 PM

I'm not sure about making the bra dynamic. It can be done, one of my free Vicki 3 dynamic clothing packs has a dynamic bra, and BillyT has some dynamic lingerie on the market. 
The main advantage is not having to fiddle with oodles of morph dials to get the bra to fit - and doing the same the next keyframe, and the next, ad infinitum. But it certainly is more difficult to model well.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


Nebula posted Tue, 02 January 2007 at 8:13 PM

Hey, your the master.  I'd just be thrilled to have a set that would work for V4, dynamic or not.

Along those lines, is it possible to make your V3 dynamic kimono work for V4?  Is that something that could be easy done?  I've downloaded it again to try and see if it would work as it is.  It worked GREAT for V3.  And you also have a V3 dynamic blouse and skirt set too.

I look forward to whatever you create!

Thanks again,

Nebula


svdl posted Sun, 07 January 2007 at 10:25 PM

Maybe OT, but this is what I've come up with so far. The skirt was a quickie, just a deformed cylinder, the bra is a conformer - with a load of morpphs (not all of them good), and the shirt is far from finished - the lapels give me a lot of grief.

Anyway, this is it.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


Nebula posted Mon, 08 January 2007 at 6:52 AM

Hey!  It's looking great!!  And a very nice fit too!  The skirt looks like it will work well.  The blouse seems a little loose fitting, tho that can be a good thing too.  What's the problem with the lapels?  Maybe be able to set them to a slightly different material in the Cloth window to stiffen them up a hair?

Would it be possible to morph the sleeves and cuff to fit a little tighter, should one desire too?  The loose fit is fine, no doubt.  But if it is possible to be able to dial it a little more form-fitting, that'd be nice too.  If not, by all means, leave it just like you have it!  It's fantastic!!

Nebula


svdl posted Sat, 13 January 2007 at 4:43 AM

Attached Link: http://www.renderosity.com/mod/forumpro/showthread.php?thread_id=2680487&page=1

A second attempt, posted in the Poser forum. Slowly getting there...

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff