Geometry Nodes: Expose non-asset tools
Node tools are no longer required to be assets, and they aren't assets
by default anymore. Non-assets don't have catalogs for header menu
organization, so they are only exposed in the "Unassigned" menu, which
is now just an icon so it takes less spac, makes the connection to the
asset browser, and signals more that it's not the "final" place for a
tool. Tool node groups have fake user set by default, since they don't
have users. The "Is Tool" status of a node group is configurable in the
editor N-panel, just like the modifier status.
This is similar to af3461c387, and has the same check for
whether a node group is "local."
This commit is contained in:
@@ -43,7 +43,8 @@ def geometry_node_group_empty_modifier_new(name):
|
||||
|
||||
def geometry_node_group_empty_tool_new(context):
|
||||
group = geometry_node_group_empty_new(data_("Tool"))
|
||||
group.asset_mark()
|
||||
# Node tools have fake users by default, otherwise Blender will delete them since they have no users.
|
||||
group.use_fake_user = True
|
||||
group.is_tool = True
|
||||
|
||||
ob_type = context.object.type if context.object else 'MESH'
|
||||
|
||||
@@ -163,7 +163,7 @@ class NODE_HT_header(Header):
|
||||
row.template_ID(snode, "node_tree", new="node.new_geometry_nodes_modifier")
|
||||
else:
|
||||
layout.template_ID(snode, "node_tree", new="node.new_geometry_node_group_tool")
|
||||
if snode.node_tree and snode.node_tree.asset_data:
|
||||
if snode.node_tree:
|
||||
layout.popover(panel="NODE_PT_geometry_node_tool_object_types", text="Types")
|
||||
layout.popover(panel="NODE_PT_geometry_node_tool_mode", text="Modes")
|
||||
display_pin = False
|
||||
|
||||
Reference in New Issue
Block a user