Message 1 of 3
Check parameter validity (C++)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to check whether a scene object has it's "texmap" parameter set or not. I couldn't find API for that so I came up with the following, but it doesn't work:
auto object = lightNode->GetObjectRef(); if (isVrayLight(object)) { auto pb = static_cast<IParamBlock2*>(GetReference(0)); Texmap* texmap; auto success = pb->GetValueByName(TSTR{ "texmap" }, TimeValue{}, texmap, Interval{}); // if (!Texmap) doesn't work properly either if (!success) {} // I also tried this: auto object = lightNode->GetObjectRef(); if (isVrayLight(object)) { auto pb = static_cast<IParamBlock2*>(GetReference(0)); auto texmap = pb->GetTexmap(34, TimeValue{}, Interval{}); if (!texmap) {}
The second example involves hardcoding the ID (in this case, 34, which I deducted from within maxscript by running getpropnames $). Does anyone know a better way to get it or should I just stick to GetValueByName()?