collada: lua: emit uri in image table

This commit is contained in:
Zack Buhman 2026-02-24 16:53:18 +00:00
parent 727f5ff8d7
commit e41f8667f0
3 changed files with 10 additions and 7 deletions

View File

@ -298,8 +298,8 @@ def render_light(light_name, light_type, color):
yield f".color = {{ {render_float_tuple(color)} }}," yield f".color = {{ {render_float_tuple(color)} }},"
yield "};" yield "};"
def render_image(image_id, image_name, resource_name): def render_image(image_id, image_name, resource_name, uri):
yield f"// {image.id}" yield f"// {image_id}"
yield f"image const image_{image_name} = {{" yield f"image const image_{image_name} = {{"
yield f'.resource_name = L"{resource_name}",' yield f'.resource_name = L"{resource_name}",'
yield "};" yield "};"

View File

@ -786,7 +786,7 @@ def render_image(state, collada, image, image_index):
resource_name = image_resource_name(state, image.image_source.uri) resource_name = image_resource_name(state, image.image_source.uri)
image_name = sanitize_name(state, image.id, image) image_name = sanitize_name(state, image.id, image)
yield from lang_header.render_image(image.id, image_name, resource_name) yield from lang_header.render_image(image.id, image_name, resource_name, image.image_source.uri)
def render_library_images(state, collada): def render_library_images(state, collada):
image_index = 0 image_index = 0

View File

@ -191,7 +191,7 @@ def render_opt_color(field_name, color):
yield f"{field_name} = {render_float_tuple(color.value)}," yield f"{field_name} = {render_float_tuple(color.value)},"
def render_opt_texture(field_name, image_index, image_id): def render_opt_texture(field_name, image_index, image_id):
yield f"{field_name} = {{ .image_index = {image_index} }}, -- {image_id}" yield f"{field_name} = {{ image_index = {image_index} }}, -- {image_id}"
def render_opt_color_or_texture(field_name, opt_type, render_body): def render_opt_color_or_texture(field_name, opt_type, render_body):
yield f"{field_name} = {{" yield f"{field_name} = {{"
@ -231,6 +231,9 @@ def render_descriptor(namespace):
yield "nodes = nodes," yield "nodes = nodes,"
yield "nodes_count = #nodes," yield "nodes_count = #nodes,"
yield "" yield ""
yield "geometries = geometries,"
yield "nodes_count = #geometries,"
yield ""
yield "inputs_list = inputs_list," yield "inputs_list = inputs_list,"
yield "inputs_list_count = #inputs_list," yield "inputs_list_count = #inputs_list,"
yield "" yield ""
@ -296,10 +299,10 @@ def render_light(light_name, light_type, color):
yield f"color = {render_float_tuple(color)}," yield f"color = {render_float_tuple(color)},"
yield "}" yield "}"
def render_image(image_id, image_name, resource_name): def render_image(image_id, image_name, resource_name, uri):
yield f"-- {image.id}" yield f"-- {image_id}"
yield f"local image_{image_name} = {{" yield f"local image_{image_name} = {{"
yield f'resource_name = L"{resource_name}",' yield f'uri = "{uri}",'
yield "}" yield "}"
def render_library_images(image_names): def render_library_images(image_names):