canvas image fix
diff --git a/extension/jsx/renderManager.jsx b/extension/jsx/renderManager.jsx
index 1ac74b2..5648284 100644
--- a/extension/jsx/renderManager.jsx
+++ b/extension/jsx/renderManager.jsx
@@ -88,6 +88,7 @@
hasExpressionsFlag = false;
currentCompID = comp.id;
currentCompSettings = compSettings;
+ bm_eventDispatcher.log('currentCompSettings.hiddens: ' + currentCompSettings.hiddens);
bm_eventDispatcher.sendEvent('bm:render:update', {type: 'update', message: 'Starting Render', compId: currentCompID, progress: 0});
destinationPath = destination;
bm_sourceHelper.reset();
diff --git a/extension/jsx/utils/XMPParser.jsx b/extension/jsx/utils/XMPParser.jsx
index 1557efd..a77dabd 100644
--- a/extension/jsx/utils/XMPParser.jsx
+++ b/extension/jsx/utils/XMPParser.jsx
@@ -4,7 +4,7 @@
ob.created = true;
ob.setMetadata = setMetadata;
ob.getMetadata = getMetadata;
- var namespace = 'Bodymovin15';
+ var namespace = 'bodymovin';
function init(){
var proj = app.project;
diff --git a/player/js/animation/AnimationItem.js b/player/js/animation/AnimationItem.js
index 3b55c15..7a7c941 100644
--- a/player/js/animation/AnimationItem.js
+++ b/player/js/animation/AnimationItem.js
@@ -256,6 +256,10 @@
}
}());
+AnimationItem.prototype.addPendingElement = function () {
+ this.pendingElements += 1;
+}
+
AnimationItem.prototype.elementLoaded = function () {
this.pendingElements--;
this.checkLoaded();
diff --git a/player/js/elements/canvasElements/CVImageElement.js b/player/js/elements/canvasElements/CVImageElement.js
index b6c4cc3..1ca5c20 100644
--- a/player/js/elements/canvasElements/CVImageElement.js
+++ b/player/js/elements/canvasElements/CVImageElement.js
@@ -1,23 +1,19 @@
function CVImageElement(data, comp,globalData){
- this.animationItem = globalData.renderer.animationItem;
- this.assetData = this.animationItem.getAssetData(data.refId);
- this.path = this.animationItem.getPath();
+ this.assetData = globalData.getAssetData(data.refId);
+ this.path = globalData.getPath();
this._parent.constructor.call(this,data, comp,globalData);
- this.animationItem.pendingElements += 1;
+ this.globalData.addPendingElement();
}
createElement(CVBaseElement, CVImageElement);
CVImageElement.prototype.createElements = function(){
- var self = this;
-
var imageLoaded = function(){
- self.animationItem.elementLoaded();
- };
+ this.globalData.elementLoaded();
+ }.bind(this);
var imageFailed = function(){
- //console.log('imageFailed');
- self.failed = true;
- self.animationItem.elementLoaded();
- };
+ this.failed = true;
+ this.globalData.elementLoaded();
+ }.bind(this);
this.img = new Image();
this.img.addEventListener('load', imageLoaded, false);
@@ -49,6 +45,5 @@
CVImageElement.prototype.destroy = function(){
this.img = null;
- this.animationItem = null;
this._parent.destroy.call();
};
\ No newline at end of file
diff --git a/player/js/renderers/CanvasRenderer.js b/player/js/renderers/CanvasRenderer.js
index 04d283e..8e0c3f2 100644
--- a/player/js/renderers/CanvasRenderer.js
+++ b/player/js/renderers/CanvasRenderer.js
@@ -227,6 +227,10 @@
this.globalData.fontManager = new FontManager();
this.globalData.fontManager.addChars(animData.chars);
this.globalData.fontManager.addFonts(animData.fonts,document);
+ this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
+ this.globalData.getPath = this.animationItem.getPath.bind(this.animationItem);
+ this.globalData.elementLoaded = this.animationItem.elementLoaded.bind(this.animationItem);
+ this.globalData.addPendingElement = this.animationItem.addPendingElement.bind(this.animationItem);
};
CanvasRenderer.prototype.updateContainerSize = function () {