Help with texture applying/copying and setting values script
rokkr
Posts: 179
I need a script that does the following:
1) apply one texture from the library in the Diffuse Overlay Weight channel (I don't know if it's called "channel" or not, but I guess everyone can understand it; in case it's not, pardon my ignorance);
2) set the value of the overlay weight;
3) copy the texture from the Base Color channel (a.k.a., "diffuse") to the Diffuse Overlay Color channel;
4) set the value of the diffuse overlay color.
All this with a character selected so I don't have to manually input anything into the script (i.e., type it). Does anyone know how to do this and can help me?
EDIT: and I also need to set a new limit to the Diffuse Overlay Color channel.
Post edited by rokkr on
Comments
Have you looked at the sample scripts covering materials and properties? http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/start They should cover most of what you would need.
Thank you. I had seen some examples but had not found this page with all of them listed.
Can I mix declarative language with scripting? That is, can I create a DUF material preset with my points 1, 2, & 4 and only use scripting for item 3 which would be character-dependent?
A script could load a preset, but they couldn't be directly in the same file.
Thanks. Do you have any tips or sources for starting scripting in Daz? I'm acquainted with programming (PHP, JS, and Python) but haven't ventured into Daz Scripting yet.
Have a look at the samples, link above, then the object definitions, go up a level of the breadcrumbs (although the samples have links to relevant sections too). Daz Script is ECMA2 - so similar to Java Script, but not identical.
Thanks!
That will teach me to go from memory - ECMA-262 5.1.