Skip to content

Commit 1ab1be5

Browse files
committed
Update constraints
1 parent 75a0f2a commit 1ab1be5

3 files changed

Lines changed: 32 additions & 17 deletions

File tree

bundle/jsx/dataManager.jsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,12 @@ loop:
323323
error = 'Composition should not include any Texts';
324324
break;
325325
}
326-
if (layers[i].hasMask === true || layers[i].masksProperties != null) {
327-
error = 'Composition should not include any Masks';
326+
if (layers[i].ty === 9) {
327+
error = 'Composition should not include any Videos';
328328
break;
329329
}
330-
if (layers[i].tt != null) {
331-
error = 'Composition should not include any Mattes';
330+
if (layers[i].hasMask === true || layers[i].masksProperties != null) {
331+
error = 'Composition should not include any Masks';
332332
break;
333333
}
334334
if (layers[i].ao === 1) {
@@ -364,18 +364,22 @@ loop:
364364
var string = JSON.stringify(data);
365365
string = string.replace(/\n/g, '');
366366

367+
var error = null;
368+
367369
var frameRate = data.fr;
368-
var totalFrames = data.op - data.ip;
370+
if (frameRate != 30.0 && frameRate != 60.0) {
371+
error = 'Composition framerate must be exactly 30 or 60 FPS';
372+
}
369373

370-
var error = null;
374+
var totalFrames = data.op - data.ip;
371375

372376
var duration = totalFrames / frameRate;
373-
if (duration > 3.0) {
377+
if (error == null && duration > 3.0) {
374378
error = 'Composition duration must be not greater than 3 seconds';
375379
}
376380

377-
if (error == null && (data.w != 512 || data.h != 512)) {
378-
error = 'Composition dimensions should be exactly 512x512px';
381+
if (error == null && !((data.w == 100 && data.h == 100) || (data.w == 512 && data.h >= 512 && data.h <= 832 && data.h % 16 == 0) || (data.h == 512 && data.w >= 512 && data.w <= 832 && data.w % 16 == 0))) {
382+
error = 'Composition dimensions should be exactly 512x512px (or 100x100px for sticker set thumbnail)';
379383
}
380384

381385
if (error == null && data.ddd != null && data.ddd != 0) {

bundle/jsx/renderManager.jsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,18 +250,28 @@ $.__bodymovin.bm_renderManager = (function () {
250250
}
251251

252252
function clearNames(layers) {
253-
if (hasExpressionsFlag) {
254-
return;
255-
}
256253
var i, len = layers.length;
257254
for (i = 0; i < len; i += 1) {
258255
layers[i].nm = null;
259256
delete layers[i].nm;
260257
if (layers[i].ty === layerTypes.precomp && layers[i].layers) {
261258
clearNames(layers[i].layers);
262259
}
260+
if (layers[i].shapes) {
261+
clearShapeNames(layers[i].shapes)
262+
}
263+
}
264+
}
265+
266+
function clearShapeNames(shapes) {
267+
var i, len = shapes.length;
268+
for (i = 0; i < len; i += 1) {
269+
shapes[i].nm = null;
270+
delete shapes[i].nm;
271+
if (shapes[i].it) {
272+
clearShapeNames(shapes[i].it)
273+
}
263274
}
264-
265275
}
266276

267277
function removeExtraData() {
@@ -387,7 +397,8 @@ $.__bodymovin.bm_renderManager = (function () {
387397
}
388398

389399
function shouldSkipDefaultProperties() {
390-
return currentCompSettings.skip_default_properties;
400+
return true;
401+
//return currentCompSettings.skip_default_properties;
391402
}
392403

393404
function shouldIncludeNotSupportedProperties() {

src/redux/reducers/compositions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ let defaultComposition = {
2222
standalone: false,
2323
demo: false,
2424
avd: false,
25-
glyphs: true,
26-
hiddens: true,
25+
glyphs: false,
26+
hiddens: false,
2727
original_names: false,
2828
should_encode_images: false,
2929
should_compress: false,
@@ -33,7 +33,7 @@ let defaultComposition = {
3333
active: false,
3434
list:[]
3535
},
36-
guideds: true,
36+
guideds: false,
3737
ignore_expression_properties: false,
3838
export_old_format: false,
3939
skip_default_properties: false,

0 commit comments

Comments
 (0)