13 lines
769 B
Python
13 lines
769 B
Python
"""Attach real granite grain to the photo-traced monument's vertex weathering."""
|
|
import bpy
|
|
s=bpy.data.scenes['Summit slab and marker'];bpy.context.window.scene=s
|
|
body=bpy.data.objects['Photo matched summit boulder'];mesh=body.data
|
|
uv=mesh.uv_layers.get('Granite grain UV') or mesh.uv_layers.new(name='Granite grain UV')
|
|
for face in mesh.polygons:
|
|
for li in face.loop_indices:
|
|
p=mesh.vertices[mesh.loops[li].vertex_index].co;uv.data[li].uv=(p.x*.85,p.z*.85)
|
|
# The saved study already contains the authored color multiply and normal map.
|
|
# Export temporarily connects the scan directly; glTF multiplies COLOR_0 itself.
|
|
s.render.filepath='D:/project/sunrise/assets/summit/blender-plateau-study/marker-photo-match.png'
|
|
bpy.ops.render.render(write_still=True)
|