forked from 1b-agent/opencadstudio-upstream
Cargo: codec 1ca7d33 (acadrust 0.6.0 sync), kernel 7fb0abb, graph d7908a8
The codec now carries upstream acadrust 0.6.0 (foldhash, thiserror 2, MLINE / legacy class / layer handle fixes). Its new Spline::dwg_scenario is serde-skipped, so the Python plugin's generated entity records could not name it; they now take such fields from the type's Default. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
fafb1758c1
commit
2dfa9f3f2a
6 files changed
+30
-22
No files matched your search
Generated
+4
-5
@@ -28,7 +28,6 @@ dependencies = [
|
||||
"cfg-if",
|
||||
"getrandom 0.3.4",
|
||||
"once_cell",
|
||||
"serde",
|
||||
"version_check",
|
||||
"zerocopy",
|
||||
]
|
||||
@@ -1264,15 +1263,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "opencadcodec"
|
||||
version = "0.5.5"
|
||||
source = "git+https://github.com/HakanSeven12/opencadcodec.git?rev=04b26f2#04b26f2c992110c1da4ed6bc0491d76906fbf4e5"
|
||||
version = "0.6.0"
|
||||
source = "git+https://github.com/HakanSeven12/opencadcodec.git?rev=1ca7d33#1ca7d3360a34384b59297ffe8aa18b157d2701d9"
|
||||
dependencies = [
|
||||
"ahash 0.8.12",
|
||||
"anyhow",
|
||||
"bitflags",
|
||||
"byteorder",
|
||||
"encoding_rs",
|
||||
"flate2",
|
||||
"foldhash",
|
||||
"indexmap",
|
||||
"itoa",
|
||||
"memmap2",
|
||||
@@ -1281,7 +1280,7 @@ dependencies = [
|
||||
"rayon",
|
||||
"ryu",
|
||||
"serde",
|
||||
"thiserror 1.0.69",
|
||||
"thiserror 2.0.20",
|
||||
"web-time",
|
||||
]
|
||||
|
||||
|
||||
@@ -693,6 +693,14 @@ fn gen_struct(name: &str, info: &TypeInfo, registry: &TypeRegistry, required: &[
|
||||
.map(|field| format!("\"{field}\""))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ");
|
||||
// Fields the codec keeps out of serde (`#[serde(skip)]`) are invisible to
|
||||
// the traced registry; entity records default them through their own
|
||||
// `Default` instead of failing to construct.
|
||||
let rest = if info.fields.iter().any(|f| f.type_id.as_str() == "EntityCommon") {
|
||||
" ..Default::default()\n"
|
||||
} else {
|
||||
""
|
||||
};
|
||||
for f in &info.fields {
|
||||
if f.type_id.as_str() == "EntityCommon" {
|
||||
// A sub-record's own common data (layer, XDATA, handles) is not part
|
||||
@@ -750,14 +758,16 @@ fn dict_to_{snake}(value: PyObjectRef, vm: &VirtualMachine) -> PyResult<{path}>
|
||||
return Err(vm.new_value_error(format!("{name} needs {{required}}")));
|
||||
}}
|
||||
}}
|
||||
#[allow(clippy::needless_update)]
|
||||
Ok({path} {{
|
||||
{from_dict_fields} }})
|
||||
{from_dict_fields}{rest} }})
|
||||
}}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn default_{snake}() -> {path} {{
|
||||
#[allow(clippy::needless_update)]
|
||||
{path} {{
|
||||
{default_fields} }}
|
||||
{default_fields}{rest} }}
|
||||
}}
|
||||
|
||||
"#
|
||||
|
||||
Reference in new issue
Block a user