feat(web): auto-discover line style subtype batch
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

This commit is contained in:
mes123456
2026-09-03 18:53:23 +08:00
parent 81a5c763da
commit 21abcd615a
21 changed files with 12513 additions and 77 deletions

View File

@@ -4750,6 +4750,13 @@ json scene_ir_from_blend(const ParsedBlend &blend,
brushes.push_back(std::move(brush));
}
else if (record.type_name == "FreestyleLineStyle") {
auto modifier_type_codes = [&](const char *member) {
json codes = json::array();
for (const ElementRef &modifier : linked_list_elements(blend, element, member)) {
codes.push_back(read_integer(*blend.sdna, modifier, "type").value_or(-1));
}
return codes;
};
const std::vector<float> color = {read_float(*blend.sdna, element, "r").value_or(0.0f),
read_float(*blend.sdna, element, "g").value_or(0.0f),
read_float(*blend.sdna, element, "b").value_or(0.0f)};
@@ -4767,7 +4774,12 @@ json scene_ir_from_blend(const ParsedBlend &blend,
{"color", linked_list_elements(blend, element, "color_modifiers").size()},
{"alpha", linked_list_elements(blend, element, "alpha_modifiers").size()},
{"thickness", linked_list_elements(blend, element, "thickness_modifiers").size()},
{"geometry", linked_list_elements(blend, element, "geometry_modifiers").size()}}}
{"geometry", linked_list_elements(blend, element, "geometry_modifiers").size()}}},
{"modifierTypeCodes", {
{"color", modifier_type_codes("color_modifiers")},
{"alpha", modifier_type_codes("alpha_modifiers")},
{"thickness", modifier_type_codes("thickness_modifiers")},
{"geometry", modifier_type_codes("geometry_modifiers")}}}
});
}
else if (record.type_name == "Lattice") {