mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-11 02:24:38 +08:00
Fix crash on camera delete (#1094)
This commit is contained in:
parent
6896028fc5
commit
006703bb64
@ -612,6 +612,11 @@ export default function CameraPanel(props) {
|
||||
|
||||
sceneTree.delete(['Camera Path', 'Cameras']); // delete old cameras, which is important
|
||||
if (cameras.length < 1) {
|
||||
dispatch({
|
||||
type: 'write',
|
||||
path: 'renderingState/camera_choice',
|
||||
data: 'Main Camera',
|
||||
});
|
||||
camera_render_helper.set_visibility(false);
|
||||
} else {
|
||||
camera_render_helper.set_visibility(true);
|
||||
@ -625,7 +630,7 @@ export default function CameraPanel(props) {
|
||||
labelDiv.className = 'label';
|
||||
labelDiv.textContent = camera.properties.get('NAME');
|
||||
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.padding = '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.
|
||||
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
|
||||
focal_length = pp_h / np.tan(fov * (np.pi / 180.0) / 2.0)
|
||||
return focal_length
|
||||
|
||||
Loading…
Reference in New Issue
Block a user