THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/07/2003 at 01:50, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 7.303
Platform: Windows ;
Language(s) : C.O.F.F.E.E ;
---------
Hi,
I am trying to add a material to more than one object at a same time. But my control never come out of the loop. When I check with a single object it works fine. What could be the problem?
Lets consider I have five objects in my document (named 1,2,3,4,5) Here is some part of my code,
NewMat = new(Material);
doc->InsertMaterial(NewMat, NULL);
NewMat->SetChannelState(CHANNEL_COLOR, TRUE);
NewMat->SetName("NewTexture");
color_channel = NewMat->GetChannel(CHANNEL_COLOR);
container = color_channel->GetContainer();
container->SetData(CH_COLOR,vector(0,100,100));
color_channel->SetContainer(container);
MatMarker = NewMat->GetMarker();
NewMat->Update();
GeEventAdd(MATERIAL_CHANGED);
TexTag = new(TextureTag);
for(i=1; i<=5; i++)
{
Obj = doc->FindObject(i);
Obj->InsertTag(TexTag, NULL);
TexTag->SetMaterial(MatMarker);
}
GeEventAdd(REDRAW_ALL);
As I mentioned earlier, this code works fine for single object. But I want to update multiple objects, its getting hang. Where am I doing mistake?