There is this great little script on the site, but I cannot get it to work.
Setting the filepath of the arnold driver using this script , clears the filepath, instead of adding the custom filepath value.
Is this a bug, or am I missing something?
Hope someone can help me out,
Thanks
Bas
Solved! Go to Solution.
Solved by peter.horvath6V6K3. Go to Solution.
see the first example here: https://support.solidangle.com/x/aABeAg
Thanks for the quick answer, I've been trying to get this to work, and I've got as far as creating a custom new ARNOLD_DRIVER with a custom path, but I can not get it to modify an existing arnold driver.
object.GetDataInstance() does not work with the SetParameter... I'm clearly missing the python/scripting knowledge to fix this. And I can't wrap my head around this Custom UI python script part.
Below I've pasted the code, if anyone has the time, could they have a quick look, and tell me what I'm doing wrong?
All the best!
import c4d # From plugins/C4DtoA/res/c4dtoa_symbols.h ARNOLD_DRIVER = 1030141 # From plugins/C4DtoA/res/description/ainode_driver_exr.h C4DAIP_DRIVER_EXR_FILENAME = 1285755954 # From plugins/C4DtoA/res/description/arnold_driver.h C4DAI_DRIVER_TYPE = 101 # From plugins/C4DtoA/api/include/util/NodeIds.h C4DAIN_DRIVER_EXR = 9504161 C4DAIN_DRIVER_DEEPEXR = 1058716317 C4DAIN_DRIVER_JPEG = 313466666 C4DAIN_DRIVER_PNG = 9492523 C4DAIN_DRIVER_TIFF = 313114887 def main(): exrDriver = c4d.BaseObject(ARNOLD_DRIVER) exrDriver.SetName("myDriver") path_id = c4d.DescID(c4d.DescLevel(C4DAIP_DRIVER_EXR_FILENAME), c4d.DescLevel(1)) type_id = c4d.DescID(c4d.DescLevel(C4DAIP_DRIVER_EXR_FILENAME), c4d.DescLevel(2)) print "Current path: %s" % exrDriver.GetParameter(path_id, c4d.DESCFLAGS_GET_0) print "Current type: %d" % exrDriver.GetParameter(type_id, c4d.DESCFLAGS_GET_0) exrDriver.SetParameter(path_id, "c:\\test\\path", c4d.DESCFLAGS_SET_0) exrDriver.SetParameter(type_id, 1, c4d.DESCFLAGS_SET_0) doc.InsertObject(exrDriver) c4d.EventAdd() if __name__=='__main__': main()
This code is correct, it creates a new Arnold Driver named "myDriver" sets the path and adds the driver to the scene.
If you want to modify an existing Arnold Driver object, then first you have to find that object in the scene. For instance:
exrDriver = doc.SearchObject("myDriver")
and than you can set the parameters of this object:
exrDriver.SetParameter(path_id, "c:\\my\\new\\path", c4d.DESCFLAGS_SET_0)
Hope this helps.