feat: track remaining production assets, playtest scenes and references
Close the gaps left open after the LFS migration: 177 files that were sitting untracked now enter version control, with every binary going through Git LFS. - labels: milk and orange-juice wrap artwork (SVG/PNG), Seedream sources, prompts and Dreamina job records - orange juice 2L: bottle, cap, empty state and three label variants (blend + glb each) - cup contents: desktop and mobile-optimised variants plus 3 textures - milk 2L: empty and packaged variants with their glb exports - milk frother: low-poly assembly and split base/jug parts - tamper: model, glb and fit test - juicer: seven assembly-part review scenes and their export scripts - playtests: extraction animation scene and grinding/tamping whitebox - reference: Minex page candidates, user review screenshots, sequence analysis frames and tamper STLs - docs: item design draft, bean research notes, region reference and the model-asset audit report Re-renderable preview/check frames stay untracked on purpose.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"source_blend_sha256": "b21ac50c76a191ece61abb486a794f59ba0f59c69c003e074850e7f384098498",
|
||||
"cap_file_hashes": {
|
||||
"PerfectCoffee_orange_juice_2l_Cap.blend": "b6ef7541002077a5f71dc95e63a5380e1c9a37608468e4526a6d80655123fb23",
|
||||
"PerfectCoffee_orange_juice_2l_Cap.glb": "6f1d380edc9dde6505265990389da757c07e094132e119f0a8a3e92cb597a83e"
|
||||
},
|
||||
"source_triangles": 960,
|
||||
"source_vertices": 274,
|
||||
"source_polygons": 288,
|
||||
"cap_files_untouched": true,
|
||||
"native_reopen_passed": true,
|
||||
"glb_reimport_passed": true,
|
||||
"native_triangles": 960,
|
||||
"glb_triangles": 960,
|
||||
"technical_validation_passed": true,
|
||||
"visual_review_passed": true,
|
||||
"passed": true,
|
||||
"label_applied": false,
|
||||
"label_removed_reason": "Poor visual fit to the bottle body",
|
||||
"label_texture_files_retained": true
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import math
|
||||
import shutil
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import bpy
|
||||
from mathutils import Vector
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
ROOT = OUT.parents[1]
|
||||
ASSET = ROOT / "orange_juice_2l"
|
||||
BLEND = ASSET / "PerfectCoffee_orange_juice_2l.blend"
|
||||
GLB = ASSET / "PerfectCoffee_orange_juice_2l.glb"
|
||||
TEXTURE = OUT / "orange_juice_wrap.png"
|
||||
REPORT = ASSET / "validation.json"
|
||||
STATE = OUT / "application_validation.json"
|
||||
BODY = "OrangeJuice_Bottle_Body"
|
||||
LABEL_MATERIAL = "OrangeJuice_Label"
|
||||
LABEL_UV = "UVMap_Label"
|
||||
Z_MIN, Z_MAX = 0.023, 0.113
|
||||
|
||||
|
||||
def sha256(path):
|
||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def mesh_objects():
|
||||
return [obj for obj in bpy.context.scene.objects if obj.type == "MESH" and not obj.name.startswith("Studio_")]
|
||||
|
||||
|
||||
def triangle_count(objects):
|
||||
total = 0
|
||||
for obj in objects:
|
||||
obj.data.calc_loop_triangles()
|
||||
total += len(obj.data.loop_triangles)
|
||||
return total
|
||||
|
||||
|
||||
def label_polygons(body):
|
||||
return [
|
||||
polygon for polygon in body.data.polygons
|
||||
if all(Z_MIN - 0.00001 <= body.data.vertices[index].co.z <= Z_MAX + 0.00001
|
||||
for index in polygon.vertices)
|
||||
]
|
||||
|
||||
|
||||
def apply_label():
|
||||
assert "100%" not in (OUT / "orange_juice_wrap.svg").read_text()
|
||||
initial = {
|
||||
"source_blend_sha256": sha256(BLEND),
|
||||
"cap_file_hashes": {
|
||||
name: sha256(ASSET / name)
|
||||
for name in ("PerfectCoffee_orange_juice_2l_Cap.blend", "PerfectCoffee_orange_juice_2l_Cap.glb")
|
||||
},
|
||||
}
|
||||
backup = OUT / "_work"
|
||||
backup.mkdir(exist_ok=True)
|
||||
if not (backup / "unlabeled.blend").exists():
|
||||
shutil.copy2(BLEND, backup / "unlabeled.blend")
|
||||
bpy.ops.wm.open_mainfile(filepath=str(BLEND))
|
||||
bpy.context.preferences.filepaths.save_version = 0
|
||||
body = bpy.data.objects[BODY]
|
||||
initial["source_triangles"] = triangle_count(mesh_objects())
|
||||
initial["source_vertices"] = len(body.data.vertices)
|
||||
initial["source_polygons"] = len(body.data.polygons)
|
||||
polygons = label_polygons(body)
|
||||
assert len(polygons) == 64, f"Expected 64 outer-wall label faces, got {len(polygons)}"
|
||||
uv = body.data.uv_layers.get(LABEL_UV) or body.data.uv_layers.new(name=LABEL_UV)
|
||||
body.data.uv_layers.active = uv
|
||||
for polygon in polygons:
|
||||
coordinates = []
|
||||
for loop_index in polygon.loop_indices:
|
||||
vertex = body.data.vertices[body.data.loops[loop_index].vertex_index].co
|
||||
u = (math.atan2(vertex.y, vertex.x) - math.pi / 2) / math.tau % 1.0
|
||||
v = (vertex.z - Z_MIN) / (Z_MAX - Z_MIN)
|
||||
coordinates.append((loop_index, u, v))
|
||||
seam = max(value[1] for value in coordinates) - min(value[1] for value in coordinates) > 0.5
|
||||
for loop_index, u, v in coordinates:
|
||||
if seam and u < 0.5:
|
||||
u += 1.0
|
||||
uv.data[loop_index].uv = (u, v)
|
||||
image = bpy.data.images.load(str(TEXTURE), check_existing=True)
|
||||
image.name = "OrangeJuice_Wrap_NoPercentage"
|
||||
image.colorspace_settings.name = "sRGB"
|
||||
image.use_fake_user = True
|
||||
image.pack()
|
||||
mat = bpy.data.materials.get(LABEL_MATERIAL) or bpy.data.materials.new(LABEL_MATERIAL)
|
||||
mat.use_nodes = True
|
||||
mat.use_backface_culling = False
|
||||
mat.node_tree.nodes.clear()
|
||||
output = mat.node_tree.nodes.new("ShaderNodeOutputMaterial")
|
||||
shader = mat.node_tree.nodes.new("ShaderNodeBsdfPrincipled")
|
||||
texture = mat.node_tree.nodes.new("ShaderNodeTexImage")
|
||||
texture.image = image
|
||||
texture.interpolation = "Linear"
|
||||
texture.extension = "REPEAT"
|
||||
shader.inputs["Roughness"].default_value = 0.62
|
||||
shader.inputs["Alpha"].default_value = 1.0
|
||||
mat.node_tree.links.new(texture.outputs["Color"], shader.inputs["Base Color"])
|
||||
mat.node_tree.links.new(shader.outputs["BSDF"], output.inputs["Surface"])
|
||||
if LABEL_MATERIAL not in [slot.name for slot in body.data.materials]:
|
||||
body.data.materials.append(mat)
|
||||
material_index = [slot.name for slot in body.data.materials].index(LABEL_MATERIAL)
|
||||
for polygon in polygons:
|
||||
polygon.material_index = material_index
|
||||
body["label_scope"] = "Outer straight wall only; original generic artwork without percentage claims"
|
||||
body["label_z_range_m"] = [Z_MIN, Z_MAX]
|
||||
body["label_seam"] = "Back (+Y); front label centered at -Y"
|
||||
assert triangle_count(mesh_objects()) == initial["source_triangles"]
|
||||
assert len(body.data.vertices) == initial["source_vertices"]
|
||||
assert len(body.data.polygons) == initial["source_polygons"]
|
||||
collection = bpy.data.collections["Model"]
|
||||
bpy.ops.object.select_all(action="DESELECT")
|
||||
for obj in collection.all_objects:
|
||||
obj.select_set(True)
|
||||
bpy.context.view_layer.objects.active = body
|
||||
bpy.ops.export_scene.gltf(
|
||||
filepath=str(GLB), export_format="GLB", use_selection=True,
|
||||
export_yup=True, export_apply=True, export_texcoords=True,
|
||||
export_cameras=False, export_lights=False,
|
||||
)
|
||||
scene = bpy.context.scene
|
||||
scene.render.filepath = str(ASSET / "preview.png")
|
||||
bpy.ops.render.render(write_still=True)
|
||||
pivot = bpy.data.objects["OrangeJuice_Cap_Pivot"]
|
||||
location = pivot.location.copy()
|
||||
pivot.location += Vector((0.045, 0, 0.055))
|
||||
scene.render.filepath = str(ASSET / "preview_cap_removed.png")
|
||||
bpy.ops.render.render(write_still=True)
|
||||
pivot.location = location
|
||||
camera = scene.camera
|
||||
camera_matrix = camera.matrix_world.copy()
|
||||
camera_scale = camera.data.ortho_scale
|
||||
resolution = (scene.render.resolution_x, scene.render.resolution_y)
|
||||
for name, position in (("front", (0, -0.55, 0.18)), ("back", (0, 0.55, 0.18))):
|
||||
camera.location = position
|
||||
target = Vector((0, 0, 0.14))
|
||||
camera.rotation_euler = (target - camera.location).to_track_quat("-Z", "Y").to_euler()
|
||||
camera.data.ortho_scale = 0.325
|
||||
scene.render.resolution_x = 900
|
||||
scene.render.resolution_y = 900
|
||||
scene.render.filepath = str(ASSET / f"preview_label_{name}.png")
|
||||
bpy.ops.render.render(write_still=True)
|
||||
camera.matrix_world = camera_matrix
|
||||
camera.data.ortho_scale = camera_scale
|
||||
scene.render.resolution_x, scene.render.resolution_y = resolution
|
||||
scene.render.filepath = str(ASSET / "preview.png")
|
||||
assert sha256(BLEND) == initial["source_blend_sha256"], "Bottle changed on disk during label application; not saving"
|
||||
bpy.ops.wm.save_as_mainfile(filepath=str(BLEND), compress=True)
|
||||
for name, old_hash in initial["cap_file_hashes"].items():
|
||||
assert sha256(ASSET / name) == old_hash
|
||||
initial["label_faces"] = len(polygons)
|
||||
initial["label_triangle_increase"] = 0
|
||||
initial["label_png_dimensions"] = [2048, 768]
|
||||
initial["cap_files_untouched"] = True
|
||||
STATE.write_text(json.dumps(initial, ensure_ascii=False, indent=2) + "\n")
|
||||
report = json.loads(REPORT.read_text())
|
||||
report["visual_review_passed"] = False
|
||||
REPORT.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n")
|
||||
|
||||
|
||||
def validate(visual_reviewed):
|
||||
state = json.loads(STATE.read_text())
|
||||
report = json.loads(REPORT.read_text())
|
||||
bpy.ops.wm.open_mainfile(filepath=str(BLEND))
|
||||
body = bpy.data.objects[BODY]
|
||||
native_triangles = triangle_count(mesh_objects())
|
||||
native_faces = label_polygons(body)
|
||||
label_uv = body.data.uv_layers.get(LABEL_UV)
|
||||
uv_loops = sum(len(polygon.loop_indices) for polygon in native_faces)
|
||||
native_texture = bpy.data.materials[LABEL_MATERIAL].node_tree.nodes.get("Image Texture")
|
||||
native_ok = (
|
||||
native_triangles == state["source_triangles"]
|
||||
and len(body.data.vertices) == state["source_vertices"]
|
||||
and len(body.data.polygons) == state["source_polygons"]
|
||||
and len(native_faces) == 64
|
||||
and uv_loops == 256
|
||||
and label_uv is not None
|
||||
and all(polygon.material_index < len(body.data.materials)
|
||||
and body.data.materials[polygon.material_index].name == LABEL_MATERIAL
|
||||
for polygon in native_faces)
|
||||
and native_texture is not None
|
||||
and list(native_texture.image.size) == [2048, 768]
|
||||
and native_texture.image.packed_file is not None
|
||||
)
|
||||
for name, old_hash in state["cap_file_hashes"].items():
|
||||
assert sha256(ASSET / name) == old_hash
|
||||
for obj in list(bpy.context.scene.objects):
|
||||
if not obj.name.startswith("Studio_"):
|
||||
bpy.data.objects.remove(obj, do_unlink=True)
|
||||
for mesh in list(bpy.data.meshes):
|
||||
if mesh.users == 0:
|
||||
bpy.data.meshes.remove(mesh)
|
||||
for material in list(bpy.data.materials):
|
||||
if material.users == 0:
|
||||
bpy.data.materials.remove(material)
|
||||
bpy.ops.import_scene.gltf(filepath=str(GLB))
|
||||
imported_objects = mesh_objects()
|
||||
glb_triangles = triangle_count(imported_objects)
|
||||
imported_label_faces = 0
|
||||
imported_label_uv = False
|
||||
imported_texture_size = None
|
||||
for obj in imported_objects:
|
||||
for polygon in obj.data.polygons:
|
||||
material = obj.data.materials[polygon.material_index]
|
||||
if material and material.name == LABEL_MATERIAL:
|
||||
imported_label_faces += 1
|
||||
imported_label_uv = imported_label_uv or bool(obj.data.uv_layers)
|
||||
for node in material.node_tree.nodes:
|
||||
if node.type == "TEX_IMAGE" and node.image:
|
||||
imported_texture_size = list(node.image.size)
|
||||
glb_ok = (
|
||||
glb_triangles == state["source_triangles"]
|
||||
and imported_label_faces == 128
|
||||
and imported_label_uv
|
||||
and imported_texture_size == [2048, 768]
|
||||
and not any(obj.name.startswith("Studio_") for obj in imported_objects)
|
||||
)
|
||||
if glb_ok:
|
||||
scene = bpy.context.scene
|
||||
camera = scene.camera
|
||||
camera.location = (0, -0.55, 0.18)
|
||||
camera.rotation_euler = (Vector((0, 0, 0.14)) - camera.location).to_track_quat("-Z", "Y").to_euler()
|
||||
camera.data.ortho_scale = 0.325
|
||||
scene.render.resolution_x = 900
|
||||
scene.render.resolution_y = 900
|
||||
scene.render.filepath = str(OUT / "preview_glb_front.png")
|
||||
bpy.ops.render.render(write_still=True)
|
||||
technical_passed = native_ok and glb_ok
|
||||
report.update({
|
||||
"native_reopen_passed": native_ok,
|
||||
"glb_reimport_passed": glb_ok,
|
||||
"native_triangles": native_triangles,
|
||||
"glb_triangles": glb_triangles,
|
||||
"passed_triangle_budget": native_triangles <= 1000 and glb_triangles <= 1000,
|
||||
"technical_validation_passed": technical_passed,
|
||||
"generic_label_applied": True,
|
||||
"brand_graphics": False,
|
||||
"percentage_purity_claims_present": False,
|
||||
"label_texture": "model_assets/labels/orange_juice/orange_juice_wrap.png",
|
||||
"label_uv_faces": 64,
|
||||
"label_uv_loops": uv_loops,
|
||||
"label_triangle_increase": 0,
|
||||
"label_texture_packed": True,
|
||||
"glb_label_texture_verified": imported_texture_size == [2048, 768],
|
||||
"no_image_textures_or_labels": False,
|
||||
"cap_files_untouched_by_label_application": True,
|
||||
})
|
||||
report.pop("labels_or_brand_graphics", None)
|
||||
if visual_reviewed:
|
||||
report["visual_review_passed"] = True
|
||||
report["visual_review_notes"] = (
|
||||
"Original orange-tree wrap is centered on the front, with a clean rear seam, legible generic text, "
|
||||
"no 100% claim and transparent PET retained above and below the label. Independent cap and bottle geometry unchanged."
|
||||
)
|
||||
report["passed"] = technical_passed and report.get("visual_review_passed", False)
|
||||
REPORT.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n")
|
||||
state.update({
|
||||
"native_reopen_passed": native_ok,
|
||||
"glb_reimport_passed": glb_ok,
|
||||
"native_triangles": native_triangles,
|
||||
"glb_triangles": glb_triangles,
|
||||
"glb_label_faces": imported_label_faces,
|
||||
"glb_label_triangles": imported_label_faces,
|
||||
"glb_label_uv_verified": imported_label_uv,
|
||||
"glb_texture_dimensions": imported_texture_size,
|
||||
"technical_validation_passed": technical_passed,
|
||||
"visual_review_passed": report.get("visual_review_passed", False),
|
||||
"passed": report["passed"],
|
||||
})
|
||||
STATE.write_text(json.dumps(state, ensure_ascii=False, indent=2) + "\n")
|
||||
summary_path = ROOT / "low_poly_consumables_validation.json"
|
||||
summary = json.loads(summary_path.read_text())
|
||||
for asset in summary["assets"]:
|
||||
if asset["directory"] == "orange_juice_2l":
|
||||
asset.update({
|
||||
"native_triangles": native_triangles,
|
||||
"glb_triangles": glb_triangles,
|
||||
"technical_validation_passed": technical_passed,
|
||||
"visual_review_passed": report.get("visual_review_passed", False),
|
||||
"passed": report["passed"],
|
||||
})
|
||||
summary["all_technical_checks_passed"] = all(asset["technical_validation_passed"] for asset in summary["assets"])
|
||||
summary["all_visual_reviews_passed"] = all(asset["visual_review_passed"] for asset in summary["assets"])
|
||||
summary_path.write_text(json.dumps(summary, ensure_ascii=False, indent=2) + "\n")
|
||||
assert technical_passed, "Orange label validation failed"
|
||||
print(json.dumps(state, ensure_ascii=False, indent=2))
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--check", action="store_true")
|
||||
parser.add_argument("--visual-reviewed", action="store_true")
|
||||
args = parser.parse_args(sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else [])
|
||||
if not args.check:
|
||||
apply_label()
|
||||
validate(args.visual_reviewed)
|
||||
@@ -0,0 +1,180 @@
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import bpy
|
||||
from mathutils import Vector
|
||||
from mathutils.bvhtree import BVHTree
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
ROOT = OUT.parents[1]
|
||||
ASSET = ROOT / "orange_juice_2l"
|
||||
SOURCE = ASSET / "PerfectCoffee_orange_juice_2l_MilkJug_LabelTest.blend"
|
||||
BLEND = ASSET / "PerfectCoffee_orange_juice_2l_MilkJug_OriginalLabel.blend"
|
||||
GLB = BLEND.with_suffix(".glb")
|
||||
TEXTURE = OUT / "orange_grove_wrap.png"
|
||||
MATERIAL_NAME = "OrangeJuice_Label_Original"
|
||||
IMAGE_NAME = "OrangeGrove_OriginalVector"
|
||||
|
||||
|
||||
def sha256(path):
|
||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def mesh_objects():
|
||||
return [obj for obj in bpy.context.scene.objects if obj.type == "MESH" and not obj.name.startswith("Studio_")]
|
||||
|
||||
|
||||
def triangle_count(objects):
|
||||
total = 0
|
||||
for obj in objects:
|
||||
obj.data.calc_loop_triangles()
|
||||
total += len(obj.data.loop_triangles)
|
||||
return total
|
||||
|
||||
|
||||
def surface_gaps(body, label):
|
||||
bpy.context.view_layer.update()
|
||||
depsgraph = bpy.context.evaluated_depsgraph_get()
|
||||
tree = BVHTree.FromObject(body, depsgraph)
|
||||
evaluated = label.evaluated_get(depsgraph)
|
||||
mesh = evaluated.to_mesh()
|
||||
inverse = body.matrix_world.inverted()
|
||||
gaps = []
|
||||
for vertex in mesh.vertices:
|
||||
point = inverse @ (label.matrix_world @ vertex.co)
|
||||
nearest, normal, _, _ = tree.find_nearest(point)
|
||||
gaps.append((point - nearest).dot(normal))
|
||||
evaluated.to_mesh_clear()
|
||||
return [min(gaps) * 1000, max(gaps) * 1000]
|
||||
|
||||
|
||||
source_hash = sha256(SOURCE)
|
||||
bpy.ops.wm.open_mainfile(filepath=str(SOURCE))
|
||||
bpy.context.preferences.filepaths.save_version = 0
|
||||
body = bpy.data.objects["OrangeJuice_Bottle_Body"]
|
||||
label = bpy.data.objects["OrangeJuice_Label_Surface"]
|
||||
root = bpy.data.objects["OrangeJuice2L_MilkJug_LabelTest_Root"]
|
||||
source_triangles = triangle_count(mesh_objects())
|
||||
material = bpy.data.materials["OrangeJuice_Label_Tight"]
|
||||
material.name = MATERIAL_NAME
|
||||
texture_node = material.node_tree.nodes["Image Texture"]
|
||||
image = bpy.data.images.load(str(TEXTURE), check_existing=True)
|
||||
image.name = IMAGE_NAME
|
||||
image.colorspace_settings.name = "sRGB"
|
||||
image.use_fake_user = True
|
||||
image.pack()
|
||||
texture_node.image = image
|
||||
old_image = bpy.data.images.get("OrangeJuice_Wrap_Tight")
|
||||
if old_image:
|
||||
bpy.data.images.remove(old_image)
|
||||
root.name = "OrangeJuice2L_MilkJug_OriginalLabel_Root"
|
||||
root["label_design"] = "Original asymmetric geometric citrus tree with a separate right-hand text card"
|
||||
root["label_artwork_origin"] = "Original vector composition; no brand logo and no reference-derived label raster"
|
||||
root["label_fit_method"] = "Surface-cut geometry with shrinkwrap to the actual bottle exterior"
|
||||
assert source_triangles == 970
|
||||
assert triangle_count(mesh_objects()) == source_triangles
|
||||
collection = bpy.data.collections["Model"]
|
||||
bpy.ops.object.select_all(action="DESELECT")
|
||||
for obj in collection.all_objects:
|
||||
obj.select_set(True)
|
||||
bpy.context.view_layer.objects.active = label
|
||||
bpy.ops.export_scene.gltf(
|
||||
filepath=str(GLB), export_format="GLB", use_selection=True,
|
||||
export_yup=True, export_apply=True, export_texcoords=True,
|
||||
export_cameras=False, export_lights=False,
|
||||
)
|
||||
scene = bpy.context.scene
|
||||
camera = scene.camera
|
||||
camera_matrix = camera.matrix_world.copy()
|
||||
camera_scale = camera.data.ortho_scale
|
||||
scene.render.filepath = str(ASSET / "preview_original_label.png")
|
||||
bpy.ops.render.render(write_still=True)
|
||||
for name, position in (("front", (0, -0.55, 0.18)), ("back", (0, 0.55, 0.18)), ("fit", (0.20, -0.28, 0.16))):
|
||||
camera.location = position
|
||||
target = Vector((0, 0, 0.14 if name != "fit" else 0.075))
|
||||
camera.rotation_euler = (target - camera.location).to_track_quat("-Z", "Y").to_euler()
|
||||
camera.data.ortho_scale = 0.325 if name != "fit" else 0.205
|
||||
scene.render.resolution_x = 900
|
||||
scene.render.resolution_y = 900
|
||||
scene.render.filepath = str(ASSET / f"preview_original_label_{name}.png")
|
||||
bpy.ops.render.render(write_still=True)
|
||||
camera.matrix_world = camera_matrix
|
||||
camera.data.ortho_scale = camera_scale
|
||||
scene.render.resolution_x = 720
|
||||
scene.render.resolution_y = 720
|
||||
scene.render.filepath = str(ASSET / "preview_original_label.png")
|
||||
assert sha256(SOURCE) == source_hash, "Source label-test model changed during original-label application"
|
||||
bpy.ops.wm.save_as_mainfile(filepath=str(BLEND), compress=True)
|
||||
|
||||
bpy.ops.wm.open_mainfile(filepath=str(BLEND))
|
||||
body = bpy.data.objects["OrangeJuice_Bottle_Body"]
|
||||
label = bpy.data.objects["OrangeJuice_Label_Surface"]
|
||||
native_gaps = surface_gaps(body, label)
|
||||
native_texture = bpy.data.materials[MATERIAL_NAME].node_tree.nodes["Image Texture"]
|
||||
native_alpha = bpy.data.materials["OrangeJuice_PET_Observe15"].node_tree.nodes["Principled BSDF"].inputs["Alpha"].default_value
|
||||
native_ok = (
|
||||
triangle_count(mesh_objects()) == source_triangles
|
||||
and abs(native_alpha - 0.15) < 0.00001
|
||||
and native_texture.image.name == IMAGE_NAME
|
||||
and list(native_texture.image.size) == [3584, 768]
|
||||
and native_texture.image.packed_file is not None
|
||||
and bpy.data.images.get("OrangeJuice_Wrap_Tight") is None
|
||||
and max(native_gaps) <= 0.061 and min(native_gaps) > 0
|
||||
and label.modifiers["Tight_To_Bottle"].target == body
|
||||
)
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
bpy.ops.import_scene.gltf(filepath=str(GLB))
|
||||
imported_objects = mesh_objects()
|
||||
body = bpy.data.objects["OrangeJuice_Bottle_Body"]
|
||||
label = bpy.data.objects["OrangeJuice_Label_Surface"]
|
||||
glb_gaps = surface_gaps(body, label)
|
||||
glb_texture = bpy.data.materials[MATERIAL_NAME].node_tree.nodes["Image Texture"]
|
||||
glb_alpha = bpy.data.materials["OrangeJuice_PET_Observe15"].node_tree.nodes["Principled BSDF"].inputs["Alpha"].default_value
|
||||
glb_ok = (
|
||||
triangle_count(imported_objects) == source_triangles
|
||||
and abs(glb_alpha - 0.15) < 0.00001
|
||||
and list(glb_texture.image.size) == [3584, 768]
|
||||
and bool(label.data.uv_layers)
|
||||
and bpy.data.images.get("OrangeJuice_Wrap_Tight") is None
|
||||
and max(glb_gaps) <= 0.061 and min(glb_gaps) > 0
|
||||
)
|
||||
assert native_ok and glb_ok, "Original label validation failed"
|
||||
report = {
|
||||
"asset": "OrangeJuice2L_MilkJug_OriginalLabel_Root",
|
||||
"source_model": "model_assets/orange_juice_2l/PerfectCoffee_orange_juice_2l_MilkJug_LabelTest.blend",
|
||||
"source_unchanged": True,
|
||||
"source_sha256": source_hash,
|
||||
"artwork": "Original vector citrus grove with asymmetric geometric tree and right-hand text card",
|
||||
"design_changes": [
|
||||
"Asymmetric low-poly canopy and angled trunk replace the reference-like wreath tree",
|
||||
"Text moves to a separate right-hand cream card",
|
||||
"Oval frame and orange lower semicircle are removed",
|
||||
"Mint-blue palette and diagonal background shapes create a distinct layout",
|
||||
],
|
||||
"brand_logo_present": False,
|
||||
"percentage_purity_claim_present": False,
|
||||
"previous_label_raster_packed": False,
|
||||
"label_texture": "model_assets/labels/orange_juice/orange_grove_wrap.png",
|
||||
"body_opacity": 0.15,
|
||||
"interior_empty": True,
|
||||
"native_triangles": source_triangles,
|
||||
"glb_triangles": source_triangles,
|
||||
"triangle_limit": 1000,
|
||||
"native_surface_gap_mm": native_gaps,
|
||||
"glb_surface_gap_mm": glb_gaps,
|
||||
"label_below_handle": True,
|
||||
"native_reopen_passed": native_ok,
|
||||
"glb_reimport_passed": glb_ok,
|
||||
"technical_validation_passed": True,
|
||||
"visual_review_passed": False,
|
||||
"passed": False,
|
||||
"blend": BLEND.name,
|
||||
"glb": GLB.name,
|
||||
"preview": "preview_original_label.png",
|
||||
"preview_front": "preview_original_label_front.png",
|
||||
"preview_back": "preview_original_label_back.png",
|
||||
"preview_fit": "preview_original_label_fit.png",
|
||||
}
|
||||
(ASSET / "validation_original_label.json").write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n")
|
||||
print(json.dumps(report, ensure_ascii=False, indent=2))
|
||||
@@ -0,0 +1,178 @@
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import bpy
|
||||
from mathutils import Vector
|
||||
from mathutils.bvhtree import BVHTree
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
ROOT = OUT.parents[1]
|
||||
ASSET = ROOT / "orange_juice_2l"
|
||||
SOURCE = ASSET / "PerfectCoffee_orange_juice_2l_MilkJug_OriginalLabel.blend"
|
||||
BLEND = ASSET / "PerfectCoffee_orange_juice_2l_MilkJug_SeedreamLabel.blend"
|
||||
GLB = BLEND.with_suffix(".glb")
|
||||
TEXTURE = OUT / "orange_seedream_wrap.png"
|
||||
MATERIAL_NAME = "OrangeJuice_Label_Seedream"
|
||||
IMAGE_NAME = "OrangeJuice_SeedreamGroveLabel"
|
||||
|
||||
|
||||
def sha256(path):
|
||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def mesh_objects():
|
||||
return [obj for obj in bpy.context.scene.objects if obj.type == "MESH" and not obj.name.startswith("Studio_")]
|
||||
|
||||
|
||||
def triangle_count(objects):
|
||||
total = 0
|
||||
for obj in objects:
|
||||
obj.data.calc_loop_triangles()
|
||||
total += len(obj.data.loop_triangles)
|
||||
return total
|
||||
|
||||
|
||||
def surface_gaps(body, label):
|
||||
bpy.context.view_layer.update()
|
||||
depsgraph = bpy.context.evaluated_depsgraph_get()
|
||||
tree = BVHTree.FromObject(body, depsgraph)
|
||||
evaluated = label.evaluated_get(depsgraph)
|
||||
mesh = evaluated.to_mesh()
|
||||
inverse = body.matrix_world.inverted()
|
||||
gaps = []
|
||||
for vertex in mesh.vertices:
|
||||
point = inverse @ (label.matrix_world @ vertex.co)
|
||||
nearest, normal, _, _ = tree.find_nearest(point)
|
||||
gaps.append((point - nearest).dot(normal))
|
||||
evaluated.to_mesh_clear()
|
||||
return [min(gaps) * 1000, max(gaps) * 1000]
|
||||
|
||||
|
||||
source_hash = sha256(SOURCE)
|
||||
bpy.ops.wm.open_mainfile(filepath=str(SOURCE))
|
||||
bpy.context.preferences.filepaths.save_version = 0
|
||||
body = bpy.data.objects["OrangeJuice_Bottle_Body"]
|
||||
label = bpy.data.objects["OrangeJuice_Label_Surface"]
|
||||
root = bpy.data.objects["OrangeJuice2L_MilkJug_OriginalLabel_Root"]
|
||||
source_triangles = triangle_count(mesh_objects())
|
||||
material = bpy.data.materials["OrangeJuice_Label_Original"]
|
||||
material.name = MATERIAL_NAME
|
||||
texture_node = material.node_tree.nodes["Image Texture"]
|
||||
image = bpy.data.images.load(str(TEXTURE), check_existing=True)
|
||||
image.name = IMAGE_NAME
|
||||
image.colorspace_settings.name = "sRGB"
|
||||
image.use_fake_user = True
|
||||
image.pack()
|
||||
texture_node.image = image
|
||||
old_image = bpy.data.images.get("OrangeGrove_OriginalVector")
|
||||
if old_image:
|
||||
bpy.data.images.remove(old_image)
|
||||
root.name = "OrangeJuice2L_MilkJug_SeedreamLabel_Root"
|
||||
root["label_design"] = "Seedream geometric citrus tree in a hexagonal illustration tile with a right-hand text card"
|
||||
root["label_artwork_origin"] = "Seedream 5.5 text-to-image asset without reference images; original SVG layout"
|
||||
root["seedream_prompt"] = "model_assets/labels/orange_juice/seedream55_grove_prompt.txt"
|
||||
assert source_triangles == 970
|
||||
assert triangle_count(mesh_objects()) == source_triangles
|
||||
collection = bpy.data.collections["Model"]
|
||||
bpy.ops.object.select_all(action="DESELECT")
|
||||
for obj in collection.all_objects:
|
||||
obj.select_set(True)
|
||||
bpy.context.view_layer.objects.active = label
|
||||
bpy.ops.export_scene.gltf(
|
||||
filepath=str(GLB), export_format="GLB", use_selection=True,
|
||||
export_yup=True, export_apply=True, export_texcoords=True,
|
||||
export_cameras=False, export_lights=False,
|
||||
)
|
||||
scene = bpy.context.scene
|
||||
camera = scene.camera
|
||||
camera_matrix = camera.matrix_world.copy()
|
||||
camera_scale = camera.data.ortho_scale
|
||||
scene.render.filepath = str(ASSET / "preview_seedream_label.png")
|
||||
bpy.ops.render.render(write_still=True)
|
||||
for name, position in (("front", (0, -0.55, 0.18)), ("back", (0, 0.55, 0.18)), ("fit", (0.20, -0.28, 0.16))):
|
||||
camera.location = position
|
||||
target = Vector((0, 0, 0.14 if name != "fit" else 0.075))
|
||||
camera.rotation_euler = (target - camera.location).to_track_quat("-Z", "Y").to_euler()
|
||||
camera.data.ortho_scale = 0.325 if name != "fit" else 0.205
|
||||
scene.render.resolution_x = 900
|
||||
scene.render.resolution_y = 900
|
||||
scene.render.filepath = str(ASSET / f"preview_seedream_label_{name}.png")
|
||||
bpy.ops.render.render(write_still=True)
|
||||
camera.matrix_world = camera_matrix
|
||||
camera.data.ortho_scale = camera_scale
|
||||
scene.render.resolution_x = 720
|
||||
scene.render.resolution_y = 720
|
||||
scene.render.filepath = str(ASSET / "preview_seedream_label.png")
|
||||
assert sha256(SOURCE) == source_hash, "Source model changed during Seedream-label application"
|
||||
bpy.ops.wm.save_as_mainfile(filepath=str(BLEND), compress=True)
|
||||
|
||||
bpy.ops.wm.open_mainfile(filepath=str(BLEND))
|
||||
body = bpy.data.objects["OrangeJuice_Bottle_Body"]
|
||||
label = bpy.data.objects["OrangeJuice_Label_Surface"]
|
||||
native_gaps = surface_gaps(body, label)
|
||||
native_texture = bpy.data.materials[MATERIAL_NAME].node_tree.nodes["Image Texture"]
|
||||
native_alpha = bpy.data.materials["OrangeJuice_PET_Observe15"].node_tree.nodes["Principled BSDF"].inputs["Alpha"].default_value
|
||||
native_ok = (
|
||||
triangle_count(mesh_objects()) == source_triangles
|
||||
and abs(native_alpha - 0.15) < 0.00001
|
||||
and native_texture.image.name == IMAGE_NAME
|
||||
and list(native_texture.image.size) == [3584, 768]
|
||||
and native_texture.image.packed_file is not None
|
||||
and bpy.data.images.get("OrangeGrove_OriginalVector") is None
|
||||
and max(native_gaps) <= 0.061 and min(native_gaps) > 0
|
||||
and label.modifiers["Tight_To_Bottle"].target == body
|
||||
)
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
bpy.ops.import_scene.gltf(filepath=str(GLB))
|
||||
imported_objects = mesh_objects()
|
||||
body = bpy.data.objects["OrangeJuice_Bottle_Body"]
|
||||
label = bpy.data.objects["OrangeJuice_Label_Surface"]
|
||||
glb_gaps = surface_gaps(body, label)
|
||||
glb_texture = bpy.data.materials[MATERIAL_NAME].node_tree.nodes["Image Texture"]
|
||||
glb_alpha = bpy.data.materials["OrangeJuice_PET_Observe15"].node_tree.nodes["Principled BSDF"].inputs["Alpha"].default_value
|
||||
glb_ok = (
|
||||
triangle_count(imported_objects) == source_triangles
|
||||
and abs(glb_alpha - 0.15) < 0.00001
|
||||
and list(glb_texture.image.size) == [3584, 768]
|
||||
and bool(label.data.uv_layers)
|
||||
and bpy.data.images.get("OrangeGrove_OriginalVector") is None
|
||||
and max(glb_gaps) <= 0.061 and min(glb_gaps) > 0
|
||||
)
|
||||
assert native_ok and glb_ok, "Seedream label validation failed"
|
||||
report = {
|
||||
"asset": "OrangeJuice2L_MilkJug_SeedreamLabel_Root",
|
||||
"source_model": "model_assets/orange_juice_2l/PerfectCoffee_orange_juice_2l_MilkJug_OriginalLabel.blend",
|
||||
"source_unchanged": True,
|
||||
"source_sha256": source_hash,
|
||||
"artwork": "Seedream 5.5 original geometric citrus tree in a hexagonal tile, with original SVG text layout",
|
||||
"seedream_model": "seedream_5.5",
|
||||
"seedream_reference_images_used": False,
|
||||
"seedream_asset": "model_assets/labels/orange_juice/seedream55_grove.png",
|
||||
"seedream_prompt": "model_assets/labels/orange_juice/seedream55_grove_prompt.txt",
|
||||
"brand_logo_present": False,
|
||||
"percentage_purity_claim_present": False,
|
||||
"previous_label_raster_packed": False,
|
||||
"label_texture": "model_assets/labels/orange_juice/orange_seedream_wrap.png",
|
||||
"body_opacity": 0.15,
|
||||
"interior_empty": True,
|
||||
"native_triangles": source_triangles,
|
||||
"glb_triangles": source_triangles,
|
||||
"triangle_limit": 1000,
|
||||
"native_surface_gap_mm": native_gaps,
|
||||
"glb_surface_gap_mm": glb_gaps,
|
||||
"label_below_handle": True,
|
||||
"native_reopen_passed": native_ok,
|
||||
"glb_reimport_passed": glb_ok,
|
||||
"technical_validation_passed": True,
|
||||
"visual_review_passed": False,
|
||||
"passed": False,
|
||||
"blend": BLEND.name,
|
||||
"glb": GLB.name,
|
||||
"preview": "preview_seedream_label.png",
|
||||
"preview_front": "preview_seedream_label_front.png",
|
||||
"preview_back": "preview_seedream_label_back.png",
|
||||
"preview_fit": "preview_seedream_label_fit.png",
|
||||
}
|
||||
(ASSET / "validation_seedream_label.json").write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n")
|
||||
print(json.dumps(report, ensure_ascii=False, indent=2))
|
||||
@@ -0,0 +1,65 @@
|
||||
import base64
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
WIDTH, HEIGHT = 2048, 768
|
||||
BLUE = "#07527b"
|
||||
ORANGE = "#ed8208"
|
||||
YELLOW = "#fff2a6"
|
||||
|
||||
|
||||
def orange_icon(cx, cy, scale=1.0):
|
||||
return f'''<g transform="translate({cx} {cy}) scale({scale})">
|
||||
<path d="M 4 -29 C 17 -62 43 -68 65 -62 C 56 -37 33 -24 4 -29 Z" fill="#246d37"/>
|
||||
<path d="M -2 -27 C -15 -51 -38 -55 -52 -45 C -41 -23 -20 -17 -2 -27 Z" fill="#9bbd3e"/>
|
||||
<path d="M 0 -25 Q 9 -42 24 -51" fill="none" stroke="#326b32" stroke-width="5" stroke-linecap="round"/>
|
||||
<circle cx="0" cy="14" r="46" fill="#f28a09"/>
|
||||
<path d="M -27 2 Q -8 -14 18 -5" fill="none" stroke="#f9ac22" stroke-width="6" stroke-linecap="round" opacity="0.65"/>
|
||||
</g>'''
|
||||
|
||||
|
||||
def text(x, y, value, size, fill=BLUE, weight=700, family="Arial, sans-serif", spacing=0):
|
||||
return (f'<text x="{x}" y="{y}" text-anchor="middle" font-family="{family}" '
|
||||
f'font-size="{size}" font-weight="{weight}" letter-spacing="{spacing}" fill="{fill}">{value}</text>')
|
||||
|
||||
|
||||
base64_image = base64.b64encode((OUT / "decorative_base_cutout.png").read_bytes()).decode("ascii")
|
||||
parts = [f'''<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{WIDTH}" height="{HEIGHT}" viewBox="0 0 {WIDTH} {HEIGHT}">
|
||||
<defs>
|
||||
<linearGradient id="sky" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#eaf9ff"/>
|
||||
<stop offset="0.58" stop-color="#cceef7"/>
|
||||
<stop offset="1" stop-color="#a7ddec"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect width="2048" height="768" fill="url(#sky)"/>
|
||||
<rect width="2048" height="12" fill="{ORANGE}"/>
|
||||
<rect y="716" width="2048" height="52" fill="{ORANGE}"/>
|
||||
<path d="M0 701 Q256 681 512 701 T1024 701 T1536 701 T2048 701" fill="none" stroke="#f5a51b" stroke-width="5"/>
|
||||
''']
|
||||
for x in (0, WIDTH):
|
||||
parts.append(orange_icon(x, 346, 1.1))
|
||||
for x in (290, 1758):
|
||||
parts.append(orange_icon(x, 245, 1.25))
|
||||
parts.append(text(x, 385, "ORANGE", 24, weight=700, spacing=1.8))
|
||||
parts.append(f'<image x="694" y="34" width="660" height="700" xlink:href="data:image/png;base64,{base64_image}"/>')
|
||||
parts.extend([
|
||||
text(1024, 309, "ORANGE", 65, weight=900, spacing=1),
|
||||
text(1024, 380, "JUICE", 58, weight=900, spacing=4),
|
||||
'<path d="M 957 402 L 1091 402" stroke="#ee8909" stroke-width="5" stroke-linecap="round"/>',
|
||||
text(1024, 556, "FRESH & FRUITY", 17, fill=YELLOW, weight=700, spacing=2.5),
|
||||
text(1024, 616, "鲜橙汁", 45, fill=YELLOW, weight=600, family="PingFang SC, Microsoft YaHei, sans-serif", spacing=4),
|
||||
text(1024, 669, "2 L", 28, fill=YELLOW, weight=700, spacing=3),
|
||||
'</svg>',
|
||||
])
|
||||
svg_path = OUT / "orange_juice_wrap.svg"
|
||||
svg_path.write_text("\n".join(parts), encoding="utf-8")
|
||||
subprocess.run(["sips", "-s", "format", "png", str(svg_path), "--out", str(OUT / "orange_juice_wrap.png")], check=True)
|
||||
subprocess.run([
|
||||
"ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-i", str(OUT / "orange_juice_wrap.png"),
|
||||
"-vf", "crop=960:768:544:0", "-frames:v", "1", str(OUT / "orange_juice_front.png"),
|
||||
], check=True)
|
||||
print(OUT / "orange_juice_wrap.svg")
|
||||
print(OUT / "orange_juice_wrap.png")
|
||||
print(OUT / "orange_juice_front.png")
|
||||
@@ -0,0 +1,81 @@
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
WIDTH, HEIGHT = 3584, 768
|
||||
|
||||
|
||||
def side_icon(x):
|
||||
return f'''<g transform="translate({x} 360)">
|
||||
<path d="M 0 -62 L 46 -8 L 0 48 L -46 -8 Z" fill="#f28a19"/>
|
||||
<path d="M 0 -48 C 8 -79 34 -89 57 -82 C 45 -57 23 -43 0 -48 Z" fill="#397c55"/>
|
||||
<path d="M -3 -42 C -18 -66 -39 -66 -53 -55 C -38 -34 -20 -31 -3 -42 Z" fill="#91bd68"/>
|
||||
<path d="M -16 -9 L 4 13" stroke="#ffd37c" stroke-width="5" stroke-linecap="round"/>
|
||||
</g>'''
|
||||
|
||||
|
||||
parts = ['''<svg xmlns="http://www.w3.org/2000/svg" width="3584" height="768" viewBox="0 0 3584 768">
|
||||
<defs>
|
||||
<linearGradient id="mintSky" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#e5f7f3"/>
|
||||
<stop offset="0.62" stop-color="#ccece9"/>
|
||||
<stop offset="1" stop-color="#abd9dc"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect width="3584" height="768" fill="url(#mintSky)"/>
|
||||
<path d="M0 102 C640 12 1050 192 1590 98 C2200 -10 2850 96 3584 28 L3584 0 L0 0 Z" fill="#f6faf1" opacity="0.75"/>
|
||||
<path d="M0 668 C620 614 1030 722 1600 654 C2220 580 2860 712 3584 628" fill="none" stroke="#f8fcf7" stroke-width="38" opacity="0.65"/>
|
||||
<path d="M0 732 L3584 732" stroke="#f28a19" stroke-width="12"/>
|
||||
<path d="M0 744 L3584 744" stroke="#247763" stroke-width="4" opacity="0.55"/>
|
||||
''']
|
||||
for x in (0, 640, 2944, 3584):
|
||||
parts.append(side_icon(x))
|
||||
for x in (640, 2944):
|
||||
parts.append(f'<text x="{x}" y="510" text-anchor="middle" font-family="Arial, sans-serif" font-size="25" font-weight="700" letter-spacing="3" fill="#17666a">ORANGE</text>')
|
||||
parts.append('''
|
||||
<g id="asymmetric-citrus-tree">
|
||||
<path d="M1460 630 L1487 478 L1526 363 L1570 264" fill="none" stroke="#be7535" stroke-width="25" stroke-linecap="square" stroke-linejoin="bevel"/>
|
||||
<path d="M1492 472 L1408 390 L1360 312 M1514 423 L1610 355 L1654 278" fill="none" stroke="#be7535" stroke-width="14" stroke-linecap="square"/>
|
||||
<path d="M1290 330 L1350 205 L1450 175 L1510 260 L1450 360 L1350 400 Z" fill="#4b8b59"/>
|
||||
<path d="M1490 248 L1570 145 L1668 195 L1705 300 L1615 352 L1530 330 Z" fill="#77ac62"/>
|
||||
<path d="M1288 440 L1355 345 L1450 365 L1480 450 L1400 510 L1315 505 Z" fill="#86b96a"/>
|
||||
<path d="M1530 380 L1620 320 L1700 375 L1675 470 L1580 470 Z" fill="#2f7450"/>
|
||||
<path d="M1310 283 L1370 235 L1418 250 L1372 310 Z" fill="#2e744b" opacity="0.8"/>
|
||||
<path d="M1540 235 L1590 177 L1622 216 L1582 275 Z" fill="#a0c875"/>
|
||||
<path d="M1320 442 L1385 388 L1420 423 L1362 474 Z" fill="#a4c873"/>
|
||||
<path d="M1580 401 L1632 355 L1670 384 L1628 436 Z" fill="#57955c"/>
|
||||
<circle cx="1404" cy="281" r="39" fill="#f28a19"/>
|
||||
<circle cx="1586" cy="258" r="43" fill="#ed7e12"/>
|
||||
<circle cx="1480" cy="405" r="36" fill="#f3971d"/>
|
||||
<path d="M1382 267 Q1396 250 1417 257" fill="none" stroke="#ffb63c" stroke-width="7" stroke-linecap="round"/>
|
||||
<path d="M1568 239 Q1582 221 1603 232" fill="none" stroke="#ffb63c" stroke-width="7" stroke-linecap="round"/>
|
||||
<path d="M1342 479 A42 42 0 0 1 1426 479 Z" fill="#f49a20"/>
|
||||
<path d="M1350 476 A34 34 0 0 1 1418 476 Z" fill="#ffd580"/>
|
||||
<path d="M1384 476 L1361 449 M1384 476 L1407 449 M1384 476 L1384 443" stroke="#fff2c2" stroke-width="4"/>
|
||||
<path d="M1455 632 L1510 632" stroke="#a9602c" stroke-width="14" stroke-linecap="square"/>
|
||||
</g>
|
||||
<g id="right-aligned-label-copy">
|
||||
<rect x="1760" y="154" width="430" height="480" rx="34" fill="#faf6e9"/>
|
||||
<path d="M1760 188 Q1760 154 1794 154 L1794 634 L1794 634 Q1760 634 1760 600 Z" fill="#f28a19"/>
|
||||
<text x="1822" y="229" font-family="Arial, sans-serif" font-size="24" font-weight="700" letter-spacing="6" fill="#3a806d">CITRUS</text>
|
||||
<text x="1817" y="322" font-family="Arial, sans-serif" font-size="66" font-weight="900" fill="#0c5961">ORANGE</text>
|
||||
<text x="1820" y="394" font-family="Arial, sans-serif" font-size="56" font-weight="800" letter-spacing="4" fill="#0c5961">JUICE</text>
|
||||
<path d="M1822 423 L2105 423" stroke="#e4b35e" stroke-width="4"/>
|
||||
<rect x="1820" y="451" width="304" height="75" rx="37" fill="#ed8a22"/>
|
||||
<text x="1972" y="501" text-anchor="middle" font-family="PingFang SC, Microsoft YaHei, sans-serif" font-size="38" font-weight="600" letter-spacing="4" fill="#fff7df">鲜橙汁</text>
|
||||
<text x="1822" y="585" font-family="Arial, sans-serif" font-size="31" font-weight="700" letter-spacing="3" fill="#0c5961">2 L</text>
|
||||
<path d="M2050 562 L2090 562 L2090 602 L2050 602 Z" fill="#9fc7b0"/>
|
||||
<path d="M2057 589 Q2070 570 2083 589" fill="none" stroke="#faf6e9" stroke-width="4"/>
|
||||
</g>
|
||||
</svg>''')
|
||||
svg_path = OUT / "orange_grove_wrap.svg"
|
||||
svg_path.write_text("\n".join(parts), encoding="utf-8")
|
||||
assert "100%" not in svg_path.read_text()
|
||||
assert "eastcoast" not in svg_path.read_text().lower()
|
||||
subprocess.run(["sips", "-s", "format", "png", str(svg_path), "--out", str(OUT / "orange_grove_wrap.png")], check=True)
|
||||
subprocess.run([
|
||||
"ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-i", str(OUT / "orange_grove_wrap.png"),
|
||||
"-vf", "crop=1376:768:1104:0", "-frames:v", "1", str(OUT / "orange_grove_front.png"),
|
||||
], check=True)
|
||||
print(OUT / "orange_grove_wrap.png")
|
||||
print(OUT / "orange_grove_front.png")
|
||||
@@ -0,0 +1,68 @@
|
||||
import base64
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
WIDTH, HEIGHT = 3584, 768
|
||||
image = base64.b64encode((OUT / "seedream55_grove.png").read_bytes()).decode("ascii")
|
||||
|
||||
|
||||
def side_icon(x):
|
||||
return f'''<g transform="translate({x} 360)">
|
||||
<path d="M 0 -62 L 46 -8 L 0 48 L -46 -8 Z" fill="#f28a19"/>
|
||||
<path d="M 0 -48 C 8 -79 34 -89 57 -82 C 45 -57 23 -43 0 -48 Z" fill="#397c55"/>
|
||||
<path d="M -3 -42 C -18 -66 -39 -66 -53 -55 C -38 -34 -20 -31 -3 -42 Z" fill="#91bd68"/>
|
||||
<path d="M -16 -9 L 4 13" stroke="#ffd37c" stroke-width="5" stroke-linecap="round"/>
|
||||
</g>'''
|
||||
|
||||
|
||||
parts = [f'''<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="3584" height="768" viewBox="0 0 3584 768">
|
||||
<defs>
|
||||
<linearGradient id="mintSky" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#e5f7f3"/>
|
||||
<stop offset="0.62" stop-color="#ccece9"/>
|
||||
<stop offset="1" stop-color="#abd9dc"/>
|
||||
</linearGradient>
|
||||
<clipPath id="groveTile">
|
||||
<path d="M1360 62 L1812 62 L1922 384 L1812 706 L1360 706 L1248 384 Z"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<rect width="3584" height="768" fill="url(#mintSky)"/>
|
||||
<path d="M0 102 C640 12 1050 192 1590 98 C2200 -10 2850 96 3584 28 L3584 0 L0 0 Z" fill="#f6faf1" opacity="0.75"/>
|
||||
<path d="M0 668 C620 614 1030 722 1600 654 C2220 580 2860 712 3584 628" fill="none" stroke="#f8fcf7" stroke-width="38" opacity="0.65"/>
|
||||
<path d="M0 732 L3584 732" stroke="#f28a19" stroke-width="12"/>
|
||||
<path d="M0 744 L3584 744" stroke="#247763" stroke-width="4" opacity="0.55"/>
|
||||
''']
|
||||
for x in (0, 640, 2944, 3584):
|
||||
parts.append(side_icon(x))
|
||||
for x in (640, 2944):
|
||||
parts.append(f'<text x="{x}" y="510" text-anchor="middle" font-family="Arial, sans-serif" font-size="25" font-weight="700" letter-spacing="3" fill="#17666a">ORANGE</text>')
|
||||
parts.append(f'''
|
||||
<path d="M1360 62 L1812 62 L1922 384 L1812 706 L1360 706 L1248 384 Z" fill="#f7f5e9" stroke="#397c55" stroke-width="7"/>
|
||||
<image x="1288" y="62" width="634" height="644" clip-path="url(#groveTile)" xlink:href="data:image/png;base64,{image}"/>
|
||||
<path d="M1360 62 L1812 62 L1922 384 L1812 706 L1360 706 L1248 384 Z" fill="none" stroke="#397c55" stroke-width="7"/>
|
||||
<g id="right-aligned-label-copy" transform="translate(180 0)">
|
||||
<rect x="1760" y="154" width="430" height="480" rx="34" fill="#faf6e9"/>
|
||||
<path d="M1760 188 Q1760 154 1794 154 L1794 634 L1794 634 Q1760 634 1760 600 Z" fill="#f28a19"/>
|
||||
<text x="1822" y="229" font-family="Arial, sans-serif" font-size="24" font-weight="700" letter-spacing="6" fill="#3a806d">CITRUS</text>
|
||||
<text x="1817" y="322" font-family="Arial, sans-serif" font-size="66" font-weight="900" fill="#0c5961">ORANGE</text>
|
||||
<text x="1820" y="394" font-family="Arial, sans-serif" font-size="56" font-weight="800" letter-spacing="4" fill="#0c5961">JUICE</text>
|
||||
<path d="M1822 423 L2105 423" stroke="#e4b35e" stroke-width="4"/>
|
||||
<rect x="1820" y="451" width="304" height="75" rx="37" fill="#ed8a22"/>
|
||||
<text x="1972" y="501" text-anchor="middle" font-family="PingFang SC, Microsoft YaHei, sans-serif" font-size="38" font-weight="600" letter-spacing="4" fill="#fff7df">鲜橙汁</text>
|
||||
<text x="1822" y="585" font-family="Arial, sans-serif" font-size="31" font-weight="700" letter-spacing="3" fill="#0c5961">2 L</text>
|
||||
<path d="M2050 562 L2090 562 L2090 602 L2050 602 Z" fill="#9fc7b0"/>
|
||||
<path d="M2057 589 Q2070 570 2083 589" fill="none" stroke="#faf6e9" stroke-width="4"/>
|
||||
</g>
|
||||
</svg>''')
|
||||
svg_path = OUT / "orange_seedream_wrap.svg"
|
||||
svg_path.write_text("\n".join(parts), encoding="utf-8")
|
||||
assert "100%" not in svg_path.read_text()
|
||||
assert "eastcoast" not in svg_path.read_text().lower()
|
||||
subprocess.run(["sips", "-s", "format", "png", str(svg_path), "--out", str(OUT / "orange_seedream_wrap.png")], check=True)
|
||||
subprocess.run([
|
||||
"ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-i", str(OUT / "orange_seedream_wrap.png"),
|
||||
"-vf", "crop=1376:768:1000:0", "-frames:v", "1", str(OUT / "orange_seedream_front.png"),
|
||||
], check=True)
|
||||
print(OUT / "orange_seedream_wrap.png")
|
||||
print(OUT / "orange_seedream_front.png")
|
||||
@@ -0,0 +1,34 @@
|
||||
import base64
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
WIDTH, HEIGHT = 3584, 768
|
||||
source = (OUT / "orange_juice_wrap.png").read_bytes()
|
||||
assert b"100%" not in (OUT / "orange_juice_wrap.svg").read_bytes()
|
||||
encoded = base64.b64encode(source).decode("ascii")
|
||||
|
||||
|
||||
def orange_icon(cx):
|
||||
return f'''<g transform="translate({cx} 345) scale(1.1)">
|
||||
<path d="M4 -29 C17 -62 43 -68 65 -62 C56 -37 33 -24 4 -29 Z" fill="#246d37"/>
|
||||
<path d="M-2 -27 C-15 -51 -38 -55 -52 -45 C-41 -23 -20 -17 -2 -27 Z" fill="#9bbd3e"/>
|
||||
<circle cx="0" cy="14" r="46" fill="#f28a09"/>
|
||||
</g>'''
|
||||
|
||||
|
||||
svg = f'''<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{WIDTH}" height="{HEIGHT}" viewBox="0 0 {WIDTH} {HEIGHT}">
|
||||
<defs><linearGradient id="sky" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#eaf9ff"/><stop offset="0.58" stop-color="#cceef7"/><stop offset="1" stop-color="#a7ddec"/>
|
||||
</linearGradient></defs>
|
||||
<rect width="3584" height="768" fill="url(#sky)"/>
|
||||
<rect width="3584" height="12" fill="#ed8208"/><rect y="716" width="3584" height="52" fill="#ed8208"/>
|
||||
<path d="M0 701 Q448 681 896 701 T1792 701 T2688 701 T3584 701" fill="none" stroke="#f5a51b" stroke-width="5"/>
|
||||
{orange_icon(0)}{orange_icon(3584)}
|
||||
{orange_icon(384)}{orange_icon(3200)}
|
||||
<image x="768" y="0" width="2048" height="768" xlink:href="data:image/png;base64,{encoded}"/>
|
||||
</svg>'''
|
||||
svg_path = OUT / "orange_juice_wrap_wide.svg"
|
||||
svg_path.write_text(svg, encoding="utf-8")
|
||||
subprocess.run(["sips", "-s", "format", "png", str(svg_path), "--out", str(OUT / "orange_juice_wrap_wide.png")], check=True)
|
||||
print(OUT / "orange_juice_wrap_wide.png")
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"jobKey": "perfect-coffee-original-orange-label",
|
||||
"canvasId": "3cee1497-ce35-4c74-9d12-a6d09136c1a4",
|
||||
"canvasUrl": "https://jimeng.jianying.com/ai-tool/ai-canvas/3cee1497-ce35-4c74-9d12-a6d09136c1a4",
|
||||
"reference": {
|
||||
"pageUrl": "https://eastcoastbeverages.com.au/products/orange-juice/",
|
||||
"imageUrl": "https://eastcoastbeverages.com.au/wp-content/uploads/orange-juice.jpg",
|
||||
"resourceId": "d3323f6f-2790-4c93-b759-3a7b5f41f40a",
|
||||
"usage": "Composition and color reference only; original game label, no brand reproduction"
|
||||
},
|
||||
"items": {
|
||||
"decorative-label-base": {
|
||||
"nodeId": "node_8ad2hvmxjf",
|
||||
"model": "seedream_5.5",
|
||||
"ratio": "1:1",
|
||||
"resolution": "2K",
|
||||
"count": 1,
|
||||
"textAddedSeparately": true,
|
||||
"submitId": "304a3a66-eb79-4f09-b62b-73d425389d1b",
|
||||
"operationRef": "304a3a66-eb79-4f09-b62b-73d425389d1b",
|
||||
"selectedResourceId": "7ffc8922-7717-437d-8caf-0a68f2bb24ba",
|
||||
"resourceState": "succeeded",
|
||||
"sourceImageSize": [2048, 2048],
|
||||
"download": "decorative_base.png",
|
||||
"downloadSha256": "634a475cf29f3c42c284799f8c7cf84be09f659dcab3c53941cd18d0bf283c9e"
|
||||
}
|
||||
},
|
||||
"deliverables": {
|
||||
"wrapSvg": "orange_juice_wrap.svg",
|
||||
"wrapPng": "orange_juice_wrap.png",
|
||||
"frontPreview": "orange_juice_front.png",
|
||||
"wideWrapSvg": "orange_juice_wrap_wide.svg",
|
||||
"wideWrapPng": "orange_juice_wrap_wide.png",
|
||||
"wideDimensions": [3584, 768],
|
||||
"labelTestBlend": "model_assets/orange_juice_2l/PerfectCoffee_orange_juice_2l_MilkJug_LabelTest.blend",
|
||||
"labelTestSurfaceGapMm": [0.04242360228090547, 0.060001304518664256],
|
||||
"labelTestApplied": true,
|
||||
"originalVectorVariant": {
|
||||
"svg": "orange_grove_wrap.svg",
|
||||
"png": "orange_grove_wrap.png",
|
||||
"frontPreview": "orange_grove_front.png",
|
||||
"blend": "model_assets/orange_juice_2l/PerfectCoffee_orange_juice_2l_MilkJug_OriginalLabel.blend",
|
||||
"artworkSource": "New original vector geometry and layout; no reference image used for this variant",
|
||||
"previousLabelRasterPacked": false,
|
||||
"applied": true
|
||||
},
|
||||
"dimensions": [2048, 768],
|
||||
"frontCenterU": 0.5,
|
||||
"seamU": 0.0,
|
||||
"editableElements": "Text, palette, background bands and layout in SVG; orange-tree artwork is raster",
|
||||
"text": ["ORANGE", "JUICE", "FRESH & FRUITY", "鲜橙汁", "2 L"],
|
||||
"removedClaims": ["100%"],
|
||||
"brandLogoUsed": false,
|
||||
"appliedToBottleOrUvModified": false,
|
||||
"applicationScript": "apply_label.py",
|
||||
"removalScript": "remove_label.py",
|
||||
"applicationStatus": "Removed after bottle-fit review; source textures retained"
|
||||
},
|
||||
"modelFilesModified": {
|
||||
"orange_juice": true,
|
||||
"milk": false,
|
||||
"milk_frother": false
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,76 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="3584" height="768" viewBox="0 0 3584 768">
|
||||
<defs>
|
||||
<linearGradient id="mintSky" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#e5f7f3"/>
|
||||
<stop offset="0.62" stop-color="#ccece9"/>
|
||||
<stop offset="1" stop-color="#abd9dc"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect width="3584" height="768" fill="url(#mintSky)"/>
|
||||
<path d="M0 102 C640 12 1050 192 1590 98 C2200 -10 2850 96 3584 28 L3584 0 L0 0 Z" fill="#f6faf1" opacity="0.75"/>
|
||||
<path d="M0 668 C620 614 1030 722 1600 654 C2220 580 2860 712 3584 628" fill="none" stroke="#f8fcf7" stroke-width="38" opacity="0.65"/>
|
||||
<path d="M0 732 L3584 732" stroke="#f28a19" stroke-width="12"/>
|
||||
<path d="M0 744 L3584 744" stroke="#247763" stroke-width="4" opacity="0.55"/>
|
||||
|
||||
<g transform="translate(0 360)">
|
||||
<path d="M 0 -62 L 46 -8 L 0 48 L -46 -8 Z" fill="#f28a19"/>
|
||||
<path d="M 0 -48 C 8 -79 34 -89 57 -82 C 45 -57 23 -43 0 -48 Z" fill="#397c55"/>
|
||||
<path d="M -3 -42 C -18 -66 -39 -66 -53 -55 C -38 -34 -20 -31 -3 -42 Z" fill="#91bd68"/>
|
||||
<path d="M -16 -9 L 4 13" stroke="#ffd37c" stroke-width="5" stroke-linecap="round"/>
|
||||
</g>
|
||||
<g transform="translate(640 360)">
|
||||
<path d="M 0 -62 L 46 -8 L 0 48 L -46 -8 Z" fill="#f28a19"/>
|
||||
<path d="M 0 -48 C 8 -79 34 -89 57 -82 C 45 -57 23 -43 0 -48 Z" fill="#397c55"/>
|
||||
<path d="M -3 -42 C -18 -66 -39 -66 -53 -55 C -38 -34 -20 -31 -3 -42 Z" fill="#91bd68"/>
|
||||
<path d="M -16 -9 L 4 13" stroke="#ffd37c" stroke-width="5" stroke-linecap="round"/>
|
||||
</g>
|
||||
<g transform="translate(2944 360)">
|
||||
<path d="M 0 -62 L 46 -8 L 0 48 L -46 -8 Z" fill="#f28a19"/>
|
||||
<path d="M 0 -48 C 8 -79 34 -89 57 -82 C 45 -57 23 -43 0 -48 Z" fill="#397c55"/>
|
||||
<path d="M -3 -42 C -18 -66 -39 -66 -53 -55 C -38 -34 -20 -31 -3 -42 Z" fill="#91bd68"/>
|
||||
<path d="M -16 -9 L 4 13" stroke="#ffd37c" stroke-width="5" stroke-linecap="round"/>
|
||||
</g>
|
||||
<g transform="translate(3584 360)">
|
||||
<path d="M 0 -62 L 46 -8 L 0 48 L -46 -8 Z" fill="#f28a19"/>
|
||||
<path d="M 0 -48 C 8 -79 34 -89 57 -82 C 45 -57 23 -43 0 -48 Z" fill="#397c55"/>
|
||||
<path d="M -3 -42 C -18 -66 -39 -66 -53 -55 C -38 -34 -20 -31 -3 -42 Z" fill="#91bd68"/>
|
||||
<path d="M -16 -9 L 4 13" stroke="#ffd37c" stroke-width="5" stroke-linecap="round"/>
|
||||
</g>
|
||||
<text x="640" y="510" text-anchor="middle" font-family="Arial, sans-serif" font-size="25" font-weight="700" letter-spacing="3" fill="#17666a">ORANGE</text>
|
||||
<text x="2944" y="510" text-anchor="middle" font-family="Arial, sans-serif" font-size="25" font-weight="700" letter-spacing="3" fill="#17666a">ORANGE</text>
|
||||
|
||||
<g id="asymmetric-citrus-tree">
|
||||
<path d="M1460 630 L1487 478 L1526 363 L1570 264" fill="none" stroke="#be7535" stroke-width="25" stroke-linecap="square" stroke-linejoin="bevel"/>
|
||||
<path d="M1492 472 L1408 390 L1360 312 M1514 423 L1610 355 L1654 278" fill="none" stroke="#be7535" stroke-width="14" stroke-linecap="square"/>
|
||||
<path d="M1290 330 L1350 205 L1450 175 L1510 260 L1450 360 L1350 400 Z" fill="#4b8b59"/>
|
||||
<path d="M1490 248 L1570 145 L1668 195 L1705 300 L1615 352 L1530 330 Z" fill="#77ac62"/>
|
||||
<path d="M1288 440 L1355 345 L1450 365 L1480 450 L1400 510 L1315 505 Z" fill="#86b96a"/>
|
||||
<path d="M1530 380 L1620 320 L1700 375 L1675 470 L1580 470 Z" fill="#2f7450"/>
|
||||
<path d="M1310 283 L1370 235 L1418 250 L1372 310 Z" fill="#2e744b" opacity="0.8"/>
|
||||
<path d="M1540 235 L1590 177 L1622 216 L1582 275 Z" fill="#a0c875"/>
|
||||
<path d="M1320 442 L1385 388 L1420 423 L1362 474 Z" fill="#a4c873"/>
|
||||
<path d="M1580 401 L1632 355 L1670 384 L1628 436 Z" fill="#57955c"/>
|
||||
<circle cx="1404" cy="281" r="39" fill="#f28a19"/>
|
||||
<circle cx="1586" cy="258" r="43" fill="#ed7e12"/>
|
||||
<circle cx="1480" cy="405" r="36" fill="#f3971d"/>
|
||||
<path d="M1382 267 Q1396 250 1417 257" fill="none" stroke="#ffb63c" stroke-width="7" stroke-linecap="round"/>
|
||||
<path d="M1568 239 Q1582 221 1603 232" fill="none" stroke="#ffb63c" stroke-width="7" stroke-linecap="round"/>
|
||||
<path d="M1342 479 A42 42 0 0 1 1426 479 Z" fill="#f49a20"/>
|
||||
<path d="M1350 476 A34 34 0 0 1 1418 476 Z" fill="#ffd580"/>
|
||||
<path d="M1384 476 L1361 449 M1384 476 L1407 449 M1384 476 L1384 443" stroke="#fff2c2" stroke-width="4"/>
|
||||
<path d="M1455 632 L1510 632" stroke="#a9602c" stroke-width="14" stroke-linecap="square"/>
|
||||
</g>
|
||||
<g id="right-aligned-label-copy">
|
||||
<rect x="1760" y="154" width="430" height="480" rx="34" fill="#faf6e9"/>
|
||||
<path d="M1760 188 Q1760 154 1794 154 L1794 634 L1794 634 Q1760 634 1760 600 Z" fill="#f28a19"/>
|
||||
<text x="1822" y="229" font-family="Arial, sans-serif" font-size="24" font-weight="700" letter-spacing="6" fill="#3a806d">CITRUS</text>
|
||||
<text x="1817" y="322" font-family="Arial, sans-serif" font-size="66" font-weight="900" fill="#0c5961">ORANGE</text>
|
||||
<text x="1820" y="394" font-family="Arial, sans-serif" font-size="56" font-weight="800" letter-spacing="4" fill="#0c5961">JUICE</text>
|
||||
<path d="M1822 423 L2105 423" stroke="#e4b35e" stroke-width="4"/>
|
||||
<rect x="1820" y="451" width="304" height="75" rx="37" fill="#ed8a22"/>
|
||||
<text x="1972" y="501" text-anchor="middle" font-family="PingFang SC, Microsoft YaHei, sans-serif" font-size="38" font-weight="600" letter-spacing="4" fill="#fff7df">鲜橙汁</text>
|
||||
<text x="1822" y="585" font-family="Arial, sans-serif" font-size="31" font-weight="700" letter-spacing="3" fill="#0c5961">2 L</text>
|
||||
<path d="M2050 562 L2090 562 L2090 602 L2050 602 Z" fill="#9fc7b0"/>
|
||||
<path d="M2057 589 Q2070 570 2083 589" fill="none" stroke="#faf6e9" stroke-width="4"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 743 KiB |
Binary file not shown.
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 1.0 MiB |
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 4.8 MiB |
@@ -0,0 +1,169 @@
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import bpy
|
||||
from mathutils import Vector
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
ROOT = OUT.parents[1]
|
||||
ASSET = ROOT / "orange_juice_2l"
|
||||
BLEND = ASSET / "PerfectCoffee_orange_juice_2l.blend"
|
||||
GLB = ASSET / "PerfectCoffee_orange_juice_2l.glb"
|
||||
REPORT = ASSET / "validation.json"
|
||||
STATE = OUT / "application_validation.json"
|
||||
BODY = "OrangeJuice_Bottle_Body"
|
||||
LABEL_MATERIAL = "OrangeJuice_Label"
|
||||
|
||||
|
||||
def sha256(path):
|
||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def mesh_objects():
|
||||
return [obj for obj in bpy.context.scene.objects if obj.type == "MESH" and not obj.name.startswith("Studio_")]
|
||||
|
||||
|
||||
def triangle_count(objects):
|
||||
total = 0
|
||||
for obj in objects:
|
||||
obj.data.calc_loop_triangles()
|
||||
total += len(obj.data.loop_triangles)
|
||||
return total
|
||||
|
||||
|
||||
source_hash = sha256(BLEND)
|
||||
cap_hashes = {
|
||||
name: sha256(ASSET / name)
|
||||
for name in ("PerfectCoffee_orange_juice_2l_Cap.blend", "PerfectCoffee_orange_juice_2l_Cap.glb")
|
||||
}
|
||||
bpy.ops.wm.open_mainfile(filepath=str(BLEND))
|
||||
bpy.context.preferences.filepaths.save_version = 0
|
||||
body = bpy.data.objects[BODY]
|
||||
original_triangles = triangle_count(mesh_objects())
|
||||
original_vertices = len(body.data.vertices)
|
||||
original_polygons = len(body.data.polygons)
|
||||
pet = bpy.data.materials["OrangeJuice_ClearPET"]
|
||||
body.data.materials.clear()
|
||||
body.data.materials.append(pet)
|
||||
for polygon in body.data.polygons:
|
||||
polygon.material_index = 0
|
||||
uv = body.data.uv_layers.get("UVMap_Label")
|
||||
if uv:
|
||||
body.data.uv_layers.remove(uv)
|
||||
for key in ("label_scope", "label_z_range_m", "label_seam"):
|
||||
if key in body:
|
||||
del body[key]
|
||||
label_material = bpy.data.materials.get(LABEL_MATERIAL)
|
||||
if label_material and label_material.users == 0:
|
||||
bpy.data.materials.remove(label_material)
|
||||
label_image = bpy.data.images.get("OrangeJuice_Wrap_NoPercentage")
|
||||
if label_image:
|
||||
bpy.data.images.remove(label_image)
|
||||
assert triangle_count(mesh_objects()) == original_triangles
|
||||
assert len(body.data.vertices) == original_vertices
|
||||
assert len(body.data.polygons) == original_polygons
|
||||
collection = bpy.data.collections["Model"]
|
||||
bpy.ops.object.select_all(action="DESELECT")
|
||||
for obj in collection.all_objects:
|
||||
obj.select_set(True)
|
||||
bpy.context.view_layer.objects.active = body
|
||||
bpy.ops.export_scene.gltf(
|
||||
filepath=str(GLB), export_format="GLB", use_selection=True,
|
||||
export_yup=True, export_apply=True, export_texcoords=True,
|
||||
export_cameras=False, export_lights=False,
|
||||
)
|
||||
scene = bpy.context.scene
|
||||
scene.render.filepath = str(ASSET / "preview.png")
|
||||
bpy.ops.render.render(write_still=True)
|
||||
pivot = bpy.data.objects["OrangeJuice_Cap_Pivot"]
|
||||
location = pivot.location.copy()
|
||||
pivot.location += Vector((0.045, 0, 0.055))
|
||||
scene.render.filepath = str(ASSET / "preview_cap_removed.png")
|
||||
bpy.ops.render.render(write_still=True)
|
||||
pivot.location = location
|
||||
scene.render.filepath = str(ASSET / "preview.png")
|
||||
assert sha256(BLEND) == source_hash, "Bottle changed on disk during label removal; not saving"
|
||||
bpy.ops.wm.save_as_mainfile(filepath=str(BLEND), compress=True)
|
||||
|
||||
bpy.ops.wm.open_mainfile(filepath=str(BLEND))
|
||||
native_ok = (
|
||||
triangle_count(mesh_objects()) == original_triangles
|
||||
and bpy.data.objects[BODY].data.uv_layers.get("UVMap_Label") is None
|
||||
and bpy.data.materials.get(LABEL_MATERIAL) is None
|
||||
and len(bpy.data.objects[BODY].data.materials) == 1
|
||||
and bpy.data.objects[BODY].data.materials[0].name == "OrangeJuice_ClearPET"
|
||||
)
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
bpy.ops.import_scene.gltf(filepath=str(GLB))
|
||||
imported_objects = mesh_objects()
|
||||
image_texture_nodes = [
|
||||
node for obj in imported_objects for material in obj.data.materials
|
||||
if material and material.use_nodes for node in material.node_tree.nodes if node.type == "TEX_IMAGE"
|
||||
]
|
||||
glb_ok = (
|
||||
triangle_count(imported_objects) == original_triangles
|
||||
and bpy.data.materials.get(LABEL_MATERIAL) is None
|
||||
and not image_texture_nodes
|
||||
)
|
||||
for name, old_hash in cap_hashes.items():
|
||||
assert sha256(ASSET / name) == old_hash
|
||||
technical_passed = native_ok and glb_ok
|
||||
assert technical_passed, "Label removal validation failed"
|
||||
report = json.loads(REPORT.read_text())
|
||||
report.update({
|
||||
"native_reopen_passed": native_ok,
|
||||
"glb_reimport_passed": glb_ok,
|
||||
"native_triangles": original_triangles,
|
||||
"glb_triangles": original_triangles,
|
||||
"technical_validation_passed": True,
|
||||
"generic_label_applied": False,
|
||||
"no_image_textures_or_labels": True,
|
||||
"brand_graphics": False,
|
||||
"percentage_purity_claims_present": False,
|
||||
"label_removed_reason": "Packaging fit did not follow the bottle body well enough",
|
||||
"label_texture_retained_at": "model_assets/labels/orange_juice/orange_juice_wrap.png",
|
||||
"cap_files_untouched_by_label_removal": True,
|
||||
"visual_review_passed": False,
|
||||
"passed": False,
|
||||
})
|
||||
for key in (
|
||||
"label_texture", "label_uv_faces", "label_uv_loops", "label_triangle_increase",
|
||||
"label_texture_packed", "glb_label_texture_verified", "cap_files_untouched_by_label_application",
|
||||
):
|
||||
report.pop(key, None)
|
||||
REPORT.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n")
|
||||
state = json.loads(STATE.read_text()) if STATE.exists() else {}
|
||||
state.update({
|
||||
"label_applied": False,
|
||||
"label_removed_reason": "Poor visual fit to the bottle body",
|
||||
"label_texture_files_retained": True,
|
||||
"native_reopen_passed": native_ok,
|
||||
"glb_reimport_passed": glb_ok,
|
||||
"native_triangles": original_triangles,
|
||||
"glb_triangles": original_triangles,
|
||||
"cap_files_untouched": True,
|
||||
"technical_validation_passed": True,
|
||||
"visual_review_passed": False,
|
||||
"passed": False,
|
||||
})
|
||||
for key in (
|
||||
"label_faces", "label_triangle_increase", "label_png_dimensions",
|
||||
"glb_label_faces", "glb_label_triangles", "glb_label_uv_verified", "glb_texture_dimensions",
|
||||
):
|
||||
state.pop(key, None)
|
||||
STATE.write_text(json.dumps(state, ensure_ascii=False, indent=2) + "\n")
|
||||
summary_path = ROOT / "low_poly_consumables_validation.json"
|
||||
summary = json.loads(summary_path.read_text())
|
||||
for asset in summary["assets"]:
|
||||
if asset["directory"] == "orange_juice_2l":
|
||||
asset.update({
|
||||
"native_triangles": original_triangles,
|
||||
"glb_triangles": original_triangles,
|
||||
"technical_validation_passed": True,
|
||||
"visual_review_passed": False,
|
||||
"passed": False,
|
||||
})
|
||||
summary["all_visual_reviews_passed"] = all(asset["visual_review_passed"] for asset in summary["assets"])
|
||||
summary_path.write_text(json.dumps(summary, ensure_ascii=False, indent=2) + "\n")
|
||||
print(json.dumps(state, ensure_ascii=False, indent=2))
|
||||
Binary file not shown.
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"jobKey": "original-geometric-citrus-tree-no-reference",
|
||||
"canvasId": "3cee1497-ce35-4c74-9d12-a6d09136c1a4",
|
||||
"canvasUrl": "https://jimeng.jianying.com/ai-tool/ai-canvas/3cee1497-ce35-4c74-9d12-a6d09136c1a4",
|
||||
"nodeId": "node_982g0rwj69",
|
||||
"model": "seedream_5.5",
|
||||
"mode": "t2i",
|
||||
"referenceImages": [],
|
||||
"promptFile": "seedream55_grove_prompt.txt",
|
||||
"ratio": "1:1",
|
||||
"resolution": "2K",
|
||||
"count": 1,
|
||||
"textAddedSeparately": true,
|
||||
"submitId": "487e79be-3811-4cbe-8799-484cfed38bfd",
|
||||
"operationRef": "487e79be-3811-4cbe-8799-484cfed38bfd",
|
||||
"selectedResourceId": "0383af65-a771-445e-9301-b4dddb1c2c25",
|
||||
"resourceState": "succeeded",
|
||||
"sourceImageSize": [2048, 2048],
|
||||
"download": "seedream55_grove.png",
|
||||
"downloadSha256": "a5c7f78ce357730b5781f40a8dfd59daab27ed0709b78a7b361eba102ccab31b",
|
||||
"visualReview": {
|
||||
"passed": true,
|
||||
"containsTextOrLogo": false,
|
||||
"containsPackaging": false,
|
||||
"referenceImagesUsed": false,
|
||||
"notes": "Asymmetric geometric canopy, four oranges including one cut half, clean mint background; suitable as an illustration asset for later layout."
|
||||
},
|
||||
"application": {
|
||||
"applied": true,
|
||||
"labelSvg": "orange_seedream_wrap.svg",
|
||||
"labelPng": "orange_seedream_wrap.png",
|
||||
"blend": "model_assets/orange_juice_2l/PerfectCoffee_orange_juice_2l_MilkJug_SeedreamLabel.blend",
|
||||
"glb": "model_assets/orange_juice_2l/PerfectCoffee_orange_juice_2l_MilkJug_SeedreamLabel.glb",
|
||||
"layout": "Hexagonal illustration tile with a separate right-hand text card",
|
||||
"sourceBottleModified": false,
|
||||
"newVariantCreated": true
|
||||
},
|
||||
"bottleModelModified": false
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
为校园咖啡店题材的低多边形游戏绘制一枚原创橙汁包装插画素材。画面中只出现一棵风格化橙树,不要包装,不要文字。橙树主体居中,采用向左倾斜的折线形树干,三个大小不同、上下错开的几何多边形树冠;树冠由深绿、橄榄绿和嫩绿色的清晰块面构成,挂有四颗简洁橙果,其中一颗表现为带清楚果瓣的半颗橙子切面。整体采用扁平矢量插画与低多边形结合的风格,轮廓清晰,色块干净,明亮自然,具有轻松友好的校园咖啡店气息。主体周围保留充足空白,背景为均匀、纯净的浅薄荷色,便于后期裁切和排版。不要写实摄影,不要复杂渐变,不要纸张纹理,不要投影,不要立体瓶身,不要椭圆边框,不要任何字母、汉字、数字、商标、Logo、二维码、地图或现有品牌元素,也不要模仿任何现有商品包装的具体构图。
|
||||
Reference in New Issue
Block a user