Merge pull request #2335 from MoritzBrueckner/fix-trait-fakeuser

Fix fake user export for traits
This commit is contained in:
Lubos Lenco 2021-09-18 11:05:19 +02:00 committed by GitHub
commit 16976cdc5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2508,7 +2508,7 @@ Make sure the mesh only has tris/quads.""")
o['constraints'].append(out_constraint)
def export_traits(self, bobject: bpy.types.Object, o):
def export_traits(self, bobject: Union[bpy.types.Scene, bpy.types.Object], o):
if not hasattr(bobject, 'arm_traitlist'):
return
@ -2628,7 +2628,12 @@ Make sure the mesh only has tris/quads.""")
out_trait['props'].append(value)
o['traits'].append(out_trait)
if not traitlistItem.enabled_prop:
# If we're here, fake_user is enabled, otherwise we
# would have skipped this trait already
ArmoryExporter.import_traits.append(out_trait['class_name'])
else:
o['traits'].append(out_trait)
def export_scene_traits(self) -> None:
"""Exports the traits of the scene and adds some internal traits