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

    object is clone??

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 432 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 06/05/2009 at 13:13, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   r11 
      Platform:      
      Language(s) :     C++  ;

      ---------
      hey there,

      is it possible to check within one object plugin if it is cloned or not? I have one plugin which creates clones of a child object. now I have another objectplugin which can be used as a child of the first one, too. and i'd like to change the random seed for each of the cloned objects..

      this is how i am currently trying it (change the seed of the child from the parent object) and somwhow the seed is changed, but it seems the seed is the same for each clone, no matter that I pass different seeds (seed+i), where seed is the seed of the current object and i is the iterator

      > `

        
      \>  bc = clone->GetDataInstance();  
      \>  bc->SetLong(SEED,bc->GetLong(SEED) + i + seed);  
      \>  
      

      `

      any help appreciated..

      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 07/05/2009 at 08:41, xxxxxxxx wrote:

        Hi,

        i guess you could just set a flag in the BaseContainer of your clones, so you would always know if it was created by your plugin.

        > \> bc = obj->GetDataInstance(); \> bc->SetBool(IS_A\_CLONE,TRUE); \>

        ofc you have to define IS_A_CLONE in your res files, like you probably did with SEED.

        About your seed always being the same, there's probably some small error in your loop. Just recheck it or post some more code 😉

        greetings,
        Daniel

        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 07/05/2009 at 10:35, xxxxxxxx wrote:

          thank you!

          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 07/05/2009 at 10:59, xxxxxxxx wrote:

            btw, i guess i understand the issue with the seed. i am using a shared random function and the Random is initialised there, too. i guess it'll be better to create the Random inside every object..

            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 07/05/2009 at 12:20, xxxxxxxx wrote:

              when i do random stuff, i have one 'Random r' as private variable of my plugin, which I init in the plugins Init() function with:

              r.Init(GeGetTimer());

              whenever i need some random value i just call

              r.Get01() to get a value between 0 and 1
              or
              r.Get11() * 100 for example, to get a value between -100 and 100

              greetings,
              Daniel

              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 07/05/2009 at 13:05, xxxxxxxx wrote:

                thank you very much! now it works...

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