tkeskita / BVtkNodes

Create and execute VTK pipelines in Blender Node Editor
GNU General Public License v3.0
111 stars 19 forks source link

advice on mapping image data to sphere? #85

Closed derekeden closed 1 year ago

derekeden commented 2 years ago

Hello there,

This add-on is fantastic and I've used it to make some really great renders/animations.

I am wondering if you have any advice on how to read in some image data (either image format like JPG, or vti) and map it to a sphere?

Similar to what BlenderNC does.

I can't figure it out for the life of me.

I am able to bring in unstructured grid data and use the Resample to Image filter, which results in a vtkImageData object - the same if I directly import a vti file.

I've tried using vtkTexturedSphereSource and also vtkTextureMapToSphere nodes. I also notice that I can't find the vtkTexture node which is present in the vtk library using python.

What I'm trying to do is bring in some vtk data (usually unstructured), resample it to an image, and then map that image to a sphere.

I know this is possible by using a Image Texture in the Shader Node editor. The only way I see this happening is if I resample the data to a regular grid myself then create an internal Blender image/texture with the data and colours I've created myself. But this would completely skip over BVTKNodes. I'm wondering if this is possible within the BVTKNodes framework itself?

I know it's possible in pure VTK one way or another, but can't figure out how to make it happen in BVTKNodes.

Would lead to some amazing global model simulation animations.

Thanks in advance.

tkeskita commented 2 years ago

Hi, creating a Blender image texture from VTK data was possible in past. I will try to see if I can bring it back (create a VTK To Blender Image node), but it will take some time.

tkeskita commented 2 years ago

Hi, I've just added VTK To Blender Image Node to the add-on. It can be used to generate Blender images from VTK data. Here is one example node tree showing how to use it. Please let me know if this works for you!

bvtknodes_image_export_007.json.txt (rename txt to json and import node tree via Tree tab --> Import JSON)

Screenshot_2022-05-28_14-45-03 :