Geometry Nodes: expose simulation bake path in UI #108220
|
@ -45,34 +45,8 @@ class PHYSICS_PT_geometry_nodes(Panel):
|
|||
layout.prop(ob, "use_simulation_cache", text="Cache")
|
||||
|
||||
|
||||
class PHYSICS_PT_geometry_nodes_bake_paths(Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "physics"
|
||||
bl_label = "Paths"
|
||||
bl_parent_id = "PHYSICS_PT_geometry_nodes"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
objects = [ob for ob in context.selected_editable_objects
|
||||
if any(m.type == 'NODES' for m in ob.modifiers)]
|
||||
multiple_objects = len(objects) > 1
|
||||
|
||||
for ob in objects:
|
||||
col = layout.column()
|
||||
if multiple_objects:
|
||||
col.label(text=ob.name, icon='OBJECT_DATA')
|
||||
for modifier in ob.modifiers:
|
||||
if modifier.type != 'NODES':
|
||||
continue
|
||||
col.prop(modifier, "simulation_bake_directory", text=modifier.name)
|
||||
|
||||
|
||||
classes = (
|
||||
PHYSICS_PT_geometry_nodes,
|
||||
PHYSICS_PT_geometry_nodes_bake_paths,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1913,6 +1913,8 @@ static void internal_dependencies_panel_draw(const bContext * /*C*/, Panel *pane
|
|||
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
||||
NodesModifierData *nmd = static_cast<NodesModifierData *>(ptr->data);
|
||||
|
||||
uiItemR(layout, ptr, "simulation_bake_directory", 0, "Bake Path", ICON_NONE);
|
||||
Hans Goudey
commented
Outdated
Review
```cpp
uiLayout *col = uiLayoutColumn(layout, false);
uiLayoutSetPropSep(col, true);
uiLayoutSetPropDecorate(col, false);
uiItemR(col, ptr, "simulation_bake_directory", 0, "Bake Path", ICON_NONE);
```
|
||||
|
||||
geo_log::GeoTreeLog *tree_log = get_root_tree_log(*nmd);
|
||||
if (tree_log == nullptr) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue