Change object position by tag's param



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

    On 02/04/2005 at 22:56, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   9.1 
    Platform:   Windows  ;   
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    How to change object position after the change position value of tag aligntospline in the while circle?

    main(doc,op)
    {
    var obj_master = doc->FindObject("master");
    var obj_slave = doc->FindObject("slave");

    var pos_master = obj_master->GetMg()->GetV0();
    var pos_slave = obj_slave->GetMg()->GetV0();

    var pos=0;

    var dist=0;
    var i=0;
    dist=vlen(pos_master-pos_slave);
    println("start dist is ",dist);
    while ((dist>100)&&(i<15))
    {
         pos+=0.05;
    obj_slave->GetFirstTag()#ALIGNTOSPLINETAG_POSITION=pos;
    //******************************************************
    //In this point position of "slave" must be changed but it not happened :(
    //*****************************************************
    pos_master = obj_master->GetMg()->GetV0();
    pos_slave = obj_slave->GetMg()->GetV0();
    dist=vlen(pos_master-pos_slave);
    i++;
    println(dist," ",pos);
    }

    }



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

    On 10/04/2005 at 14:58, xxxxxxxx wrote:

    Unfortunately it's not possible to control the execution from within a single C.O.F.F.E.E. tag like that. One possibility would be to put all of the script in a single menu plugin or similar, and then use EventAdd() to force the scene to redraw. Another way might be to split the script into two tags and make one of the execute before the align tag and the other after, thought I'm not sure how to get the loop effect that way. A third way would be to implement the align-to-spline functionality yourself using SplineObject functions. Probably not possible if you need a 100% match.


Log in to reply