Skip to content

Commit

Permalink
Updated test scene for mlap renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
RodZill4 committed Oct 9, 2023
1 parent 16f21fa commit 57e5fb3
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 28 deletions.
22 changes: 0 additions & 22 deletions addons/material_maker/map_renderer/map_renderer_test.gd

This file was deleted.

6 changes: 0 additions & 6 deletions addons/material_maker/map_renderer/map_renderer_test.tscn

This file was deleted.

22 changes: 22 additions & 0 deletions addons/material_maker/map_renderer/test.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
extends TextureRect

var map_list : Array

func _ready():
var s : int = 512
get_window().size = Vector2i(s, s)
map_list = MMMapGenerator.MAP_DEFINITIONS.keys()
$Maps.clear()
for map in map_list:
$Maps.add_item(map)
$Maps.select(0)
show_map(map_list[0])

func show_map(map_name : String):
var mesh = load("res://material_maker/meshes/suzanne.obj")
var t : MMTexture = MMTexture.new()
await MMMapGenerator.generate(mesh, map_name, get_window().size.x, t)
texture = await t.get_texture()

func _on_maps_item_selected(index):
show_map(map_list[index])
18 changes: 18 additions & 0 deletions addons/material_maker/map_renderer/test.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[gd_scene load_steps=2 format=3 uid="uid://boy8werx31h7b"]

[ext_resource type="Script" path="res://addons/material_maker/map_renderer/test.gd" id="1_h34mq"]

[node name="test" type="TextureRect"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_h34mq")

[node name="Maps" type="OptionButton" parent="."]
layout_mode = 0
offset_right = 45.0
offset_bottom = 20.0

[connection signal="item_selected" from="Maps" to="." method="_on_maps_item_selected"]

0 comments on commit 57e5fb3

Please sign in to comment.