Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Tag Update ?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 371 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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*

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          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://developers.maxon.net/forum/topic/3688/3126_problem-with-a-refresh

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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

            1 Reply Last reply Reply Quote 0
            • First post
              Last post