feat(Blenvy:blender): made it impossible to add or update components that are not in the registry
* minor tweaks & cleanups
This commit is contained in:
parent
75d7f940ae
commit
3961e0b22c
|
@ -171,8 +171,13 @@ Blender side:
|
||||||
- [x] in theory, srgba, linearrgba , and hsva should be able to be represented visually
|
- [x] in theory, srgba, linearrgba , and hsva should be able to be represented visually
|
||||||
- [x] bevy_render::color::Color => bevy_color::color::Color
|
- [x] bevy_render::color::Color => bevy_color::color::Color
|
||||||
- [x] fix weird issue with hashmaps with enums as values
|
- [x] fix weird issue with hashmaps with enums as values
|
||||||
- [ ] prevent attempting to add unexisting components to targets (ie when using the component search)
|
- [x] prevent attempting to add unexisting components to targets (ie when using the component search)
|
||||||
|
- [x] also for the bulk fix actions
|
||||||
|
- [ ] hidden objects/collections only semi respected at export
|
||||||
|
- this is because blueprints are external ?
|
||||||
|
- [ ] verify based on gltf settings
|
||||||
|
- [ ] add "Visibility::Hidden" component otherwise
|
||||||
|
https://devtalk.blender.org/t/how-to-get-render-visibility-for-object/23717
|
||||||
|
|
||||||
- [ ] inject_export_path_into_internal_blueprints should be called on every asset/blueprint scan !! Not just on export
|
- [ ] inject_export_path_into_internal_blueprints should be called on every asset/blueprint scan !! Not just on export
|
||||||
- [ ] undo after a save removes any saved "serialized scene" data ? DIG into this
|
- [ ] undo after a save removes any saved "serialized scene" data ? DIG into this
|
||||||
|
@ -181,11 +186,9 @@ Blender side:
|
||||||
- [ ] disabled components
|
- [ ] disabled components
|
||||||
- [ ] blueprint instances as children of blueprint instances
|
- [ ] blueprint instances as children of blueprint instances
|
||||||
- [ ] blueprint instances as children of empties
|
- [ ] blueprint instances as children of empties
|
||||||
|
- [ ] update testing files
|
||||||
|
|
||||||
|
|
||||||
- [ ] hidden objects/collections not respected at export !!!?
|
|
||||||
- [ ] verify based on gltf settings
|
|
||||||
- [ ] add "hidden" component otherwise ?
|
|
||||||
https://devtalk.blender.org/t/how-to-get-render-visibility-for-object/23717
|
|
||||||
- [ ] add option to 'split out' meshes from blueprints ?
|
- [ ] add option to 'split out' meshes from blueprints ?
|
||||||
- [ ] ie considering meshletts etc , it would make sense to keep blueprints seperate from purely mesh gltfs
|
- [ ] ie considering meshletts etc , it would make sense to keep blueprints seperate from purely mesh gltfs
|
||||||
- [ ] persist exported materials path in blueprints so that it can be read from library file users
|
- [ ] persist exported materials path in blueprints so that it can be read from library file users
|
||||||
|
@ -195,11 +198,16 @@ Blender side:
|
||||||
|
|
||||||
Bevy Side:
|
Bevy Side:
|
||||||
- [x] deprecate BlueprintName & BlueprintPath & use BlueprintInfo instead
|
- [x] deprecate BlueprintName & BlueprintPath & use BlueprintInfo instead
|
||||||
|
- [ ] make blueprint instances invisible until spawning is done to avoid "spawn flash"?
|
||||||
- [ ] should "blueprint spawned" only be triggered after all its sub blueprints have spawned ?
|
- [ ] should "blueprint spawned" only be triggered after all its sub blueprints have spawned ?
|
||||||
- [ ] simplify testing example:
|
- [ ] simplify testing example:
|
||||||
- [x] remove use of rapier physics (or even the whole common boilerplate ?)
|
- [x] remove use of rapier physics (or even the whole common boilerplate ?)
|
||||||
- [ ] remove/replace bevy editor pls with some native ui to display hierarchies
|
- [ ] remove/replace bevy editor pls with some native ui to display hierarchies
|
||||||
- [x] try out hot reloading
|
- [x] try out hot reloading
|
||||||
|
- [ ] add a way of overriding assets for collection instances
|
||||||
|
- [ ] add a way of visualizing per blueprint instances
|
||||||
|
- [ ] cleanup all the spurious debug messages
|
||||||
|
- [ ] fix animation handling
|
||||||
- [ ] simplify examples:
|
- [ ] simplify examples:
|
||||||
- [ ] a full fledged demo (including physics & co)
|
- [ ] a full fledged demo (including physics & co)
|
||||||
- [ ] other examples without interactions or physics
|
- [ ] other examples without interactions or physics
|
||||||
|
@ -208,9 +216,5 @@ Bevy Side:
|
||||||
- [ ] replace all references to the old 2 add-ons with those to Blenvy
|
- [ ] replace all references to the old 2 add-ons with those to Blenvy
|
||||||
- [ ] rename repo to "Blenvy"
|
- [ ] rename repo to "Blenvy"
|
||||||
- [ ] do a deprecation release of all bevy_gltf_xxx crates to point at the new Blenvy crate
|
- [ ] do a deprecation release of all bevy_gltf_xxx crates to point at the new Blenvy crate
|
||||||
- [ ] add a way of overriding assets for collection instances
|
|
||||||
- [ ] add a way of visualizing per blueprint instances
|
|
||||||
- [ ] cleanup all the spurious debug messages
|
|
||||||
- [ ] fix animation handling
|
|
||||||
|
|
||||||
clear && pytest -svv --blender-template ../../testing/bevy_example/art/testing_library.blend --blender-executable /home/ckaos/tools/blender/blender-4.1.0-linux-x64/blender tests/test_bevy_integration_prepare.py && pytest -svv --blender-executable /home/ckaos/tools/blender/blender-4.1.0-linux-x64/blender tests/test_bevy_integration.py
|
clear && pytest -svv --blender-template ../../testing/bevy_example/art/testing_library.blend --blender-executable /home/ckaos/tools/blender/blender-4.1.0-linux-x64/blender tests/test_bevy_integration_prepare.py && pytest -svv --blender-executable /home/ckaos/tools/blender/blender-4.1.0-linux-x64/blender tests/test_bevy_integration.py
|
|
@ -15,7 +15,7 @@ def draw_settings_ui(layout, auto_export_settings):
|
||||||
#op.export_format = 'GLTF_SEPARATE'
|
#op.export_format = 'GLTF_SEPARATE'
|
||||||
op.use_selection=True
|
op.use_selection=True
|
||||||
op.will_save_settings=True
|
op.will_save_settings=True
|
||||||
op.use_visible=True # Export visible and hidden objects. See Object/Batch Export to skip.
|
op.use_visible=True
|
||||||
op.use_renderable=True
|
op.use_renderable=True
|
||||||
op.use_active_collection = True
|
op.use_active_collection = True
|
||||||
op.use_active_collection_with_nested=True
|
op.use_active_collection_with_nested=True
|
||||||
|
|
|
@ -209,7 +209,7 @@ def draw_component_ui(layout, object_or_collection, registry, selected_component
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
op = row.operator("blenvy.component_add", text="Add", icon="ADD")
|
op = row.operator("blenvy.component_add", text="Add", icon="ADD")
|
||||||
op.component_type = selected_component
|
op.component_type = selected_component
|
||||||
row.enabled = selected_component != ''
|
row.enabled = selected_component != '' and selected_component in list(registry.type_infos.keys())
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
|
@ -377,7 +377,6 @@ class BLENVY_PT_component_tools_panel(bpy.types.Panel):
|
||||||
def draw_invalid_items(self, layout, upgreadable_entries):
|
def draw_invalid_items(self, layout, upgreadable_entries):
|
||||||
for entry in upgreadable_entries:
|
for entry in upgreadable_entries:
|
||||||
(status, custom_property, item, item_type) = entry
|
(status, custom_property, item, item_type) = entry
|
||||||
print("ENTRY", entry)
|
|
||||||
self.draw_invalid_or_unregistered(layout, status, custom_property, item, item_type)
|
self.draw_invalid_or_unregistered(layout, status, custom_property, item, item_type)
|
||||||
|
|
||||||
def gather_invalid_item_data(self, item, invalid_component_names, items_with_invalid_components, items_with_original_components, original_name, item_type):
|
def gather_invalid_item_data(self, item, invalid_component_names, items_with_invalid_components, items_with_original_components, original_name, item_type):
|
||||||
|
@ -428,8 +427,7 @@ class BLENVY_PT_component_tools_panel(bpy.types.Panel):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
registry = bpy.context.window_manager.components_registry
|
registry = bpy.context.window_manager.components_registry
|
||||||
registry_has_type_infos = registry.has_type_infos()
|
registry_has_type_infos = registry.has_type_infos()
|
||||||
selected_object = context.selected_objects[0] if len(context.selected_objects) > 0 else None
|
type_infos = list(registry.type_infos.keys())
|
||||||
selected_component = bpy.context.window_manager.blenvy.components.component_selector
|
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.label(text= "* Single item actions: Rename / Fix / Upgrade")#"Invalid/ unregistered components")
|
row.label(text= "* Single item actions: Rename / Fix / Upgrade")#"Invalid/ unregistered components")
|
||||||
|
@ -484,7 +482,7 @@ class BLENVY_PT_component_tools_panel(bpy.types.Panel):
|
||||||
operator.original_name = original_name
|
operator.original_name = original_name
|
||||||
operator.target_name = target_component_name
|
operator.target_name = target_component_name
|
||||||
operator.target_items = json.dumps(items_with_original_components)
|
operator.target_items = json.dumps(items_with_original_components)
|
||||||
col.enabled = registry_has_type_infos and original_name != "" and original_name != target_component_name
|
col.enabled = registry_has_type_infos and original_name != "" and original_name != target_component_name and original_name in type_infos and target_component_name in type_infos
|
||||||
else:
|
else:
|
||||||
if hasattr(layout,"progress") : # only for Blender > 4.0
|
if hasattr(layout,"progress") : # only for Blender > 4.0
|
||||||
col.progress(factor = components_rename_progress, text=f"updating {components_rename_progress * 100.0:.2f}%")
|
col.progress(factor = components_rename_progress, text=f"updating {components_rename_progress * 100.0:.2f}%")
|
||||||
|
|
|
@ -43,14 +43,11 @@ def process_map(registry, definition, update, nesting_long_names=[]):
|
||||||
|
|
||||||
#if the content of the list is a unit type, we need to generate a fake wrapper, otherwise we cannot use layout.prop(group, "propertyName") as there is no propertyName !
|
#if the content of the list is a unit type, we need to generate a fake wrapper, otherwise we cannot use layout.prop(group, "propertyName") as there is no propertyName !
|
||||||
if is_value_value_type:
|
if is_value_value_type:
|
||||||
print("WRAPPPER, property group", definition["short_name"])
|
|
||||||
values_property_group_class = generate_wrapper_propertyGroup(f"{long_name}_values", original_long_name, definition_link, registry, update, nesting_long_names)
|
values_property_group_class = generate_wrapper_propertyGroup(f"{long_name}_values", original_long_name, definition_link, registry, update, nesting_long_names)
|
||||||
else:
|
else:
|
||||||
|
|
||||||
(_, list_content_group_class) = process_component.process_component(registry, value_definition, update, {"nested": True, "long_name": original_long_name}, nesting_long_names)
|
(_, list_content_group_class) = process_component.process_component(registry, value_definition, update, {"nested": True, "long_name": original_long_name}, nesting_long_names)
|
||||||
values_property_group_class = list_content_group_class
|
values_property_group_class = list_content_group_class
|
||||||
print("COMPONENT, property group", definition["short_name"], values_property_group_class)
|
|
||||||
|
|
||||||
|
|
||||||
values_collection = CollectionProperty(type=values_property_group_class)
|
values_collection = CollectionProperty(type=values_property_group_class)
|
||||||
values_property_group_pointer = PointerProperty(type=values_property_group_class)
|
values_property_group_pointer = PointerProperty(type=values_property_group_class)
|
||||||
|
|
|
@ -93,7 +93,8 @@ class ComponentsSettings(PropertyGroup):
|
||||||
|
|
||||||
|
|
||||||
component_selector: StringProperty(
|
component_selector: StringProperty(
|
||||||
search=add_component_to_ui_list
|
search=add_component_to_ui_list,
|
||||||
|
description="component selector: only components present in the registry are accepted"
|
||||||
)# type: ignore
|
)# type: ignore
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue