lik
1
I am using SDK_Win_x64_18-0-18664.zip. I want to get the default front face color and back face color. The code in vs2017:
-
int main() {
-
SUInitialize();
-
SUModelRef model = SU_INVALID;
-
SUResult res = SUModelCreateFromFile(&model, "model.skp");
-
if (res != SU_ERROR_NONE)
-
return 1;
-
SURenderingOptionsRef ro;
-
SUModelGetRenderingOptions(model, &ro);
-
SUTypedValueRef value;
-
SUTypedValueCreate(&value);
-
res = SURenderingOptionsGetValue(ro, "FaceFrontColor", &value);
-
SUColor color;
-
SUTypedValueGetColor(value, &color);
-
SUTypedValueRelease(&value);
-
...
-
}
when run the row 11 throw exception, as fallow:

I has checked this is not the utf8 coding problem.
I think this maybe the sdk’s bug. Has anybody ever had this question?
SUModelGetRenderingOptions(model, &ro);
Are you checking the return value?
lik
3
I can’t get the return value, it has crashed.
I was referring to row 8, GetRenderingOptions
It may be that you need to call SUSceneGetUseRenderingOptions
Refer to this link: Getting Rendering Options DisplayColorByLayer
lik
5
Thanks for your replies.
I have tried SUSceneGetUseRenderingOptions and SUSceneGetRenderingOptions, it has the same problem.
I pasted in your code, it was failing on SUTypedValueCreate because the passed value was not initially set, so try this…
SUTypedValueRef value = SU_INVALID;
system
Closed
7
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.