0
$\begingroup$

I try to append custom properties to my collection and object in the hopes the asset library would carry them over when appended to a scene.

Unfortunately they are lost when appending or linking.

Please try the following:

  • Open my attached .blend file and run the script.
  • Custom properties will be created for both the collection and the object.
  • On the bottom right side pull the newly created asset from the Asset Library into the scene.
  • Observe that the custom property has been lost on the asset.

Here is the simple script from my test .blend:

import bpy

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

bpy.context.scene.collection.objects.unlink(obj)

asset = 'CustomTest'

bpy.ops.collection.create(name=asset)
bpy.context.scene.collection.children.link(bpy.data.collections[asset])
bpy.data.collections[asset].objects.link(obj)

bpy.data.collections[asset].asset_mark()
bpy.data.collections[asset]['test_property'] = 0
bpy.data.collections[asset].property_overridable_library_set('["test_property"]', True)

bpy.context.view_layer.objects.active = obj

Can you help me carrying over the custom properties from an appended or linked asset? [sample Blend file][1]

$\endgroup$
2
  • $\begingroup$ An account is necessary to access your file, please upload it here directly blend-exchange.com $\endgroup$
    – taiyo
    Aug 16, 2023 at 19:44
  • $\begingroup$ Done, thanks for letting me know $\endgroup$
    – rbx 775
    Aug 16, 2023 at 20:48

0

You must log in to answer this question.

Browse other questions tagged .