Jump to content

How to paint primitives on a Grid SOP?


magneto

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?

Link to comment
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.

Link to comment
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.

Link to comment
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
Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

  • 7 years later...

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...