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

    Subdivision Error

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 306 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 29/08/2009 at 08:41, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :

      ---------
      Here's the code I am using.
      I am trying to get the MDATA_SUBDIVIDE_SUB to pull the number that is entered in to the NUM_SUBDIVISIONS text box to set the number of subdivisions.

      I keep getting this error.

      subdivisiontool.cpp(80) : error C2664: 'String::StringToLong' : cannot convert parameter 1 from 'String' to 'LONG *'

      Anyone have any thoughts?

      Thanks,

      ~Shawn

      > `

        
      \>    
      \>       LONG amount;  
      \>       String subAmount;  
      \>       subAmount = mdat.bc->GetString(NUM_SUBDIVISIONS);  
      \>       amount = String::StringToLong (subAmount);  
      \>    
      \>       //Determine Attributes  
      \>    
      \>            if (mdat.bc->GetBool(HYPERNURBS_SUBDIVISION, TRUE)) //If HyperNURBS is checked  
      \>            {  
      \>            mdat.bc->SetBool(MDATA_SUBDIVIDE_HYPER, TRUE);  
      \>            }  
      \>            else  
      \>            {  
      \>            mdat.bc->SetBool(MDATA_SUBDIVIDE_HYPER, FALSE);  
      \>            }  
      \>            mdat.bc->SetLong(MDATA_SUBDIVIDE_SUB, subAmount);  
      \>           mdat.bc->SetReal(MDATA_SUBDIVIDE_ANGLE, pi);  
      \>              
      \>       //Subdivision Command  
      \>       SendModelingCommand(MCOMMAND_SUBDIVIDE, mdat);   
      \>    
      \>       return true;  
      \>    
      \>  
      

      `

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

        Need more information/code. What is NUM_SUBDIVISIONS defined as in the description resource file (.res)? It would be easier to define it as LONG and then simply get LONG amount = mdat.bc->GetLong(NUM_SUBDIVISIONS).

        I'm not sure why you are getting this value from a ModelingCommandData. Wouldn't it be something entered by the user into the dialog associated with the tool plugin?

        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 29/08/2009 at 20:11, xxxxxxxx wrote:

          okay I ended up just using a LONG instead of a string. so that worked well. Now I'd like to set the default value of a LONG field to contain the number of polygons in the object.

          This is the code I am using to set my default values.

          > `

            
          \>  void SubdivisionTool::InitDefaultSettings(BaseDocument *doc, BaseContainer &data;)  
          \>  {       
          \>       //This function sets the default perameters for the Subdivision Options.  
          \>       PolygonObject* objPoly;  
          \>       objPoly=(PolygonObject* )doc;  
          \>    
          \>       DescriptionToolData::InitDefaultSettings(doc,data);  
          \>       data.SetLong(NUM_SUBDIVISIONS, 1);  
          \>       data.SetLong(HYPERNURBS_SUBDIVISION, TRUE);  
          \>       data.SetReal(MAX_ANGLE, 180);  
          \>       data.SetLong(POLYGON_COUNT, objPoly->GetPolygonCount());  
          \>    
          \>    
          \>  }  
          \>    
          \>  
          

          `

          Setting the polygon count is not working..    What am I doing wrong. This learning curve is killing me. LOL

          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 29/08/2009 at 21:02, xxxxxxxx wrote:

            Solved it thanks,

            ~Shawn

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