Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

C++ Slate vs Compact Material Editor: Maps using NumRefs() inconsistent behavior

1 REPLY 1
Reply
Message 1 of 2
Anonymous
359 Views, 1 Reply

C++ Slate vs Compact Material Editor: Maps using NumRefs() inconsistent behavior

I'm experiencing completely inconsistent behavior depending on whether or not I'm in Slate vs. Compact. 

This has been happening since release 2017, and hasn't gotten better. What is going on under the hood that I need to account for here? There is nothing in the SDK documentation I can find that even implies there should be a difference.

Take this for example:

int NumParamBlocks() { return 3; }
IParamBlock2* GetParamBlock(int i) { switch (i) { case 0: return pblock; /*case 1: return pbCurve;*/ case 1: return pbMap; case 2: return pbXYZ; } return NULL; }
IParamBlock2* GetParamBlockByID(BlockID id) {
if (pblock->ID() == id) return pblock;
// if (pbCurve->ID() == id) return pbCurve;
if (pbMap->ID() == id) return pbMap;
if (pbXYZ->ID() == id) return pbXYZ;
return NULL;
}

Above, case 1 has been commented out and all the other cases shifted over by one. This is allowable, but incorrect if the individual Pblock ref IDs have not been adjusted accordingly. 

BUT this will result in a correct representation in the COMPACT material editor whereas it will result in everything after Case 0 failing to properly update in SLATE. To be honest neither method should work well in either compact, or slate -- but yet it does. 

Why the inconsistency? (It literally makes one want to tear one's hair out when troubleshooting)

Are you paying attention, Autodesk?

Tags (3)
1 REPLY 1
Message 2 of 2
guruware
in reply to: Anonymous

can you show your paramblock definition, pretty sure you don't have 3 paramblocks

can you show yourimplementation of GetReference() and SetReference()

what are the ref_nums for the xyz gen, and the map ?

 

there can be lots of reasons why this happen for you

 

 

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

Post to forums  

Autodesk Design & Make Report