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: 

How to increment a value inside iterator or for-each loop

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
pranaymeher
445 Views, 2 Replies

How to increment a value inside iterator or for-each loop

Hey guys, I stumbled upon this issue but could not solve it. Basically I wanted to increment a value inside an iterator block or for-each block. I know for-each is a parallel block, so it's not a good choice. I'm also know how to use the feedback ports to update the existing attribute values. But Bifrost errors when I use feedback port inside an iteration block. To simply put it, I want to graph the following python code in Bifrost. 

 

import maya.cmds as MC

value = 5

for i in range(5):
    value += (value/2)

print value
# Result : 33

 

If anyone knows how to do it then please share with me. Thank you.

2 REPLIES 2
Message 2 of 3
mjcg91
in reply to: pranaymeher

What you are looking for is a port state. It is available in do-while and iterate loom compounds.

 

port_state.jpg

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 3 of 3
pranaymeher
in reply to: mjcg91

Thanks a lot for the reply @mjcg91. That's exactly what I was looking for. The naming 'port_state' doesn't make sense but as long as it does what it does, its good.

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

Post to forums