I completely agree - I just didnāt think that doing some extra steps in Blender was getting this any closer. If you need an external app to convert something, you might as well not use Blender.
-w
Blender is here a red herring. Since @Holo has access to Photoshop Iām sure heāll be using that to create his files. Just any tool to convert the TIFF to an EXR, and probably can be scripted too. I donāt have Photoshop, but I do have Blender - so I used that to test
addendum: I noticed I had forgotten to type a bit about evaluator flags, so I did just that and pushed the updated text. Should be on the earlier linked page soon if not already - refresh until there is text prior to the code fragment for getting the texture evaluator.
Unless Iām very wrong, the entire story here isnāt just getting some pixel values into Rhino. Those pixels represent values in latitude, longitude, and elevation. Depending on where on Earth this area is from, the resulting x,y,z values will be different.
Iād love all of this to be handled natively inside of Rhino but if you need any external application at all to start converting things, you might as well use one that does all of this correctly right away and not additionally have to jump through hoops in Rhino coding.
-w
Maybe so. The question was how to get the one-channel TIFF (height data) read in Rhino which I set out to answer. The code given does that, just not for the TIFF format as Rhino currently is unable to do so. But it can with other formats that are capable of the same.
Once the YT I logged is fixed the code can be adapted to directly use the TIFF.
import clr
clr.AddReference('bella_dotnet')
import bella
s = bella.Scene()
s.loadDefs()
t = s.createNode('fileTexture')
t.setPath('d:/DTM_32-1-514-134-76.tif')
t.nodePrep()
r = t.output('outRes').asVec2()
o = t.output('outVector')
for y in range(0, int(r.y)):
for x in range(0, int(r.x)):
uv = bella.Vec2((x+0.5)/r.x, (y+0.5)/r.y)
v = o.sample(uv)
if x == 0:
print('[%d %d] %s [%f %f %f]'%(x, y, uv, v.r, v.g, v.b))
Nice!
I guess this is an obvious question, but this requires Bella to be installed on the computer, right?
I need to be able to use this on multiple machines, and not only my own