Jump to content

Recommended Posts

Is it possible to access primintrinsics in dops? I have Geometry wich is transformed by a sim. For the second rbd sim i want to make the geometry look at a particular direction. For example to its original direction. So I deleted all Attributes from the first sim to prevent side effects and connected it in to the second sim.

To make it look to a direction i want to use the poplookat node (target is direction) in dops. I enabled VEXpression. This is my VEXpression setup:

target = {1,0,0};
refdir = v@xdir;

up = {0,1,0};
refup = v@ydir;

Now i need the original X direction and the Y direction from my Geo.

 

I could convert the primintrinsic "transform" matrix to the directions, but somehow it is not possible to do that in dops.

 

is there any solution?

Share this post


Link to post
Share on other sites

one solution is using a SOPGEO, in some cases a sopsolver also would help.

Share this post


Link to post
Share on other sites
21 hours ago, Varaya said:

Is it possible to access primintrinsics in dops?

@Varaya Packed geometry already give you primintrinsics ... in dops using particles you can access those ..Please post your file and some one with more experiences can help you ..

 

//geometry wranG popforce

f@age += @TimeInc;
int i = chi('activate');
if (i == 1) {

//measure distance between point and rest
vector p1 = point(0,"P", @ptnum);
vector p2 = point(1,"P", @ptnum);
vector pivot = primintrinsic(1,"pivot", @primnum);
setprimintrinsic(0, "pivot", @primnum, pivot, "set");
float dist = distance(p1,p2);

if (dist < (1+@age/3)) {
    //set mix value
    float mix = .1;
    f@mix += mix;
    // blend transformation matrix
    matrix m1 = getpackedtransform(0, @primnum);
    matrix m2 = getpackedtransform(1, @primnum);
    matrix m3 = slerp(m1,m2,mix);
    setpackedtransform(0,@primnum, m3);
    //deactivate stuff
    if (dist < .3) @active = 0;
    if (@mix > 5) @group_ignore = 1;
    
    }

    
}

 

colggg.gif

Share this post


Link to post
Share on other sites

@Librarian your code is pretty helpful i think. But can you share your node setup, so i can view the code in context? Im not experienced enough to get it work. Thank you :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×