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

    Subdivide

    SDK Help
    0
    26
    14.5k
    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 03/09/2009 at 20:14, xxxxxxxx wrote:

      LOL..   obviously the obvious eludes me some times. HAHA..

      Do I fill it the way it is declared?

      like this.

      DoCommand(ModelingCommandData &mdat;);

      or do I need something else in the parenthesis?

      LOL. thank you for you patience with this noob.

      ~Shawn

      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 03/09/2009 at 20:27, xxxxxxxx wrote:

        Like this unless you have another mdat you have already alotted for this:

        > Bool SculptTool::Message(BaseDocument\* doc, BaseContainer& data, LONG type, void\* t_data) \> { \> switch (type) \>      { \>           case MSG_DESCRIPTION_COMMAND: \>           { \>           DescriptionCommand \*dc = (DescriptionCommand\* ) t_data; \>           if (dc->id[0].id==COMMAND_SUBDIVIDE) \>                { \>                GePrint("Subdivide Button Clicked"); \>                ModelingCommandData     mdat; \>                DoCommand(mdat); \>                } \>           } \>      } \>      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 03/09/2009 at 20:31, xxxxxxxx wrote:

          HAHA.. WOW.. that couldn't be more obvious..   LOL

          thanks Robert. Not sure what time it is where you are but it's 11:30 PM here in NY.    I'm obviously tired..

          Thanks again.

          ~Shawn

          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 03/09/2009 at 20:36, xxxxxxxx wrote:

            Okay. so now it calls the DoCommand function but as soon as it does, C4D crashes out...

            Do you see anything in this code that would cause C4D to crash?

            > `

              
            \>  Bool SculptTool::DoCommand(ModelingCommandData &mdat;)  
            \>  {  
            \>    
            \>  //CODE RELATED TO THE SUBDIVISION OPTIONS/////////////////////////////////  
            \>    
            \>       //Define Variables  
            \>    
            \>      PolygonObject *objPoly = ToPoly(mdat.doc->GetActiveObject());  
            \>    
            \>       //Determine Attributes  
            \>    
            \>       if (mdat.bc->GetBool(HYPERNURBS_SUBDIVISION, TRUE)) //If HyperNURBS is checked  
            \>       {  
            \>       mdat.bc->SetBool(MDATA_SUBDIVIDE_HYPER, TRUE); //Set HyperNURBS subdivision  
            \>       }  
            \>       else  
            \>       {  
            \>       mdat.bc->SetBool(MDATA_SUBDIVIDE_HYPER, FALSE); //Disable HyperNURBS subdivision  
            \>       }  
            \>       mdat.bc->SetLong(MDATA_SUBDIVIDE_SUB, mdat.bc->GetLong(NUM_SUBDIVISIONS)); //Set Number of Subdivisions  
            \>       mdat.bc->SetReal(MDATA_SUBDIVIDE_ANGLE, mdat.bc->GetReal(MAX_ANGLE)); //Set Maxiumum Angle  
            \>              
            \>       //Subdivision Command  
            \>       SendModelingCommand(MCOMMAND_SUBDIVIDE, mdat);  
            \>       mdat.bc->SetLong(POLYGON_COUNT, objPoly->GetPolygonCount());  
            \>         
            \>       return TRUE;  
            \>    
            \>  //END SUBDIVISION OPTIONS/////////////////////////////////////////////////  
            \>    
            \>    
            \>  }  
            \>    
            \>  
            

            `

            Thanks,

            ~Shawn

            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 03/09/2009 at 20:41, xxxxxxxx wrote:

              After you get objPoly, check that it isn't NULL:

              if (!objPoly) return FALSE;

              Also, make sure that the mdat.bc is set to a BaseContainer. I'd do this in Message after declaring mdat. Declare a BaseContainer and add it:

              BaseContainer bc;
              mdat.bc = bc;

              You may also want to set your input BaseContainer value (HYPERNURBS_SUBDIVISION).

              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 03/09/2009 at 20:59, xxxxxxxx wrote:

                now I have this in Message()

                > `

                  
                \>  Bool SculptTool::Message(BaseDocument* doc, BaseContainer& data, LONG type, void* t_data)  
                \>  {  
                \>    
                \>  switch (type)  
                \>       {  
                \>            case MSG_DESCRIPTION_COMMAND:  
                \>            {  
                \>            DescriptionCommand *dc = (DescriptionCommand* ) t_data;  
                \>            if (dc->id[0].id==COMMAND_SUBDIVIDE)  
                \>                 {  
                \>                 GePrint("Subdivide Button Clicked");  
                \>                 ModelingCommandData mdat;  
                \>                 BaseContainer* bc;  
                \>                 mdat.bc = bc;  
                \>              DoCommand(mdat);  
                \>                 }  
                \>            }  
                \>       }  
                \>       return TRUE;  
                \>  }  
                \>  
                

                `

                and this is the error.

                warning C4700: uninitialized local variable 'bc' used

                I assume there is more I have to do to the basecontainer.

                🙂
                ~Shawn

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

                  Don't use a pointer to it, just declare it as I did above. 🙂

                  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 03/09/2009 at 21:25, xxxxxxxx wrote:

                    hmm.. now I get this.

                    error C2440: '=' : cannot convert from 'BaseContainer' to 'BaseContainer *'

                    after changing

                    BaseContainer* bc;

                    to

                    BaseContainer bc;

                    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 03/09/2009 at 21:37, xxxxxxxx wrote:

                      mdat.bc = &bc;

                      That will do it.

                      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 03/09/2009 at 21:43, xxxxxxxx wrote:

                        yes it did. Thanks a lot Robert.

                        Off to bed now.

                        Thanks for your help.

                        ~Shawn

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