diff --git a/nerfstudio/viewer/app/src/index.scss b/nerfstudio/viewer/app/src/index.scss index c39522b58..a27610a81 100644 --- a/nerfstudio/viewer/app/src/index.scss +++ b/nerfstudio/viewer/app/src/index.scss @@ -96,6 +96,29 @@ $sidebar-color: $accent-color3 !default; $sidebar-width: 100% !default; @import '~react-pro-sidebar/dist/scss/styles.scss'; +// Scrollbar + +/* width */ +::-webkit-scrollbar { + width: 8px; + height: 6px; +} + +/* Track */ +::-webkit-scrollbar-track { + background: #454651; +} + +/* Handle */ +::-webkit-scrollbar-thumb { + background: $accent-color3; +} + +/* Handle on hover */ +::-webkit-scrollbar-thumb:hover { + background: $highlight-color2; +} + // ------------------------------------ // Status Panel styling .StatusPanel { @@ -161,6 +184,41 @@ $sidebar-width: 100% !default; margin: 3px; } +// ------------------------------------ +// Render Modal styling + +.RenderModal-box { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 600px; // 400 + background-color: $base-color2; + border: 2px solid #000; + // box-shadow: 24px 24px; + padding: 32px; +} + +.RenderModal-code { + padding: 10px; + background-color: $base-color3; + overflow-x: scroll; + font-family: monospace; + white-space: pre; + margin-top: 16px; +} + +.RenderModal-inline-code { + font-size: 0.9rem; + color: $accent-color3; +} + +.RenderModal-box .RenderModal-button { + width: 50%; + padding: 5px; + margin-top: 20px; +} + // ------------------------------------ // Camera Pane @@ -173,6 +231,13 @@ $sidebar-width: 100% !default; margin-top: 8px; } +.CameraPanel-render-button { + display: inline-block; + width: 70%; + margin: 4px; + margin-top: 8px; +} + .CameraPanel-slider-container { margin-top: 40px; margin-left: auto; diff --git a/nerfstudio/viewer/app/src/modules/RenderModal/RenderModal.jsx b/nerfstudio/viewer/app/src/modules/RenderModal/RenderModal.jsx new file mode 100644 index 000000000..6305d4043 --- /dev/null +++ b/nerfstudio/viewer/app/src/modules/RenderModal/RenderModal.jsx @@ -0,0 +1,93 @@ +/* eslint-disable react/jsx-props-no-spreading */ +import * as React from 'react'; + +import { Box, Button, Modal, TextField, Typography } from '@mui/material'; +import { useSelector } from 'react-redux'; +import ContentCopyRoundedIcon from '@mui/icons-material/ContentCopyRounded'; + +interface RenderModalProps { + open: object; + setOpen: object; +} + +export default function RenderModal(props: RenderModalProps) { + const open = props.open; + const setOpen = props.setOpen; + + // redux store state + const config_base_dir = useSelector( + (state) => state.renderingState.config_base_dir, + ); + + // react state + const [filename, setFilename] = React.useState('render_output'); + + const handleClose = () => setOpen(false); + + // Copy the text inside the text field + const config_filename = `${config_base_dir}/config.yml`; + const camera_path_filename = `${config_base_dir}/camera_path.json`; + const cmd = `ns-render --load-config ${config_filename} --traj filename --camera-path-filename ${camera_path_filename} --output-path renders/${filename}.mp4`; + + const text_intro = `To render a full resolution video, run the following command in a terminal.`; + + const handleCopy = () => { + navigator.clipboard.writeText(cmd); + }; + + return ( +
+ {text_intro}
+
+ The video will be saved to{' '}
+
+ ./renders/{filename}.mp4
+
+ .
+