PDA

View Full Version : MentalRay->Geometry Shader->Question about placeholder object naming?


Lyrid
03-08-2006, 02: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.

francescaluce
03-08-2006, 04:32 PM
when you create something in a geoshader it always
append a prefix. this prefix makes impossible to match
the name of your external mi file. so the workaround
we used in ctrl_me is to make a dummy obj where it
will be attached the placeholder. after that you'll
discover that the raylib that comes with dcc apz
has the 'incremental' keyword not implemented so
no placeholder from mi files in standard maya2mr.



ciao
francesca

CGTalk Moderation
03-08-2006, 04:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.