Changing path of reference crash Clarisse

Hi, I have made this script that changes the path of the selected references for a different version, In my case I am switching from a static asset to an animated asset. As soon as I change the filename attribute value in python, Clarisse crashes violently with a crash dump.
I have tried different approach to set the path but I always get a crash. I have tried setting the value in the attribute,
Tied using the ix.cmds.SetReferenceFilename() function, the ix.cmds.SetExpression() function...always the same crash.
Using the Path Manager and doing a find and replace works and doesn't crash...but if I copy/paste the command executed by the find and replace and put in a python script and call this script from a shelf button or a custom menu I get a crash.
I am stuck...anyone would have an idea?
I have tried different approach to set the path but I always get a crash. I have tried setting the value in the attribute,
- Code: Select all
attr = sub_context.get_attribute('filename')
attr.set_string(new_path, 0)
Tied using the ix.cmds.SetReferenceFilename() function, the ix.cmds.SetExpression() function...always the same crash.
Using the Path Manager and doing a find and replace works and doesn't crash...but if I copy/paste the command executed by the find and replace and put in a python script and call this script from a shelf button or a custom menu I get a crash.
I am stuck...anyone would have an idea?