Community
Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

runtime evaluation with bifrost

2 REPLIES 2
Reply
Message 1 of 3
batarg
212 Views, 2 Replies

runtime evaluation with bifrost

my goal is to recreate autorotate evaluation in bifrost like i made it with expressions.

expression example:

given:

locator1 - driver

locator2 - driven

locator1 has custom created double3 attribute that stores position

 

// get previous position
vector $a = <<
	locator1.lastPosX,
	locator1.lastPosY,
	locator1.lastPosZ
>>;

// get cur position
vector $b = <<
	locator1.translateX,
	locator1.translateY,
	locator1.translateZ
>>;
// delta (direction)
vector $dir = $b - $a;

// apply new position
locator2.translateX = $dir.x;
locator2.translateY = $dir.y;
locator2.translateZ = $dir.z;

// store new position
locator1.lastPosX = $cur_pos.x;
locator1.lastPosY = $cur_pos.y;
locator1.lastPosZ = $cur_pos.z;

 

 

what it does - its updating driven object while you drag driver

 

how to recreate this in bifrist graph editor?

 

2 REPLIES 2
Message 2 of 3
Roland.Reyer
in reply to: batarg

I believe what you're trying to do is this:

Use "port feedback" to store the last position for the next iteration.

 

If you RMB on a port of the output you can choose a "port feedback" on the input to connect it to.

 

In this example (inside a simple compound) "position" goes into "last_position1".

In the next iteration this "last_position1" will show up on the input "last_position" and you can use it e.g. in the subtraction.

 

feedback_ports.jpg

 

 

 

Message 3 of 3
batarg
in reply to: Roland.Reyer

wow! i will try it as soon as possible thank you very much!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report