Timeline for Add a driver to a material property using Python
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Feb 23 at 11:58 | history | suggested | Peter Mortensen | CC BY-SA 4.0 |
Copy edited (e.g. ref. <https://en.wikipedia.org/wiki/Python_%28programming_language%29>). In English, the subjective form of the singular first-person pronoun, "I", is capitalized, along with all its contractions such as I'll and I'm.
|
Feb 23 at 11:17 | review | Suggested edits | |||
S Feb 23 at 11:58 | |||||
Feb 23 at 9:01 | history | became hot network question | |||
Feb 22 at 21:44 | comment | added | Markus von Broady | @scurest interesting... I didn't know this is "legal". I just checked and the driver works, and the actual value in the field is "ignored" (overriden by the driver). | |
Feb 22 at 21:37 | comment | added | scurest |
@MarkusvonBroady Yes, I have tried it. The field isn't purple because it isn't the "canonical" path to that datum, because you used a socket name instead of a number. Starting from a blank file, you can manually add a driver to a socket in the UI, then do D.materials[X].node_tree.animation_data.drivers[0].dath_path to see what data path Blender actually creates.
|
|
Feb 22 at 20:51 | comment | added | Markus von Broady | @scurest I fall for this a 2nd time... Thanks :D But still, have you tried it? I don't get an error after fixing the quotes but the field still doesn't become purple. | |
Feb 22 at 20:13 | comment | added | scurest | @MarkusvonBroady Quoted strings in fcurve data paths are "double quoted". | |
Feb 22 at 20:02 | vote | accept | Walter | ||
Feb 22 at 19:49 | comment | added | Markus von Broady | @scurest have you tested it? Doesn't work for me: i.imgur.com/Zs8ROCi.png | |
Feb 22 at 19:46 | answer | added | Markus von Broady | timeline score: 4 | |
Feb 22 at 19:46 | comment | added | scurest |
mat.node_tree.driver_add('nodes["My Node Name"].inputs[1].default_value', 0)
|
|
Feb 22 at 19:38 | history | asked | Walter | CC BY-SA 4.0 |