Lyrid
03-08-2006, 01:39 PM
Recently I have studied Geometry Shader in Mental Ray and tested the mi_api_object_file function in order to understand the concept of placeholder.
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
#myGeo.c
DLLEXPORT miBoolean myGeo(
miTag *result,
miState *state)
{
miObject *obj;
obj = mi_api_object_begin(mi_mem_strdup("::sphereshape"));
...
mi_api_object_file(mi_mem_strdup("sphere.mi"));
...
}
#sphere.mi
incremental object "::sphereshape"
...
...
end object
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?
Thanks!
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.
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
#myGeo.c
DLLEXPORT miBoolean myGeo(
miTag *result,
miState *state)
{
miObject *obj;
obj = mi_api_object_begin(mi_mem_strdup("::sphereshape"));
...
mi_api_object_file(mi_mem_strdup("sphere.mi"));
...
}
#sphere.mi
incremental object "::sphereshape"
...
...
end object
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?
Thanks!
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.
