Browse Source

- Taml serialization WIP.

MelvMay-GG 12 years ago
parent
commit
a6d900e

+ 2 - 2
engine/source/2d/core/SpriteBatch.cc

@@ -1160,7 +1160,7 @@ void SpriteBatch::destroySpriteBatchTree( void )
 
 //------------------------------------------------------------------------------
 
-void SpriteBatch::onTamlCustomWrite( TamlCustomProperty* pSpritesProperty )
+void SpriteBatch::onTamlCustomWrite( TamlCustomNode* pSpritesNode )
 {
     // Debug Profiling.
     PROFILE_SCOPE(SpriteBatch_TamlCustomWrite);
@@ -1181,7 +1181,7 @@ void SpriteBatch::onTamlCustomWrite( TamlCustomProperty* pSpritesProperty )
 
 //------------------------------------------------------------------------------
 
-void SpriteBatch::onTamlCustomRead( const TamlCustomProperty* pSpritesProperty )
+void SpriteBatch::onTamlCustomRead( const TamlCustomNode* pSpritesNode )
 {
     // Debug Profiling.
     PROFILE_SCOPE(SpriteBatch_TamlCustomRead);

+ 2 - 2
engine/source/2d/core/SpriteBatch.h

@@ -209,8 +209,8 @@ protected:
     void createSpriteBatchTree( void );
     void destroySpriteBatchTree( void );
 
-    void onTamlCustomWrite( TamlCustomProperty* pSpritesProperty );
-    void onTamlCustomRead( const TamlCustomProperty* pSpritesProperty );
+    void onTamlCustomWrite( TamlCustomNode* pSpritesNode );
+    void onTamlCustomRead( const TamlCustomNode* pSpritesNode );
 
 private:
     bool destroySprite( const U32 batchId );

+ 3 - 3
engine/source/2d/sceneobject/CompositeSprite.cc

@@ -393,11 +393,11 @@ void CompositeSprite::onTamlCustomWrite( TamlCustomNodes& customNodes )
     if ( spriteCount == 0 )
         return;
 
-    // Add sprites property.
-    TamlCustomProperty* pSpritesProperty = customProperties.addProperty( StringTable->insert("Sprites") );
+    // Add sprites node.
+    TamlCustomNode* pSpritesNode = customNodes.addNode( StringTable->insert("Sprites") );
 
     // Write property with sprite batch.
-    SpriteBatch::onTamlCustomWrite( pSpritesProperty );
+    SpriteBatch::onTamlCustomWrite( pSpritesNode );
 }
 
 //-----------------------------------------------------------------------------

+ 1 - 1
engine/source/assets/assetQuery.cc

@@ -66,7 +66,7 @@ void AssetQuery::onTamlCustomWrite( TamlCustomNodes& customNodes )
     // Iterate asset.
     for( Vector<StringTableEntry>::iterator assetItr = begin(); assetItr != end(); ++assetItr )
     {
-        // Add custom node.
+        // Add asset node.
         TamlCustomNode* pAssetNode = pCustomNode->addNode( ASSETQUERY_ASSETNODE_NAME );
 
         // Add fields.

+ 42 - 36
engine/source/assets/assetTagsManifest.cc

@@ -127,31 +127,31 @@ void AssetTagsManifest::onTamlCustomWrite( TamlCustomNodes& customNodes )
     if ( mTagNameDatabase.size() == 0 )
         return;
 
-    // Add property.
-    TamlCustomProperty* pTagProperty = customProperties.addProperty( ASSETTAGS_TAGS_CUSTOMPROPERTY_NAME );
+    // Add node.
+    TamlCustomNode* pTagsNode = customNodes.addNode( ASSETTAGS_TAGS_NODE_NAME );
 
     // Iterate tags.
     for( typeTagNameHash::iterator tagItr = mTagNameDatabase.begin(); tagItr != mTagNameDatabase.end(); ++tagItr )
     {
-        // Add alias.
-        TamlPropertyAlias* pAlias = pTagProperty->addAlias( ASSETTAGS_TAGS_TYPE_NAME );
+        // Add tag node.
+        TamlCustomNode* pTagNode = pTagsNode->addNode( ASSETTAGS_TAGS_TYPE_NAME );
 
         // Add fields.
-        pAlias->addField( ASSETTAGS_TAGS_NAME_FIELD, tagItr->key );
+        pTagNode->addField( ASSETTAGS_TAGS_NAME_FIELD, tagItr->key );
     }
 
-    // Add property.
-    TamlCustomProperty* pAssetTagProperty = customProperties.addProperty( ASSETTAGS_ASSETS_CUSTOMPROPERTY_NAME );
+    // Add node.
+    TamlCustomNode* pAssetTagsNode = customNodes.addNode( ASSETTAGS_ASSETS_NODE_NAME );
 
     // Iterate asset locations.
     for( typeAssetToTagHash::iterator assetTagItr = mAssetToTagDatabase.begin(); assetTagItr != mAssetToTagDatabase.end(); ++assetTagItr )
     {
-        // Add alias.
-        TamlPropertyAlias* pAlias = pAssetTagProperty->addAlias( ASSETTAGS_ASSETS_TYPE_NAME );
+        // Add asset tag node.
+        TamlCustomNode* pAssetNode = pAssetTagsNode->addNode( ASSETTAGS_ASSETS_TYPE_NAME );
 
         // Add fields.
-        pAlias->addField( ASSETTAGS_ASSETS_ASSETID_FIELD, assetTagItr->key );
-        pAlias->addField( ASSETTAGS_ASSETS_TAG_FIELD, assetTagItr->value->mTagName );
+        pAssetNode->addField( ASSETTAGS_ASSETS_ASSETID_FIELD, assetTagItr->key );
+        pAssetNode->addField( ASSETTAGS_ASSETS_TAG_FIELD, assetTagItr->value->mTagName );
     }
 }
 
@@ -160,30 +160,33 @@ void AssetTagsManifest::onTamlCustomWrite( TamlCustomNodes& customNodes )
 void AssetTagsManifest::onTamlCustomRead( const TamlCustomNodes& customNodes )
 {
     // Call parent.
-    Parent::onTamlCustomRead( customProperties );
+    Parent::onTamlCustomRead( customNodes );
 
-    // Find custom property name.
-    const TamlCustomProperty* pTagProperty = customProperties.findProperty( ASSETTAGS_TAGS_CUSTOMPROPERTY_NAME );
+    // Find tags nodes.
+    const TamlCustomNode* pTagProperty = customNodes.findNode( ASSETTAGS_TAGS_NODE_NAME );
 
-    // Finish if we don't have a property name.
+    // Finish if we don't have a tags node name.
     if ( pTagProperty == NULL )
         return;
 
-    // Fetch alias name.
-    StringTableEntry tagAliasName = StringTable->insert( ASSETTAGS_TAGS_TYPE_NAME );
+    // Fetch node name.
+    StringTableEntry tagNodeName = StringTable->insert( ASSETTAGS_TAGS_TYPE_NAME );
 
-    // Iterate property alias.
-    for( TamlCustomProperty::const_iterator propertyAliasItr = pTagProperty->begin(); propertyAliasItr != pTagProperty->end(); ++propertyAliasItr )
+    // Fetch children asset nodes.
+    const TamlCustomNodeVector& tagNodes = pTagProperty->getChildren();
+
+    // Iterate tag nodes.
+    for( TamlCustomNodeVector::const_iterator tagNodeItr = tagNodes.begin(); tagNodeItr != tagNodes.end(); ++tagNodeItr )
     {
-        // Fetch property alias.
-        const TamlPropertyAlias* pAlias = *propertyAliasItr;
+        // Fetch tag node.
+        const TamlCustomNode* pTagNode = *tagNodeItr;
 
-        // Skip if an unknown alias name.
-        if ( pAlias->mAliasName != tagAliasName )
+        // Skip if an unknown node name.
+        if ( pTagNode->mNodeName != tagNodeName )
             continue;
 
         // Fetch "Name" field.
-        const TamlCustomNodeField* pTagNameField = pAlias->findField( ASSETTAGS_TAGS_NAME_FIELD );
+        const TamlCustomNodeField* pTagNameField = pTagNode->findField( ASSETTAGS_TAGS_NAME_FIELD );
 
         // Do we find the field?
         if ( pTagNameField == NULL )
@@ -197,28 +200,31 @@ void AssetTagsManifest::onTamlCustomRead( const TamlCustomNodes& customNodes )
         createTag( pTagNameField->getFieldValue() );
     }
 
-    // Find custom property name.
-    const TamlCustomProperty* pAssetTagProperty = customProperties.findProperty( ASSETTAGS_ASSETS_CUSTOMPROPERTY_NAME );
+    // Find asset tags node.
+    const TamlCustomNode* pAssetTagProperty = customNodes.findNode( ASSETTAGS_ASSETS_NODE_NAME );
 
-    // Finish if we don't have a property name.
+    // Finish if we don't have an asset tags node name.
     if ( pAssetTagProperty == NULL )
         return;
 
-    // Fetch alias name.
-    StringTableEntry assetTagAliasName = StringTable->insert( ASSETTAGS_ASSETS_TYPE_NAME );
+    // Fetch node name.
+    StringTableEntry assetTagNodeName = StringTable->insert( ASSETTAGS_ASSETS_TYPE_NAME );
+
+    // Fetch children asset tag nodes.
+    const TamlCustomNodeVector& assetTagNodes = pAssetTagProperty->getChildren();
 
     // Iterate property alias.
-    for( TamlCustomProperty::const_iterator propertyAliasItr = pAssetTagProperty->begin(); propertyAliasItr != pAssetTagProperty->end(); ++propertyAliasItr )
+    for( TamlCustomNodeVector::const_iterator assetTagNodeItr = assetTagNodes.begin(); assetTagNodeItr != assetTagNodes.end(); ++assetTagNodeItr )
     {
-        // Fetch property alias.
-        const TamlPropertyAlias* pAlias = *propertyAliasItr;
+        // Fetch asset node.
+        const TamlCustomNode* pAssetTagNode = *assetTagNodeItr;
 
-        // Skip if an unknown alias name.
-        if ( pAlias->mAliasName != assetTagAliasName )
+        // Skip if an unknown node name.
+        if ( pAssetTagNode->mNodeName != assetTagNodeName )
             continue;
 
         // Fetch "AssetId" field.
-        const TamlCustomNodeField* pAssetIdField = pAlias->findField( ASSETTAGS_ASSETS_ASSETID_FIELD );
+        const TamlCustomNodeField* pAssetIdField = pAssetTagNode->findField( ASSETTAGS_ASSETS_ASSETID_FIELD );
 
         // Do we find the field?
         if ( pAssetIdField == NULL )
@@ -229,7 +235,7 @@ void AssetTagsManifest::onTamlCustomRead( const TamlCustomNodes& customNodes )
         }
 
         // Fetch "Tag" field.
-        const TamlCustomNodeField* pTagField = pAlias->findField( ASSETTAGS_ASSETS_TAG_FIELD );
+        const TamlCustomNodeField* pTagField = pAssetTagNode->findField( ASSETTAGS_ASSETS_TAG_FIELD );
 
         // Do we find the field?
         if ( pTagField == NULL )

+ 2 - 2
engine/source/assets/assetTagsManifest.h

@@ -41,11 +41,11 @@
 
 //-----------------------------------------------------------------------------
 
-#define ASSETTAGS_TAGS_CUSTOMPROPERTY_NAME      "Tags"
+#define ASSETTAGS_TAGS_NODE_NAME                "Tags"
 #define ASSETTAGS_TAGS_TYPE_NAME                "Tag"
 #define ASSETTAGS_TAGS_NAME_FIELD               "Name"
 
-#define ASSETTAGS_ASSETS_CUSTOMPROPERTY_NAME    "Assets"
+#define ASSETTAGS_ASSETS_NODE_NAME              "Assets"
 #define ASSETTAGS_ASSETS_TYPE_NAME              "Tag"
 #define ASSETTAGS_ASSETS_ASSETID_FIELD          "AssetId"
 #define ASSETTAGS_ASSETS_TAG_FIELD              "Name"

+ 58 - 46
engine/source/component/behaviors/behaviorComponent.cpp

@@ -901,8 +901,8 @@ void BehaviorComponent::onTamlCustomWrite( TamlCustomNodes& customNodes )
     // Fetch behavior template asset field type.
     StringTableEntry behaviorTemplateAssetFieldType = StringTable->insert( BEHAVIORTEMPLATE_ASSET_FIELDTYPE );
 
-    // Add behavior property.
-    TamlCustomProperty* pBehaviorProperty = customProperties.addProperty( BEHAVIOR_CUSTOMPROPERTY_NAME );
+    // Add custom behaviors node.
+    TamlCustomNode* pCustomBehaviorNode = customNodes.addNode( BEHAVIOR_NODE_NAME );
 
     // Iterate behaviors.
     for( SimSet::iterator behaviorItr = mBehaviors.begin(); behaviorItr != mBehaviors.end(); ++behaviorItr )
@@ -913,11 +913,11 @@ void BehaviorComponent::onTamlCustomWrite( TamlCustomNodes& customNodes )
         // Fetch template.
         BehaviorTemplate* pBehaviorTemplate = pBehaviorInstance->getTemplate();
 
-        // Add behavior alias.
-        TamlPropertyAlias* pBehaviorAlias = pBehaviorProperty->addAlias( pBehaviorInstance->getTemplateName() );
+        // Add behavior node.
+        TamlCustomNode* pBehaviorNode = pCustomBehaviorNode->addNode( pBehaviorInstance->getTemplateName() );
 
         // Add behavior Id field.
-        pBehaviorAlias->addField( BEHAVIOR_ID_FIELD_NAME, pBehaviorInstance->getBehaviorId() );
+        pBehaviorNode->addField( BEHAVIOR_ID_FIELD_NAME, pBehaviorInstance->getBehaviorId() );
 
         // Fetch field count,
         const U32 behaviorFieldCount = pBehaviorTemplate->getBehaviorFieldCount();
@@ -942,7 +942,7 @@ void BehaviorComponent::onTamlCustomWrite( TamlCustomNodes& customNodes )
             const char* pFieldValue = pBehaviorInstance->getPrefixedDynamicDataField( pBehaviorField->mName, NULL, fieldType );
 
             // Add behavior field.
-            pBehaviorAlias->addField( pBehaviorField->mName, pFieldValue );
+            pBehaviorNode->addField( pBehaviorField->mName, pFieldValue );
         }
     }
 
@@ -953,8 +953,8 @@ void BehaviorComponent::onTamlCustomWrite( TamlCustomNodes& customNodes )
     if ( behaviorConnectionCount == 0 )
         return;
 
-    // Add behavior connection property.
-    TamlCustomProperty* pConnectionProperty = customProperties.addProperty( BEHAVIOR_CONNECTION_CUSTOMPROPERTY_NAME );
+    // Add custom behavior connection property.
+    TamlCustomNode* pCustomConnection = customNodes.addNode( BEHAVIOR_CONNECTION_NODE_NAME );
     
     // Iterate instance connections.
     for( typeInstanceConnectionHash::iterator instanceItr = mBehaviorConnections.begin(); instanceItr != mBehaviorConnections.end(); ++instanceItr )
@@ -974,12 +974,12 @@ void BehaviorComponent::onTamlCustomWrite( TamlCustomNodes& customNodes )
                 // Fetch connection.
                 BehaviorPortConnection* pConnection = connectionItr;
 
-                // Add connection alias.
-                TamlPropertyAlias* pConnectionAlias = pConnectionProperty->addAlias( BEHAVIOR_CONNECTION_TYPE_NAME );
+                // Add connectionnode.
+                TamlCustomNode* pConnectionNode = pCustomConnection->addNode( BEHAVIOR_CONNECTION_TYPE_NAME );
 
                 // Add behavior field.
-                pConnectionAlias->addField( pConnection->mOutputName, pConnection->mOutputInstance->getBehaviorId() );
-                pConnectionAlias->addField( pConnection->mInputName, pConnection->mInputInstance->getBehaviorId() );
+                pConnectionNode->addField( pConnection->mOutputName, pConnection->mOutputInstance->getBehaviorId() );
+                pConnectionNode->addField( pConnection->mInputName, pConnection->mInputInstance->getBehaviorId() );
             }
         }
     }
@@ -990,13 +990,13 @@ void BehaviorComponent::onTamlCustomWrite( TamlCustomNodes& customNodes )
 void BehaviorComponent::onTamlCustomRead( const TamlCustomNodes& customNodes )
 {
     // Call parent.
-    Parent::onTamlCustomRead( customProperties );
+    Parent::onTamlCustomRead( customNodes );
 
-    // Find behavior custom property name.
-    const TamlCustomProperty* pCustomProperty = customProperties.findProperty( BEHAVIOR_CUSTOMPROPERTY_NAME );
+    // Find custom behaviors node.
+    const TamlCustomNode* pCustomBehaviorNode = customNodes.findNode( BEHAVIOR_NODE_NAME );
 
     // Do we have the property?
-    if ( pCustomProperty != NULL )
+    if ( pCustomBehaviorNode != NULL )
     {
         // Yes, so reset maximum behavior Id.
         S32 maximumBehaviorId = 0;
@@ -1007,23 +1007,26 @@ void BehaviorComponent::onTamlCustomRead( const TamlCustomNodes& customNodes )
         // Fetch behavior template asset field type.
         StringTableEntry behaviorTemplateAssetFieldType = StringTable->insert( BEHAVIORTEMPLATE_ASSET_FIELDTYPE );
 
-        // Iterate property alias.
-        for( TamlCustomProperty::const_iterator propertyAliasItr = pCustomProperty->begin(); propertyAliasItr != pCustomProperty->end(); ++propertyAliasItr )
+        // Fetch children behavior nodes.
+        const TamlCustomNodeVector& behaviorNodes = pCustomBehaviorNode->getChildren();
+
+        // Iterate behavior nodes.
+        for( TamlCustomNodeVector::const_iterator behaviorNodeItr = behaviorNodes.begin(); behaviorNodeItr != behaviorNodes.end(); ++behaviorNodeItr )
         {
-            // Fetch property alias.
-            TamlPropertyAlias* pPropertyAlias = *propertyAliasItr;
+            // Fetch behavior node.
+            TamlCustomNode* pBehaviorNode = *behaviorNodeItr;
 
             // Fetch template.
-            BehaviorTemplate* pTemplate = dynamic_cast<BehaviorTemplate *>( Sim::findObject( pPropertyAlias->mAliasName ) );
+            BehaviorTemplate* pTemplate = dynamic_cast<BehaviorTemplate *>( Sim::findObject( pBehaviorNode->mNodeName ) );
 
             // Find template?
             if( pTemplate == NULL )
             {
                 // No, so warn appropriately.
-                Con::warnf( "BehaviorComponent::onTamlCustomRead() - Missing Behavior '%s'", pPropertyAlias->mAliasName );
+                Con::warnf( "BehaviorComponent::onTamlCustomRead() - Missing Behavior '%s'", pBehaviorNode->mNodeName );
 
                 if( isMethod( "onBehaviorMissing" ) )
-                    Con::executef( this, 2, "onBehaviorMissing", pPropertyAlias->mAliasName );
+                    Con::executef( this, 2, "onBehaviorMissing", pBehaviorNode->mNodeName );
 
                 // Skip it.
                 continue;
@@ -1036,10 +1039,10 @@ void BehaviorComponent::onTamlCustomRead( const TamlCustomNodes& customNodes )
             if ( pBehaviorInstance == NULL )
             {
                 // No, so warn appropriately.
-                Con::warnf( "BehaviorComponent::onTamlCustomRead() - Found behavior could not create an instance '%s'", pPropertyAlias->mAliasName );
+                Con::warnf( "BehaviorComponent::onTamlCustomRead() - Found behavior could not create an instance '%s'", pBehaviorNode->mNodeName );
 
                 if( isMethod( "onBehaviorMissing" ) )
-                    Con::executef( this, 2, "onBehaviorMissing", pPropertyAlias->mAliasName );
+                    Con::executef( this, 2, "onBehaviorMissing", pBehaviorNode->mNodeName );
 
                 // Skip it.
                 continue;
@@ -1047,17 +1050,20 @@ void BehaviorComponent::onTamlCustomRead( const TamlCustomNodes& customNodes )
 
             S32 behaviorId = 0;
 
-            // Iterate property fields.
-            for ( TamlPropertyAlias::const_iterator propertyFieldItr = pPropertyAlias->begin(); propertyFieldItr != pPropertyAlias->end(); ++propertyFieldItr )
+            // Fetch field nodes.
+            const TamlCustomFieldVector& fieldNodes = pBehaviorNode->getFields();
+
+            // Iterate node fields.
+            for ( TamlCustomFieldVector::const_iterator nodeFieldItr = fieldNodes.begin(); nodeFieldItr != fieldNodes.end(); ++nodeFieldItr )
             {
-                // Fetch property field.
-                TamlCustomNodeField* pPropertyField = *propertyFieldItr;
+                // Fetch node field.
+                TamlCustomNodeField* pNodeField = *nodeFieldItr;
 
                 // Fetch field name.
-                const char* pFieldName = pPropertyField->getFieldName();
+                const char* pFieldName = pNodeField->getFieldName();
 
                 // Fetch field value.
-                const char* pFieldValue = pPropertyField->getFieldValue();
+                const char* pFieldValue = pNodeField->getFieldValue();
 
                 // Is this the behavior field Id name?
                 if ( pFieldName == behaviorFieldIdName )
@@ -1071,7 +1077,7 @@ void BehaviorComponent::onTamlCustomRead( const TamlCustomNodes& customNodes )
                         // No, so warn.
                         Con::warnf( "BehaviorComponent::onTamlCustomRead() - Encountered an invalid behavior Id of '%d' on behavior '%s'.",
                             behaviorId,
-                            pPropertyAlias->mAliasName );
+                            pBehaviorNode->mNodeName );
                     }
 
                     // Update maximum behavior Id found.
@@ -1096,7 +1102,7 @@ void BehaviorComponent::onTamlCustomRead( const TamlCustomNodes& customNodes )
                 }
 
                 // Set field.
-                pBehaviorInstance->setPrefixedDynamicDataField( pPropertyField->getFieldName(), NULL, pPropertyField->getFieldValue(), fieldType );
+                pBehaviorInstance->setPrefixedDynamicDataField( pNodeField->getFieldName(), NULL, pNodeField->getFieldValue(), fieldType );
             }
 
             // Add behavior.
@@ -1111,27 +1117,33 @@ void BehaviorComponent::onTamlCustomRead( const TamlCustomNodes& customNodes )
         mMasterBehaviorId = (U32)maximumBehaviorId+1;
     }
 
-    // Find behavior connections custom property name.
-    const TamlCustomProperty* pConnectionProperty = customProperties.findProperty( BEHAVIOR_CONNECTION_CUSTOMPROPERTY_NAME );
+    // Find behavior connections custom node.
+    const TamlCustomNode* pCustomConnectionNode = customNodes.findNode( BEHAVIOR_CONNECTION_NODE_NAME );
 
-    // Do we have the property?
-    if ( pConnectionProperty != NULL )
+    // Do we have the custom connection node?
+    if ( pCustomConnectionNode != NULL )
     {
-        // Yes, so insert connection alias.
-        StringTableEntry connectionAlias = StringTable->insert( BEHAVIOR_CONNECTION_TYPE_NAME );
+        // Yes, so fetch the connection node name..
+        StringTableEntry connectionNodeName = StringTable->insert( BEHAVIOR_CONNECTION_TYPE_NAME );
+
+        // Fetch children connection nodes.
+        const TamlCustomNodeVector& connectionNodes = pCustomConnectionNode->getChildren();
 
         // Iterate property alias.
-        for( TamlCustomProperty::const_iterator propertyAliasItr = pConnectionProperty->begin(); propertyAliasItr != pConnectionProperty->end(); ++propertyAliasItr )
+        for( TamlCustomNodeVector::const_iterator connectionNodeItr = connectionNodes.begin(); connectionNodeItr != connectionNodes.end(); ++connectionNodeItr )
         {
-            // Fetch property alias.
-            TamlPropertyAlias* pPropertyAlias = *propertyAliasItr;
+            // Fetch connection node.
+            TamlCustomNode* pConnectionNode = *connectionNodeItr;
 
             // Skip if the alias isn't a connection.
-            if ( pPropertyAlias->mAliasName != connectionAlias )
+            if ( pConnectionNode->mNodeName != connectionNodeName )
                 continue;
 
+            // Fetch field nodes.
+            const TamlCustomFieldVector& connectionFieldNodes = pConnectionNode->getFields();
+
             // Are there two properties?
-            if ( pPropertyAlias->size() != 2 )
+            if ( connectionFieldNodes.size() != 2 )
             {
                 // No, so warn.
                 Con::warnf( "BehaviorComponent::onTamlCustomRead() - Encountered a behavior connection with more than two connection fields." );
@@ -1139,8 +1151,8 @@ void BehaviorComponent::onTamlCustomRead( const TamlCustomNodes& customNodes )
             }
 
             // Fetch property field #1.
-            TamlCustomNodeField* pPropertyField1 = *pPropertyAlias->begin();
-            TamlCustomNodeField* pPropertyField2 = *(pPropertyAlias->begin()+1);
+            TamlCustomNodeField* pPropertyField1 = *connectionFieldNodes.begin();
+            TamlCustomNodeField* pPropertyField2 = *(connectionFieldNodes.begin()+1);
            
             // Fetch behavior instances #1.
             BehaviorInstance* pBehaviorInstance1 = getBehaviorByInstanceId( dAtoi( pPropertyField1->getFieldValue() ) );

+ 2 - 2
engine/source/component/behaviors/behaviorComponent.h

@@ -34,8 +34,8 @@
 //-----------------------------------------------------------------------------
 
 #define BEHAVIOR_ID_FIELD_NAME                  "Id"
-#define BEHAVIOR_CUSTOMPROPERTY_NAME                "Behaviors"
-#define BEHAVIOR_CONNECTION_CUSTOMPROPERTY_NAME     "BehaviorConnections"
+#define BEHAVIOR_NODE_NAME                      "Behaviors"
+#define BEHAVIOR_CONNECTION_NODE_NAME           "BehaviorConnections"
 #define BEHAVIOR_CONNECTION_TYPE_NAME           "Connection"
 
 //-----------------------------------------------------------------------------

+ 1 - 1
engine/source/persistence/taml/taml.cc

@@ -695,7 +695,7 @@ void Taml::compileCustomProperties( TamlWriteNode* pTamlWriteNode )
             TamlPropertyAlias* pAlias = *typeAliasItr;
 
             // Iterate the fields.
-            for( TamlCustomNodeFieldVector::iterator fieldItr = pAlias->begin(); fieldItr != pAlias->end(); ++fieldItr )
+            for( TamlCustomFieldVector::iterator fieldItr = pAlias->begin(); fieldItr != pAlias->end(); ++fieldItr )
             {
                 TamlCustomNodeField* pPropertyField = *fieldItr;
 

+ 8 - 8
engine/source/persistence/taml/tamlCustom.h

@@ -196,7 +196,7 @@ private:
 };
 
 static FactoryCache<TamlCustomNodeField> TamlCustomNodeFieldFactory;
-typedef Vector<TamlCustomNodeField*> TamlCustomNodeFieldVector;
+typedef Vector<TamlCustomNodeField*> TamlCustomFieldVector;
 
 //-----------------------------------------------------------------------------
 
@@ -429,7 +429,7 @@ public:
 
 #if TORQUE_DEBUG
         // Ensure a field name conflict does not exist.
-        for( TamlCustomNodeFieldVector::iterator nodeFieldItr = mFields.begin(); nodeFieldItr != mFields.end(); ++nodeFieldItr )
+        for( TamlCustomFieldVector::iterator nodeFieldItr = mFields.begin(); nodeFieldItr != mFields.end(); ++nodeFieldItr )
         {
             // Skip if field name is not the same.
             if ( pNodeField->getFieldName() != (*nodeFieldItr)->getFieldName() )
@@ -458,7 +458,7 @@ public:
         StringTableEntry fieldName = StringTable->insert( pFieldName );
 
         // Find node field.
-        for( TamlCustomNodeFieldVector::const_iterator fieldItr = mFields.begin(); fieldItr != mFields.end(); ++fieldItr )
+        for( TamlCustomFieldVector::const_iterator fieldItr = mFields.begin(); fieldItr != mFields.end(); ++fieldItr )
         {
             if ( (*fieldItr)->getFieldName() == fieldName )
                 return (*fieldItr);
@@ -468,12 +468,12 @@ public:
     }
 
     const TamlCustomNodeVector& getChildren( void ) const { return mChildren; }
-    const TamlCustomNodeFieldVector& getFields( void ) const { return mFields; }
+    const TamlCustomFieldVector& getFields( void ) const { return mFields; }
 
-    StringTableEntry            mNodeName;
-    Vector<TamlCustomNode*>     mChildren;
-    TamlCustomNodeFieldVector   mFields;
-    bool                        mIgnoreEmpty;
+    StringTableEntry        mNodeName;
+    Vector<TamlCustomNode*> mChildren;
+    TamlCustomFieldVector   mFields;
+    bool                    mIgnoreEmpty;
 };
 
 static FactoryCache<TamlCustomNode> TamlCustomNodeFactory;