THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/10/2009 at 11:12, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.1
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
---------
Hi,
in my generator I have created some objects. Now I want to attach texture tags to those objects and link a material in those tags. The material is given by the user and linked in the description of my generator.
This is how I retrieve the material that the user has linked:
> BaseMaterial \*Mat = (BaseMaterial\* )bc->GetLink(MY_MAT_LINK, doc);
So far it works, "Mat" is not NULL.
Now I create a texture tag on an object in my virtual hierarchy and want to link the material there:
> if (Mat) { \> BaseTag \*MatTag = BaseTag::Alloc(Ttexture); \> if (MatTag) { \> MatTag->GetDataInstance()->SetLink(TEXTURETAG_MATERIAL, Mat); \> MatTag->GetDataInstance()->SetLong(TEXTURETAG_PROJECTION, TEXTURETAG_PROJECTION_FLAT); \> MatTag->GetDataInstance()->SetReal(TEXTURETAG_LENGTHX, MatScale); \> MatTag->GetDataInstance()->SetReal(TEXTURETAG_LENGTHY, MatScale); \> PolyPlane->InsertTag(MatTag); \> } \> } \>
I does not crash, but the material is also not linked. When I convert my generator object with "c" and look into the texture tag, the link field is empty. Why?
Thanks in advance for any help!
Cheers,
Jack