Hi.
My addon has a custom scene property this is a filebrowser type to allow user to setup path for saving during my script.
However, if the user does not un-check the Accept ‘Relative Path’ button, it returns a relative path string. (duh!)
But my script errors for some reason when it tries to save to that relative path. (a render)
So I figured I’d just convert it afterward using py.path.abspath(). I want the user to see the absolute path anyway.
I want to write it back into the filepath property (and display), but I get a ‘writing to ID classes in this context is not allowed’ kind of error.
So what’s the trick?
thanks
(I’d really like to know how to do this in general but in this particular case if I can just force the path selection to an absolute one it would work also.)
thanks! I like this approach, but I can’t find a way to #do work in this context, since using the file browser is not part of my script.
Personally I don’t use relative paths much so I could just force the absolute paths option permanently but others may not like this.
I’m working an alternative, a home-rolled operator that uses a button to file browse (with relative paths disabled) then print the path in a separate string display. However… bpy.ops.buttons.directory_browse() is not doing anything when I click it. It returns a ‘cancelled’ value.