Community
Arnold for 3ds Max
Rendering with Arnold in 3ds Max using the MaxtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MTOA API CExtensionAttrHelper ERROR ??

4 REPLIES 4
Reply
Message 1 of 5
a523090511
557 Views, 4 Replies

MTOA API CExtensionAttrHelper ERROR ??

The user guides documentation use a CAttrData and ExtensionAttrHelper to add new attribute in a maya node . like this:

https://support.solidangle.com/display/A5AFMUG/Adding+specific+Arnold+attributes+to+a+node

So , I wrote a new node to do the test .

static void NodeInitialiser(CAbTranslator context)

{

CExtensionAttrHelper helper(context.maya,"procedural");

CAttrData data;

data.stringDefault = MString("");

data.name = "wahaha";

data.shortName = "wahaha";

helper.MakeInputEnum(data);

}

When I use this method, I encountered an error. :

API error detected in plugins\mtoa\attributes\AttrHelper.cpp at line 1301 : (kInvalidParameter): Object is incompatible with this method

Also, no attributes are added to the my node.

Please tell me why and how to fix it... thank you so much ~~

Labels (3)
4 REPLIES 4
Message 2 of 5

Hi,

here's an example of how enum attributes have to be created :

CAttrData data;

MStringArray strArr;

strArr.append("Fixed");

strArr.append("Grid");

data.enums = strArr;

data.defaultValue.INT() = 0;

data.name = "aiTextureCoordinateMethod";

data.shortName = "ai_texture_coordinate_method";

helper.MakeInputEnum(data);

Message 3 of 5
a523090511
in reply to: a523090511

Thank you so much for your help ~~

But i still have problem when i do this :

void Wahaha_Translator::NodeInitialiser(CAbTranslator context)

{

CExtensionAttrHelper helper(context.maya,"procedural"); //CShapeTranslator::MakeCommonAttributes(helper); //CShapeTranslator::MakeMayaVisibilityFlags(helper);

CAttrData data;

MStringArray strArr;

strArr.append("Fixed");

strArr.append("Grid");

data.enums = strArr;

data.defaultValue.INT() = 0;

data.name = "aiTextureCoordinateMethod";

data.shortName = "ai_texture_coordinate_method";

helper.MakeInputEnum(data);

}

The same error message , no attributes are added to the my node again .

If i cancel the comment in the code ,

CShapeTranslator::MakeCommonAttributes(helper); or

CShapeTranslator::MakeMayaVisibilityFlags(helper);

Maya will crash ...

I am trying to write a maya shape node and translate it with mtoa .Working with MAYA2017-UPDATE3 and MTOA 2.0.2 and Arnold 5.0.1.2 .

https://support.solidangle.com/display/A5AFMUG/Adding+specific+Arnold+attributes+to+a+node

I have done the contents of the document once , but i can get the expected results . The "aiSpecularWeight" attribute dose not appear in the phong node .

Dose anyone know why ? Thank you so much ~~

Message 4 of 5

Hi,

which Os, compiler, and version of the compiler are you using ?

Message 5 of 5
a523090511
in reply to: a523090511

Hi , sorry for reply you so late. I'm using win10 , vs2010 . I found another way to fix this problem during this time . I created a similar class using MAYA API to fix it .

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report