Tue, Oct 22, 12:43 PM 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: A python to apply shaders in P6?


Aery_Soul ( ) posted Sun, 15 January 2006 at 2:57 PM ยท edited Tue, 22 October 2024 at 12:43 PM

Hello,
I have created a material shader I want to use for all things I use in my renders since, I usually assign it manually to the various clothes/objcts material parts but there are some that have many ones, moreover if I modify something I have to re-modify the setting for every material part.

Is there a way via Python Scripts to make this process automatic? I mean, to automatically add the shader to the object (the script should "attach" the shader to the basic texture file).
I am working in P6.

Thanks for any help/suggestion,
Siliphiel

www.aerysoul.com


nruddock ( ) posted Sun, 15 January 2006 at 3:16 PM

If your working in P6, then yes it's possible.

The extent and type of modifications you make to the settings will determine what the best way of dealing with them is.

Feel free to post an MT5.

You might also want to see if PoseWorks' ShaderSpider
available at DAZ -> http://www.daz3d.com/shop.php?op=itemdetails&item=3551
can do some or all of what you want.


Aery_Soul ( ) posted Mon, 16 January 2006 at 9:11 AM

Hello, thank you for the suggestion! I've bought the product and it does the 75% of the work i need, but its anyway a good thing ! Bye! -As Shanim

www.aerysoul.com


tromnek ( ) posted Tue, 17 January 2006 at 6:50 AM

I made a client module for the prpc project http://prpc.sourceforge.net that will allow you to load a material set (.mt5, .mz5) on multiple figures and material zones. The client module is called prpcLoadMatSet134b06.py and is in the beta section of the file distribution area. http://sourceforge.net/project/showfiles.php?group_id=154670 Maybe that will work for you.


Aery_Soul ( ) posted Tue, 17 January 2006 at 7:33 AM

Thanks for the link. I try that script but not working on my poser (i'm using poser 6 sr2) --------------- Traceback (most recent call last): File "", line 343, in ? File "", line 53, in init NameError: global name 'prpcd' is not defined -------------

www.aerysoul.com


Dizzi ( ) posted Tue, 17 January 2006 at 4:35 PM

It's a "plug in" for PRPC, so you'll have to run the prpc deamon first and then run it.



tromnek ( ) posted Tue, 17 January 2006 at 6:30 PM

Yes. Read the homepage for the project to get a general idea about what it's all about. Follow the instructions for the main PRPC package. Then you can run the client module. Then you can send the mt5 file to the client module using Windows Explorer. If it looks promising, I suggest using 'Advanced Library' or 'P3dO' instead of Windows Explorer.


Aery_Soul ( ) posted Wed, 18 January 2006 at 6:19 AM

Thanks for suggestion, i'll try soon ! -As Shanim

www.aerysoul.com


PoseWorks ( ) posted Thu, 19 January 2006 at 9:02 PM

ShaderSpider is what you're looking for; it can create partial/wedge shaders that hook into your existing texture maps, as well as juggle settings for all of a figure's various material groups.


Aery_Soul ( ) posted Fri, 20 January 2006 at 12:56 AM

Yes shaderspider can do it, but i need to llink my texture map (image node) to 2 part on the same node. Sharderspider hook only 1 node.

www.aerysoul.com


PoseWorks ( ) posted Fri, 20 January 2006 at 1:09 AM

file_318608.jpg

If you need the map to go into multiple inputs, here's what you do: 1) Create a Simple_Color node, leave the color white. 2) Hook the Simple_Color to any inputs that you want the texture map to go to. (Do not connect the texture to the simple color, except for testing purposes--you don't want the texture saved in the FX6!) 3) Save the partial shader, and set it to have the Diffuse_Color's in-node (the texture) connect to the Simple_Color.


Aery_Soul ( ) posted Fri, 20 January 2006 at 1:27 AM

This is very usefull, thanks for suggestion -As Shanim

www.aerysoul.com


randym77 ( ) posted Mon, 23 January 2006 at 2:18 PM

If your working in P6, then yes it's possible.

Why is not possible in P5? How do Face_Off's Python scripts work? (Real Skin Shader, etc.?)


Dizzi ( ) posted Mon, 23 January 2006 at 2:28 PM

Because material room support was added with P6 and that makes those work arounds Real Skin Shader etc. use (writing a pose file and then applying that) unnecessary (as that really is a pain).



randym77 ( ) posted Mon, 23 January 2006 at 3:15 PM

Thanks! That makes sense.


PoseWorks ( ) posted Thu, 26 January 2006 at 3:09 AM ยท edited Thu, 26 January 2006 at 3:10 AM

To modify shader trees in P5, you'll need to do the following in Python:

  1. Save a CR2 (if you're using a figure) or a PZ3 (if a prop--since SaveLibraryProp has never worked properly)

  2. Search the file to find the shader tree you want

  3. Parse the shader tree to get the components that you want

  4. Ponder the reason why CL never added Python support for the Material Room in P5

  5. Make modifications to that data and translate it back into Poser's library code

  6. Write a new PZ2 with the modified shader tree

  7. Apply the PZ2 to the figure/prop

  8. Cry yourself to sleep

Message edited on: 01/26/2006 03:10


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.