Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

Texture Tag

 Post Reply Post Reply
Author
Message
Charles View Drop Down
Member
Member


Joined: 2002 Nov 25
Location: Singapore
Online Status: Offline
Posts: 76
Post Options Post Options   Quote Charles Quote  Post ReplyReply Direct Link To This Post Topic: Texture Tag
    Posted: 2003 Jul 16 at 1:50am

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?


 

Thanks & Regards,
Charles.
Back to Top
Mikael Sterner View Drop Down
Member
Member


Joined: 2002 Oct 29
Location: Sweden
Online Status: Offline
Posts: 1512
Post Options Post Options   Quote Mikael Sterner Quote  Post ReplyReply Direct Link To This Post Posted: 2003 Jul 23 at 10:26am

You cannot insert the same TextureTag onto several objects at the same time. Move the allocation of the tag into the loop.

(Btw. this is the 2000th post on this new forum... :-)

Mikael Sterner
Developer Support
Back to Top
3D Designer View Drop Down
Member
Member
Avatar

Joined: 2002 Oct 30
Location: Germany
Online Status: Offline
Posts: 1928
Post Options Post Options   Quote 3D Designer Quote  Post ReplyReply Direct Link To This Post Posted: 2003 Jul 23 at 3:01pm

> (Btw. this is the 2000th post on this new forum... :-)

Cool! :) But you still have more posts than me...I´m gonna get you sooner or later >8))

 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.