Fri, Nov 29, 9:39 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 29 7:57 am)



Subject: Is there an existing script to copy parameter limits between figures?


Cage ( ) posted Fri, 03 May 2013 at 11:22 PM edited Fri, 29 November 2024 at 9:37 AM

I have need of a script to copy joint limits between several modified versions of Antonia.聽 Before I break down and write one, I thought I should ask if there's already such a script out there.聽 Is there such a thing?聽 馃槙

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.聽 He apologizes for this.聽 He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.聽 His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


markschum ( ) posted Sat, 04 May 2013 at 12:10 AM

I started something a while back

import poser
scn = poser.Scene()
xt = poser.kParmCodeXTRAN
yt = poser.kParmCodeYTRAN
zt = poser.kParmCodeZTRAN
xr = poser.kParmCodeXROT
yr = poser.kParmCodeYROT
zr = poser.kParmCodeZROT
parmtypes = [xt,yt,zt,xr,yr,zr]
fig = scn.Figure("Figure 1")
fig2 = scn.Figure("Figure 2")
acts = fig.Actors()
for act in acts:
聽聽 聽if act.IsBodyPart():
聽聽 聽聽聽 聽for t in parmtypes:
聽聽 聽聽聽 聽聽聽 聽p = act.Parameter(t).MaxValue()
聽聽 聽聽聽 聽聽聽 聽fig2.Actor(act.Name()).Parameter(t).SetMaxValue(p)

No idea if it works.


Cage ( ) posted Sat, 04 May 2013 at 12:29 AM

Hey, wow.聽 That's simpler than I was anticipating.聽 :woot:聽 Thanks, markschum!聽 :thumbupboth:

I don't remember clearly, but I thought when I'd tried to process limits using a script, there was some unusual extra step required to actually activate them.聽 Maybe I'm thinking of a case where I needed forceLimits to be active.聽 Hmm.聽 馃槙聽 I have this tendency to make things more complicated in my thoughts than they really are, out there in the real world.聽 :lol:

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.聽 He apologizes for this.聽 He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.聽 His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


Morkonan ( ) posted Sat, 04 May 2013 at 6:31 AM

Quote - ...No idea if it works.

I tried to follow the instructions, but got my head stuck in a tree while being force-fed small toy fire-engines by a plaid colored gorrilla named "Sam." I think I did something wrong...

IIRC, Poser2012Pro has a native way to copy joint parameters. I've only fiddled with it a couple of times and succeeded in launching a watermelon fifty-feet into the air so it could catch a ride with a zeppelin... I probably did something wrong there, too.

(Note: I assume all I have to do in order to test this is to copy the text and create a python file extension for it?)


ockham ( ) posted Sat, 04 May 2013 at 6:35 AM edited Sat, 04 May 2013 at 6:37 AM

Nope, there isn't an extra step.聽 I've got a script that looks about the same as markschum's example, and it works instantly.

You would need an error check on the body parts and parm names, like this

import poser

scene=poser.Scene()

fig1=scene.Figure('FirstVickyOrSomething')

fig2=scene.Figure('SecondVickyOrWhatever')

for a1 in fig1.Actors():
聽聽聽 try:
聽聽聽聽聽聽聽 a2=fig2.Actor(a1.Name())
聽聽聽 except:
聽聽聽聽聽聽聽 continue
聽聽聽 for p1 in a1.Parameters():
聽聽聽聽聽聽聽 try:
聽聽聽聽聽聽聽聽聽聽聽 p2=a2.Parameter(p1.Name())
聽聽聽聽聽聽聽 except:
聽聽聽聽聽聽聽聽聽聽聽 continue
聽聽聽聽聽聽聽 p2.SetMaxValue(p1.MaxValue())
聽聽聽聽聽聽聽 p2.SetMinValue(p1.MinValue())
聽聽聽聽聽 聽

My python page
My ShareCG freebies


Cage ( ) posted Mon, 13 May 2013 at 3:28 PM edited Mon, 13 May 2013 at 3:31 PM

file_494396.txt

I adapted the code posted here, in the attached, and finally got around to testing it.聽 The process works, but setting min and max limits in Poser is strangely slow, so the script prints its progress to let the user know it's still running.聽 Use of try-except proved to be even slower than what I have and presented the risk of possible exception errors being hidden when the script runs, so I dropped that in favor of building a quick list of actor names common to both figures, using Python set intersection.

I'm posting this here since there doesn't seem to be a copy limits script already available in Poserdom, and not everyone can write one as needed.聽 :unsure:聽 Change the extension from .txt to .py to use the script.

The script requires at least Poser 6, for use of DialogSimple.聽 Python sets may or may not have been available for Poser 6, so possibly P7 is needed to run this.聽 I never had P6, so I can't test it in that version.聽 :unsure:

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.聽 He apologizes for this.聽 He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.聽 His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


primorge ( ) posted Mon, 13 May 2013 at 9:44 PM edited Mon, 13 May 2013 at 9:46 PM

Thank you for that, Markschum and Cage.


markschum ( ) posted Tue, 14 May 2013 at 11:52 AM

My scripts tend to be brute force single use code that I rewrite as needed. For a general purpose script they need changes as ockham has shown or you get a crash. Crashing python is my second hobby ;-)


Cage ( ) posted Tue, 14 May 2013 at 12:53 PM edited Tue, 14 May 2013 at 12:56 PM

Quote - My scripts tend to be brute force single use code that I rewrite as needed. For a general purpose script they need changes as ockham has shown or you get a crash. Crashing python is my second hobby ;-)

Oh, aye.聽 :lol:聽 Crashing Poser Python quickly becomes one's primary pursuit, when one is writing a PPy script.聽 :lol:聽 I think I've had only two or three work immediately without ever going awry.聽 I suspect what I posted above could throw a wobbly if any actor lacks a ROT or TRAN dial.聽 The error handling I added, now that I look at it, would only be able to kick in after Poser threw an error and quit the script.聽 Oops!聽 馃槉聽 But I suspect you can't actually pass Poser an actor without those dials.聽 It will create them if they aren't there... umm, right?聽 Never tested that.聽 :unsure:聽 I know the dials can be hidden, but can they ever be wholly absent?聽 Hmm.聽 馃槙

I'll bet LesBentley or someone can answer that.聽 I'm a Poser Techie, but not a high-ranking member of that order.聽 :lol:聽 Such things remain a mystery to me, and I only end up testing them when it becomes absolutely necessary.

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.聽 He apologizes for this.聽 He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.聽 His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


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.