Jump to content
magneto

How to paint primitives on a Grid SOP?

Recommended Posts

Hi,

I have learnt about the Paint SOP a while ago, and now I actually needed a way to paint primitives to later identify them.

So for instance say you have a 10x10 Grid. I want to be able to paint on this, by roughly painting on their center, instead of painting on top of points. So I want to use 1 brush to mark them as grass, another brush to mark them as rock, another to mark them as water, etc.

If I could do it just like I can paint points, then I could use different colors to differentiate them. But it seems like Paint SOP adds attributes to points, right?

Is there a way to accomplish this?

Share this post


Link to post
Share on other sites

Hi,

I have learnt about the Paint SOP a while ago, and now I actually needed a way to paint primitives to later identify them.

So for instance say you have a 10x10 Grid. I want to be able to paint on this, by roughly painting on their center, instead of painting on top of points. So I want to use 1 brush to mark them as grass, another brush to mark them as rock, another to mark them as water, etc.

If I could do it just like I can paint points, then I could use different colors to differentiate them. But it seems like Paint SOP adds attributes to points, right?

Is there a way to accomplish this?

I'm not sure if you can directly paint the primitives, but you can use a attribute promote after your paint sop, and change your Cd from Point to Primitive.but it's not exactly what you want.

Share this post


Link to post
Share on other sites

I'm not sure if you can directly paint the primitives, but you can use a attribute promote after your paint sop, and change your Cd from Point to Primitive.but it's not exactly what you want.

I did it so that I overrode Color (Cd), then used a Group SOP to select the prims but yeah this gives me prims if all of its points are painted. I could probably do it so that if any of its points are painted, it would include the prim. But this requires painting on verts and will add more prims than desired. I explain the use case below.

why can't you just group the prims then colour by group?

I could do that but this DA I want to make, I want to give artists the ability to paint on any prims and populate them with the right models. So they will have the control to paint on any prim, anything they want as defined by what type of brush it is.

Share this post


Link to post
Share on other sites

I think in order to make it work perfectly, you need some python coding, or at least I don't know any other way. But a hack could be this, use a facet sop before your paint sop, and check the unique points in it, and then paint, and after that, use a attribpromote and change promotion method to maximum. if you make a new attribute that gets a value of 1 when your color attribute is bigger than 0, then I think that would work.

Edited by ehsan parizi

Share this post


Link to post
Share on other sites

I think in order to make it work perfectly, you need some python coding, or at least I don't know any other way. But a hack could be this, use a facet sop before your paint sop, and check the unique points in it, and then paint, and after that, use a attribpromote and change promotion method to maximum. if you make a new attribute that gets a value of 1 when your color attribute is bigger than 0, then I think that would work.

Thanks Ehsan. I wasn't aware of attribpromote. But what's the use of Facet SOP here? I am not sure, just wondering.

Also another thing that I was thinking is if I could get each prim in the Grid and place a point in the center of them that divides them and creates 4 extra edges. Is there a SOP for this? I am gonna see if there is a way to do this too.

Share this post


Link to post
Share on other sites

each primitive by default is sharing some points with neighbour prims, facet sop in this case, creates unique points for each primitive. so each primitive has its own unique points that is not sharing with other prims.

check out the attached file.

I don't know about that, but try divide sop, maybe that helps.

color_prims.hipnc

Share this post


Link to post
Share on other sites

you're welcome. good luck with your digital asset.

by the way, if you want to use that method, you probably have to change the value of the attribute that you create to if($CR>0.3,1,0) from if($CR>0,1,0) because if you wanna delete the color, that would work better.

Share this post


Link to post
Share on other sites

Im doing the same thing :D but I left this to later time, to learn more stuff.

Share this post


Link to post
Share on other sites

Awesome Tom, I will be sure to check it out for ideas ;)

I downloaded the first file and painted on the grid but didn't see any change. Is it supposed to be a non-interactive tool?

Share this post


Link to post
Share on other sites

Its half-interactive, you need to template last node to see result.

Seems i uploaded non working version, you can fixit by just chosing "select" group un scatter points node.

Here is working version, check also old school hip files :)

GRASS_GEN_v1.hipnc

Share this post


Link to post
Share on other sites

Its half-interactive, you need to template last node to see result.

Seems i uploaded non working version, you can fixit by just chosing "select" group un scatter points node.

Here is working version, check also old school hip files :)

Your sample looks pretty good. I will check old school's files as well.

Thanks Tom.

Share this post


Link to post
Share on other sites

I know it's been a minute since the thread was active, but I kind of have the same problem and was wondering what you

ended up doing to paint on the primitives.
 

I basically paint boxes on a surface and depending on the attributes I paint, they have a different look. So far I've used

the draw curve tool to paint curves and added custom parameters in the multiparm of the draw curve tool. This works fine,

but the more curves I draw, the more tedious it gets to go through the tabs and change the attributes.

That's why I though to use the Paint Tool to pick the attribute values beforehand and paint them onto the primitives. Now

I realize that you can't actually do that and am looking for a workaround.

Google keeps pointing me to this thread, so I thought I'd ask here.

So, do you have any new insides on this?

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

×