Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

logix1390

Connectivity and Foreach problem

Hi everyone,

I stumbled across a small problem. I have a few basic assets with geometry copied onto the points .

I want to run a foreach on these assets and be able to see the asset as a whole so that I can manipulate it.

However, the foreach only reveals only one part of that asset (the geometry copied onto the points of that particular asset). I understand that the connectivity is separating each connected geometry and giving it an attribute called "class", which makes sense.

but in this situation I would like to view the asset as a whole (including the copied geo) inside the foreach. 

I have attached my scene file if you want to take a quick look.

Thank you!

grouping_connectivity_problem.hip

Share this post


Link to post
Share on other sites

Pin your viewport before entering the foreach. It's the leftmost icon above where you select your camera. 

Share this post


Link to post
Share on other sites

Either as Woodenduck says, pin your Scene View.
Or you can use the new for each loop and just preview the End Block.

Share this post


Link to post
Share on other sites

Thats not exactly the issue here.. I need to be able to manipulate the geometry inside the foreach after I merge all the assets together.

Edited by logix1390

Share this post


Link to post
Share on other sites

i would discourage you from using old style of for each loops (the one where you have to dive inside the node). it is a legacy feature and is not developed any longer. the new one is much more straightforward anyway even if it takes some time to get used to the different approach.

in any case, you can always put a template flag at null (or any node) after your loop and look at that while working with the nodes inside of the loop (so you can see both at the same time). you can change the way how template geometry is displayed (in Display options) if default display style is not what you want (press D when hovering mouse over the viewport)

Edited by davpe

Share this post


Link to post
Share on other sites

davpe  I know how to template geometry lol. I am trying to manipulate the geometry inside the foreach... but not just one part of the geometry  as you can see in the file.

 

Share this post


Link to post
Share on other sites

sry for stating the obvious... you never know :) anyway, I suggest you using a new looping method with a template flag. that's what you want. with the old looping method, use two scene views. one with a pin outside of the loop.

Share this post


Link to post
Share on other sites

I'm not sure about what you are trying to do ?

the foreach is behaving as expected, you've got access to each set of connected primitives at a time.

If you want to work on the whole "asset" (just confirming we are talking about 'torus + boxes' or 'boxes + spheres', anything coming out of the ASSET_MDL) you have to define your class attribute per asset, not per set of connected primitives.
Add an attribwrangler set on primitive mode before each one of your black nulls and define a class attribute manually per asset: @class = 0; // or @class = 1; etc,

But in that case I don't understand why you want to go through a foreach approach and not do your operations before the merge.

Share this post


Link to post
Share on other sites

Thank you iamyog. That is exactly what I am trying to do. I need a class attribute for the whole asset (Torus+boxes etc..) I will try this method.

I am basically trying to make a procedural village and have come across this problem.

Thanks again.

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