Hello.I am a new user to Houdini.
I imported an unwrapped model (In UDIM format) . I then Painted on the object in MARI for preparing it to scatter on the locations where there is color(Black). I Imported them in Houdini and got them on my object using attribute to MAP.
My object now has the paint. I want to know how do I scatter on the specific black color only and nowhere else?
How do you scatter objects based on color MAP
4507 2 2-
- abhi12344
- Member
- 1 posts
- Joined: March 2018
- Offline
-
- neil_math_comp
- Member
- 1743 posts
- Joined: March 2012
- Offline
If you have the colour as a Cd attribute, you can, in an Attribute Wrangle, do something like:
Then, you can enable the Density Attribute option on the Scatter SOP. If you have a texture map as a regular image file, (sorry, no direct UDIM support in the Scatter SOP), you'll want where you want points to be scattered to be white, and where you don't want points to be scattered to be black, so you may need to invert the image. You can then set Generate to “In Texture Space”, and crank up the Density Scale. (It will probably need to be in the 10,000's to 100,000's range, since it's the average number of points scattered into the unit square of texture space.)
Hopefully one of those works for you!
// Make dark areas 1.0, and everywhere else 0.0 @density = (length2(v@Cd) < 1e-4) ? 1.0 : 0.0;
Then, you can enable the Density Attribute option on the Scatter SOP. If you have a texture map as a regular image file, (sorry, no direct UDIM support in the Scatter SOP), you'll want where you want points to be scattered to be white, and where you don't want points to be scattered to be black, so you may need to invert the image. You can then set Generate to “In Texture Space”, and crank up the Density Scale. (It will probably need to be in the 10,000's to 100,000's range, since it's the average number of points scattered into the unit square of texture space.)
Hopefully one of those works for you!
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
-
- jsmack
- Member
- 8223 posts
- Joined: Sept. 2011
- Offline
-
- Quick Links

