문제

I've made an exporter (in Python) from Blender (2.5+) to a custom format. What bothers me is that most models I download contain no UV layers but instead are using auto-generated texture coordinates.

The question is: how can I access Blender-generated coordinates (ORCO) from Python?

Edit-2: Example file: http://dl.dropbox.com/u/16317117/orco.blend

Created by loading the default scene with a cube and changing its texture unit type to 'Wood'. The default mapping is already Generated:Flat. If you render the scene, you can see that wood texture is applied correctly, as if the cube had a proper UV unwrap.

Edit-3: The Answer.

I've found an answer in the Yafaray blender exporter source. Thank you, guys! If you see this thread - please, respond, so that I can award you a bounty.

Generated coordinate (ORCO) is a 'normalized' local coordinate of the vertex. Basically, given the local bounding box of the object: Orco(v) = 2*(v-center)/size.

도움이 되었습니까?

해결책

Generated coordinate (ORCO) is a 'normalized' local coordinate of the vertex. Basically, given the local bounding box of the object: Orco(v) = 2*(v-center)/size.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top