Forum: Poser - OFFICIAL


Subject: Zeroing dials - can Python do it?

FishNose opened this issue on Jun 21, 2004 ยท 23 posts


FishNose posted Mon, 21 June 2004 at 11:19 AM

When I'm working with a character that has a zillion morphs and I want to spawn a new morph from a magnet setting - I have to first zero ALL the other dials in the body part (apart from the Transform dials of course) which can take a long, long time.... I mean, a body part with 197 dials, you know.... going through all that looking for non-zero settings.
Can take a while.

Can Python be used to set all dials for a body part (or indeed for the entire figure - including fbm's) to zero, apart from the Transform dials?

:] Fish

Message edited on: 06/21/2004 11:21


stewer posted Mon, 21 June 2004 at 11:31 AM

Here you are:

for a in poser.Scene().CurrentFigure().Actors():
        for p in a.Parameters():
                if (p.IsMorphTarget()):
                        p.SetValue(0)

markschum posted Mon, 21 June 2004 at 11:32 AM

Essentially yes. The scale, rotation and translation dials are all accessible. There is a python script that generates a list of all available parameters for each body part of a figure. I don't remember where I saw it though. There are also a couple of scripts for identifying dials that are zeroed. If you can't find one drop me a message and I will send you one. regards


stewer posted Mon, 21 June 2004 at 11:38 AM

I thought it was suppoosed to do that? Not? Uh, maybe I just misunderstood the question, nevermind.


ockham posted Mon, 21 June 2004 at 11:51 AM

Oh, maybe so. In any case, both things are now available in the thread!

My python page
My ShareCG freebies


d-larsen posted Mon, 21 June 2004 at 12:21 PM

Um,, err, Ockham what happens to my figure when this script runs? It's gone from view and I can't find it


stewer posted Mon, 21 June 2004 at 12:28 PM

It zeroes all the scaling parms...


d-larsen posted Mon, 21 June 2004 at 12:32 PM

Yes, I noticed. I thought the idea was to just zero morph dials. A variation of this script to not affect scaling or trans dials would be really cool! Like Fisknose said, after spawning the new morph to reset 100 dials is very time-consuming. I add it to my wishlist.


stewer posted Mon, 21 June 2004 at 12:39 PM

I thought the idea was to just zero morph dials that's what my script does.


d-larsen posted Mon, 21 June 2004 at 12:48 PM

Thanks stew! Just tried yours and it errors on line 4 as invalid syntax. Sorry, don't mean to sound like I'm complaining, I think I'm doing something wrong. I obviously misunderstood what Ockham was doing with his script. I now see that your script is what I want to do, at least, and what I understood the question orignally. I just have to figure out what I'm doing wrong. Thanks to both you and Ockham for all that you two give us newbies!


stewer posted Mon, 21 June 2004 at 12:55 PM

Python wants you to have a newline at the end of the script - just press enter after p.SetValue(0), then save. The script should run now (I tested it in P5, but it should run just as well with PPP).


d-larsen posted Mon, 21 June 2004 at 12:57 PM

Thanks stew! I appreciate it greatly!


ockham posted Mon, 21 June 2004 at 1:23 PM

I just deleted my script above since it;s obviously wrong. (I should learn not to post things quickly in the morning, before drinking sufficient coffee.)

My python page
My ShareCG freebies


EnglishBob posted Mon, 21 June 2004 at 1:31 PM

Attached Link: http://ockhamsbungalow.com/Python/

Ockham - don't you have a script on your site that does this? ZeroMorphs.zip at the link... I know you haven't had your coffee yet, but it feel strange for me to be telling you what you've already done; considering I only got Poser 5 last week, and downloaded your scripts today, I may well have it wrong.

ockham posted Mon, 21 June 2004 at 1:36 PM

You're right. Actually I did remember that script, but I somehow got the idea that FishNose was asking for a script to zero everything except the morphs. So I wrote a quickie, which had the above-mentioned bad side effect.

My python page
My ShareCG freebies


d-larsen posted Mon, 21 June 2004 at 2:20 PM

It's the effort that counts as far as I am concerned! Thanks again Ockham, EnglishBob, and Stewer.


lesbentley posted Mon, 21 June 2004 at 4:28 PM

Um, perhaps a script to set all dials to zero EXCEPT scale channels which should be set to one.


FishNose posted Mon, 21 June 2004 at 5:56 PM

Yes, I want to set everything to zero except the Transform dials - since I don't want to change the pose itself. Does zeromorphs set everything to zero, in ALL body parts at once, plus Body? (I'm not in a position right now to test it I'm afraid) Coolest would be a script that allowed you to specify: 1. This Body Part Only 2. All Parts 3. All Parts incl Body fbm's :] Fish


d-larsen posted Mon, 21 June 2004 at 6:50 PM

Ockham's script to Zero Morphs, zeros all the morphs. It asks you what Figure or part of figure. You supply the figure or body part name and it zeroed all morph targets leaving the trans and scale dials alone. I just used it in P5 no problems.


FreeBass posted Mon, 21 June 2004 at 6:59 PM

Uhhh....I have a Python script that duz MOR files. Why not just make a zeroed MOR pose?



WARNING!

This user has been known to swear. A LOT!


d-larsen posted Mon, 21 June 2004 at 7:25 PM

I don't know why! I never thought of using that, but the script Ockham has works great so I guess it would work unless somebody knows a reason why.


byAnton posted Mon, 21 June 2004 at 10:51 PM

Daz has a Python script that does this. ASk them. Maybe they will make it a freebie.

-Anton, creator of Apollo Maximus
"Conviction without truth is denial; Denial in the face of truth is concealment."


Over 100,000 Downloads....


EnglishBob posted Tue, 22 June 2004 at 2:58 AM

An MOR pose has to name the morphs it's zeroing explicitly, so it would only be good for one particular figure - and that figure would have to be unmodified (no extra morph targets added). The advantage of Python is that it can have access to all the parameters without having to know their names.