THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/11/2009 at 04:26, xxxxxxxx wrote:
Cinema 4D Version: 10.5
Platform: Windows ;
Language(s) : C++ ;
in my PlugIn, I am trying to automatically assign colors to selections of my PolygonObject. I can successfully create the Selections, the Materials and the Texture Tags. Now my problem is the assignment of the texture to the selection.
The item "TEXTURETAG_RESTRICTION" in Ttexture is only a string, and simply setting this string to my selection name seems not work. Is there other means of doing that?
Here's part of my code on the problem:
PolygonObject* op = (PolygonObject* )doc->GetActiveObject();
SelectionTag* opTag = SelectionTag::Alloc(Tpolygonselection);
Material* opMat = Material::Alloc();
TextureTag* opTex = TextureTag::Alloc();
opTex->SetMaterial(opMat); opTex->GetDataInstance()->SetString(TEXTURETAG_RESTRICTION, opTag->GetName());
Would appreciate any help on that!
On 17/11/2009 at 07:52, xxxxxxxx wrote:
Do it this way instead:
opTex->SetParameter(DescID(TEXTURETAG_RESTRICTION), GeData(opTag->GetName()), NULL);
Don't forget to send update messages (opTex->Message(MSG_UPDATE)).
On 18/11/2009 at 07:46, xxxxxxxx wrote:
Thanks. That did it!