Compare commits

...

3 Commits

Author SHA1 Message Date
3b8faeba57 Update README.md 2022-06-06 18:02:29 +03:00
eff4641547 Version number updated 2022-06-06 13:05:22 +03:00
2255903ab2 Fixed paths to scripts 2022-06-06 12:49:26 +03:00
6 changed files with 47 additions and 4 deletions

View File

@ -2,6 +2,8 @@
![icon](https://user-images.githubusercontent.com/18103556/172068287-a90cc657-ee91-4fec-b843-e4c2f7c44290.png) ![icon](https://user-images.githubusercontent.com/18103556/172068287-a90cc657-ee91-4fec-b843-e4c2f7c44290.png)
**This plugin is for Godot stable 3.X version. If you want to use it on 4.0 alpha, check out [this fork](https://github.com/Lakamfo/godot4-camera-preview) by [Lakamfo](https://github.com/Lakamfo/)**
Allows you to add a small preview window inside main editor's view to show the preview of the selected camera. Allows you to add a small preview window inside main editor's view to show the preview of the selected camera.
It can search through the children of selected node to find a Camera node (disabled by default) It can search through the children of selected node to find a Camera node (disabled by default)

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/camera_preview/cam_preview.gd" type="Script" id=1] [ext_resource path="./cam_preview.gd" type="Script" id=1]
[ext_resource path="res://addons/camera_preview/window.gd" type="Script" id=2] [ext_resource path="./window.gd" type="Script" id=2]
[sub_resource type="StyleBoxFlat" id=1] [sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0, 0, 0, 0.164706 ) bg_color = Color( 0, 0, 0, 0.164706 )

35
icon.png.import Normal file
View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-37a5d2293e9438a3a40c69269d7ba52b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/camera_preview/icon.png"
dest_files=[ "res://.import/icon.png-37a5d2293e9438a3a40c69269d7ba52b.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -3,5 +3,5 @@
name="CameraPreview" name="CameraPreview"
description="Allows user to create a small window inside the main editor view to preview selected Camera in 3d scene" description="Allows user to create a small window inside the main editor view to preview selected Camera in 3d scene"
author="Nefrace" author="Nefrace"
version="0.4" version="0.5"
script="plugin.gd" script="plugin.gd"

View File

@ -36,6 +36,12 @@ func _exit_tree():
if button_instance: if button_instance:
button_instance.queue_free() button_instance.queue_free()
func _process(_delta):
if cam_selected and pcam:
pcam.fov = cam_selected.fov
pcam.projection = cam_selected.projection
pcam.size = cam_selected.size
func find_a_camera(root) -> Camera: func find_a_camera(root) -> Camera:
if root is Camera: if root is Camera:
return root return root

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/camera_preview/toggle_button.gd" type="Script" id=1] [ext_resource path="./toggle_button.gd" type="Script" id=1]
[node name="ToolButton" type="MenuButton"] [node name="ToolButton" type="MenuButton"]
margin_right = 114.0 margin_right = 114.0