Tag Update ?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 13/12/2010 at 06:48, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   11.5 
    Platform:   Windows  ;   
    Language(s) :   C.O.F.F.E.E  ;   XPRESSO  ;

    ---------

    Hi Guys, I'm new to this Forum. 🙂I have a question. I wrote a script which sets random offset values to the first texturetag on Objects. Then next Objecfs follow. Everything works fine, but when the values have been set, to get the Editor updated, all Tags have to be selected individually.I already tried
    > doc->MultiMessae(MSG_UPDATE);
    and
    > obj_tag->Message(MSG_UPDATE);
    while obj_tag is the iterated Tag.
    Using this will cause only the first and last of the iterated Tags get updated.
    Can someone help me ?Here the script in a more simple way. Look whats (not) happening after using the Script and when you click on the tags. Dont forget to use more than 2 Objects.
    >
    >
    > var obj = doc->GetActiveObject();
    > if (!obj) return false;
    >
    > var obj_tag = obj->GetFirstTag();
    > if (!obj) return false;
    >
    > var i = 1;
    >
    > while (obj) {
    >
    > var bc = obj_tag->GetContainer();
    > bc->SetData(TEXTURETAG_OFFSETX, i*1.05);
    > bc->SetData(TEXTURETAG_OFFSETY, i*2.36);
    > obj_tag->SetContainer(bc);
    >
    > obj = obj->GetNext();
    > if (!obj) return false;
    > i++;
    >
    > obj_tag = obj->GetFirstTag();
    > while (obj_tag && !instanceof(obj_tag, TextureTag) {
    >   obj_tag = obj_tag->GetNext();
    >   if (!obj_tag) return false;
    > }
    > }
    >
    >
    >
    Thanks in advance.nux
    PS: is it true that you can write plugins for C4D in Java, too ?
    PS²: Oh i think i postet in the wrong subdirectory 😊*mod call*



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/12/2010 at 08:47, xxxxxxxx wrote:

    Why can i not edit the Post ? 😲

    Anyway, sorry tht sth went wrong copying the script. Here the working script.

    var obj = doc->GetActiveObject();
    if (!obj) return false;

    var obj_tag = obj->GetFirstTag();
    if (!obj) return false;

    var i = 1;

    while (obj) {

    var bc = obj_tag->GetContainer();
    bc->SetData(TEXTURETAG_OFFSETX, i*1.05);
    bc->SetData(TEXTURETAG_OFFSETY, i*2.36);
    obj_tag->SetContainer(bc);

    obj = obj->GetNext();
    if (!obj) return false;
    i++;

    obj_tag = obj->GetFirstTag();
    while (obj_tag && !instanceof(obj_tag, TextureTag)) {
      obj_tag = obj_tag->GetNext();
      if (!obj_tag) return false;
    }
    }

    But the problem is still the same. Tags in between the first and last Object dont get updated automatically.

    Greets nux



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/12/2010 at 16:10, xxxxxxxx wrote:

    Hello Nux,

    Take a look here:
    https://plugincafe.maxon.net/topic/3688/3126_problem-with-a-refresh



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 15/12/2010 at 00:28, xxxxxxxx wrote:

    So using SetParameter should be the solution ?
    I don't know how to use it and i can't find anything about it in the SDK Documentation.

    Thanks either 😄

    greets nux

    //edit:
    Ha i found a way without using any function 🙂
    In Java its called PointNotation its kinda like that here just with an # 😉

    tag#TEXTURETAG_OFFSETX = Offsetx;

    and there is no problem in update. :)

    //edit:
    Here the full Skript for download if someone is interested [German Forum]

    http://www.psd-tutorials.de/modules/Forum/176_c4d-plug-ins-und-externe-render/120696-offset-randomizer-coffee-script.html#post1652738


Log in to reply