C++ Slate vs Compact Material Editor: Maps using NumRefs() inconsistent behavior
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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?