Skip to content

Commit

Permalink
Misc. updates and fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
RodZill4 committed Feb 21, 2024
1 parent 8148ee8 commit bfd2f18
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions addons/material_maker/nodes/material_3d.mmg
Original file line number Diff line number Diff line change
Expand Up @@ -507,15 +507,15 @@
],
"preview_shader": [
"shader_type spatial;",
"render_mode blend_mix,depth_draw_alpha_prepass,cull_back,diffuse_burley,specular_schlick_ggx;",
"render_mode blend_mix,depth_prepass_alpha,cull_back,diffuse_burley,specular_schlick_ggx;",
"",
"varying vec3 texcoords_3d;",
"",
"$definitions",
"",
"void vertex() {",
"$if $(param:world)",
"\ttexcoords_3d = (vec4(VERTEX, 1.0)*WORLD_MATRIX).xyz;",
"\ttexcoords_3d = (vec4(VERTEX, 1.0)*MODEL_MATRIX).xyz;",
"$else",
"\ttexcoords_3d = VERTEX;",
"$fi",
Expand Down
7 changes: 3 additions & 4 deletions material_maker/main_window.gd
Original file line number Diff line number Diff line change
Expand Up @@ -744,12 +744,11 @@ func edit_select_connected(end1 : String, end2 : String) -> void:
var node_list : Array = []
for n in graph_edit.get_selected_nodes():
node_list.push_back(n.name)
print(node_list)
while !node_list.is_empty():
var new_node_list = []
for c in graph_edit.get_connection_list():
if c[end1] in node_list:
var source = graph_edit.get_node(c[end2])
var source = graph_edit.get_node(NodePath(c[end2]))
if !source.selected:
new_node_list.push_back(c[end2])
source.selected = true
Expand All @@ -760,14 +759,14 @@ func edit_select_sources_is_disabled() -> bool:
return graph_edit == null or graph_edit.get_selected_nodes().is_empty()

func edit_select_sources() -> void:
edit_select_connected("to", "from")
edit_select_connected("to_node", "from_node")

func edit_select_targets_is_disabled() -> bool:
var graph_edit : MMGraphEdit = get_current_graph_edit()
return graph_edit.get_selected_nodes().is_empty() if graph_edit else true

func edit_select_targets() -> void:
edit_select_connected("from", "to")
edit_select_connected("from_node", "to_node")

func edit_duplicate_is_disabled() -> bool:
return edit_cut_is_disabled()
Expand Down
3 changes: 2 additions & 1 deletion material_maker/main_window_layout.gd
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ func load_panels() -> void:
func save_config() -> void:
var current_config : Dictionary = $FlexibleLayout.serialize()
for mode in [ "material", "paint" ]:
mm_globals.config.set_value("layout", mode, JSON.stringify(layout[mode]))
if layout.has(mode):
mm_globals.config.set_value("layout", mode, JSON.stringify(layout[mode]))

func get_panel(n) -> Control:
if panels.has(n):
Expand Down
2 changes: 1 addition & 1 deletion material_maker/panels/preview_3d/preview_3d.gd
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func _on_Model_item_selected(id) -> void:
dialog.access = FileDialog.ACCESS_FILESYSTEM
dialog.file_mode = FileDialog.FILE_MODE_OPEN_FILE
for f in MMMeshLoader.get_file_dialog_filters():
dialog.add_filter()
dialog.add_filter(f)
if mm_globals.config.has_section_key("path", "mesh"):
dialog.current_dir = mm_globals.config.get_value("path", "mesh")
var files = await dialog.select_files()
Expand Down

0 comments on commit bfd2f18

Please sign in to comment.