Sweep Nurbs in SDK



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

    On 31/05/2006 at 07:56, xxxxxxxx wrote:

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

    ---------
    Hi,
    Can anybody explain me how to use the Sweep Nurbs in the C4D SDK?
    Thank you.
     
    B->



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

    On 03/06/2006 at 23:30, xxxxxxxx wrote:

    You use them just like in the main application: create a Sweep NURBS and put at least two splines in it. To do this you need to use BaseObject::Alloc() and BaseDocument::InsertObject(), and some functions to create the splines. It might be easier to help you if you describe more completely what you want to do.



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

    On 05/06/2006 at 23:26, xxxxxxxx wrote:

    Hi,
    Need some advice/support here.  Trying to develop a simple plugin that will duplicate an existing cube along a "Circle" spline.  I used the below code.  The Duplicate works giving me the Cube copies, however the Duplicate Mode-Along Spline does not.  So I end up with copies on the same location.  Am I using the correct method/parameters? 
       var doc = GetActiveDocument();
       var bc = new(BaseContainer);
       var obj = doc->FindObject("Cube");
       bc->SetData(MDATA_DUPLICATE_COPIES, 8);
       bc->SetData(MDATA_ARRANGE_MODE_ALONGSPLINE, true);
       bc->SetData(MDATA_ARRANGE_SPLINE_PERSTEP, true);
       bc->SetData(MDATA_ARRANGE_SPLINE_USE_MOVE, true);
       bc->SetData(MDATA_ARRANGE_SPLINE_LINK, "Circle");
       bc->SetData(MDATA_ARRANGE_SPLINE_STARTPOS, 0);
       bc->SetData(MDATA_ARRANGE_SPLINE_ENDPOS,100);
       bc->SetData(MDATA_ARRANGE_SPLINE_USE_ROTATION, true);
       bc->SetData(MDATA_ARRANGE_SPLINE_ALIGNTANGENTIAL, "+Z");
       var result = SendModelingCommand(ID_MODELING_DUPLICATE_TOOL,doc,obj,bc,MODIFY_ALL);
    Thank you.



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

    On 06/06/2006 at 00:44, xxxxxxxx wrote:

    Thank you,
     
    The Sweep NURBS works fine now.
    What we wanted to do is to simulate a river that follow a river's bed
    on a custom fractal terrain generator plugin ;)



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

    On 09/06/2006 at 08:35, xxxxxxxx wrote:

    Hi,
    About the DUPLICATE/ARRANGE commands, 8 copies is only to try out the code.  I am looking at more than 80 copies.  :)
    Can someone help me or give me some advice?
    Thanks.
    ________
    wengkit



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

    On 15/06/2006 at 22:55, xxxxxxxx wrote:

    Use:

        
        
        bc->Set **Object** (MDATA_ARRANGE_SPLINE_LINK, circleObject);
    

    Setting the name directly like you did won't work. You can find circleObject by doc->FindObject("circle"). Btw, this looks like C.O.F.F.E.E., not C++?!



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

    On 17/06/2006 at 07:27, xxxxxxxx wrote:

    Hi Mikael,
    Thanks for your advice.  Based on that, I used:
    > var circleObject = doc->FindObject("Circle");
    >
    > bc->SetObject(MDATA_ARRANGE_SPLINE_LINK, circleObject);
    >
    before calling the SendModelingCommand() API as per my earlier post on 05 June.  However, it still did not work.  Could not get the Cube copies on the spline.  Any idea?
    Many thanks.
     
    -------------
    wengkit



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

    On 27/06/2006 at 03:39, xxxxxxxx wrote:

    Sorry for not testing your code. There were some other errors. This is a working example:

        
        
           var bc = new(BaseContainer);  
           var obj = doc->FindObject("Cube");
        
        
        
        
           var circleObject = doc->FindObject("Circle");   
           bc->SetData(MDATA_DUPLICATE_COPIES, 8);  
           bc->SetData(MDATA_ARRANGE_MODE, MDATA_ARRANGE_MODE_ALONGSPLINE);  
           bc->SetData(MDATA_ARRANGE_SPLINE_PERSTEP, true);  
           bc->SetData(MDATA_ARRANGE_SPLINE_USE_MOVE, true);  
           bc->SetData(MDATA_ARRANGE_SPLINE_USE_MOVE_X, true);  
           bc->SetData(MDATA_ARRANGE_SPLINE_USE_MOVE_Y, true);  
           bc->SetData(MDATA_ARRANGE_SPLINE_USE_MOVE_Z, true);  
           bc->SetObject(MDATA_ARRANGE_SPLINE_LINK, circleObject);  
           bc->SetData(MDATA_ARRANGE_SPLINE_STARTPOS, 0.0);  
           bc->SetData(MDATA_ARRANGE_SPLINE_ENDPOS, 1.0);  
           bc->SetData(MDATA_ARRANGE_SPLINE_USE_ROTATION, true);  
           bc->SetData(MDATA_ARRANGE_SPLINE_ALIGNTANGENTIAL, MDATA_ARRANGE_SPLINE_ALIGNTANGENTIAL_Z);  
           var result = SendModelingCommand(ID_MODELING_DUPLICATE_TOOL,doc,obj,bc,MODIFY_ALL);
    

    I suggest that you look at toolarrange.res to see where I found the correct constants to use. Also PERCENT = 0.0 to 1.0.



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

    On 28/06/2006 at 23:53, xxxxxxxx wrote:

    Hi Mikael,
    Thanks for your reply, it is a great help.  Your suggestion has open some very useful 'doors' to a newbie like me. 
    ------------------
    wengkit


Log in to reply