feat: add croissant cake and cream toast

This commit is contained in:
Yanchen
2026-11-15 14:47:19 +08:00
parent 036ee25a2a
commit e784ef07a8
22 changed files with 559 additions and 129 deletions
Binary file not shown.
@@ -0,0 +1,68 @@
{
"asset": "CakeSlice_Root",
"design_id": "cake_slice",
"blender_version": "5.2.0 LTS",
"units": "meters",
"axis_convention": "Blender Z up; GLB Y up",
"triangle_limit": 1000,
"triangles": 194,
"passed_triangle_budget": true,
"mesh_components": {
"Cake_Sponge_Lower": 28,
"Cake_Cream_Lower": 28,
"Cake_Sponge_Upper": 28,
"Cake_Cream_Upper": 28,
"Cake_Frosting_Top": 28,
"Cake_Strawberry": 48,
"Cake_Leaf_1": 2,
"Cake_Leaf_2": 2,
"Cake_Leaf_3": 2
},
"bounds_min_m": [
-0.05400000140070915,
-0.05999999865889549,
0.0010000000474974513
],
"bounds_max_m": [
0.05400000140070915,
0.054999999701976776,
0.0949999988079071
],
"dimensions_m": [
0.1080000028014183,
0.11499999836087227,
0.09399999876040965
],
"reference_photo": "cake_slice.jpg",
"reference_images_packed": true,
"labels_or_brand_graphics": false,
"blend": "PerfectCoffee_CakeSlice.blend",
"glb": "PerfectCoffee_CakeSlice.glb",
"preview": "preview.png",
"native_reopen_passed": true,
"glb_reimport_passed": true,
"passed": true,
"native_triangles": 194,
"native_dimensions_m": [
0.1080000028014183,
0.11499999836087227,
0.09399999876040965
],
"no_image_textures_or_labels": true,
"cap_detach_parenting_passed": null,
"cap_blend_and_glb_passed": null,
"liquid_volume_2000ml_passed": null,
"plausible_dimensions_passed": true,
"transparent_pet_passed": null,
"glb_triangles": 194,
"glb_dimensions_m": [
0.1080000028014183,
0.11499999836087227,
0.09399999876040965
],
"studio_excluded_from_glb": true,
"technical_validation_passed": true,
"visual_review_passed": true,
"visual_review_notes": "Triangular slice, two chocolate sponge layers, cream filling, frosting and strawberry are correctly proportioned and visible.",
"cap_assembly_test_passed": null
}
Binary file not shown.
@@ -0,0 +1,60 @@
{
"asset": "Croissant_Root",
"design_id": "croissant",
"blender_version": "5.2.0 LTS",
"units": "meters",
"axis_convention": "Blender Z up; GLB Y up",
"triangle_limit": 1000,
"triangles": 456,
"passed_triangle_budget": true,
"mesh_components": {
"Croissant_Rolled_Pastry": 456
},
"bounds_min_m": [
-0.09190463274717331,
-0.0371473990380764,
0.0012263512471690774
],
"bounds_max_m": [
0.09190463274717331,
0.0447818785905838,
0.058773647993803024
],
"dimensions_m": [
0.18380926549434662,
0.0819292776286602,
0.05754729674663395
],
"reference_photo": "croissant.jpg",
"reference_images_packed": true,
"labels_or_brand_graphics": false,
"blend": "PerfectCoffee_Croissant.blend",
"glb": "PerfectCoffee_Croissant.glb",
"preview": "preview.png",
"native_reopen_passed": true,
"glb_reimport_passed": true,
"passed": true,
"native_triangles": 456,
"native_dimensions_m": [
0.18380926549434662,
0.0819292776286602,
0.05754729674663395
],
"no_image_textures_or_labels": true,
"cap_detach_parenting_passed": null,
"cap_blend_and_glb_passed": null,
"liquid_volume_2000ml_passed": null,
"plausible_dimensions_passed": true,
"transparent_pet_passed": null,
"glb_triangles": 456,
"glb_dimensions_m": [
0.18380926549434662,
0.0819292776286602,
0.05754729674663395
],
"studio_excluded_from_glb": true,
"technical_validation_passed": true,
"visual_review_passed": true,
"visual_review_notes": "Curved crescent silhouette, tapered tips and rolled laminated bands are readable in the render.",
"cap_assembly_test_passed": null
}
+109
View File
@@ -0,0 +1,109 @@
import bpy
from pathlib import Path
from mathutils import Vector
ROOT = Path(__file__).resolve().parent
ASSETS = [
("01 CROISSANT", "bakery_and_cake/Croissant/PerfectCoffee_Croissant.blend"),
("02 CAKE SLICE", "bakery_and_cake/CakeSlice/PerfectCoffee_CakeSlice.blend"),
("03 CREAM TOAST", "toast_and_wrap/AvocadoToast/PerfectCoffee_AvocadoToast.blend"),
]
POSITIONS = [(-0.25, 0), (0, 0), (0.25, 0)]
bpy.ops.wm.read_factory_settings(use_empty=True)
scene = bpy.context.scene
scene.render.engine = "BLENDER_EEVEE"
scene.render.resolution_x = 1600
scene.render.resolution_y = 1250
scene.render.resolution_percentage = 100
scene.render.image_settings.file_format = "PNG"
scene.render.film_transparent = False
scene.view_settings.view_transform = "AgX"
scene.view_settings.look = "AgX - Medium High Contrast"
scene.view_settings.exposure = -0.5
scene.world = bpy.data.worlds.new("Review_World")
scene.world.use_nodes = True
scene.world.node_tree.nodes["Background"].inputs["Color"].default_value = (0.72, 0.78, 0.82, 1)
scene.world.node_tree.nodes["Background"].inputs["Strength"].default_value = 0.3
for (label, relative_path), (x, y) in zip(ASSETS, POSITIONS):
with bpy.data.libraries.load(str(ROOT / relative_path), link=False) as (source, target):
target.collections = ["Model"]
model = target.collections[0]
instance = bpy.data.objects.new(label, None)
instance.instance_type = "COLLECTION"
instance.instance_collection = model
instance.location = (x, y, 0)
scene.collection.objects.link(instance)
meshes = [obj for obj in model.all_objects if obj.type == "MESH"]
triangle_count = 0
for obj in meshes:
obj.data.calc_loop_triangles()
triangle_count += len(obj.data.loop_triangles)
assert triangle_count <= 1000, (label, triangle_count)
print("FOOD_REVIEW", label, triangle_count, flush=True)
for text, size, offset in [(label, 0.015, -0.105), (f"{triangle_count} TRIANGLES", 0.008, -0.121)]:
curve = bpy.data.curves.new(text, "FONT")
curve.body = text
curve.align_x = "CENTER"
curve.size = size
text_object = bpy.data.objects.new(text, curve)
text_object.location = (x, y + offset, 0.001)
scene.collection.objects.link(text_object)
curve = bpy.data.curves.new("Review_Notes", "FONT")
curve.body = "FOOD MODEL REVIEW\n\n3 FOOD ASSETS\nBLENDER 5.2\n1000 TRI LIMIT EACH\nNO PACKAGING\n\nREVIEW SCENE ONLY"
curve.align_x = "CENTER"
curve.size = 0.014
notes = bpy.data.objects.new("Review_Notes", curve)
notes.location = (0, 0.29, 0.001)
scene.collection.objects.link(notes)
text_material = bpy.data.materials.new("Review_Text")
text_material.diffuse_color = (0.045, 0.055, 0.065, 1)
text_material.use_nodes = True
text_material.node_tree.nodes["Principled BSDF"].inputs["Base Color"].default_value = (0.045, 0.055, 0.065, 1)
for obj in scene.objects:
if obj.type == "FONT":
obj.data.materials.append(text_material)
material = bpy.data.materials.new("Review_Background")
material.diffuse_color = (0.38, 0.41, 0.36, 1)
material.use_nodes = True
material.node_tree.nodes["Principled BSDF"].inputs["Base Color"].default_value = (0.38, 0.41, 0.36, 1)
material.node_tree.nodes["Principled BSDF"].inputs["Roughness"].default_value = 0.86
bpy.ops.mesh.primitive_plane_add(size=200, location=(0, 0, -0.0002))
bpy.context.object.data.materials.append(material)
for label, offset, power, size in [
("Key", (-0.5, -0.5, 0.9), 8, 0.7),
("Fill", (0.6, -0.1, 0.5), 4, 0.6),
("Rim", (0.0, 0.7, 0.8), 6, 0.6),
]:
light_data = bpy.data.lights.new(label, "AREA")
light_data.energy = power
light_data.shape = "DISK"
light_data.size = size
light_object = bpy.data.objects.new(label, light_data)
light_object.location = offset
light_object.rotation_euler = (Vector((0, 0.12, 0)) - light_object.location).to_track_quat("-Z", "Y").to_euler()
scene.collection.objects.link(light_object)
camera_data = bpy.data.cameras.new("Review_Camera")
camera = bpy.data.objects.new("Review_Camera", camera_data)
camera_data.type = "ORTHO"
camera_data.ortho_scale = 0.78
scene.collection.objects.link(camera)
scene.camera = camera
center = Vector((0, 0.105, 0))
camera.location = center + Vector((0.25, -0.60, 0.72))
camera.rotation_euler = (center - camera.location).to_track_quat("-Z", "Y").to_euler()
scene.render.filepath = str(ROOT / "review_three_quarter.png")
bpy.ops.render.render(write_still=True)
camera.location = (0, 0.105, 1)
camera.rotation_euler = (0, 0, 0)
camera_data.ortho_scale = 0.78
scene.render.filepath = str(ROOT / "review_top.png")
bpy.ops.render.render(write_still=True)
print("FOOD_REVIEW_COMPLETE", flush=True)
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,59 @@
{
"asset": "AvocadoToast_Root",
"design_id": "avocado_toast",
"presentation": "Plain toast with one pale-yellow cream layer; no avocado, chili or other toppings",
"blender_version": "5.2.0 LTS",
"units": "meters",
"axis_convention": "Blender Z up; GLB Y up",
"triangle_limit": 1000,
"triangles": 330,
"passed_triangle_budget": true,
"mesh_components": {
"Toast_Bread_Crust": 148,
"Toast_Inner_Crumb": 72,
"Toast_PaleYellowCream_Layer": 110
},
"bounds_min_m": [
-0.05700000002980232,
-0.05900000035762787,
0.0010000000474974513
],
"bounds_max_m": [
0.05700000002980232,
0.06400000303983688,
0.01940000057220459
],
"dimensions_m": [
0.11400000005960464,
0.12300000339746475,
0.01840000052470714
],
"reference_photo": "cream_toast.jpg",
"reference_images_packed": true,
"labels_or_brand_graphics": false,
"blend": "PerfectCoffee_AvocadoToast.blend",
"glb": "PerfectCoffee_AvocadoToast.glb",
"preview": "preview.png",
"native_reopen_passed": true,
"glb_reimport_passed": true,
"passed": true,
"native_triangles": 330,
"native_dimensions_m": [
0.11400000005960464,
0.12300000339746475,
0.01840000052470714
],
"glb_triangles": 330,
"glb_dimensions_m": [
0.11400000005960464,
0.12300000339746475,
0.01840000052470714
],
"no_image_textures_or_labels": true,
"plausible_dimensions_passed": true,
"studio_excluded_from_glb": true,
"technical_validation_passed": true,
"visual_review_passed": true,
"visual_review_notes": "One continuous pale-yellow cream layer over toast, with an exposed crust and crumb border; no avocado slices, chili or other toppings.",
"preview_top": "preview_top.png"
}