Browse Source

SpineObject persistence update. Try to give at least a little support for reading/writing as taml. Also a bug fix and couple of other minor tweaks.

Daddy 5 years ago
parent
commit
d7923d5bd7

+ 2 - 2
engine/compilers/VisualStudio 2017/Torque 2D.vcxproj

@@ -54,7 +54,7 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup>
   <PropertyGroup>
     <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
     <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../../</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\Projects\T2D\KidFun\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../Link/VC2012.$(Configuration).$(PlatformName)/$(ProjectName)/</IntDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../Link/VC2012.$(Configuration).$(PlatformName)/$(ProjectName)/</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     </LinkIncremental>
     </LinkIncremental>
@@ -102,7 +102,7 @@
     </ResourceCompile>
     </ResourceCompile>
     <Link>
     <Link>
       <AdditionalDependencies>COMCTL32.LIB;COMDLG32.LIB;USER32.LIB;ADVAPI32.LIB;GDI32.LIB;RPCRT4.LIB;WINMM.LIB;WS2_32.LIB;vfw32.lib;Imm32.lib;shell32.lib;shlwapi.lib;ole32.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalDependencies>COMCTL32.LIB;COMDLG32.LIB;USER32.LIB;ADVAPI32.LIB;GDI32.LIB;RPCRT4.LIB;WINMM.LIB;WS2_32.LIB;vfw32.lib;Imm32.lib;shell32.lib;shlwapi.lib;ole32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <OutputFile>../../../Torque2D_DEBUG.exe</OutputFile>
+      <OutputFile>$(OutDir)Torque2D_DEBUG.exe</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>../../Lib/unicode;../../lib/MSPlatformSDK/Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <AdditionalLibraryDirectories>../../Lib/unicode;../../lib/MSPlatformSDK/Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
       <IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>

+ 29 - 36
engine/source/2d/core/ImageFrameProviderCore.cc

@@ -218,46 +218,39 @@ const ImageAsset::FrameArea& ImageFrameProviderCore::getProviderImageFrameArea(
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
 
 
 void ImageFrameProviderCore::render(
 void ImageFrameProviderCore::render(
-    const bool flipX,
-    const bool flipY,
-    const Vector2& vertexPos0,
-    const Vector2& vertexPos1,
-    const Vector2& vertexPos2,
-    const Vector2& vertexPos3,
-	BatchRender* pBatchRenderer ) const
+	const bool flipX,
+	const bool flipY,
+	const Vector2& vertexPos0,
+	const Vector2& vertexPos1,
+	const Vector2& vertexPos2,
+	const Vector2& vertexPos3,
+	BatchRender* pBatchRenderer) const
 {
 {
-    // Finish if we can't render.
-    if ( !validRender() )
-        return;
+	// Finish if we can't render.
+	if (!validRender())
+		return;
 
 
-    // Fetch texel area.
-    ImageAsset::FrameArea::TexelArea texelArea = getProviderImageFrameArea().mTexelArea;
+	// Fetch texel area.
+	ImageAsset::FrameArea::TexelArea texelArea = getProviderImageFrameArea().mTexelArea;
 
 
-    // Flip texture coordinates appropriately.
-    texelArea.setFlip( flipX, flipY );
+	// Flip texture coordinates appropriately.
+	texelArea.setFlip(flipX, flipY);
 
 
-    // Fetch lower/upper texture coordinates.
-    const Vector2& texLower = texelArea.mTexelLower;
-    const Vector2& texUpper = texelArea.mTexelUpper;
-    
-	Vector2 texturePos0, texturePos1, texturePos2, texturePos3;
-
-	texturePos0 = Vector2(texLower.x, texUpper.y);
-	texturePos1 = Vector2(texUpper.x, texUpper.y);
-	texturePos2 = Vector2(texUpper.x, texLower.y);
-	texturePos3 = Vector2(texLower.x, texLower.y);
-
-    // Submit batched quad.
-    pBatchRenderer->SubmitQuad(
-        vertexPos0,
-        vertexPos1,
-        vertexPos2,
-        vertexPos3,
-		texturePos0,
-		texturePos1,
-		texturePos2,
-		texturePos3,
-		getProviderTexture() );
+	// Fetch lower/upper texture coordinates.
+	const Vector2& texLower = texelArea.mTexelLower;
+	const Vector2& texUpper = texelArea.mTexelUpper;
+
+	// Submit batched quad.
+	pBatchRenderer->SubmitQuad(
+		vertexPos0,
+		vertexPos1,
+		vertexPos2,
+		vertexPos3,
+		Vector2(texLower.x, texUpper.y),
+		Vector2(texUpper.x, texUpper.y),
+		Vector2(texUpper.x, texLower.y),
+		Vector2(texLower.x, texLower.y),
+		getProviderTexture());
 }
 }
 
 
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------

+ 16 - 0
engine/source/2d/sceneobject/SpineCollisionProxy.cc

@@ -20,9 +20,25 @@ IMPLEMENT_CONOBJECT(SpineCollisionProxy);
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
 
 
 SpineCollisionProxy::SpineCollisionProxy() :
 SpineCollisionProxy::SpineCollisionProxy() :
+	mAttachmentName{NULL},
+	mSlotName{NULL},
+	mSkinName{NULL},
+	mWidthSizer{1.0f},
+	mHeightSizer{1.0f},
+	mObjectName{NULL},
 	mActive{true},
 	mActive{true},
 	mRotation{0.0f}
 	mRotation{0.0f}
 {}
 {}
 
 
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
 
 
+SpineCollisionProxy::SpineCollisionProxy(const char *name, const char *slot, const char *skin, F32 wSizer, F32 hSizer, const char *objectName) :
+	mAttachmentName{ name },
+	mSlotName{ slot },
+	mSkinName{ skin },
+	mWidthSizer{ wSizer },
+	mHeightSizer{ hSizer },
+	mObjectName{ objectName },
+	mActive{ true },
+	mRotation{ 0.0f }
+{}

+ 9 - 0
engine/source/2d/sceneobject/SpineCollisionProxy.h

@@ -28,6 +28,14 @@ protected:
 
 
 public:
 public:
 	SpineCollisionProxy();
 	SpineCollisionProxy();
+	SpineCollisionProxy(const char *name, const char *slot, const char *skin, F32 wSizer = 1.0f, F32 hSizer = 1.0f, const char *objectName = NULL);
+
+	const char *mAttachmentName;
+	const char *mSlotName;
+	const char *mSkinName;
+	F32			mWidthSizer;
+	F32			mHeightSizer;
+	const char *mObjectName;
 
 
 	bool mActive;
 	bool mActive;
 
 
@@ -39,6 +47,7 @@ public:
 public:
 public:
 	inline void deActivate(void) { if (!mActive) return;  mActive = false; setActive(false); }
 	inline void deActivate(void) { if (!mActive) return;  mActive = false; setActive(false); }
 	inline void activate(void) { if (mActive) return;  mActive = true; setActive(true); }
 	inline void activate(void) { if (mActive) return;  mActive = true; setActive(true); }
+
 };
 };
 
 
 #endif // _SPINE_COLLISION_PROXY_H_
 #endif // _SPINE_COLLISION_PROXY_H_

+ 163 - 8
engine/source/2d/sceneobject/SpineObject.cc

@@ -129,8 +129,7 @@ void SpineObject::initPersistFields()
 	addProtectedField("Asset", TypeSpineAssetPtr, Offset(mSpineAsset, SpineObject), &setSpineAsset, &defaultProtectedGetFn, &writeSpineAsset, "The spine asset ID used for the spine.");
 	addProtectedField("Asset", TypeSpineAssetPtr, Offset(mSpineAsset, SpineObject), &setSpineAsset, &defaultProtectedGetFn, &writeSpineAsset, "The spine asset ID used for the spine.");
 	addProtectedField("Skin", TypeString, 0, &setSkin, &getSkinName, &writeCurrentSkin, "The skin to use.");
 	addProtectedField("Skin", TypeString, 0, &setSkin, &getSkinName, &writeCurrentSkin, "The skin to use.");
 	addProtectedField("Scale", TypeVector2, 0, &setScale, &getScale, &writeScale, "Scaling of the skeleton geometry.");
 	addProtectedField("Scale", TypeVector2, 0, &setScale, &getScale, &writeScale, "Scaling of the skeleton geometry.");
-	addProtectedField("AnimationCycle", TypeBool, Offset(mShouldLoop, SpineObject), &setShouldLoop, &defaultProtectedGetFn, &writeAnimationData, "Whether the startup animation should loop or not.");
-	addProtectedField("AnimationName", TypeString, 0, &setAnimation, &getAnimationName, &writeAnimationData, "The animation name to play at startup.");
+	addProtectedField("AnimationData", TypeString, 0, &setAnimationData, &getAnimationData, &writeAnimationData, "String encoding of the running animations.  It's a tilde separated list of animation entries.  Within each entry, each attribute is separated by a semicolon.  The attributes are, in this order:  1) Name - String: Name of animation as defined in Spine.  2) Track - Integer: Track the animation is running on.  3) Is Looping - Boolean: 1 or 0.  4) Mix Duration - Float: Can be set to -1.0 to request default mix duration.");
 	addProtectedField("TimeScale", TypeF32, 0, &setTimeScale, &getTimeScale, &writeTimeScale, "Time scale (animation speed) adjustment factor.");
 	addProtectedField("TimeScale", TypeF32, 0, &setTimeScale, &getTimeScale, &writeTimeScale, "Time scale (animation speed) adjustment factor.");
 	addProtectedField("FlipX", TypeBool, Offset(mFlipX, SpineObject), &setFlipX, &defaultProtectedGetFn, &writeFlipX, "Whether to invert the image horizontally.");
 	addProtectedField("FlipX", TypeBool, Offset(mFlipX, SpineObject), &setFlipX, &defaultProtectedGetFn, &writeFlipX, "Whether to invert the image horizontally.");
 	addProtectedField("FlipY", TypeBool, Offset(mFlipY, SpineObject), &setFlipY, &defaultProtectedGetFn, &writeFlipY, "Whether image should be inverted vertically.");
 	addProtectedField("FlipY", TypeBool, Offset(mFlipY, SpineObject), &setFlipY, &defaultProtectedGetFn, &writeFlipY, "Whether image should be inverted vertically.");
@@ -144,6 +143,7 @@ void SpineObject::initPersistFields()
 	addProtectedField("SwirlAngle", TypeF32, 0, &setSwirlAngle, &getSwirlAngle, &writeSwirlEffectValues, "A 'Swirl' vertex special effect setting.");
 	addProtectedField("SwirlAngle", TypeF32, 0, &setSwirlAngle, &getSwirlAngle, &writeSwirlEffectValues, "A 'Swirl' vertex special effect setting.");
 	endGroup("Vertex Effects");
 	endGroup("Vertex Effects");
 	addProtectedField("EventCallbacksEnabled", TypeBool, 0, &setEventCallbacksEnabled, &defaultProtectedGetFn, &writeEventCallbacksEnabled, "Whether the SpineObject should receive spine animation event callbacks.");
 	addProtectedField("EventCallbacksEnabled", TypeBool, 0, &setEventCallbacksEnabled, &defaultProtectedGetFn, &writeEventCallbacksEnabled, "Whether the SpineObject should receive spine animation event callbacks.");
+	addProtectedField("CollisionData", TypeString, 0, &setCollisionData, &getCollisionData, &writeCollisionData, "String encoding of the Spine object's collision boxes.  It's a tilde separated list of collision proxy definitions.  Within each entry, each attribute is separated by a semicolon.  The attributes are, in this order:  1) Attachment Name - String: Name of attachment that box belongs to.  2) Slot Name - String: Slot that owns the attachment.  3) Skin Name - String: Skin that defines the attachment.  4) Width Sizer - Float: Factor useful to tweak the width of the box.  5) Height Sizer - Float: Factor useful to tweak the height of the box.  6) SimObject Name - String: Name assigned to the collision proxy instance.  May be NULL if no name was assigned.");
 
 
 }
 }
 
 
@@ -175,8 +175,6 @@ void SpineObject::resetState() {
 	mPriorFlipX = mFlipX;
 	mPriorFlipX = mFlipX;
 	mPriorFlipY = mFlipY;
 	mPriorFlipY = mFlipY;
 
 
-	mShouldLoop = false;
-
 	mCollisionProxies.clear();
 	mCollisionProxies.clear();
 }
 }
 
 
@@ -483,6 +481,8 @@ inline StringTableEntry SpineObject::getSkinName(void) const {
 	spSkin* pSkin = mSkeleton->skin;
 	spSkin* pSkin = mSkeleton->skin;
 
 
 	if (!pSkin) {
 	if (!pSkin) {
+		AssertFatal(mSkeleton->data->defaultSkin, avar("SpineObject::getSkinName() - Skin name is undefined in '%s'.  Is file valid?", mSpineAsset->mSpineFile));
+
 		// Using default skin.
 		// Using default skin.
 		return StringTable->insert(mSkeleton->data->defaultSkin->name, true);
 		return StringTable->insert(mSkeleton->data->defaultSkin->name, true);
 	}
 	}
@@ -1089,7 +1089,7 @@ const SpineCollisionProxy* SpineObject::getCollisionProxy(
 	const char* aSkinName,
 	const char* aSkinName,
 	const F32 sizerWidth,
 	const F32 sizerWidth,
 	const F32 sizerHeight,
 	const F32 sizerHeight,
-	const char* objectName) {
+	const char* anObjectName) {
 
 
 	// First, locate the requested attachment.
 	// First, locate the requested attachment.
 	spAttachment* pAttachment = NULL;
 	spAttachment* pAttachment = NULL;
@@ -1146,7 +1146,8 @@ const SpineCollisionProxy* SpineObject::getCollisionProxy(
 	}
 	}
 
 
 	// Create new proxy object.
 	// Create new proxy object.
-	auto pProxy = new SpineCollisionProxy();
+	const char *objectName = anObjectName ? StringTable->insert(anObjectName, true) : NULL;
+	auto pProxy = new SpineCollisionProxy(attachmentName, slotName, skinName, sizerWidth, sizerHeight, objectName);
 
 
 	// Add to the internal collection
 	// Add to the internal collection
 	mCollisionProxies.insert(pAttachment, pProxy);
 	mCollisionProxies.insert(pAttachment, pProxy);
@@ -1192,7 +1193,7 @@ const SpineCollisionProxy* SpineObject::getCollisionProxy(
 	}
 	}
 
 
 	// Create collision fixture and enable collision callback support.
 	// Create collision fixture and enable collision callback support.
-	auto fixtureIndex = pProxy->createPolygonBoxCollisionShape(width * mSkeleton->scaleX, height * mSkeleton->scaleY);
+	auto fixtureIndex = pProxy->createPolygonBoxCollisionShape(width * abs(mSkeleton->scaleX), height * abs(mSkeleton->scaleY));
 	pProxy->setCollisionShapeIsSensor(fixtureIndex, true);
 	pProxy->setCollisionShapeIsSensor(fixtureIndex, true);
 	pProxy->setCollisionCallback(true);
 	pProxy->setCollisionCallback(true);
 
 
@@ -1209,7 +1210,10 @@ const SpineCollisionProxy* SpineObject::getCollisionProxy(
 	// Deactivate.  If should be active, it will be made so at render time.
 	// Deactivate.  If should be active, it will be made so at render time.
 	pProxy->deActivate();
 	pProxy->deActivate();
 
 
-	getScene()->addToScene(pProxy);
+	// If Spine object is already in the scene, add the proxy too.
+	if (getScene()) {
+		getScene()->addToScene(pProxy);
+	}
 
 
 	return pProxy;
 	return pProxy;
 }
 }
@@ -1236,4 +1240,155 @@ bool SpineObject::deleteCollisionProxy(const char *proxyId) {
 
 
 	Con::warnf("SpineObject::deleteCollisionProxy() - Unable to locate proxy with given id: '%s'.", proxyId);
 	Con::warnf("SpineObject::deleteCollisionProxy() - Unable to locate proxy with given id: '%s'.", proxyId);
 	return false;
 	return false;
+}
+
+//-----------------------------------------------------------------------------
+
+bool SpineObject::writeAnimationData(void) const {
+	// According to the API, a track entry might be null.  So we need to make sure there is at least
+	// one valid entry before returning true.
+	for (auto i = 0; i < mAnimationState->tracksCount; ++i) {
+		if (mAnimationState->tracks[i] != NULL) {
+			return true;
+		}
+	}
+
+	return false;
+}
+
+//-----------------------------------------------------------------------------
+
+const char *SpineObject::getAnimationData(void) const {
+	string result;
+	
+	for (auto i = 0; i < mAnimationState->tracksCount; ++i) {
+		spTrackEntry *track = mAnimationState->tracks[i];
+		if (track) {
+			// Encode the track entry.
+			result
+				.append(track->animation->name).append(";")
+				.append(Con::getIntArg(track->trackIndex)).append(";")
+				.append(Con::getBoolArg(track->loop)).append(";")
+				.append(Con::getFloatArg(track->mixDuration)).append(";~");
+		}
+	}
+
+	// Could throw it in the StringTable, but don't want to pollute that with this crud.
+	unique_ptr<char> retVal = unique_ptr<char>(new char[result.size() + 1]);
+	dStrcpy(retVal.get(), result.c_str());
+
+	return retVal.get();
+}
+
+//-----------------------------------------------------------------------------
+
+void SpineObject::setAnimationData(const char *animationData) {
+	if (!animationData) {
+		Con::warnf("SpineObject::setAnimationData() - Ignoring empty animation data string.");
+		return;
+	}
+
+	// Break into list of entries.
+	vector<char *> entries;
+	char *entry = dStrtok(const_cast<char *>(animationData), "~");
+	while (entry) {
+		entries.push_back(entry);
+		entry = dStrtok(NULL, "~");
+	}
+
+	// Process each entry
+	for (auto entry : entries) {
+		const char *name = dStrtok(entry, ";");
+		int track = dAtoi(dStrtok(NULL, ";"));
+		bool loop = dAtob(dStrtok(NULL, ";"));
+		F32 mixDuration = dAtof(dStrtok(NULL, ";"));
+
+		setAnimation(name, track, loop, mixDuration);
+	}
+}
+
+//-----------------------------------------------------------------------------
+
+bool SpineObject::writeCollisionData(void) const {
+	return mCollisionProxies.size() > 0;
+}
+
+//-----------------------------------------------------------------------------
+
+const char *SpineObject::getCollisionData(void) const {
+	string result;
+
+	for (auto pair : mCollisionProxies) {
+		auto proxy = pair.value;
+
+		// Encode the proxy.
+		result
+			.append(proxy->mAttachmentName).append(";")
+			.append(proxy->mSlotName).append(";")
+			.append(proxy->mSkinName).append(";")
+			.append(Con::getFloatArg(proxy->mWidthSizer)).append(";")
+			.append(Con::getFloatArg(proxy->mHeightSizer)).append(";");
+
+		if (proxy->mObjectName) {
+			result.append(proxy->mObjectName).append(";~");
+		}
+		else {
+			result.append("~");
+		}
+	}
+
+	unique_ptr<char> retVal = unique_ptr<char>(new char[result.size() + 1]);
+	dStrcpy(retVal.get(), result.c_str());
+
+	return retVal.get();
+}
+
+//-----------------------------------------------------------------------------
+
+void SpineObject::setCollisionData(const char *collisionData) {
+	if (!collisionData) {
+		Con::warnf("SpineObject::setCollisionData() - Ignoring empty collision setup string.");
+		return;
+	}
+
+	// Break into list of entries.
+	vector<char *> entries;
+	char *entry = dStrtok(const_cast<char *>(collisionData), "~");
+	while (entry) {
+		entries.push_back(entry);
+		entry = dStrtok(NULL, "~");
+	}
+	
+	// Process each entry
+	for (auto entry : entries) {
+		const char *attachmentName = dStrtok(entry, ";");
+		const char *slotName = dStrtok(NULL, ";");
+		const char *skinName = dStrtok(NULL, ";");
+		F32 wSizer = dAtof(dStrtok(NULL, ";"));
+		F32 hSizer = dAtof(dStrtok(NULL, ";"));
+		const char *objectName = dStrtok(NULL, ";");
+
+		getCollisionProxy(attachmentName, slotName, skinName, wSizer, hSizer, objectName);
+	}
+}
+
+//-----------------------------------------------------------------------------
+
+void SpineObject::OnRegisterScene(Scene *scene) {
+	Parent::OnRegisterScene(scene);
+
+	for (auto i : mCollisionProxies) {
+		scene->addToScene(i.value);
+	}
+}
+
+//-----------------------------------------------------------------------------
+
+void SpineObject::OnUnregisterScene(Scene *scene) {
+	Parent::OnUnregisterScene(scene);
+
+	for (auto i : mCollisionProxies) {
+		if(i.value->getScene())
+			i.value->getScene()->removeFromScene(i.value);
+	}
 }
 }

+ 28 - 6
engine/source/2d/sceneobject/SpineObject.h

@@ -230,23 +230,45 @@ protected:
 	// Internal management
 	// Internal management
 	void SpineObject::resetState();
 	void SpineObject::resetState();
 
 
+	virtual void OnRegisterScene(Scene *scene);
+	virtual void OnUnregisterScene(Scene *scene);
+
 private:
 private:
 	// Utility 
 	// Utility 
 
 
 	// Cope with spine reflecting about an axis to accomplish a flip, while the SceneObject doesn't support such flipping.
 	// Cope with spine reflecting about an axis to accomplish a flip, while the SceneObject doesn't support such flipping.
 	inline F32 setPerFlipState(const F32 value) { return mFlipY ? (mFlipX ? value : -value) : (mFlipX ? -value : value); }
 	inline F32 setPerFlipState(const F32 value) { return mFlipY ? (mFlipX ? value : -value) : (mFlipX ? -value : value); }
 
 
-	// This is only used during TAML loading. It buffers the value needed when setting the requested animation.
-	bool mShouldLoop;
+	// Object Persistence Support
+	//
+	// This determines if there is any animation data to write and returns true if there is.
+	bool writeAnimationData(void) const;
+	bool writeCollisionData(void) const;
+
+	// This encodes and returns the information required to restart the currently running animations.  It is returned
+	// in a string for writing to the TAML file.
+	const char *getAnimationData(void) const;
+
+	// This encodes and returns the information required to recreate the Spine object's collision boxes.  
+	const char *getCollisionData(void) const;
+
+	// This attempts to start the animation(s) defined in the animation data string passed in.
+	void setAnimationData(const char *animationData);
+
+	// This attempts to create the collision boxes defined in the data passed in.
+	void setCollisionData(const char *collisionData);
 
 
 protected:
 protected:
 	static bool setSpineAsset(void* obj, const char* data) { static_cast<SpineObject*>(obj)->setSpineAsset(data); return false; }
 	static bool setSpineAsset(void* obj, const char* data) { static_cast<SpineObject*>(obj)->setSpineAsset(data); return false; }
 	static bool writeSpineAsset(void* obj, StringTableEntry pFieldName) { return static_cast<SpineObject*>(obj)->mSpineAsset.notNull(); }
 	static bool writeSpineAsset(void* obj, StringTableEntry pFieldName) { return static_cast<SpineObject*>(obj)->mSpineAsset.notNull(); }
 
 
-	static bool setShouldLoop(void* obj, const char* data) { static_cast<SpineObject*>(obj)->mShouldLoop = dAtob(data); return false; }
-	static bool setAnimation(void* obj, const char* data) { static_cast<SpineObject*>(obj)->setAnimation(data, static_cast<SpineObject*>(obj)->mShouldLoop); return false; }
-	static const char* getAnimationName(void* obj, const char* data) { return static_cast<SpineObject*>(obj)->getAnimationName(); }
-	static bool writeAnimationData(void*obj, const char* data) { return static_cast<SpineObject*>(obj)->getAnimationName() != StringTable->EmptyString; }
+	static bool setAnimationData(void* obj, const char* data) { static_cast<SpineObject*>(obj)->setAnimationData(data); return false; }
+	static const char* getAnimationData(void* obj, const char* data) { return static_cast<SpineObject*>(obj)->getAnimationData(); }
+	static bool writeAnimationData(void*obj, const char* data) { return static_cast<SpineObject*>(obj)->writeAnimationData(); }
+
+	static bool setCollisionData(void* obj, const char* data) { static_cast<SpineObject*>(obj)->setCollisionData(data); return false; }
+	static const char* getCollisionData(void* obj, const char* data) { return static_cast<SpineObject*>(obj)->getCollisionData(); }
+	static bool writeCollisionData(void*obj, const char* data) { return static_cast<SpineObject*>(obj)->writeCollisionData(); }
 
 
 	static bool setSkin(void* obj, const char* data) { static_cast<SpineObject*>(obj)->setSkin(data); return false; }
 	static bool setSkin(void* obj, const char* data) { static_cast<SpineObject*>(obj)->setSkin(data); return false; }
 	static const char* getSkinName(void* obj, const char* data) { return static_cast<SpineObject*>(obj)->getSkinName(); }
 	static const char* getSkinName(void* obj, const char* data) { return static_cast<SpineObject*>(obj)->getSkinName(); }

+ 0 - 6
engine/source/2d/sceneobject/SpineObject_ScriptBinding.h

@@ -620,12 +620,6 @@ ConsoleMethodWithDocs(SpineObject, disableAnimationEventCallbacks, ConsoleVoid,
 	a spine attachment.  Since it's a SceneObject, it can then be manipulated/used for collision
 	a spine attachment.  Since it's a SceneObject, it can then be manipulated/used for collision
 	processing in onCollision etc... This first checks if the attachment requested already has a proxy
 	processing in onCollision etc... This first checks if the attachment requested already has a proxy
 	and returns that if so.  If not, a new proxy is created and returned.
 	and returns that if so.  If not, a new proxy is created and returned.
-	@note
-	This method should be called after the owning spine object has been added to the scene. The
-	proxy will be automatically added to the scene in that case.  If the proxy is created prior to the
-	spine object being added to the scene, the proxy will have to be added to the scene manually. It
-	won't be automatically added later when the spine object is added.
-
 	@note
 	@note
 	The collision objects never have any velocity.  They are continually positioned (warped) to match
 	The collision objects never have any velocity.  They are continually positioned (warped) to match
 	the location of the attachment they were created on.  This means that they are only useful as
 	the location of the attachment they were created on.  This means that they are only useful as