fixed locators not being imported
This commit is contained in:
@@ -587,6 +587,22 @@
|
||||
const g = groupByBoneName.get(boneName);
|
||||
g.origin = convertPos(v3(b.pivot, 0));
|
||||
g.rotation = convertRot(v3(b.rotation, 0));
|
||||
|
||||
const locators = b?.locators && typeof b.locators === 'object' && !Array.isArray(b.locators)
|
||||
? b.locators : {};
|
||||
for (const [locatorName, locatorData] of Object.entries(locators)) {
|
||||
const position = Array.isArray(locatorData)
|
||||
? locatorData
|
||||
: locatorData?.offset || locatorData?.position || locatorData?.from;
|
||||
if (!Array.isArray(position)) continue;
|
||||
|
||||
const locator = new Locator({
|
||||
name: `${prefix}${locatorName}`,
|
||||
from: convertPos(v3(position, 0)),
|
||||
});
|
||||
locator.init();
|
||||
locator.addTo(g);
|
||||
}
|
||||
}
|
||||
|
||||
// cubes
|
||||
|
||||
Reference in New Issue
Block a user