mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-30 21:09:58 +08:00
Fix crash on camera delete (#1094)
This commit is contained in:
1 parent
6896028fc5
commit
006703bb64
2 files changed
+9
-1
No files matched your search
@@ -612,6 +612,11 @@ export default function CameraPanel(props) {
|
|||||||
|
|
||||||
sceneTree.delete(['Camera Path', 'Cameras']); // delete old cameras, which is important
|
sceneTree.delete(['Camera Path', 'Cameras']); // delete old cameras, which is important
|
||||||
if (cameras.length < 1) {
|
if (cameras.length < 1) {
|
||||||
|
dispatch({
|
||||||
|
type: 'write',
|
||||||
|
path: 'renderingState/camera_choice',
|
||||||
|
data: 'Main Camera',
|
||||||
|
});
|
||||||
camera_render_helper.set_visibility(false);
|
camera_render_helper.set_visibility(false);
|
||||||
} else {
|
} else {
|
||||||
camera_render_helper.set_visibility(true);
|
camera_render_helper.set_visibility(true);
|
||||||
@@ -625,7 +630,7 @@ export default function CameraPanel(props) {
|
|||||||
labelDiv.className = 'label';
|
labelDiv.className = 'label';
|
||||||
labelDiv.textContent = camera.properties.get('NAME');
|
labelDiv.textContent = camera.properties.get('NAME');
|
||||||
labelDiv.style.color = 'black';
|
labelDiv.style.color = 'black';
|
||||||
labelDiv.style.backgroundColor = "rgba(255, 255, 255, 0.61)";
|
labelDiv.style.backgroundColor = 'rgba(255, 255, 255, 0.61)';
|
||||||
labelDiv.style.backdropFilter = 'blur(5px)';
|
labelDiv.style.backdropFilter = 'blur(5px)';
|
||||||
labelDiv.style.padding = '6px';
|
labelDiv.style.padding = '6px';
|
||||||
labelDiv.style.borderRadius = '6px';
|
labelDiv.style.borderRadius = '6px';
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ def three_js_perspective_camera_focal_length(fov: float, image_height: int):
|
|||||||
fov: the field of view of the camera in degrees.
|
fov: the field of view of the camera in degrees.
|
||||||
image_height: the height of the image in pixels.
|
image_height: the height of the image in pixels.
|
||||||
"""
|
"""
|
||||||
|
if fov is None:
|
||||||
|
print("Warning: fov is None, using default value")
|
||||||
|
return 50
|
||||||
pp_h = image_height / 2.0
|
pp_h = image_height / 2.0
|
||||||
focal_length = pp_h / np.tan(fov * (np.pi / 180.0) / 2.0)
|
focal_length = pp_h / np.tan(fov * (np.pi / 180.0) / 2.0)
|
||||||
return focal_length
|
return focal_length
|
||||||
|
|||||||
Reference in new issue
Block a user