Skip to content

Commit

Permalink
Fixed string parsing, ending the job ';' is now possible without crash.
Browse files Browse the repository at this point in the history
Added prefix parameter when attaching. This is needed when attaching an alembic archive to a namespace in maya
  • Loading branch information
ulrikjorgensen committed Jan 16, 2015
1 parent 391999e commit 66b75fe
Show file tree
Hide file tree
Showing 6 changed files with 260 additions and 213 deletions.
Binary file modified 3DSMax/Alembic.aps
Binary file not shown.
228 changes: 114 additions & 114 deletions 3DSMax/AlembicCameraModifier.h
Original file line number Diff line number Diff line change
@@ -1,114 +1,114 @@
#ifndef __ALEMBIC_CAMERA_MODIFIER__H
#define __ALEMBIC_CAMERA_MODIFIER__H



#include "resource.h"
#include "AlembicDefinitions.h"
#include "AlembicNames.h"


class AlembicCameraModifier : public Modifier {
public:
IParamBlock2 *pblock;

// Parameters in first block:
enum
{
ID_PATH,
ID_IDENTIFIER,
ID_TIME,
ID_HFOV,
ID_VFOV,
ID_FOCAL,
ID_HAPERATURE,
ID_VAPERATURE,
ID_HFILMOFFSET,
ID_VFILMOFFSET,
ID_LSRATIO,
ID_OVERSCANL,
ID_OVERSCANR,
ID_OVERSCANT,
ID_OVERSCANB,
ID_FSTOP,
ID_FOCUSDIST,
ID_SHUTTEROPEN,
ID_SHUTTERCLOSE,
ID_NEARCLIPPINGPLANE, ID_FARCLIPPINGPLANE
};

static IObjParam *ip;
static AlembicCameraModifier *editMod;

AlembicCameraModifier();
~AlembicCameraModifier();

// From Animatable
virtual Class_ID ClassID() { return ALEMBIC_CAMERA_MODIFIER_CLASSID; }
void GetClassName(TSTR& s) { s = _T(ALEMBIC_CAMERA_MODIFIER_NAME); }
CONST_2013 TCHAR *GetObjectName() { return _T(ALEMBIC_CAMERA_MODIFIER_NAME); }

void DeleteThis() { delete this; }
RefTargetHandle Clone(RemapDir& remap);

void EnumAuxFiles(AssetEnumCallback& nameEnum, DWORD flags);

// From Modifier
ChannelMask ChannelsUsed() { return DISP_ATTRIB_CHANNEL; }
ChannelMask ChannelsChanged() { return DISP_ATTRIB_CHANNEL; }
Class_ID InputType() { return defObjectClassID; }
void ModifyObject (TimeValue t, ModContext &mc, ObjectState *os, INode *node);
//Interval LocalValidity(TimeValue t) { return GetValidity(t); }
//Interval GetValidity (TimeValue t);
BOOL DependOnTopology(ModContext &mc) { return FALSE; }

// From BaseObject
CreateMouseCallBack* GetCreateMouseCallBack() {return NULL;}

void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev);
void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);

int NumParamBlocks () { return 1; }
IParamBlock2 *GetParamBlock (int i) { return pblock; }
IParamBlock2 *GetParamBlockByID (short id) { return (pblock->ID() == id) ? pblock : NULL; }

int NumRefs() { return 1; }
RefTargetHandle GetReference(int i) { return pblock; }

int NumSubs() { return 1; }
Animatable* SubAnim(int i) { return GetReference(i); }
TSTR SubAnimName(int i) { return _T("IDS_PROPS"); }

#if crate_Max_Version == 2015
RefResult NotifyRefChanged( const Interval& changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate);
#else
RefResult NotifyRefChanged( Interval changeInt,RefTargetHandle hTarget, PartID& partID, RefMessage message);
#endif

private:
virtual void SetReference(int i, RefTargetHandle rtarg) { pblock = (IParamBlock2 *) rtarg; }
private:
std::string m_CachedAbcFile;
};



class AlembicCameraModifierClassDesc : public ClassDesc2
{
public:
AlembicCameraModifierClassDesc() {}
~AlembicCameraModifierClassDesc() {}

int IsPublic() { return TRUE; }
const TCHAR * ClassName() { return _T(ALEMBIC_CAMERA_MODIFIER_NAME); }
SClass_ID SuperClassID() { return OSM_CLASS_ID; }
void * Create(BOOL loading = FALSE) { return new AlembicCameraModifier; }
Class_ID ClassID() { return ALEMBIC_CAMERA_MODIFIER_CLASSID; }
const TCHAR* Category() { return EXOCORTEX_ALEMBIC_CATEGORY; }
const TCHAR* InternalName() { return _T(ALEMBIC_CAMERA_MODIFIER_SCRIPTNAME); } // returns fixed parsable name (scripter-visible name)
HINSTANCE HInstance() { return hInstance; } // returns owning module handle
};

ClassDesc2 *GetAlembicCameraModifierClassDesc();

#endif
#ifndef __ALEMBIC_CAMERA_MODIFIER__H
#define __ALEMBIC_CAMERA_MODIFIER__H



#include "resource.h"
#include "AlembicDefinitions.h"
#include "AlembicNames.h"


class AlembicCameraModifier : public Modifier {
public:
IParamBlock2 *pblock;

// Parameters in first block:
enum
{
ID_PATH,
ID_IDENTIFIER,
ID_TIME,
ID_HFOV,
ID_VFOV,
ID_FOCAL,
ID_HAPERATURE,
ID_VAPERATURE,
ID_HFILMOFFSET,
ID_VFILMOFFSET,
ID_LSRATIO,
ID_OVERSCANL,
ID_OVERSCANR,
ID_OVERSCANT,
ID_OVERSCANB,
ID_FSTOP,
ID_FOCUSDIST,
ID_SHUTTEROPEN,
ID_SHUTTERCLOSE,
ID_NEARCLIPPINGPLANE, ID_FARCLIPPINGPLANE
};

static IObjParam *ip;
static AlembicCameraModifier *editMod;

AlembicCameraModifier();
~AlembicCameraModifier();

// From Animatable
virtual Class_ID ClassID() { return ALEMBIC_CAMERA_MODIFIER_CLASSID; }
void GetClassName(TSTR& s) { s = _T(ALEMBIC_CAMERA_MODIFIER_NAME); }
CONST_2013 TCHAR *GetObjectName() { return _T(ALEMBIC_CAMERA_MODIFIER_NAME); }

void DeleteThis() { delete this; }
RefTargetHandle Clone(RemapDir& remap);

void EnumAuxFiles(AssetEnumCallback& nameEnum, DWORD flags);

// From Modifier
ChannelMask ChannelsUsed() { return DISP_ATTRIB_CHANNEL; }
ChannelMask ChannelsChanged() { return DISP_ATTRIB_CHANNEL; }
Class_ID InputType() { return defObjectClassID; }
void ModifyObject (TimeValue t, ModContext &mc, ObjectState *os, INode *node);
//Interval LocalValidity(TimeValue t) { return GetValidity(t); }
//Interval GetValidity (TimeValue t);
BOOL DependOnTopology(ModContext &mc) { return FALSE; }

// From BaseObject
CreateMouseCallBack* GetCreateMouseCallBack() {return NULL;}

void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev);
void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);

int NumParamBlocks () { return 1; }
IParamBlock2 *GetParamBlock (int i) { return pblock; }
IParamBlock2 *GetParamBlockByID (short id) { return (pblock->ID() == id) ? pblock : NULL; }

int NumRefs() { return 1; }
RefTargetHandle GetReference(int i) { return pblock; }

int NumSubs() { return 1; }
Animatable* SubAnim(int i) { return GetReference(i); }
TSTR SubAnimName(int i) { return _T("IDS_PROPS"); }

#if crate_Max_Version == 2015
RefResult NotifyRefChanged( const Interval& changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate);
#else
RefResult NotifyRefChanged( Interval changeInt,RefTargetHandle hTarget, PartID& partID, RefMessage message);
#endif

private:
virtual void SetReference(int i, RefTargetHandle rtarg) { pblock = (IParamBlock2 *) rtarg; }
private:
std::string m_CachedAbcFile;
};



class AlembicCameraModifierClassDesc : public ClassDesc2
{
public:
AlembicCameraModifierClassDesc() {}
~AlembicCameraModifierClassDesc() {}

int IsPublic() { return TRUE; }
const TCHAR * ClassName() { return _T(ALEMBIC_CAMERA_MODIFIER_NAME); }
SClass_ID SuperClassID() { return OSM_CLASS_ID; }
void * Create(BOOL loading = FALSE) { return new AlembicCameraModifier; }
Class_ID ClassID() { return ALEMBIC_CAMERA_MODIFIER_CLASSID; }
const TCHAR* Category() { return EXOCORTEX_ALEMBIC_CATEGORY; }
const TCHAR* InternalName() { return _T(ALEMBIC_CAMERA_MODIFIER_SCRIPTNAME); } // returns fixed parsable name (scripter-visible name)
HINSTANCE HInstance() { return hInstance; } // returns owning module handle
};

ClassDesc2 *GetAlembicCameraModifierClassDesc();

#endif
Expand Down
Binary file modified 3DSMax/AlembicExport.aps
Binary file not shown.
Loading

2 comments on commit 66b75fe

@renaudll
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seem to break the code, missing changes in CommonImport.h?

/home/rlessard/dev/ExocortexCrate/Shared/CommonUtils/CommonImport.cpp: In member function ‘bool IJobStringParser::parse(const std::string&)’:
/home/rlessard/dev/ExocortexCrate/Shared/CommonUtils/CommonImport.cpp:67: error: ‘prefix’ was not declared in this scope
/home/rlessard/dev/ExocortexCrate/Shared/CommonUtils/CommonImport.cpp: In function ‘bool AttachSceneFile(SceneNodeAlembicPtr, SceneNodeAppPtr, const IJobStringParser&, CommonProgressBar*, std::list<boost::shared_ptr<SceneNodeApp>, std::allocator<boost::shared_ptr<SceneNodeApp> > >*)’:
/home/rlessard/dev/ExocortexCrate/Shared/CommonUtils/CommonImport.cpp:608: error: ‘const class IJobStringParser’ has no member named ‘prefix’
/home/rlessard/dev/ExocortexCrate/Shared/CommonUtils/CommonImport.cpp:610: error: ‘const class IJobStringParser’ has no member named ‘prefix’
/home/rlessard/dev/ExocortexCrate/Shared/CommonUtils/CommonImport.cpp:615: error: ‘const class IJobStringParser’ has no member named ‘prefix’
make[2]: *** [Shared/CommonUtils/CMakeFiles/CommonUtils.dir/CommonImport.cpp.o] Error 1
make[1]: *** [Shared/CommonUtils/CMakeFiles/CommonUtils.dir/all] Error 2
make: *** [all] Error 2

@bhouston
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

Please sign in to comment.