Image into attributes in SOP

   3709   7   2
User Avatar
Member
152 posts
Joined: Jan. 2014
Offline
How could I get image file data (eg. R component) to be converted into attributes in SOP level, if say it was on a grid?
User Avatar
Member
918 posts
Joined: March 2014
Offline
The ‘attribfrommap’ SOP should do the trick.

Andy
User Avatar
Member
152 posts
Joined: Jan. 2014
Offline
Thanks Andy.
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi,
See attached for a VOPSOP example

Rob

Attachments:
rse_peelredaway_001.hip (86.8 KB)
Screen Shot 2014-05-24 at 8.29.01 am.png (268.7 KB)

Gone fishing
User Avatar
Member
2628 posts
Joined: June 2008
Offline
@circusmonkey: I am tying to accomplish something similar to what you have posted.

What I want for output is points on a grid only if the alpha from the image is not 0. How would I add points to a group or delete them from the grid while in VOPSOP context?

Basically knock out the alpha points only.

I modified your VOPSOP by changing the colormap to export RGBA. Then I compare the 4th value to greater than zero and route that to an attribute. One level up I have placed my new variable $MYAPLHACHAN into the Point SOP following the VOPSOP and I do get non-colored output where expected.

But how do I actually use $MYALPHACHAN to remove the points from the grid?

Attachments:
Screen Shot 2015-03-26 at 6.52.49 PM.png (679.5 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
443 posts
Joined: Sept. 2012
Offline
Use delete SOP > Operation to Delete by Expression > in Filter Expression:

$MYALPHACHAN < 0.1
User Avatar
Member
443 posts
Joined: Sept. 2012
Offline
Or in AttribWrangle:

if(@myalphachan < 0.1)
removepoint(0, @ptnum);
User Avatar
Member
2628 posts
Joined: June 2008
Offline
Thanks for the reply, the Delete after the VOPSOP does work but I am not sure why?

What exactly is the contents of the $MYALPHACHAN?
I assume it is some kind of array of data. Wouldn't I need a For/Each sop to iterate through the data with the Delete inside?
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
  • Quick Links