Skip to content

Commit

Permalink
Fixed a few warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
RodZill4 committed Oct 9, 2023
1 parent 75a87f2 commit e4e54a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
11 changes: 4 additions & 7 deletions material_maker/panels/paint/paint_layers.gd
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func get_depth_texture():
func get_occlusion_texture():
return occlusion.get_texture()

func _on_Tree_selection_changed(old_selected : TreeItem, new_selected : TreeItem) -> void:
func _on_Tree_selection_changed(_old_selected : TreeItem, new_selected : TreeItem) -> void:
select_layer(new_selected.get_meta("layer"))

func select_layer(layer : Layer) -> void:
Expand Down Expand Up @@ -136,7 +136,7 @@ func select_layer(layer : Layer) -> void:
await get_tree().process_frame
_on_layers_changed()

func get_unused_layer_name(layers_array : Array) -> String:
func get_unused_layer_name(_layers_array : Array) -> String:
return "New layer"

func layer_index_is_used(index : int, layers_array : Array) -> bool:
Expand Down Expand Up @@ -167,12 +167,10 @@ func add_layer(layer_type : int = 0) -> void:
layer.name = get_unused_layer_name(layers)
layer.index = get_unused_layer_index()
layer.hidden = false
var image : Image = Image.new()
image.create(texture_size, texture_size, false, Image.FORMAT_RGBA8)
var image : Image = Image.create(texture_size, texture_size, false, Image.FORMAT_RGBA8)
image.fill(Color(0, 0, 0, 0))
for c in layer.get_channels():
var texture = ImageTexture.new()
texture.set_image(image)
var texture = ImageTexture.create_from_image(image)
layer.set(c, texture)
layers_array.push_front(layer)
select_layer(layer)
Expand Down Expand Up @@ -278,7 +276,6 @@ func update_layers_renderer(visible_layers : Array) -> void:
for viewport in [ albedo, metallic, roughness, emission, normal, depth, occlusion ]:
while viewport.get_child_count() > 0:
viewport.remove_child(viewport.get_child(0))
var texture_rect : TextureRect
var color_rect : ColorRect
color_rect = ColorRect.new()
color_rect.size = normal.size
Expand Down
12 changes: 6 additions & 6 deletions material_maker/panels/parameters/parameters.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ func set_generator(g):
continue
elif parameter_labels.has("Paint "+p.label):
var paint_parameter = parameter_labels["Paint "+p.label]
var control = GENERIC.create_parameter_control(paint_parameter, false)
control.name = paint_parameter.name
if control is CheckBox:
control.text = p.label
parameters.add_child(control)
controls[paint_parameter.name] = control
var channel_control = GENERIC.create_parameter_control(paint_parameter, false)
channel_control.name = paint_parameter.name
if channel_control is CheckBox:
channel_control.text = p.label
parameters.add_child(channel_control)
controls[paint_parameter.name] = channel_control
else:
var label : Label = Label.new()
label.text = p.label if p.has("label") else ""
Expand Down

0 comments on commit e4e54a9

Please sign in to comment.