chore(bevy_components): cleanups

This commit is contained in:
kaosat.dev 2024-05-07 00:39:15 +02:00
parent 03c3d397a7
commit c27bfb839e
3 changed files with 1 additions and 4 deletions

View File

@ -32,7 +32,7 @@ def property_group_value_to_custom_property_value(property_group, definition, re
type_info = definition["typeInfo"] if "typeInfo" in definition else None type_info = definition["typeInfo"] if "typeInfo" in definition else None
type_def = definition["type"] if "type" in definition else None type_def = definition["type"] if "type" in definition else None
is_value_type = long_name in conversion_tables is_value_type = long_name in conversion_tables
print("computing custom property: component name:", long_name, "type_info", type_info, "type_def", type_def, "value", value) # print("computing custom property: component name:", long_name, "type_info", type_info, "type_def", type_def, "value", value)
if is_value_type: if is_value_type:
value = conversion_tables[long_name](value) value = conversion_tables[long_name](value)

View File

@ -16,7 +16,6 @@ def update_component(self, context, definition, component_name):
print("update in component", component_name, self, "current_object", current_object.name) print("update in component", component_name, self, "current_object", current_object.name)
components_in_object = current_object.components_meta.components components_in_object = current_object.components_meta.components
component_meta = next(filter(lambda component: component["long_name"] == component_name, components_in_object), None) component_meta = next(filter(lambda component: component["long_name"] == component_name, components_in_object), None)
print("component_meta", component_meta)
if component_meta != None: if component_meta != None:
property_group_name = registry.get_propertyGroupName_from_longName(component_name) property_group_name = registry.get_propertyGroupName_from_longName(component_name)

View File

@ -40,8 +40,6 @@ def generate_wrapper_propertyGroup(wrapped_type_long_name_name, item_long_name,
blender_property = StringProperty(default="", update=update) blender_property = StringProperty(default="", update=update)
if item_long_name in blender_property_mapping: if item_long_name in blender_property_mapping:
value = value_types_defaults[item_long_name] if is_item_value_type else None value = value_types_defaults[item_long_name] if is_item_value_type else None
print("AAAAAAAAAAAAH", wrapped_type_long_name_name, value)
blender_property_def = blender_property_mapping[item_long_name] blender_property_def = blender_property_mapping[item_long_name]
blender_property = blender_property_def["type"]( blender_property = blender_property_def["type"](
**blender_property_def["presets"],# we inject presets first **blender_property_def["presets"],# we inject presets first