Sun, Dec 1, 3:28 AM 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: What is node a member of?


RobynsVeil ( ) posted Sun, 14 March 2010 at 3:19 AM · edited Thu, 28 November 2024 at 2:53 PM

ShaderTree?

I'm wanting to put together a list of all the nodes without the preface PM: or PMC: and then position them (bit of a hack on BagginsBill's hackpos)... and I can't figure out how to do:

for node in ...

what? ShaderTree? What is node a member of? Or how would I reference whatever group the nodes were part of?

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks


nruddock ( ) posted Sun, 14 March 2010 at 9:14 AM

You can either use ShaderTree.Nodes() which returns a list of all Nodes, or use ShaderTree.NumNodes() and ShaderTree.Node(i)


markschum ( ) posted Mon, 15 March 2010 at 12:13 AM

You do know of the Poser Python methods manual , available off the Poser help menu ?


RobynsVeil ( ) posted Mon, 22 March 2010 at 12:53 AM · edited Mon, 22 March 2010 at 12:55 AM

Quote - You can either use ShaderTree.Nodes() which returns a list of all Nodes, or use ShaderTree.NumNodes() and ShaderTree.Node(i)

That was helpful, thank you so much for that, nRuddock. I read through the PoserPython Methods Manual prior to posting here, but was unable to ascertain what the parent of 'node' was (and there was no indication in the manual, either... or I missed it): so this really helped. It just indicated "Shader Node" but not what the parent was. Is there a hierarchy diagramme somwhere for this?

Also, perhaps something more simplified than PhilC's Python tutorial which, whilst an excellent tutorial for developing GUIs for Poser, leaves some massive holes in how to write basic stuff... I think it went a bit too quickly into GUI development.

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks


PhilC ( ) posted Mon, 22 March 2010 at 5:01 AM · edited Mon, 22 March 2010 at 5:06 AM

Page 348, example script ShaderMethods_01.py illustrates the method that nruddock is referring to.

The whole Shader Tree section is 13 pages long and in addition includes five more Shader Tree example scripts.

The output of the first script looks like the image below.

I'm sorry to hear that you felt that this constituted a massive hole.


RobynsVeil ( ) posted Mon, 22 March 2010 at 5:20 AM

Oops. My bad... and my apologies, Phil. I have looked over my copy - I did buy "Python for Poser 7" from your site! - but can't seem to find that page...

hmmmmmmmmmmmmmmmm what am I missing, here???

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks


PhilC ( ) posted Mon, 22 March 2010 at 5:39 AM · edited Mon, 22 March 2010 at 5:40 AM

file_449963.jpg

The [ Python for Poser Manual by PhilC](http://istore.mikrotec.com/philc/index1.html?page=catalog&category=a&vid=668437709&pid=1505243998&oldvid=2143420604) is in PDF format. I set it up to included a fully itemized index which you can navigate by expanding the bookmarks in Adobe Reader. If you have just started reading at the beginning and only read the GUI stuff it may be that you have overlooked the entire contents of the section where I explain all the Python methods. On my screen it looks like the image above. What do you see?


RobynsVeil ( ) posted Mon, 22 March 2010 at 5:56 AM

That is absolutely correct: I did get bogged down in the GUI section and failed to look any farther. I am having another look and read of your fine manual/tutorial. Please accept my unkind words as ignorant and uncalled for.

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks


RobynsVeil ( ) posted Mon, 22 March 2010 at 6:00 AM

Back to square 1:

I'm beginning to think the issue here is that I am not working in the native Poser Python environment. I am working in BagginsBill's Matmatic, which I think might need an 'import poser' statement or something to get some of the methods to work or something.

Regardless of what they might tell you, ignorance is not bliss...

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks


PhilC ( ) posted Mon, 22 March 2010 at 6:09 AM

No worries :)

If you are running the script from within Poser you should automatically be using Poser's Python installation. If however you are also using any of the Poser Python methods, which you almost certainly are, yes you will need to start with an "import poser" statement.

 


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.