# Cannot set “is_overridable_library” option via python [“_RNA_UI”]

I'd like to control these bools there via Python but I can't quite figure out how.

If I try something like this code, "min", "max", "soft_min" and "soft_max" work fine and update their values but "is_overridable_library" and "use_soft_limits" do not.

import bpy
obj = bpy.context.object
obj["_RNA_UI"] = {"prop":{"min":0,"max":1,"soft_min":0,"soft_max":1,"is_overridable_library":1,"use_soft_limits":1}}


Thank you very much!

• I'm trying to create overridable custom properties in a script. I'm able to set name, description, values, min and max but I cannot figure out how to make those properties overridable so that once linked the object's collection in another file I can play with those custom properties. I tried both 0/1 and False/True but it's not working anyway. Thanks! – Marco Di Vita Mar 8 '20 at 11:19
• Alright, now I understand what you're trying to do. – Robert Gützkow Mar 8 '20 at 11:35
• While it may be possible to edit this through _RNA_UI, I'd avoid using a private variable from an undocumented part of the API and instead update it through bpy.ops.wm.properties_edit(). – Robert Gützkow Mar 8 '20 at 11:52
• I tried that but it gives me a RuntimeError. Specifically: RuntimeError: Error: Direct execution not supported. I found another thread regarding this issue, the same that gave me the idea of using "_RNA_UI". blender.stackexchange.com/questions/143975/… – Marco Di Vita Mar 8 '20 at 12:08
• You're right. However setting is_overridable_library through _RNA_UI doesn't seem to work either, when modifying an existing property. I'll have to look at the source code as see what's going on. Sorry for causing any confusion. – Robert Gützkow Mar 8 '20 at 12:38

The value behind is_overridable_library can be set through the method property_overridable_library_set() of an object. The following example demonstrates how to set a custom property named "prop" to be overridable.

import bpy

obj = bpy.context.object
obj.property_overridable_library_set('["prop"]', True)


The use_soft_limits is dynamically evaluated and it's not necessary to set it when using the Python API. If the soft_max or soft_min are different than the max or min, it will automatically show as enabled.

Calling bpy.ops.wm.properties_edit() results in an error message, because it expects that self._last_prop is set. This only happens in the invoke() function, not when calling execute() directly. Therefore the execution context has to be set by passing INVOKE_DEFAULT.

bpy.ops.wm.properties_edit("INVOKE_DEFAULT", data_path="object", property="prop", value="1.0", default="1.0", min=0, max=1, use_soft_limits=False, is_overridable_library=True, soft_min=0, soft_max=1, description="", subtype="NONE")


The downside of this is that the UI popup appears and has to be confirmed. Therefore the operator cannot be used without user interaction.

• Thank you very much! – Marco Di Vita Mar 8 '20 at 13:36

To add to this, getting whether a property is library overridable or not is also not obvious:

bpy.context.object.is_property_overridable_library('["prop"]')