Skip to content

Commit

Permalink
Rename some files and class names
Browse files Browse the repository at this point in the history
Mainly to remove redundant "Asset" word in many files, and add "Output"
for output related classes.
  • Loading branch information
andrewkww committed Apr 17, 2014
1 parent 5c70a0e commit d908f35
Show file tree
Hide file tree
Showing 35 changed files with 356 additions and 356 deletions.
36 changes: 18 additions & 18 deletions Asset.C
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#include <maya/MGlobal.h>

#include "Asset.h"
#include "AssetInput.h"
#include "Input.h"
#include "AssetNode.h"
#include "GeometryObject.h"
#include "InstancerObject.h"
#include "OutputGeometryObject.h"
#include "OutputInstancerObject.h"
#include "util.h"

class AttrOperation : public Util::WalkParmOperation
Expand Down Expand Up @@ -383,15 +383,15 @@ Asset::Asset(
hstat = HAPI_GetNodeInfo( myAssetInfo.nodeId, & myNodeInfo);
Util::checkHAPIStatus(hstat);

myAssetInputs = new AssetInputs( myAssetInfo.id);
myAssetInputs = new Inputs( myAssetInfo.id);
myAssetInputs->setNumInputs( myAssetInfo.maxGeoInputCount);

// get the infos
update();

// objects
int objCount = myAssetInfo.objectCount;
myObjects = new Object*[objCount];
myObjects = new OutputObject*[objCount];
myNumVisibleObjects = 0;
myNumObjects = objCount;

Expand All @@ -402,7 +402,7 @@ Asset::Asset(
for (int i=0; i<objCount; i++)
{
Util::updateProgressWindow( status, (int)( (float) i *100.0f / (float) objCount) );
myObjects[i] = Object::createObject( myAssetInfo.id, i, this);
myObjects[i] = OutputObject::createObject( myAssetInfo.id, i, this);
}

Util::hideProgressWindow();
Expand Down Expand Up @@ -435,7 +435,7 @@ Asset::getAssetName() const
return Util::getString(myAssetInfo.fullOpNameSH);
}

Object*
OutputObject*
Asset::findObjectByName(MString name)
{
for (int i=0; i< myAssetInfo.objectCount; i++)
Expand All @@ -448,7 +448,7 @@ Asset::findObjectByName(MString name)
}


Object*
OutputObject*
Asset::findObjectById(int id)
{
return myObjects[id];
Expand Down Expand Up @@ -519,10 +519,10 @@ Asset::computeInstancerObjects(
MIntArray instancedObjIds;
for (int i=0; i< myNumObjects; i++)
{
Object* obj = myObjects[i];
OutputObject* obj = myObjects[i];
//MPlug instancerElemPlug = instancersPlug.elementByLogicalIndex( instancerIndex );

if ( obj->type() == Object::OBJECT_TYPE_INSTANCER )
if ( obj->type() == OutputObject::OBJECT_TYPE_INSTANCER )
{
MDataHandle instancerElemHandle = instancersBuilder.addElement( instancerIndex );
stat = obj->compute(instancerElemHandle, needToSyncOutputs);
Expand All @@ -531,11 +531,11 @@ Asset::computeInstancerObjects(
instancerIndex++;

// get all the object ids that are instanced
MIntArray instIds = dynamic_cast< InstancerObject* >( obj )->getInstancedObjIds();
MStringArray instNames = dynamic_cast< InstancerObject* >( obj )->getUniqueInstObjNames();
MIntArray instIds = dynamic_cast< OutputInstancerObject* >( obj )->getInstancedObjIds();
MStringArray instNames = dynamic_cast< OutputInstancerObject* >( obj )->getUniqueInstObjNames();
for ( unsigned int j = 0; j < instNames.length(); ++j )
{
Object* o = findObjectByName( instNames[ j ] );
OutputObject* o = findObjectByName( instNames[ j ] );
if ( o != NULL )
instancedObjIds.append( o->getId() );
}
Expand All @@ -560,7 +560,7 @@ Asset::computeInstancerObjects(
// mark instanced objects
for ( unsigned int i = 0; i < instancedObjIds.length(); ++i )
{
Object* obj = myObjects[ instancedObjIds[ i ] ];
OutputObject* obj = myObjects[ instancedObjIds[ i ] ];
obj->myIsInstanced = true;
}

Expand Down Expand Up @@ -589,11 +589,11 @@ Asset::computeGeometryObjects(

for (int ii = 0; ii < myNumObjects; ii++)
{
Object * obj = myObjects[ ii ];
OutputObject * obj = myObjects[ ii ];

MDataHandle objectHandle = objectsBuilder.addElement( ii );

if (obj->type() == Object::OBJECT_TYPE_GEOMETRY)
if (obj->type() == OutputObject::OBJECT_TYPE_GEOMETRY)
{
obj->compute(objectHandle, needToSyncOutputs);

Expand Down Expand Up @@ -659,7 +659,7 @@ Asset::compute(
float time = (float)currentTime.as(MTime::kSeconds);
HAPI_SetTime(time);

//this figures out the Houdini asset inputs (Geo, Transform)
//this figures out the Houdini asset inputs (OutputGeometry, Transform)
//for inter-asset stuff
computeAssetInputs(plug, data);

Expand All @@ -684,7 +684,7 @@ Asset::compute(
return stat;
}

Object**
OutputObject**
Asset::getObjects()
{
return myObjects;
Expand Down
14 changes: 7 additions & 7 deletions Asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

#include <HAPI/HAPI.h>

#include "Object.h"
#include "OutputObject.h"

#include <vector>

class AssetInputs;
class Inputs;
class MFnDependencyNode;

class Asset {
Expand All @@ -26,9 +26,9 @@ class Asset {
MString getOTLFilePath() const;
MString getAssetName() const;

Object** getObjects();
Object* findObjectByName(MString name);
Object* findObjectById(int id);
OutputObject** getObjects();
OutputObject* findObjectByName(MString name);
OutputObject* findObjectById(int id);
HAPI_AssetInfo getAssetInfo() { return myAssetInfo; }

// Getters for infos
Expand Down Expand Up @@ -95,9 +95,9 @@ class Asset {
HAPI_AssetInfo myAssetInfo;
MObject myNode; //The Maya asset node

AssetInputs* myAssetInputs;
Inputs* myAssetInputs;
//TODO: make this a vector. The double pointer assumes the number of objects is static
Object** myObjects; //the Object class contains a 1 to 1 map with HAPI_ObjectInfos.
OutputObject** myObjects; //the OutputObject class contains a 1 to 1 map with HAPI_ObjectInfos.

// Arrays of infos that can be accessed when updating objects,
// keeping them here avoids getting them for individual object.
Expand Down
4 changes: 2 additions & 2 deletions AssetNode.C
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <algorithm>

#include "Asset.h"
#include "AssetInput.h"
#include "Input.h"
#include "AssetNode.h"
#include "MayaTypeID.h"
#include "util.h"
Expand Down Expand Up @@ -178,7 +178,7 @@ AssetNode::initialize()
AssetNode::outputTemplateObjects = nAttr.create("outputTemplateObjects", "outputTemplateObjects", MFnNumericData::kBoolean);

// input
AssetNode::input = AssetInputs::createInputAttribute();
AssetNode::input = Inputs::createInputAttribute();

//---------------------------------- instancer compound multi----------------------------------------------
// instancer data
Expand Down
4 changes: 2 additions & 2 deletions AssetNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class Asset;
// It does this by first calling computeInstancerObjects() then
// computeGeometryObjects(). Each of these will fill out the information in
// the output attribute. For computeInstancerObjects() it will end up doing the
// work by calling the compute() function of the InstancerObject class, and
// work by calling the compute() function of the OutputInstancerObject class, and
// for computeGeometryObjects() it will call the computeParts() function of the
// GeometryObject class.
// OutputGeometryObject class.


class AssetNode: public MPxTransform
Expand Down
12 changes: 6 additions & 6 deletions AssetSubCommandSync.C
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <maya/MFnDagNode.h>

#include "AssetNode.h"
#include "AssetSyncAttribute.h"
#include "AssetSyncOutputObject.h"
#include "AssetSyncOutputInstance.h"
#include "SyncAttribute.h"
#include "SyncOutputObject.h"
#include "SyncOutputInstance.h"

AssetSubCommandSync::AssetSubCommandSync(
const MObject &assetNodeObj
Expand Down Expand Up @@ -73,7 +73,7 @@ AssetSubCommandSync::doIt()
// attributes
if(mySyncAll || mySyncAttributes)
{
AssetSubCommand* syncOutput = new AssetSyncAttribute(myAssetNodeObj);
AssetSubCommand* syncOutput = new SyncAttribute(myAssetNodeObj);
syncOutput->doIt();

myAssetSyncs.push_back(syncOutput);
Expand Down Expand Up @@ -120,7 +120,7 @@ AssetSubCommandSync::doIt()

if( mySyncOutputHidden || visible || instanced )
{
AssetSubCommand* syncOutput = new AssetSyncOutputObject(elemPlug,
AssetSubCommand* syncOutput = new SyncOutputObject(elemPlug,
myAssetNodeObj, visible, mySyncOutputTemplatedGeos );
syncOutput->doIt();

Expand All @@ -137,7 +137,7 @@ AssetSubCommandSync::doIt()
{
MPlug elemPlug = instancersPlug[i];

AssetSubCommand* syncOutput = new AssetSyncOutputInstance(elemPlug, i, myAssetNodeObj);
AssetSubCommand* syncOutput = new SyncOutputInstance(elemPlug, i, myAssetNodeObj);
syncOutput->doIt();

myAssetSyncs.push_back(syncOutput);
Expand Down
Loading

0 comments on commit d908f35

Please sign in to comment.