The Mental Ray 3.4 Manual provides some examples using mi_api_object_callback function for explaining how to create placeholder, however, without using mi_api_object_file. So I done it.
But I find that I must prepend characters "::" in the placeholder object name in codes.
Say I have myGeo.c and sphere.mi files
DLLEXPORT miBoolean myGeo(
obj = mi_api_object_begin(mi_mem_strdup("::sphereshape"));
incremental object "::sphereshape"
Notice the characters "::" in front of object name "sphereshape". In myGeo.c file, it's absolutely necessary! but in sphere.mi file, it can be omitted.
If I lost it in .c file, the mental ray standalone would report error:
API 0.0 error 301090: sphere.mi, line 2762: while defining object "sphereshape": undefined object symbol "sphereshape"
API 0.0 error 301185: object _0@1:448::sphereshape (_0@1:448::sphereshape) not defined in file sphere.mi
GAPP 0.0 error 091045: null tag for indices of polygon list from object _0@1:448::sphereshape (_0@1:448::sphereshape)
Mental Ray add "_0@1:448::" in front of the object name automatically.
I have no idea about this. Why the prefix "::" must be added? Can anyone help me?
By the way, this thread may be more appropriate in Graphics Programming Forum, but I think it may be not the programming problem but the general knowledge that I even don't know.