Skip to content

Commit e773951

Browse files
committed
restore validation for animation modal
1 parent 16e64da commit e773951

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

frontend/javascripts/oxalis/view/action-bar/create_animation_modal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type Props = {
4545

4646
// When creating the texture for the dataset animation, we aim for for texture with the largest side of roughly this size
4747
const TARGET_TEXTURE_SIZE = 2000; // in pixels
48-
const MAX_MESHES_PER_ANIMATION = 30; // arbitrary limit to not overload the server when rendering many large STL files
48+
const MAX_MESHES_PER_ANIMATION = 40; // arbitrary limit to not overload the server when rendering many large STL files
4949

5050
function selectMagForTextureCreation(
5151
colorLayer: APIDataLayer,
@@ -147,18 +147,18 @@ function CreateAnimationModal(props: Props) {
147147
const [_, estimatedTextureSize] = selectMagForTextureCreation(colorLayer, selectedBoundingBox);
148148

149149
const hasEnoughMags = estimatedTextureSize < 1.5 * TARGET_TEXTURE_SIZE;
150-
if (hasEnoughMags)
150+
if (!hasEnoughMags)
151151
errorMessages.push(
152152
"The selected bounding box is too large to create an animation. Either shrink the bounding box or consider downsampling the dataset to coarser magnifications.",
153153
);
154154

155155
const isDtypeSupported = colorLayer.elementClass !== "uint24";
156-
if (isDtypeSupported)
156+
if (!isDtypeSupported)
157157
errorMessages.push("Sorry, animations are not supported for uInt24 datasets.");
158158

159159
const isDataset3D =
160160
!is2dDataset(state.dataset) && (colorLayer.additionalAxes?.length || 0) === 0;
161-
if (isDataset3D) errorMessages.push("Sorry, animations are only supported for 3D datasets.");
161+
if (!isDataset3D) errorMessages.push("Sorry, animations are only supported for 3D datasets.");
162162

163163
const isTooManyMeshes = meshes.length > MAX_MESHES_PER_ANIMATION;
164164
if (isTooManyMeshes)

0 commit comments

Comments
 (0)