Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions material_maker/globals.gd
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,14 @@ func interpret_file_name(file_name: String, path:="", file_extension:="",additio
file_name = file_name.replace("$idx", str(1).pad_zeros(2))

return file_name

func get_node_title_from_gen(generator : MMGenBase) -> String:
# Get GraphNode title from generator (in current graph)
if generator != null:
var graph : MMGraphEdit = main_window.get_current_graph_edit()
if graph != null:
var node_path := NodePath("node_" + generator.name)
if graph.has_node(node_path):
var gnode : GraphNode = graph.get_node(node_path)
return "reroute" if gnode is MMGraphReroute else gnode.title.to_snake_case()
return "unnamed"
1 change: 1 addition & 0 deletions material_maker/nodes/reroute/reroute.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
extends MMGraphNodeMinimal

class_name MMGraphReroute

const PREVIEW_SIZES : Array[int] = [ 0, 64, 128, 192]

Expand Down
10 changes: 6 additions & 4 deletions material_maker/panels/preview_2d/export_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ var export_settings := {

const RESOLUTION_CUSTOM := 8

var additional_ids := {"$node":"unnamed"}

func _ready() -> void:
for val in export_settings.values():
val = val.replace("$SUFFIX", owner.config_var_suffix)
Expand Down Expand Up @@ -48,6 +50,8 @@ func _open() -> void:


func update() -> void:
additional_ids["$node"] = mm_globals.get_node_title_from_gen(owner.generator)

if not is_visible_in_tree():
return

Expand Down Expand Up @@ -169,10 +173,8 @@ func interpret_file_name(file_name: String, path:="") -> String:
if path.is_empty():
path = %ExportFolder.text

var additional_ids := {"$node":"unnamed"}

if owner.generator:
additional_ids["$node"] = owner.generator.name
if not owner.generator:
additional_ids["$name"] = "unnamed"

var extension := ""
match %FileType.selected:
Expand Down