Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving blend file with GeoTIFF as plane and DEM "forgets" settings #54

Closed
mixedbredie opened this issue Dec 6, 2016 · 6 comments
Closed

Comments

@mixedbredie
Copy link

I have an odd problem. I create a new blender project with a GeoTIFF DEM added as plane and then again as DEM. I add a geo-referenced camera and have everything setup to render a lovely hill-shaded image. If I render the image after saving project and without closing the project I get the expected output. If I save the project, close it and then re-open it I get a flat grey image without any of the relief. All the settings are saved as set.

Any suggestions as to what might be happening here? I have 91 tiles to render and would like to batch process them by setting up the .blend files and letting them run overnight instead of having to manually run each one.

Image created without closing Blender file
Image created after saving, closing and re-opening Blender file

This happens on both Windows 7 64bit and Linux Mint 18 64bit with the Blender GIS extension added. Other Blender projects created without using the extension reopen correctly. I have attached the Blender file that create the first image above: 8_3.zip

And the GeoTIFF: int_tiff.zip

@mixedbredie
Copy link
Author

I should add that I am using Blender 2.78a and a recent copy of the BlenderGIS addon on both Windows 7 and Linux Mint 18.

@domlysz
Copy link
Owner

domlysz commented Dec 6, 2016

Hi,

Thanks reporting the issue.

When importing a raster coded in 16 bits integer, the script cast the data into a new image coded in float32 (because its a pain to handle negative value of signed 16 bits dataset).

After the import, in the image editor the datatype is correctly detected as float

selection_030

but after reopening the blend file, the image is detected as byte

selection_031

So the problem come from here but can't explain this inconsistency, I need to investigate more

@mixedbredie
Copy link
Author

I've done a few more tests with the same image but saved as UInt16 and Float32 and in both cases the image is retained as RGBA float when the project is saved, closed and reopened. So, to solve my problem I can use either Unsigned 16 bit Integer or Float32 GeoTIFFs. This doesn't shed any light on why Signed 16 bit integer GeoTIFFs fail though :-(

@domlysz
Copy link
Owner

domlysz commented Dec 7, 2016

Finally found the problem, as i explained before when trying to import signed int16 raster the script cast beforehand the data to float32. This new image is then packed into the blend file but packed image can only be stored as png and this format does not support float32 data, so the image downgraded to 8bits...

Results, I can't use the pack function anymore and I need to modify the script in order to copy the new 32bits image into an external file (in exr format because Blender can't write 32bits tiff).

Unfortunately this modification seems more tricky than i expected so for now I think the best workaround is to convert all your raster in uint16 or float32. These 2 datatypes can be directly used as displacement texture in Blender (there is no need to produce a new image).

@mixedbredie
Copy link
Author

Thanks @domlysz - my batch process is running as I type using Uint16 GeoTIFF with 4 tiles processed and 87 to go...

@domlysz
Copy link
Owner

domlysz commented Jun 3, 2018

fixed

@domlysz domlysz closed this as completed Jun 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants