Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Fold/Unfold in Object Manager

    SDK Help
    0
    19
    1.7k
    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

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

      On 23/02/2007 at 08:10, xxxxxxxx wrote:

      No comment. 😄

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

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

        On 26/02/2007 at 04:25, xxxxxxxx wrote:

        Hi guys.. not long ago i came across the "Bool GetNBit(LONG bit) const" Function. It is in the manual, and is probably exactly what you need ( if it works correctly 😉 )

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

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

          On 26/02/2007 at 05:34, xxxxxxxx wrote:

          Ah! Then one must also use ChangeNBit() for this. Thanks for the info Michael!....well, if it works 😉

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

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

            On 26/02/2007 at 06:59, xxxxxxxx wrote:

            Already looked at the *NBit() methods. They are for 64-bit bitfields - if that were to have any bearing on a 32-bit version of Cinema 4D, strange.

            How would you use these fields anyway? For instance, the Object Manager fold is represented by four LONG fields. What do you check here - for all of them to be non-zero? No further information.

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

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

              On 26/02/2007 at 07:35, xxxxxxxx wrote:

              That info seems misleading.. it probably just means that you have 64 "flags". You should be able to do sth. like GetNBit(NBIT_OM1_FOLD) or ChangeNBit(NBIT_OM1_FOLD,NBIT_SET
              ) without problems on any architecture. It is not possible to combine the bits though. GetNBit(NBIT_OM1_FOLD | NBIT_OM2_FOLD) is illegal ( see definition of these constants in ge_prepass.h )

              I guess that the four fold bits correspond to the four different object managers.

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

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

                On 26/02/2007 at 08:23, xxxxxxxx wrote:

                It does seem to work.

                But what do you mean by 'the four different object managers'? I know that you can have more than one OM, but have not seen any other type of OM. Oh I see - you can have up to four OMs open (previous descriptions sounded like there could be any number opened).

                I guess that I'll continue in the current vane and just get/set/del all four of them - poor users. 🙂

                Looking at these NBIT fields, do you notice that all (except for the OM ones) are timeline related - ALL of them: TL=TimeLine, FC=F-Curve, CKEY= (well) CKey? The natural question arises - why is the Object Manager folding now tied directly to the TimeLine?

                Thanks,
                Robert

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

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

                  On 26/02/2007 at 08:51, xxxxxxxx wrote:

                  With this information in hand, anyone care to speculate how you would determine which of the four possible OMs (Scene Browsers - I take it from ManagerInfo) is the active one?

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

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

                    On 12/04/2007 at 13:44, xxxxxxxx wrote:

                    Robert -
                    I ran into the same issue you did while doing a tutorial based on 9.6.
                    I'm a newb at scripting in COFFEE and I was able to get most of the script to work by changing CallCommand #'s, the only thing that drives me crazy is the folded hierarchy that SetBit, DelBit, ToggleBit don't seem to phase.  Any results with that other GetNBit function vs. the 4 OM's?   (I don't completely understand the syntax - just hoping you've found something).
                    Dell

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

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

                      On 12/04/2007 at 14:01, xxxxxxxx wrote:

                      This is the code that I'm using (within a TreeViewFunctions that somewhat mirrors the OM - but not exactly). Note that I'm only interested in the one Object Manager and decided not to do it in any others that may be available.

                      //*---------------------------------------------------------------------------*  
                      Bool DoubleClick(void* root, void* userdata, void* obj, LONG col, MouseInfo* mouseinfo)  
                      //*---------------------------------------------------------------------------*  
                      {  
                           BaseObject*          op =               (BaseObject* )obj;  
                           if (!op->IsInstanceOf(Obase))     return FALSE;  
                           BaseObject*          op2 =               op;  
                           op =                                   op->GetUp();  
                           if (!op)                              return TRUE;  
                           // Find first contracted set  
                           while (op)  
                           {  
                      #ifdef     C4D_R10  
                                if (!op->GetNBit(NBIT_OM1_FOLD))     break;  
                      #else  
                                if (!op->GetBit(BIT_OFOLD)) break;  
                      #endif  
                                op = op->GetUp();  
                           }  
                           // If there is a folded object, expand to op2  
                           if (op)  
                           {  
                                // Expand  
                                do  
                                {  
                                     op2 = op2->GetUp();  
                                     if (op2)  
                                     {  
                      #ifdef     C4D_R10  
                                          op2->ChangeNBit(NBIT_OM1_FOLD, NBIT_SET);  
                      #else  
                                          op2->SetBit(BIT_OFOLD);  
                      #endif  
                                     }  
                                } while (op2);  
                           }  
                           // If all parents expanded, contract to first IPP parent  
                           else  
                           {  
                                // Contract  
                                while (op2)  
                                {  
                                     op2->DelBit(BIT_OFOLD);  
                                     op2 = op2->GetUp();  
                                     if (op2 && (op2->GetTag(ID_IPPFIGURETAG) || op2->GetTag(ID_IPPOBJECTTAG)))  
                                     {  
                      #ifdef     C4D_R10  
                                          op2->ChangeNBit(NBIT_OM1_FOLD, NBIT_DEL);  
                      #else  
                                          op2->DelBit(BIT_OFOLD);  
                      #endif  
                                          break;  
                                     }  
                                }  
                           }  
                           EventAdd();  
                           return TRUE;  
                      }
                      
                      1 Reply Last reply Reply Quote 0
                      • H
                        Helper
                        last edited by

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

                        On 12/04/2007 at 14:46, xxxxxxxx wrote:

                        Wow!  Thank you very much Robert.  The code is a bit over my head, so I think I'll just manually expand my resulting hierarchy until I get a better handle on C4D scripting in R10.   At the moment, ChangeNBit doesn't even turn black in my script manager (ie doesn't appear to be a valid member function of Hypernurb or symmetry objects)... 😞
                        The code I'm having trouble with (with redundant debugging here - I've tried both Del and SetBits:
                        ///////////////////PROBLEM AREA.......
                        //hN is a hypernurb object
                        //sym is a symmetry object
                        hN->SetBit(BIT_OFOLD);          // doesn't work R10
                        sym->SetBit(BIT_OFOLD);          // doesn't work R10
                        println("Using SetBit and BIT_OFOLD ");
                        println(hN->GetBit(BIT_OFOLD));
                        hN->DelBit(BIT_OFOLD);
                        sym->DelBit(BIT_OFOLD);
                        println("Using DelBit and BIT_OFOLD ");
                        println(hN->GetBit(BIT_OFOLD));
                        hN->SetBit(NBIT_OM1_FOLD);   //idea from SDK R10,  but doesn't work (64 bit OS only?)
                        sym->SetBit(NBIT_OM1_FOLD);  //idea from SDK R10,  but doesn't work (64 bit OS only?)
                        println("Using SetBit and NBIT_OM1_FOLD ");
                        println(hN->GetBit(NBIT_OM1_FOLD));
                        hN->DelBit(NBIT_OM1_FOLD);
                        sym->DelBit(NBIT_OM1_FOLD);       //appears to set bit for OM1, but doesn't seem to change folding
                        println("NBIT_OM1_FOLD after modification: ");
                        println(hN->GetBit(NBIT_OM1_FOLD));  //confirms FOLD bit change 1 to 0 but no change in display OM
                        //hN->ChangeNBit(NBIT_OM1_FOLD, NBIT_SET); //ChangeNBit apparently not valid member function nH (Hypernurb object)
                        //sym->ChangeNBit(NBIT_OM1_FOLD, NBIT_SET);//or sym (symmetry object)

                        //////////////// .....END PROBLEM AREA

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

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

                          On 12/04/2007 at 15:21, xxxxxxxx wrote:

                          My code is C++ only. Don't know about COFFEE in R10 - it looks to be still R9.5 support only. Hopefully one of the dev support users can provide more information in this case.

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

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

                            On 12/04/2007 at 16:30, xxxxxxxx wrote:

                            Thanks, Robert.  Ah, the assumption I made was that scripting would be similar to plugin C++ syntax.  I thought I could practice with scripts before jumping in to plugins.  I learned something anyway.  Thanks.
                            Dell

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