Browse Source

Corrected ShapeAsset array initpersist macro to assign arraySize
Uncommented line in preview build function for material assets so they generate the reduced preview image
Added cubeFace to cubemapData import processing vars checked
Updated ShapeBaseImageData convert vars to properly use asset var names

Areloch 4 years ago
parent
commit
426f5974da

+ 6 - 6
Engine/source/T3D/assets/ShapeAsset.h

@@ -575,15 +575,15 @@ DefineEngineMethod(className, set##name, bool, (const char*  shape, S32 index),
 
 
 #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS
 #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS
 
 
-#define INITPERSISTFIELD_SHAPEASSET_ARRAY(name, consoleClass, docs) \
-   addProtectedField(assetText(name, File), TypeShapeFilename, Offset(m##name##Name, consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, docs)); \
-   addProtectedField(assetText(name, Asset), TypeShapeAssetId, Offset(m##name##AssetId, consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, asset reference.));
+#define INITPERSISTFIELD_SHAPEASSET_ARRAY(name, arraySize, consoleClass, docs) \
+   addProtectedField(assetText(name, File), TypeShapeFilename, Offset(m##name##Name, consoleClass), _set##name##Data, & defaultProtectedGetFn, arraySize, assetText(name, docs)); \
+   addProtectedField(assetText(name, Asset), TypeShapeAssetId, Offset(m##name##AssetId, consoleClass), _set##name##Data, & defaultProtectedGetFn, arraySize, assetText(name, asset reference.));
 
 
 #else
 #else
 
 
-#define INITPERSISTFIELD_SHAPEASSET_ARRAY(name, consoleClass, docs) \
-   addProtectedField(assetText(name, File), TypeShapeFilename, Offset(m##name##Name, consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \
-   addProtectedField(assetText(name, Asset), TypeShapeAssetId, Offset(m##name##AssetId, consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, asset reference.));
+#define INITPERSISTFIELD_SHAPEASSET_ARRAY(name, arraySize, consoleClass, docs) \
+   addProtectedField(assetText(name, File), TypeShapeFilename, Offset(m##name##Name, consoleClass), _set##name##Data, & defaultProtectedGetFn, arraySize, assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \
+   addProtectedField(assetText(name, Asset), TypeShapeAssetId, Offset(m##name##AssetId, consoleClass), _set##name##Data, & defaultProtectedGetFn, arraySize,assetText(name, asset reference.));
 
 
 #endif // SHOW_LEGACY_FILE_FIELDS
 #endif // SHOW_LEGACY_FILE_FIELDS
 
 

+ 2 - 2
Engine/source/T3D/fx/groundCover.cpp

@@ -561,8 +561,8 @@ void GroundCover::initPersistFields()
 
 
          addField( "billboardUVs",  TypeRectUV,    Offset( mBillboardRects, GroundCover ), MAX_COVERTYPES,  "Subset material UV coordinates for this cover billboard." );
          addField( "billboardUVs",  TypeRectUV,    Offset( mBillboardRects, GroundCover ), MAX_COVERTYPES,  "Subset material UV coordinates for this cover billboard." );
 
 
-         INITPERSISTFIELD_SHAPEASSET_ARRAY(Shape, GroundCover, "The cover shape. [Optional]");
-         addField( "shapeFilename", TypeFilename,  Offset( mShapeName, GroundCover ), MAX_COVERTYPES,  "The cover shape filename. [Optional]", AbstractClassRep::FIELD_HideInInspectors );
+         addField("shapeFilename", TypeFilename, Offset(mShapeName, GroundCover), MAX_COVERTYPES, "The cover shape filename. [Optional]", AbstractClassRep::FIELD_HideInInspectors);
+         INITPERSISTFIELD_SHAPEASSET_ARRAY(Shape, MAX_COVERTYPES, GroundCover, "The cover shape. [Optional]");
 
 
          addField( "layer",         TypeTerrainMaterialName, Offset( mLayer, GroundCover ), MAX_COVERTYPES, "Terrain material name to limit coverage to, or blank to not limit." );
          addField( "layer",         TypeTerrainMaterialName, Offset( mLayer, GroundCover ), MAX_COVERTYPES, "Terrain material name to limit coverage to, or blank to not limit." );
 
 

+ 5 - 5
Engine/source/T3D/player.cpp

@@ -1164,16 +1164,16 @@ void PlayerData::initPersistFields()
 
 
       // Mounted images arrays
       // Mounted images arrays
       addArray( "Mounted Images", ShapeBase::MaxMountedImages );
       addArray( "Mounted Images", ShapeBase::MaxMountedImages );
-         INITPERSISTFIELD_SHAPEASSET_ARRAY(ShapeFP, PlayerData, "@brief File name of this player's shape that will be used in conjunction with the corresponding mounted image.\n\n"
+         addProtectedField("shapeNameFP", TypeShapeFilename, Offset(mShapeFPName, PlayerData), &_setShapeFPData, &defaultProtectedGetFn, ShapeBase::MaxMountedImages,
+            "@brief File name of this player's shape that will be used in conjunction with the corresponding mounted image.\n\n"
             "These optional parameters correspond to each mounted image slot to indicate a shape that is rendered "
             "These optional parameters correspond to each mounted image slot to indicate a shape that is rendered "
             "in addition to the mounted image shape.  Typically these are a player's arms (or arm) that is "
             "in addition to the mounted image shape.  Typically these are a player's arms (or arm) that is "
-            "animated along with the mounted image's state animation sequences.\n");
+            "animated along with the mounted image's state animation sequences.\n", AbstractClassRep::FIELD_HideInInspectors);
 
 
-         addProtectedField( "shapeNameFP", TypeShapeFilename, Offset(mShapeFPName, PlayerData), &_setShapeFPData, &defaultProtectedGetFn, ShapeBase::MaxMountedImages,
-            "@brief File name of this player's shape that will be used in conjunction with the corresponding mounted image.\n\n"
+         INITPERSISTFIELD_SHAPEASSET_ARRAY(ShapeFP, ShapeBase::MaxMountedImages, PlayerData, "@brief File name of this player's shape that will be used in conjunction with the corresponding mounted image.\n\n"
             "These optional parameters correspond to each mounted image slot to indicate a shape that is rendered "
             "These optional parameters correspond to each mounted image slot to indicate a shape that is rendered "
             "in addition to the mounted image shape.  Typically these are a player's arms (or arm) that is "
             "in addition to the mounted image shape.  Typically these are a player's arms (or arm) that is "
-            "animated along with the mounted image's state animation sequences.\n", AbstractClassRep::FIELD_HideInInspectors);
+            "animated along with the mounted image's state animation sequences.\n");
 
 
       endArray( "Mounted Images" );
       endArray( "Mounted Images" );
 
 

+ 2 - 2
Engine/source/T3D/shapeImage.cpp

@@ -587,9 +587,9 @@ void ShapeBaseImageData::initPersistFields()
    addField( "emap", TypeBool, Offset(emap, ShapeBaseImageData),
    addField( "emap", TypeBool, Offset(emap, ShapeBaseImageData),
       "@brief Whether to enable environment mapping on this Image.\n\n" );
       "@brief Whether to enable environment mapping on this Image.\n\n" );
 
 
-   INITPERSISTFIELD_SHAPEASSET_ARRAY(Shape, ShapeBaseImageData, "The shape asset to use for this image in the third person")
+   INITPERSISTFIELD_SHAPEASSET_ARRAY(Shape, MaxShapes, ShapeBaseImageData, "The shape asset to use for this image in the third person")
 
 
-   addProtectedField("shapeFileFP", TypeShapeFilename, Offset(mShapeName[1], ShapeBaseImageData), _setShapeData, defaultProtectedGetFn, "deprecated alias for ShapeFPFile/Asset", AbstractClassRep::FIELD_HideInInspectors);
+   //addProtectedField("shapeFileFP", TypeShapeFilename, Offset(mShapeName[1], ShapeBaseImageData), _setShapeData, defaultProtectedGetFn, "deprecated alias for ShapeFPFile/Asset", AbstractClassRep::FIELD_HideInInspectors);
 
 
    addField( "imageAnimPrefix", TypeCaseString, Offset(imageAnimPrefix, ShapeBaseImageData),
    addField( "imageAnimPrefix", TypeCaseString, Offset(imageAnimPrefix, ShapeBaseImageData),
       "@brief Passed along to the mounting shape to modify animation sequences played in third person. [optional]\n\n" );
       "@brief Passed along to the mounting shape to modify animation sequences played in third person. [optional]\n\n" );

+ 5 - 5
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript

@@ -447,17 +447,17 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData)
    
    
    if(isObject(%assetDef.materialDefinitionName))
    if(isObject(%assetDef.materialDefinitionName))
    {
    {
-      if(isFile(%assetDef.materialDefinitionName.getDiffuseMap(0)))
+      	if(isFile(%assetDef.materialDefinitionName.getDiffuseMap(0)))
          {
          {
             %difMap = %assetDef.materialDefinitionName.getDiffuseMap(0);
             %difMap = %assetDef.materialDefinitionName.getDiffuseMap(0);
          }
          }
-      else if(%assetDef.materialDefinitionName.getDiffuseMapAsset(0) !$= "")
-      {
+      	else if(%assetDef.materialDefinitionName.getDiffuseMapAsset(0) !$= "")
+      	{
          %imgAsset = AssetDatabase.acquireAsset(%assetDef.materialDefinitionName.getDiffuseMapAsset(0));
          %imgAsset = AssetDatabase.acquireAsset(%assetDef.materialDefinitionName.getDiffuseMapAsset(0));
             %difMap = %imgAsset.getImagePath();
             %difMap = %imgAsset.getImagePath();
-   }
+   		}
       
       
-         //%success = saveScaledImage(%difMap, %previewFilePath);
+         %success = saveScaledImage(%difMap, %previewFilePath);
 
 
          %previewAsset = new ImageAsset()
          %previewAsset = new ImageAsset()
          {
          {

+ 2 - 2
Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript

@@ -833,7 +833,7 @@ function T3Dpre4ProjectImporter::processGuiBitmapButtonCtrlLine(%this, %line)
 // Datablocks
 // Datablocks
 //==============================================================================
 //==============================================================================
 T3Dpre4ProjectImporter::genProcessor("ForestItemData", "shape shapeAsset");
 T3Dpre4ProjectImporter::genProcessor("ForestItemData", "shape shapeAsset");
-T3Dpre4ProjectImporter::genProcessor("CubeMapData", "cubemapFace cubeMapFaceAsset cubemap cubemapAsset");
+T3Dpre4ProjectImporter::genProcessor("CubeMapData", "cubemapFace cubeMapFaceAsset cubemap cubemapAsset cubeFace cubeMapFaceAsset");
 T3Dpre4ProjectImporter::genProcessor("DebrisData", "shape shapeAsset shapeFile shapeAsset");
 T3Dpre4ProjectImporter::genProcessor("DebrisData", "shape shapeAsset shapeFile shapeAsset");
 T3Dpre4ProjectImporter::genProcessor("DecalData", "material materialAsset");
 T3Dpre4ProjectImporter::genProcessor("DecalData", "material materialAsset");
 T3Dpre4ProjectImporter::genProcessor("ExplosionData", "explosionShape explosionShapeAsset");
 T3Dpre4ProjectImporter::genProcessor("ExplosionData", "explosionShape explosionShapeAsset");
@@ -846,7 +846,7 @@ T3Dpre4ProjectImporter::genProcessor("PhysicsShapeData", "shape shapeAsset");
 T3Dpre4ProjectImporter::genProcessor("PlayerData", "shapeFP shapeFPAsset shapeNameFP shapeFPAsset");
 T3Dpre4ProjectImporter::genProcessor("PlayerData", "shapeFP shapeFPAsset shapeNameFP shapeFPAsset");
 T3Dpre4ProjectImporter::genProcessor("ProjectileData", "projectileShape projectileShapeAsset projectileShapeName projectileShapeAsset");
 T3Dpre4ProjectImporter::genProcessor("ProjectileData", "projectileShape projectileShapeAsset projectileShapeName projectileShapeAsset");
 T3Dpre4ProjectImporter::genProcessor("ShapeBaseData", "shapeFile shapeAsset shape shapeAsset debrisShape debrisShapeAsset debrisShapeName debrisShapeAsset");
 T3Dpre4ProjectImporter::genProcessor("ShapeBaseData", "shapeFile shapeAsset shape shapeAsset debrisShape debrisShapeAsset debrisShapeName debrisShapeAsset");
-T3Dpre4ProjectImporter::genProcessor("ShapeBaseImageData", "shape shapeAsset shapeFP shapeFPAsset shapeFile shapeAsset shapeFileFP shapeFPAsset");
+T3Dpre4ProjectImporter::genProcessor("ShapeBaseImageData", "shape shapeAsset[0] shapeFP shapeAsset[1] shapeFile shapeAsset[0] shapeFileFP shapeAsset[1]");
 T3Dpre4ProjectImporter::genProcessor("WheeledVehicleTire", "shape shapeAsset shapeFile shapeAsset");
 T3Dpre4ProjectImporter::genProcessor("WheeledVehicleTire", "shape shapeAsset shapeFile shapeAsset");
 //==============================================================================
 //==============================================================================
 // Materials
 // Materials