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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    get Generator dependencies

    SDK Help
    0
    8
    962
    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
      Helper
      last edited by

      On 27/10/2015 at 09:22, xxxxxxxx wrote:

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

      ---------
      I want to get Caches of all objects, consider this simple case:

        
      \+ HyperNurbs  
      \+ + Cube  
      \+ + Tube  
      

      in this case, HyberNurbs affects the Cube only, and ignores the Tube
      when generating Cache "by iterating all objects", this is what I get:

        
      HyperNurbs Cube Cache  
      Cube Cache    <<< I want to ignore this, as it is a HyberNurbs(generator) dependency  
      Tube Cache  
      

      I want to ignore the Cube Cache, as the Cube itself is already used inside the HyperNurbs, any ideas?

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

        On 28/10/2015 at 03:04, xxxxxxxx wrote:

        so it would be something similar to this "but I didn't find any function that can do this in the SDK, probably I missed?"

          
        BaseObject* a;//our generator  
        BaseObject* b;//any child to the generator a  
        Bool checkdependency(b, a);  
        

        pretty straight forward, any help?

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

          On 28/10/2015 at 03:28, xxxxxxxx wrote:

          I guess I found the solution "but I need a confirmation though, as I think I'm a bit lucky "
          it is:

          BaseObject* op;  
          ...  
          op->GetBit(BIT_CONTROLOBJECT);//this object is used by a generator  
          
          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 28/10/2015 at 07:04, xxxxxxxx wrote:

            Hi Mohamed,

            you are a bit too fast for me.
            Yes, I think, you can use the BIT_CONTROLOBJECT. BUT not directly. In general a generator object will mark it's input objects with the BIT_CONTROLOBJECT. But the generator object has this bit set as well.
            Example (* means BIT_CONTROLOBJECT is set, # means it's not) :

            \+ HyperNurbs  *
            \+ + Poly1 *
            \+ + Poly2 #
            

            looks good so far... next example:

            version a) :
            \+ HyperNurbs  *
            \+ + Cube *
            \+ + Poly #
              
            version b) :
            \+ HyperNurbs  *
            \+ + Poly *
            \+ + Cube *
            

            And with your example:

            \+ HyperNurbs *
            \+ + Cube *
            \+ + Tube *
            

            Now comes the fun part, examine the caches of the generators:

            \+ HyperNurbs *
            \+ + Cube.GetCache() *
            \+ + Tube.GetCache() #
            

            So, yes, you can use the BIT_CONTROLOBJECT to find the information you want, but it can get a bit complicated depending on the cache structure. Remember there are also DeformCaches.

            I hope, it works for you.

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

              On 28/10/2015 at 07:35, xxxxxxxx wrote:

              Hi Andreas,

              thanks for clarifications, it works for me very well "for generators, I get cache first.."
              one related question, how to get the cache of render subdivision

              for example like in HyperNurbs, when I GetCache() for it, it returns the editor subdivison BaseObject.

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

                On 28/10/2015 at 07:42, xxxxxxxx wrote:

                I guess it can be done by using GetCache(HH) , not sure though how should I fill it? "I guess it is filled by the GetCache.."

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

                  On 29/10/2015 at 11:04, xxxxxxxx wrote:

                  Hi Mohamed,

                  you can use ExecutePasses() with the BUILDFLAGS_EXTERNALRENDERER flag.
                  Another option would be to use the Hierarchy class.

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

                    On 29/10/2015 at 16:19, xxxxxxxx wrote:

                    thanks Andreas, you can consider this solved

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