Fri, Nov 22, 6:04 PM CST

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: getting point at info ?


markschum ( ) posted Sat, 23 April 2011 at 11:18 PM · edited Thu, 21 November 2024 at 10:05 PM

anyone know a way to get whats pointed at what without looking at the pz3 or other files ?

I am rigging  a complex model and wanted to check all the parts , but didnt see a way of getting that information. :(

 

 

 


semidieu ( ) posted Sun, 24 April 2011 at 5:07 AM

If someone knows how to do it, I would be glad to know too :)

 

But... the only way I could think would be to save the scene and read the scene file.


semidieu ( ) posted Sun, 24 April 2011 at 5:08 AM

poser.Scene().CurrentActor().ParameterByCode(poser.kParmCodePOINTAT)

 

This just tells if an actor is pointing at something... but is it possible to know to what ?


Dizzi ( ) posted Sun, 24 April 2011 at 5:26 AM

You can't do it directly akaik, but you could do something like this:

  1. Check if actor points at something with poser.Scene().CurrentActor().ParameterByCode(poser.kParmCodePOINTAT)

  2. Get WorldQuaternion

  3. move all other actors in the scene and compare WorldQuaternion, move actors back in place...

Rather ugly approach I guess ;-)



Cage ( ) posted Wed, 04 May 2011 at 6:18 PM · edited Wed, 04 May 2011 at 6:19 PM

You could also try getting the world displacement for all of the actors in the scene, then compare the vector between each of these and the pointed actor to the orientation vector of the pointed actor, found along the axis between its origin and endpoint.  Unfortunately this can only identify good candidates for point at target, because it can't differentiate between actors which might line up along that same vector.

So I think Dizzi has the best idea.  :laugh:

===========================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 Thu, 05 May 2011 at 7:18 PM

I did a script to  read the pz3 to get whats pointing at what.


semidieu ( ) posted Thu, 05 May 2011 at 11:50 PM

Thanks for the info. Can you tell us how 'fast' it can give the answer ?


markschum ( ) posted Fri, 06 May 2011 at 1:32 AM

Its this codeand only takes a few seconds to run.

On my system it can take up to 10 minutes or so to save a large scene so I did not automate that.

import string
mypz3 = "C:Documents and SettingsOwnerMy DocumentsPoser Scenesdystopian_picnic.pz3"
stuff = ["acto","prop","ligh","came"]
fi = file(mypz3,"r")
myfig = ""
for line in fi:
    line = line.strip("n")
    if line[0:7] == "figure ":
        myfig = line
    if line[0:4] in stuff:
        myact = line
    p = line.strip(" tn")
    if p.startswith("pointAtTarget"):
        print myfig," / ",myact," / " ,p


semidieu ( ) posted Fri, 06 May 2011 at 1:56 AM

Thanks for the info... and I now I'm curious to see what your scene look like... Dystopian Picnic ?


markschum ( ) posted Fri, 06 May 2011 at 3:55 PM

file_468558.jpg

I made a picnic basket to go with the cooler, and the rsident bear wondered where such a picnic might occur. Thus a picture was born... 


semidieu ( ) posted Sat, 07 May 2011 at 4:39 AM

I love it :)


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.