mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-11-26 13:32:32 +00:00
21a36f9878
* removed a lot of obsolete code * overhauled settings upsert * added save & load of blenvy common settings * removed most of the specific uis (mostly auto export) * moved change detection logic out of auto export (wip) * added helper to compare setting dicts * cleaned up some incoherent naming * stripped auto_export of a lot of its internals (wip) * main settings ui overhaul: now components & auto export provide their own settings UI function
22 lines
847 B
Python
22 lines
847 B
Python
import bpy
|
|
from .setup_data import setup_data
|
|
|
|
def test_blend(setup_data):
|
|
registry = bpy.context.window_manager.components_registry
|
|
registry.schemaPath = setup_data["components_schemaPath"]
|
|
bpy.ops.object.reload_registry()
|
|
|
|
long_name = "bevy_example::test_components::BasicTest"
|
|
|
|
add_component_operator = bpy.ops.object.add_bevy_component
|
|
add_component_operator(component_type=long_name)
|
|
|
|
property_group_name = registry.get_propertyGroupName_from_longName(long_name)
|
|
object = bpy.context.object
|
|
|
|
target_components_metadata = object.components_meta.components
|
|
component_meta = next(filter(lambda component: component["long_name"] == long_name, target_components_metadata), None)
|
|
propertyGroup = getattr(component_meta, property_group_name, None)
|
|
|
|
|
|
assert propertyGroup.field_names == ['a', 'b', 'c'] |