How to script modifying a body shape?
MCphylyss
Posts: 34
Hello,
I'm trying to write a very simple "random character" script, but I really don't know to script.
I have to do two things :
- How to get existing shapes names for an object ?
- How to set a shape on an object once I have my object and the shape name? ( something like: object.set_chape("Giselle_6_body", 0.75) ) ?
Thanks for help.
Post edited by MCphylyss on
Comments
Have a look at http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/properties/node_properties/start for accessing the properties of a node. You can use oProperty.setValue( value ) once you have a morph or other property you want to modify.
Thanks for the reply. Its finaly working. The only problem is that I have to write manually shapes names I want to use. I can share the script if someone's interrested.
If Someone knows a way to get shapes names by scripting, I would be interested. Thanks aagain.
The modifiers should have a name and a getLabel() function, so you could just grab all of the modifiers and list or check the names from that (or randomly pick a modifier by number).
Thanks a lot! I did not found doc about modifier object, but I just checked and methods getName() ang getLabel() are working.
How'bout moving this thread to Daz Script Developer Discussion forum, I found it really interesting/helpful.
mcphylyss_dc4b55d7ad - if you wish to move this to the Scripting forum, which is a good source of information, edit your first post by clicking the gear icon in its top-right corner and select the the new forum from the button just above the title.
Hi, I used the script as is for a while, but few days ago, A user called Davidagha sent me informations thanks to which I was able to considerably improve the script. It's now fully automated and you can randomize any body part you want : body, head, eyes, nose, mouth, brows, expressions... For those who're interested : https://www.sharecg.com/v/91228/view/8/Script/Daz3D-Morphs-Randomizer#