-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Steveplays28/picture-in-picture
Picture in picture
- Loading branch information
Showing
97 changed files
with
6,882 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[plugin] | ||
|
||
name="Change node" | ||
description="Changes a node to an instance of a scene, while keeping position, rotation, and scale." | ||
author="Steveplays28" | ||
version="1.0" | ||
script="plugin.gd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
tool | ||
extends EditorPlugin | ||
|
||
var changed_node_paths:Array = [] | ||
var removed_nodes:Dictionary = {} | ||
|
||
func _enter_tree(): | ||
add_tool_menu_item("Change nodes", self, "show_file_dialog") | ||
|
||
func _exit_tree(): | ||
remove_tool_menu_item("Change nodes") | ||
|
||
func show_file_dialog(args): | ||
var nodes = get_editor_interface().get_selection().get_selected_nodes() | ||
if nodes.size() <= 0: | ||
return | ||
|
||
var file_dialog:FileDialog = FileDialog.new() | ||
file_dialog.connect("file_selected", self, "file_dialog_file_selected") | ||
file_dialog.mode = FileDialog.MODE_OPEN_FILE | ||
file_dialog.access = FileDialog.ACCESS_RESOURCES | ||
file_dialog.filters = PoolStringArray(["*.tscn, *.scn ; Scene files","*.res ; Resource files"]) | ||
|
||
add_child(file_dialog) | ||
file_dialog.popup_centered(OS.get_window_safe_area().size / 2) | ||
|
||
func file_dialog_file_selected(path:String): | ||
changed_node_paths.append(path) | ||
|
||
var undo_redo:UndoRedo = get_undo_redo() | ||
undo_redo.create_action("Change nodes") | ||
undo_redo.add_do_method(self, "do_change_nodes") | ||
undo_redo.add_undo_method(self, "undo_change_nodes") | ||
undo_redo.commit_action() | ||
|
||
func do_change_nodes(): | ||
var selected_nodes = get_editor_interface().get_selection().get_selected_nodes() | ||
|
||
var new_node_path:String = changed_node_paths[changed_node_paths.size() - 1] | ||
var loaded_node = load(new_node_path) | ||
var instanced_node = loaded_node.instance() | ||
|
||
for selected_node in selected_nodes: | ||
if (selected_node is Spatial && instanced_node is Spatial): | ||
var selected_spatial:Spatial = selected_node as Spatial | ||
|
||
var copied_translation:Vector3 = selected_spatial.transform.origin | ||
var copied_rotation_degrees:Vector3 = selected_node.rotation_degrees | ||
var copied_scale:Vector3 = selected_node.scale | ||
|
||
selected_node.get_parent().add_child(instanced_node) | ||
instanced_node.owner = selected_node.get_parent() | ||
|
||
var new_spatial:Spatial = instanced_node as Spatial | ||
new_spatial.get_parent().move_child(new_spatial, selected_spatial.get_index()) | ||
new_spatial.transform.origin = copied_translation | ||
new_spatial.rotation_degrees = copied_rotation_degrees | ||
new_spatial.scale = copied_scale | ||
|
||
removed_nodes[selected_node] = selected_node.get_parent() | ||
selected_node.get_parent().remove_child(selected_node) | ||
|
||
func undo_change_nodes(): | ||
if removed_nodes.size() > 0: | ||
var last_removed_node:Node = removed_nodes.keys()[removed_nodes.size() - 1] | ||
removed_nodes[last_removed_node].add_child(last_removed_node) | ||
last_removed_node.owner = last_removed_node.get_parent() | ||
removed_nodes.erase(last_removed_node) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
[gd_resource type="Environment" load_steps=2 format=2] | ||
[gd_resource type="Environment" load_steps=3 format=2] | ||
|
||
[sub_resource type="ProceduralSky" id=1] | ||
sky_top_color = Color( 0.211765, 0.313726, 0.552941, 1 ) | ||
sky_horizon_color = Color( 0.545098, 0.686275, 0.811765, 1 ) | ||
sky_curve = 0.13 | ||
sun_latitude = 45.0 | ||
[ext_resource path="res://resources/skyboxes/Epic_BlueSunset_EquiRect_flat.png" type="Texture" id=1] | ||
|
||
[sub_resource type="PanoramaSky" id=1] | ||
panorama = ExtResource( 1 ) | ||
|
||
[resource] | ||
resource_local_to_scene = true | ||
background_mode = 2 | ||
background_sky = SubResource( 1 ) | ||
background_sky_orientation = Basis( -1, 0, -1.50996e-07, 0, 1, 0, 1.50996e-07, 0, -1 ) | ||
ambient_light_color = Color( 1, 1, 1, 1 ) | ||
tonemap_mode = 3 | ||
glow_bloom = 0.25 | ||
ssao_enabled = true | ||
glow_enabled = true | ||
glow_blend_mode = 0 | ||
glow_bicubic_upscale = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[gd_scene load_steps=3 format=2] | ||
|
||
[ext_resource path="res://resources/materials/brick.material" type="Material" id=2] | ||
|
||
[sub_resource type="ArrayMesh" id=1] | ||
resource_name = "brick_wall1_Cube" | ||
surfaces/0 = { | ||
"aabb": AABB( -1, -1, -1, 2.00001, 2.00001, 2 ), | ||
"array_data": PoolByteArray( 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 191, 127, 127, 129, 63, 146, 36, 146, 36, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 191, 0, 127, 129, 63, 121, 57, 210, 58, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 191, 127, 0, 127, 127, 70, 56, 158, 53, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 191, 0, 129, 127, 63, 48, 57, 209, 58, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 191, 127, 127, 129, 63, 146, 36, 12, 53, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 191, 127, 0, 127, 127, 70, 56, 48, 57, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 127, 63, 12, 53, 121, 57, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 0, 127, 129, 63, 121, 57, 130, 58, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 127, 0, 127, 127, 115, 55, 158, 53, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 63, 0, 129, 127, 63, 48, 57, 132, 58, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 127, 63, 12, 53, 219, 59, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 63, 127, 0, 127, 127, 115, 55, 48, 57, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 128, 191, 129, 0, 0, 63, 211, 47, 158, 53, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 128, 191, 127, 127, 129, 63, 12, 53, 146, 36, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 128, 191, 0, 127, 129, 63, 219, 59, 210, 58, 0, 0, 128, 191, 0, 0, 128, 191, 0, 0, 128, 191, 129, 0, 0, 63, 211, 47, 48, 57, 0, 0, 128, 191, 0, 0, 128, 191, 0, 0, 128, 191, 0, 129, 127, 63, 158, 53, 209, 58, 0, 0, 128, 191, 0, 0, 128, 191, 0, 0, 128, 191, 127, 127, 129, 63, 12, 53, 12, 53, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 128, 63, 129, 0, 0, 63, 192, 50, 158, 53, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 127, 63, 146, 36, 121, 57, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 128, 63, 0, 127, 129, 63, 219, 59, 130, 58, 0, 0, 128, 191, 0, 0, 128, 191, 0, 0, 128, 63, 129, 0, 0, 63, 192, 50, 48, 57, 0, 0, 128, 191, 0, 0, 128, 191, 0, 0, 128, 63, 0, 129, 127, 63, 158, 53, 132, 58, 0, 0, 128, 191, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 127, 63, 146, 36, 219, 59 ), | ||
"array_index_data": PoolByteArray( 1, 0, 20, 0, 14, 0, 1, 0, 7, 0, 20, 0, 10, 0, 19, 0, 6, 0, 10, 0, 23, 0, 19, 0, 21, 0, 12, 0, 18, 0, 21, 0, 15, 0, 12, 0, 16, 0, 9, 0, 3, 0, 16, 0, 22, 0, 9, 0, 5, 0, 8, 0, 2, 0, 5, 0, 11, 0, 8, 0, 17, 0, 0, 0, 13, 0, 17, 0, 4, 0, 0, 0 ), | ||
"blend_shape_data": [ ], | ||
"format": 2194711, | ||
"index_count": 36, | ||
"primitive": 4, | ||
"skeleton_aabb": [ ], | ||
"vertex_count": 24 | ||
} | ||
|
||
[node name="BrickWall1" type="Spatial"] | ||
|
||
[node name="Cube" type="MeshInstance" parent="."] | ||
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 1, 0, 10, 0 ) | ||
mesh = SubResource( 1 ) | ||
material/0 = ExtResource( 2 ) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[gd_scene load_steps=4 format=2] | ||
|
||
[ext_resource path="res://resources/materials/concrete.material" type="Material" id=1] | ||
|
||
[sub_resource type="BoxShape" id=12] | ||
|
||
[sub_resource type="CubeMesh" id=13] | ||
|
||
[node name="ConcreteFloor1" type="StaticBody"] | ||
|
||
[node name="CollisionShape" type="CollisionShape" parent="."] | ||
shape = SubResource( 12 ) | ||
|
||
[node name="MeshInstance" type="MeshInstance" parent="CollisionShape"] | ||
mesh = SubResource( 13 ) | ||
skeleton = NodePath("../../../Floor2") | ||
material/0 = ExtResource( 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[gd_scene load_steps=3 format=2] | ||
|
||
[ext_resource path="res://resources/materials/glass.material" type="Material" id=1] | ||
|
||
[sub_resource type="ArrayMesh" id=1] | ||
resource_name = "brick_wall1_Cube" | ||
surfaces/0 = { | ||
"aabb": AABB( -1, -1, -1, 2.00001, 2.00001, 2 ), | ||
"array_data": PoolByteArray( 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 191, 127, 127, 129, 63, 146, 36, 146, 36, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 191, 0, 127, 129, 63, 121, 57, 210, 58, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 191, 127, 0, 127, 127, 70, 56, 158, 53, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 191, 0, 129, 127, 63, 48, 57, 209, 58, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 191, 127, 127, 129, 63, 146, 36, 12, 53, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 191, 127, 0, 127, 127, 70, 56, 48, 57, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 127, 63, 12, 53, 121, 57, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 0, 127, 129, 63, 121, 57, 130, 58, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 127, 0, 127, 127, 115, 55, 158, 53, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 63, 0, 129, 127, 63, 48, 57, 132, 58, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 127, 63, 12, 53, 219, 59, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 63, 127, 0, 127, 127, 115, 55, 48, 57, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 128, 191, 129, 0, 0, 63, 211, 47, 158, 53, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 128, 191, 127, 127, 129, 63, 12, 53, 146, 36, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 128, 191, 0, 127, 129, 63, 219, 59, 210, 58, 0, 0, 128, 191, 0, 0, 128, 191, 0, 0, 128, 191, 129, 0, 0, 63, 211, 47, 48, 57, 0, 0, 128, 191, 0, 0, 128, 191, 0, 0, 128, 191, 0, 129, 127, 63, 158, 53, 209, 58, 0, 0, 128, 191, 0, 0, 128, 191, 0, 0, 128, 191, 127, 127, 129, 63, 12, 53, 12, 53, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 128, 63, 129, 0, 0, 63, 192, 50, 158, 53, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 127, 63, 146, 36, 121, 57, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 128, 63, 0, 127, 129, 63, 219, 59, 130, 58, 0, 0, 128, 191, 0, 0, 128, 191, 0, 0, 128, 63, 129, 0, 0, 63, 192, 50, 48, 57, 0, 0, 128, 191, 0, 0, 128, 191, 0, 0, 128, 63, 0, 129, 127, 63, 158, 53, 132, 58, 0, 0, 128, 191, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 127, 63, 146, 36, 219, 59 ), | ||
"array_index_data": PoolByteArray( 1, 0, 20, 0, 14, 0, 1, 0, 7, 0, 20, 0, 10, 0, 19, 0, 6, 0, 10, 0, 23, 0, 19, 0, 21, 0, 12, 0, 18, 0, 21, 0, 15, 0, 12, 0, 16, 0, 9, 0, 3, 0, 16, 0, 22, 0, 9, 0, 5, 0, 8, 0, 2, 0, 5, 0, 11, 0, 8, 0, 17, 0, 0, 0, 13, 0, 17, 0, 4, 0, 0, 0 ), | ||
"blend_shape_data": [ ], | ||
"format": 2194711, | ||
"index_count": 36, | ||
"primitive": 4, | ||
"skeleton_aabb": [ ], | ||
"vertex_count": 24 | ||
} | ||
|
||
[node name="GlassWall1" type="Spatial"] | ||
|
||
[node name="Cube" type="MeshInstance" parent="."] | ||
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 1, 0, 10, 0 ) | ||
mesh = SubResource( 1 ) | ||
material/0 = ExtResource( 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[gd_scene load_steps=4 format=2] | ||
|
||
[ext_resource path="res://resources/materials/purple.tres" type="Material" id=1] | ||
|
||
[sub_resource type="BoxShape" id=12] | ||
|
||
[sub_resource type="CubeMesh" id=13] | ||
|
||
[node name="PrototypeCube1" type="StaticBody"] | ||
|
||
[node name="CollisionShape" type="CollisionShape" parent="."] | ||
shape = SubResource( 12 ) | ||
|
||
[node name="MeshInstance" type="MeshInstance" parent="CollisionShape"] | ||
mesh = SubResource( 13 ) | ||
material/0 = ExtResource( 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[gd_scene load_steps=2 format=2] | ||
|
||
[ext_resource path="res://resources/models/metal_plating1/metal_plating1.glb" type="PackedScene" id=1] | ||
|
||
[node name="MetalPlating1" instance=ExtResource( 1 )] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[gd_scene load_steps=7 format=2] | ||
|
||
[ext_resource path="res://resources/materials/physics/zero_friction.tres" type="PhysicsMaterial" id=1] | ||
[ext_resource path="res://prefabs/gun1.tscn" type="PackedScene" id=2] | ||
[ext_resource path="res://scripts/PlayerController.cs" type="Script" id=4] | ||
[ext_resource path="res://resources/materials/white.tres" type="Material" id=5] | ||
|
||
[sub_resource type="BoxShape" id=2] | ||
extents = Vector3( 1, 2, 1 ) | ||
|
||
[sub_resource type="CubeMesh" id=3] | ||
|
||
[node name="Player" type="RigidBody"] | ||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5, 0 ) | ||
mass = 80.0 | ||
physics_material_override = ExtResource( 1 ) | ||
gravity_scale = 1.5 | ||
continuous_cd = true | ||
contacts_reported = 1 | ||
contact_monitor = true | ||
can_sleep = false | ||
axis_lock_angular_x = true | ||
axis_lock_angular_y = true | ||
axis_lock_angular_z = true | ||
linear_damp = 0.0 | ||
script = ExtResource( 4 ) | ||
sensitivity = Vector2( 0.12, 0.12 ) | ||
accelerationMultiplier = 10.0 | ||
deccelerationMultiplier = 0.5 | ||
|
||
[node name="CollisionShape" type="CollisionShape" parent="."] | ||
shape = SubResource( 2 ) | ||
|
||
[node name="MeshInstance" type="MeshInstance" parent="CollisionShape"] | ||
transform = Transform( 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0 ) | ||
mesh = SubResource( 3 ) | ||
material/0 = ExtResource( 5 ) | ||
|
||
[node name="Camera" type="Camera" parent="CollisionShape"] | ||
fov = 90.0 | ||
|
||
[node name="Gun1" parent="CollisionShape/Camera" instance=ExtResource( 2 )] | ||
transform = Transform( 0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 1.5, -0.5, 0.5 ) | ||
PlayerNodePath = NodePath("../../..") | ||
CameraNodePath = NodePath("..") | ||
HorizontalRotationNodePath = NodePath("../..") | ||
AimDownSightPosition = Vector3( 0, -0.4, -0.5 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[gd_scene load_steps=2 format=2] | ||
|
||
[ext_resource path="res://resources/models/steel_beam1/steel_beam1.glb" type="PackedScene" id=1] | ||
|
||
[node name="SteelBeam1" instance=ExtResource( 1 )] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[gd_scene load_steps=3 format=2] | ||
|
||
[ext_resource path="res://resources/models/window1/window1.glb" type="PackedScene" id=1] | ||
[ext_resource path="res://resources/materials/glass.material" type="Material" id=2] | ||
|
||
[node name="Window1" instance=ExtResource( 1 )] | ||
|
||
[node name="Glass" parent="." index="1"] | ||
material/0 = ExtResource( 2 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[gd_resource type="SpatialMaterial" format=2] | ||
|
||
[resource] | ||
albedo_color = Color( 0.392157, 0.392157, 1, 1 ) | ||
roughness = 0.5 |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.