Play around with internal nodes
They are selectable, isn't that interesting?
This commit is contained in:
parent
ac50e8eee7
commit
1fa1e709ff
8
NOTES.md
8
NOTES.md
@ -66,6 +66,12 @@ Mám v plánu udělat texture masku pro tvarování protálů. S házením stín
|
||||
|
||||
> Dal by se udělat celkem jednoduchý algoritmus co by generoval mesh "s prohlubní" pro jakýkoliv nákres zepředu. Obdélník je nejjednodušší, ale udělat oblouček by asi nebyl problém.
|
||||
>
|
||||
> **Custom Mesh subclassa?**
|
||||
> Podobně jak se dá "kreslit" s CSG polygonem. Ale to by byl teda komplikovaný editor widget. Ty oblouky bysme asi chtěli hladké - to vypadá na něco na styl Curve editoru... ugh
|
||||
>
|
||||
> 
|
||||
>
|
||||
> [Cyclops Level Editor](https://github.com/blackears/cyclopsLevelBuilder/blob/master/doc/index.md#display-mode)
|
||||
|
||||
**Custom Mesh subclassa?**
|
||||
|
||||
- Custom mesh subclassa je trochu divná věc. Když to všechno nastaví jeden editorový Node tak to bude asi lepší. Custom mesh se mi přegenerovává při každém spuštění, ale já chci aby se prostě "zapekl" a uložil a nazdar bazar...
|
||||
|
BIN
assets/csg-polygon.png
Normal file
BIN
assets/csg-polygon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 366 KiB |
@ -162,7 +162,6 @@ portal = NodePath("../Portal A")
|
||||
|
||||
[node name="Outer" type="CSGBox3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 2.78925)
|
||||
visible = false
|
||||
size = Vector3(2.2, 3.2, 0.25)
|
||||
|
||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="Outer"]
|
||||
|
43
levels/test_internal_nodes.gd
Normal file
43
levels/test_internal_nodes.gd
Normal file
@ -0,0 +1,43 @@
|
||||
@tool
|
||||
extends Node3D
|
||||
|
||||
|
||||
|
||||
func _add_inspector_buttons() -> Array:
|
||||
var buttons: Array = []
|
||||
|
||||
buttons.push_back({
|
||||
"name": "Regular cube mesh",
|
||||
"pressed": _add_regular_cube_mesh
|
||||
})
|
||||
buttons.push_back({
|
||||
"name": "Internal cube mesh",
|
||||
"pressed": _add_internal_cube_mesh
|
||||
})
|
||||
buttons.push_back({
|
||||
"name": "Delete all children",
|
||||
"pressed": func(): for child in get_children(true): child.queue_free()
|
||||
})
|
||||
|
||||
return buttons
|
||||
|
||||
func _add_regular_cube_mesh() -> void:
|
||||
var m = MeshInstance3D.new()
|
||||
var b = BoxMesh.new()
|
||||
m.mesh = b
|
||||
add_child(m, true)
|
||||
m.owner = self
|
||||
m.position.x = 1.5 * get_child_count(true)
|
||||
|
||||
func _add_internal_cube_mesh() -> void:
|
||||
var m = MeshInstance3D.new()
|
||||
var b = BoxMesh.new()
|
||||
m.mesh = b
|
||||
add_child(m, true, Node.INTERNAL_MODE_BACK)
|
||||
|
||||
var mat = StandardMaterial3D.new()
|
||||
mat.albedo_color = Color("ff4c4e")
|
||||
b.material = mat
|
||||
|
||||
m.owner = self
|
||||
m.position.x = 1.5 * get_child_count(true)
|
1
levels/test_internal_nodes.gd.uid
Normal file
1
levels/test_internal_nodes.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://ouk76qr5gpq0
|
38
levels/test_internal_nodes.tscn
Normal file
38
levels/test_internal_nodes.tscn
Normal file
@ -0,0 +1,38 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://bnrph4k6wpruy"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ouk76qr5gpq0" path="res://levels/test_internal_nodes.gd" id="1_glqbe"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_glqbe"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_dodl2"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_wgeau"]
|
||||
albedo_color = Color(1, 0.298039, 0.305882, 1)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_j0q2q"]
|
||||
material = SubResource("StandardMaterial3D_wgeau")
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_47wcs"]
|
||||
albedo_color = Color(1, 0.298039, 0.305882, 1)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_bkhqo"]
|
||||
material = SubResource("StandardMaterial3D_47wcs")
|
||||
|
||||
[node name="test_internal_nodes" type="Node3D"]
|
||||
script = ExtResource("1_glqbe")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 0)
|
||||
mesh = SubResource("BoxMesh_glqbe")
|
||||
|
||||
[node name="MeshInstance3D3" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 0)
|
||||
mesh = SubResource("BoxMesh_dodl2")
|
||||
|
||||
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 0)
|
||||
mesh = SubResource("BoxMesh_j0q2q")
|
||||
|
||||
[node name="MeshInstance3D4" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 0)
|
||||
mesh = SubResource("BoxMesh_bkhqo")
|
Loading…
Reference in New Issue
Block a user