i made an addon that uses custom properties to drive other properties within that file. but the thing is, it only works in that file. when i append the collection containing everything into another blend file, the custom properties dont drive the values even though the drivers are still there. i want to be able to use the custom properties in the addon to drive these other properties when i put it in a new file. below are the steps to replicate my issue
install this small test script as an addon
bl_info = \
{
#Info
"name" : "Test",
"author" : "Desper",
"version" : (1, 0, 0),
"blender" : (3, 3, 1),
"location" : "View 3D > N-Panel",
"description" :
"Test",
"category" : "Workflow",
}
import bpy
from bpy.types import Panel
class Testing(bpy.types.Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_label = "Test"
bl_idname = "gp"
bl_category = 'Test'
def draw(self, context):
layout = self.layout
col = layout.column()
row = col.row()
row.prop(context.scene, 'subdiv', toggle=False, text='Viewport Subdivision')
classes=[Testing]
def register():
for c in classes:
bpy.utils.register_class(c)
bpy.types.Scene.subdiv = bpy.props.BoolProperty(
name='subdivision',
default=False,
)
def unregister():
for c in classes:
bpy.utils.unregister_class(c)
if __name__ == '__main__':
register()
once thats installed, make sure you see this
-add a subdivision modifier to a primitive (or anything)
-copy the custom property as a new driver (right click > copy as new driver)
-paste the driver on the subdivision visibility in the viewport
-the custom prop should now control viewport subdivision of the cube
-put the cube in a new collection
-save the file and append the collection into another new file
-in the new file, the addon should still be there but the checkbox wont work even though the driver is still there
That's a smaller-scale version of what my issue is.
let me know if any other info or any files are needed!
EDIT: this is the error i get when trying to enable the addon when ``` bpy.context.Scene.subdiv = True
EDIT 2 : here is the blend file