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

    DependenceList Issue

    Scheduled Pinned Locked Moved SDK Help
    11 Posts 0 Posters 799 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 18/05/2009 at 12:52, xxxxxxxx wrote:

      hm, anyone? i still didnt manage to solve this problem

      thanks,
      ello

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

        this is how i can hide the childs child;

        > `

          
        \>       if (child)  
        \>       {  
        \>            main->AddDependence(hh, child);  
        \>            main->TouchDependenceList();  
        \>            if (child->GetDown())  
        \>            {  
        \>                 main->AddDependence(hh, child->GetDown());  
        \>                 main->TouchDependenceList();  
        \>            }  
        \>       }  
        \>  
        

        `

        but if i cannot endlessly go deeper tis way. there must be another solution

        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 19/05/2009 at 03:46, xxxxxxxx wrote:

          Look into the SDK and search for GetAndCheckHierarchyClone()

          Greetings,
          Jack

          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 21/05/2009 at 15:19, xxxxxxxx wrote:

            ok, after checking the GetAndCheckHierarchyClone... i got the dependencies working for nested pluginobjects properly but always the child of the nested object isnt hided anymore. what do i need to do that none of those child objects is visible (without using SetEditorMode/SetRenderMode )??

            thanks for your patience 🙂

            cheers,
            ello

            code at the beginning regarding the dirty thing:

            > `

              
            \>       //walk thru childs and set dependence        
            \>       BaseObject* tp = NULL;  
            \>       Bool dirty=FALSE;  
            \>       dirty = op->CheckCache(hh) || op->IsDirty(DIRTY_DATA|DIRTY_CHILDREN);  
            \>       if (!dirty)   
            \>       {  
            \>            op->NewDependenceList();  
            \>            for (tp=child;tp;tp=tp->GetNext())   
            \>            {  
            \>                 op->AddDependence(hh,tp);     
            \>            }       
            \>       }            
            \>       dirty = dirty || !op->CompareDependenceList();  
            \>       if (!dirty)  
            \>       {          
            \>            blDelete(main);   
            \>            op->TouchDependenceList();  
            \>            return op->GetCache(hh);  
            \>       }  
            \>  
            

            `

            at the end of the generator (right before the return main;) i have this code:
            > `

              
            \>         
            \>       op->NewDependenceList();   
            \>       child = op->GetDown();  
            \>       for (tp=child;tp;tp=tp->GetNext())   
            \>       {  
            \>            op->AddDependence(hh,tp);  
            \>       }       
            \>       op->TouchDependenceList();  
            \>       return main;  
            \>  
            

            `

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

              Hm, don't know because I do it totally different in my plugin. I never used TouchDependencyList 😉 Maybe you'll have to iterate the hierarchy and touch all children yourself.

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

                GetAndCheckHierarchyClone() does use it, so i thought its a good idea.. i'll do some more tests what happens when i remove it, but u thought it belongs there to hide the childs

                i'll try the iterating again, maybe i did something wrong last night

                thanks for your input

                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 22/05/2009 at 09:28, xxxxxxxx wrote:

                  well, CompareDependenceList needs to be there, otherweise even the first child isnt hidden.

                  iterating the hierarchy doesnt help, or is this the wrong was to do so?

                  > `

                    
                  \>            op->NewDependenceList();  
                  \>            for (tp=child;tp;tp=tp->GetNext())   
                  \>            {  
                  \>                 op->AddDependence(hh,tp);               
                  \>                 BaseObject *tp2 = tp->GetDown();  
                  \>                 if (tp2)  
                  \>                 {  
                  \>                      for (tp2=tp;tp2;tp2=tp2->GetNext())  
                  \>                      {     
                  \>                           op->AddDependence(hh,tp2);  
                  \>                      }        
                  \>                 }  
                  \>            }  
                  \>  
                  

                  `

                  dowsnt work if i Touch them by myself, too:
                  > `

                    
                  \>            BaseObject *tp2 = tp->GetDown();  
                  \>            if (tp2)  
                  \>            {  
                  \>                 for (tp2=tp;tp2;tp2=tp2->GetNext())  
                  \>                 {     
                  \>                      tp2->Touch();  
                  \>                 }        
                  \>            }  
                  \>  
                  

                  `

                  any help here appreciated.. as its a bit frustrating 🙂

                  cheers,
                  ello

                  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 26/05/2009 at 02:47, xxxxxxxx wrote:

                    It looks like your are not going through all of the children objects. Here is some simple working sample code:

                    > \> void StepThru(BaseObject \*op, BaseObject \*child, HierarchyHelp \*hh, LONG &childcnt;) \> { \>      while (child && !child->GetBit(BIT_CONTROLOBJECT)) \>      { \>           op->AddDependence(hh, child); \> \>           StepThru(op, child->GetDown(), hh, childcnt); \> \>           child = child->GetNext(); \> \>           childcnt++; \>      } \> } \> \> // create morphed object \> BaseObject \*MorphMixerObject::GetVirtualObjects(PluginObject \*op, HierarchyHelp \*hh) \> { \>      BaseObject \*pp = NULL, \*child = NULL; \>      child = op->GetDown(); \>      if (!child) return NULL; \> \>      // start new list \>      op->NewDependenceList(); \> \>      // check cache for validity and check master object for changes \>      Bool dirty = op->CheckCache(hh) || op->IsDirty(DIRTY_DATA); \> \>      LONG childcnt = 0; \> \>      //step thru all children \>      StepThru(op, child, hh, childcnt); \> \>      // if child list has been modified somehow \>      if (!dirty) dirty = !op->CompareDependenceList(); \> \>      // mark child objects as processed \>      op->TouchDependenceList(); \> \>      // if no change has been detected, return original cache \>      if (!dirty) return op->GetCache(hh); \> \>      GePrint(LongToString(childcnt)); \> \>      return BaseObject::Alloc(Onull); //return your generated object \> } \>

                    cheers,
                    Matthias

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

                      Yes, some good old recursing action! To understand recursions, you first have to understand recursions. But once that's done, they're fun 🙂

                      Cheers,
                      Jack

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

                        wow, thank you so much Matthias, after some changes it works so cool! and it helps to understand the principle much better because it is so clean.

                        cheers,
                        Ello

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