THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/10/2009 at 14:19, xxxxxxxx wrote:
Cinema 4D Version: r11
Platform: Windows ;
Language(s) : C++ ;
i was about getting my hands on using a tag plugin to pass data from the generator plugin to a shader plugin.. the tags values are set properly (i can see it when converting the generator and looking at the tag), but the shader doesnt get the proper values. its always zero..
RayObject *robj = NULL;
robj = cd->vd->op;
if (!robj) return 0.0;
BaseTag *ht = robj->link->GetTag(1000001);//
BaseContainer *bc = ht->GetDataInstance();
result = bc->GetVector(MATERIAL_COLOR);
thank you for all input??
On 11/10/2009 at 03:49, xxxxxxxx wrote:
or is this the same problem like here
> Quote: __
> * * *
> The problem is you are working on a virtual object which is not yet in the document. Expressions will not work.
> * * *
and if so.. how can i achive the following:
1. create clones with an objectPlugin,
2. create custom tags for those clones to to certain things, like facing toward an object for example
3. reading the tag data by a shader plugin??
all this while the object maintains the plugin object
On 11/10/2009 at 04:13, xxxxxxxx wrote:
ok.. i did something wrong and didnt use tag->GetData() (this works for the facing thing, but colors in the shaderplugin still dont work)
but still, as long as the pluginobject is not converted nothing works.. this is not so cool
furthermore, it seems that the shaderplugin doesnt find the tag.. my tag has the ID 1000001 for testing, so i create it in my objectplugin by using obj- >MakeTag(1000001);
and in the shader i do this:
BaseTag *ht = robj- >link->GetTag(1000001);
isnt that right??
On 11/10/2009 at 15:48, xxxxxxxx wrote:
hm, i am not getting nothing to work here.. the tag plugin isnt working as long as my generator plugin isnt converted and my shader plugin is not able to access the tag plugin
\> Bool facing = tag->GetData().GetBool(FACING);
\> BaseObject* targetHelper = doc->SearchObject("Facing Helper");
\> if (targetHelper && facing)
in the attribute manager i have set the facing bool and the "Facing Helper" object is in the scene.. but GePrint is not called (and i found out that it is the facing thats not read correctly), why is this??
\> Vector eShade3Data::Output(PluginShader *chn, ChannelData *cd)
\> Vector result = 0.0;
\> if (cd->vd)
\> RayObject *robj = NULL;
\> robj = cd->vd->op;
\> if (!robj) return 0.0;
\> BaseTag *ht = robj->link->GetTag(HELPERTAG);//
\> if (ht) result = Vector(1.0,0.0,0.0);
\> return result;
\> return 1.0;
tag is there and so i thought the object should get a red color, but its not happening
i have no clue what i am doing wrong there nor what to try else...
hopefully someone can point me to something.
On 12/10/2009 at 01:45, xxxxxxxx wrote:
I can't confirm, it is working for me. Maybe you did something wrong with the tag creation. I used the same code as you in my shader.
On 12/10/2009 at 04:04, xxxxxxxx wrote:
what could that be?? i tried different things. obj->MakeTag(helperTag), as well as BaseTag::Alloc(helperTag)
are there other options??