What are texspace_location and texspace_size?

Hi,

What are texspace_location and texspace_size?
How to compute them for a given Cycles mesh?

Thanks in advance.

Blender computes them from the bounding box of the (undeformed) mesh:
https://docs.blender.org/manual/en/latest/modeling/meshes/editing/uv/uv_texture_spaces.html#texture-space

1 Like

Hi @brecht,

Thanks for responding.
I am baking Normal maps for my meshes. I need to convert the generated normal map to Tangent Space. So, I need to generate ATTR_STD_UV_TANGENT and ATTR_STD_UV_TANGENT_SIGN attributes for my mesh. For this, I need to compute texspace_location and texspace_size.

I have gone thru blender’s code to find how blender is calculating them but could not find where it is. Can you please give me a clue where this calculation is?

Thanks in advance.

They’re computed in BKE_mesh_texspace_calc.

1 Like