Fri, Nov 29, 12:13 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: Script request


Jaager ( ) posted Sat, 28 September 2013 at 8:13 PM · edited Fri, 29 November 2024 at 12:02 PM

Is this possible?:

A Python script that picks up any selected .mc6 and injects it into the materials of the active figure in the Pose room as an addition - not affecting the existing nodes?

a generic Python based partial material.

connected if the .mc6 was saved that way.

with an option to select the materials from a list for injection.

 


markschum ( ) posted Sat, 28 September 2013 at 11:50 PM

Not quite clear what you want.

a script to read a material collection, mc6 and let you choose which materials to apply would be possible. The selected materials would replace the originsl material though.

I have several scripts that add in nodes to existing materials and writing one to read a file of what nodes to add is also possible but how you hook it in to the existing nodes may depend on a lot of things.

Do you have some specific things in mind ?


Jaager ( ) posted Sun, 29 September 2013 at 1:37 AM

The first thing to bring this up:

Vascularity of V4 -  it is a displacement and/or texture overlay. I converted the textures to Dawn.  The original product inserts the nodes and hooks them up - placing a color math node btween an existing texture file and Poser Surface.

Coming in to Dawn hooked up would be a plus, but just getting the nodes in - to all of the Skin materials would be the important part. In Dawn's case it is 4 maps to several materials for each.

But it is not just that - adding a displacement on the fly - vertebra for the spine, knee cap, elbow,  ribs   for example.  Tendons on the back of hand , top of foot, inside of wrist,  the tendons of the neck, back of ankle.   Bagginsbill has told me how to control the displacement strength using the value from a rotation: a JC displacement instead of a JCM.  I suspect that doing the nodes and fine tuning the controls will be a bear.  Having to do it every time for every material for every figure - it would be - tedious -almost beyond imagining.

PP2014 will let you save selected nodes as a .mt5 (sorry about the mc6 entery). If these could be layered onto an existing node setup  -  

Also  - Suppose the .mt5 were text hacked the include  more than one material?  The Vascularity product has a separate Python button  for each map. It gets all of the sub materials within at the same time.  Is it  a must that each map be handled separately?  Could there be a button to apply the nodes for all 3/4 maps to their sub materials at one go?  Can this be generic? Can the sub materials be selectable?

As I said - being already hooked up would be a bonus, but it is not the important part.


markschum ( ) posted Sun, 29 September 2013 at 3:35 PM

ok,  lets do this 1 bit at a time if you are agreeable.

The vascularity thing sounds like what I have for doing tatoos and makeup.  I use a blender node for that but a maths node is not a problem.

I would need the material names for the skin areas to apply the added maps, and the names of the maps to add. a screen print of the complete material would be good too.

I can use one or more mt5 files to get the names of the files, expanding that to multiple materials would not seem to be a problem.

 

If the original was a commercial product have you asked if the script can be amended for Dawn ?


Jaager ( ) posted Sun, 29 September 2013 at 11:10 PM · edited Sun, 29 September 2013 at 11:12 PM

file_498575.jpg

No, I did not ask the vendor if he was willing to upgrade his script.  I am thinking that it is a bit much to ask.  I am just taking advantage of the possibilities offered by RealityPaint texture conversion. 

As far as what I have for Dawn Vascularity - I am using a Logitech wireless keyboard and the PrintScreen button does not seem to do anything.

here is a zip file with the nodes in the .mt5 I saved.  It has all of the materials and the 4 textures .  Node 1 is open for the text color map. 

There is also a node for the displacement that is not attached.  Just an option to use - Most females do not have bulging veins so it would not be an oft used component.

What I would like is a Python script that just inserts this .mt5 into any Dawn without losing the existing nodes.  When I try the Material double check - Poser crashes.

 

Could you write a script to add a 2D image map (Color Texture) to a selected material with a map name of zzz.xxx for the texture and have the animate key selected ON for texture strength.?  If it a .py file it could be text edited for any texture file.

For the joint controlled displacement - when the animate key is selected - a dial is added to Body to control it.  I am of the hope that the dial can be edited to be joint controlled and the whole K&K can be a pose file using "readScript" for the .py.  I am wondering about the chicken/egg for the dial though.

 

To respond to what you wrote in addition - would you share your Makeup script?

As far as tatoo - is it possible to use a small texture and a matching mask and use node values to position them over any location?  Use node values to change the map size?  I bet it would not work across seams,  but it would be an interesting Pyton script to have.


markschum ( ) posted Sun, 29 September 2013 at 11:22 PM

zip files do not seem to attach - you could email to marks542004@yahoo.com


markschum ( ) posted Sun, 29 September 2013 at 11:39 PM

I am away from home tomorrow but I may get a chance in the evening.

I will post a script that shows how you can build up a makeup application.  Its basically a version of the tattoo script of a blender node and two images, one being a mask.

I use Poser 7 and I do not have Dawn so I will need you to supply material names as required. 


Jaager ( ) posted Sun, 29 September 2013 at 11:56 PM

file_498576.txt

trying upload again


markschum ( ) posted Mon, 30 September 2013 at 9:22 PM

I have emailed you a test script.

Please try it on a new scene that you can discard. 

 


RobynsVeil ( ) posted Mon, 30 September 2013 at 11:30 PM

Let me get this straight: you want...
o - shader that addresses the entire figure at one go
o - shader that preserves the existing colour maps (doesn't EZSkin2 do this?)
o - a mechanism that will manage things like displacement, etc
o - perhaps even a means to automate all this depending on the scene settings

Um, sounds to me like what you want is a PoserPython script to examine a scene, that would then - dunno, possibly invoke a Matmatic script, maybe? Matmatic could generate .mt5s or mc6s, depending on what you want. Just not sure if PoserPython can invoke Matmatic... :blink:

I just think EZSkin2 would be the easiest solution, all around.

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


Jaager ( ) posted Tue, 01 October 2013 at 4:08 AM

What I am requesting is a script that takes any .mt5 , reads it, and adds the nodes for each material in the .mt5 to that material in a selected figure.  

At first it was reported that PP2014 would do this using VV instead of V in the Materials library - doing this crashes Poser for me.

There is a python script for the product Vacularity that adds nodes for one texture to all of the materials using that texture.  One for color map, one for displacement.  Because V4 uses 3 different color maps for all of the skin, this product has a button for each of the color maps or displacement maps.  It is 6 buttons if you want the whole K&K added to an existing figure.  The nodes come in connected.  The color setup even inserts a colormath node between the existing color map and Poser Surface.

There is no master button to do all textures.  Was this because it can't be done?

This says that Python will do partial materials.  One of the things I am asking is:

Can this function be made to be generic - not set for a specific texture -

either using a choice box in the script or

having the texture reference be a cypher like aaa.aaa - bbb.bbb - each texture having a unique cypher.  Since a .py is a text file, find/replace in a text editor could convert the script to a specific texture.

The displacement script is more simple.  The addition would probably to a single material.   The node setup is likely to be complex - involving activating the animate function with a rotation being a Master and the displacement value being the Dependent.   - The node setup would probably be the same for each of several displacement maps.  The maps would vary -  the material target would depend on which map is used - the Master rotation would be specific to the map.

Can a Python script be written that inserts a displacement setup - attached if possible - that allows a user to text edit in a specific map and a specific rotation?

I don't have the node done yet. I don't have the displacements yet either. But I am thinking that elbows, vertebra, patella - would work maybe better as a displacement than a morph.  I know that morph JCM can be activated using a .pz2.  The JCmap may also need be done by a .pz2.  But the actual node complex needs a partial material function.

I thought that EZskin coverted a color setup to SSS.  Does it do user added nodes and can it read an existing setup?


markschum ( ) posted Tue, 01 October 2013 at 6:23 PM

reading a partial mt5 and adding the nodes is not that hard, jut tedious to code the parser for all possible parameters.

I am doing a limited script for the vascularity and then we see what else is doable.

Its dealing with all the possible combinations, and how to hook it all together thats the issue. It seems it might not be hard to try to hook stuff up, but its a bit early yet to tell.

If Poser says it will add mt5 files to an existing texture I would make sure to report a bug.


Jaager ( ) posted Tue, 01 October 2013 at 7:24 PM

It is my impression that PP2014 adding a partial file was an unreported function. An unintended goody that I can't duplicate with a complex .mt5.  I am not sure if I tried a single material.  It was a real loss when Poser took this function away with P4 or P5 or which ever early version that did this.  So it is not a bug - unfortunately.


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.