Tue, Oct 22, 6:33 AM CDT

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: Adjust feet in Poser animation


Nebula ( ) posted Sun, 04 March 2007 at 10:24 AM · edited Wed, 14 August 2024 at 5:10 PM

Hello,

  Is there any kind of python script around that will automate the adjustment of a characters' feet in Poser.  I have an animation that is 1000 frames long.  I also have the model wearing heels.  The heel product came with a "feet pose" to adjust the feet fit the heels.  What I would like is for the script to go thru each frame and basically click the "feet pose" button automatically.  I hope this makes sense.  Does something like this exist?  If not, I am a programmer by trade.  Would there be any good place to look to figure it out for myself?

 Thanks,

Nebula


svdl ( ) posted Sun, 04 March 2007 at 10:42 AM

Attached Link: http://www.svdlinden.nl/webposerstuff/downloads/footbends.zip

Here are two scripts that I wrote a long time ago. If you combine them and tweak a little, you can make the script you're looking for.

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 Sun, 04 March 2007 at 11:05 AM

Wow, thanks!  I will look at them right now.

Your the man today! lol

Nebula


Nebula ( ) posted Sun, 04 March 2007 at 3:17 PM

I am messing around to learn how Python works.  Having a problem tho....

Question:  What am I doing wrong here??  Error highlighted in code below.....

(Also, how do I rename the character from "Victoria 4" to "JoJo" in the GUI list?)

Error: Traceback (most recent call last):
            File "D:GraphicsPoser 7RuntimePythonCreate_JoJo.py", line 18, in ?
            LeftHeel.SetConformTarget(JoJo)
            AttributeError: 'str' object has no attribute 'SetConformTarget'

Python Code:
*scene=poser.Scene()

scene.LoadLibraryFigure("D:GraphicsPSR-DLCV4-DLCRuntimelibrariescharacterVictoria 4Victoria 4.cr2")
fig=scene.CurrentFigure()
JoJo=fig.Name()

scene.LoadLibraryPose("D:GraphicsPSR-DLCV4-DLCRuntimelibrariesposeJoJo!!jojo_morphINJ.pz2")
scene.LoadLibraryPose("D:GraphicsPSR-DLCV4-DLCRuntimelibrariesposeJoJo!jojo_texture.pz2")
scene.LoadLibraryPose("D:GraphicsPSR-DLCV4-DLCRuntimelibrariesposeJoJomu_2.pz2")
scene.LoadLibraryPose("D:GraphicsPSR-DLCV4-DLCRuntimelibrariesposeAll the Right MovesARM - 115a.pz2")

scene.LoadLibraryFigure("D:GraphicsPSR-DLCV4-DLCRuntimelibrariescharacterHard-Sole SandalsV4HardSoleSandal01 L.cr2")
fig=scene.CurrentFigure()
LeftHeel=fig.Name()
scene.LoadLibraryPose("D:GraphicsPSR-DLCV4-DLCRuntimelibrariesposeHard-Sole Sandals!Show_Ring.pz2")
scene.LoadLibraryPose("D:GraphicsPSR-DLCV4-DLCRuntimelibrariesposeHard-Sole SandalsMAT_01.pz2")
LeftHeel.SetConformTarget(JoJo)  < Problem Line

scene.LoadLibraryFigure("D:GraphicsPSR-DLCV4-DLCRuntimelibrariescharacterHard-Sole SandalsV4HardSoleSandal01 R.cr2")
fig=scene.CurrentFigure()
RightHeel=fig.Name()
scene.LoadLibraryPose("D:GraphicsPSR-DLCV4-DLCRuntimelibrariesposeHard-Sole Sandals!Show_Ring.pz2")
scene.LoadLibraryPose("D:GraphicsPSR-DLCV4-DLCRuntimelibrariesposeHard-Sole SandalsMAT_01.pz2")
scene.SetConformTarget(JoJo)*


svdl ( ) posted Sun, 04 March 2007 at 3:35 PM

The problem arises from the line "LeftHeel=fig.Name()" LeftHeel is just a string.
Replace the lines

fig=scene.CurrentFigure()
LeftHeel=fig.Name()

and

fig=scene.CurrentFigure()
RightHeel=fig.Name()

with

LeftHeel=scene.CurrentFigure()

and

RightHeel=scene.CurrentFigure()

This will make sure that LeftHeel and RightHeel are figure objects, not strings. Figure objects have a SetConformTarget method.
Since SetConformTarget takes a figure object as argument, you also should change the line

JoJo=fig.Name()

into

JoJo=scene.CurrentFigure()

Hope this helps,

Steven.

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

My gallery   My freestuff


nruddock ( ) posted Sun, 04 March 2007 at 3:37 PM

Quote - I am messing around to learn how Python works.  Having a problem tho....

Question: What am I doing wrong here??

Based on your code snippet, you need to use fig.SetConformTarget(JoJo) in both places where you're trying to conform an item.


svdl ( ) posted Sun, 04 March 2007 at 3:48 PM

Setting a figure's name:

  • from Python:

fig.SetName("")

  • from the user interface:
    choose Object->Properties, select the Body actor, switch to the Properties tab and enter your name. Confirm with

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 Sun, 04 March 2007 at 8:37 PM

Steven,

  The python command fig.SetName("") doesn't work.  I don't believe SetName is a valid method for a figure.  There is one for an Actor, but not for a Figure.  Or else I am missing something.  I was able to get the rest to work just great....... after several tries that is.  But, I'm learning!

  Thanks for your help!!

Doug


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.