feat: Update floor item selection logic to use userData for model UUID comparison
This commit is contained in:
@@ -73,11 +73,17 @@ function Model({ asset }: { readonly asset: Asset }) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setDeletableFloorItem(null);
|
setDeletableFloorItem(null);
|
||||||
if (selectedFloorItem === null || selectedFloorItem.modelUuid !== asset.modelUuid) {
|
if (selectedFloorItem === null || selectedFloorItem.userData.modelUuid !== asset.modelUuid) {
|
||||||
resetAnimation(asset.modelUuid);
|
resetAnimation(asset.modelUuid);
|
||||||
}
|
}
|
||||||
}, [activeModule, toolMode, selectedFloorItem])
|
}, [activeModule, toolMode, selectedFloorItem])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (selectedFloorItem && selectedFloorItem.userData.modelUuid === asset.modelUuid) {
|
||||||
|
setSelectedFloorItem(groupRef.current);
|
||||||
|
}
|
||||||
|
}, [isRendered, selectedFloorItem])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const loader = new GLTFLoader();
|
const loader = new GLTFLoader();
|
||||||
const dracoLoader = new DRACOLoader();
|
const dracoLoader = new DRACOLoader();
|
||||||
|
|||||||
Reference in New Issue
Block a user