update assetID

This commit is contained in:
2025-06-12 09:31:51 +05:30
parent 9b0842ed14
commit c7cc5cf2ca
59 changed files with 1039 additions and 1029 deletions

View File

@@ -1,13 +1,12 @@
import { useEffect } from "react";
import {
useDeleteTool,
useDeletePointOrLine,
useObjectPosition,
useObjectRotation,
useSelectedWallItem,
useSocketStore,
useWallItems,
useSelectedItem,
useToolMode,
} from "../../../store/builder/store";
import { Csg } from "../csg/csg";
import * as Types from "../../../types/world/worldTypes";
@@ -31,11 +30,10 @@ const WallItemsGroup = ({
const state = useThree();
const { socket } = useSocketStore();
const { pointer, camera, raycaster } = state;
const { deleteTool } = useDeleteTool();
const { toolMode } = useToolMode();
const { wallItems, setWallItems } = useWallItems();
const { setObjectPosition } = useObjectPosition();
const { setObjectRotation } = useObjectRotation();
const { deletePointOrLine } = useDeletePointOrLine();
const { setSelectedWallItem } = useSelectedWallItem();
const { activeModule } = useModuleStore();
const { selectedItem } = useSelectedItem();
@@ -43,7 +41,7 @@ const WallItemsGroup = ({
useEffect(() => {
// Load Wall Items from the backend
loadInitialWallItems(setWallItems,projectId);
loadInitialWallItems(setWallItems, projectId);
}, []);
////////// Update the Position value changes in the selected item //////////
@@ -51,7 +49,7 @@ const WallItemsGroup = ({
useEffect(() => {
const canvasElement = state.gl.domElement;
function handlePointerMove(e: any) {
if (selectedItemsIndex !== null && !deletePointOrLine && e.buttons === 1) {
if (selectedItemsIndex !== null && toolMode === 'cursor' && e.buttons === 1) {
const Raycaster = state.raycaster;
const intersects = Raycaster.intersectObjects(CSGGroup.current?.children[0].children!, true);
const Object = intersects.find((child) => child.object.name.includes("WallRaycastReference"));
@@ -123,7 +121,7 @@ const WallItemsGroup = ({
setTimeout(async () => {
const email = localStorage.getItem("email");
const organization = email!.split("@")[1].split(".")[0];
const organization = email!.split("@")[1].split(".")[0];
const userId = localStorage.getItem("userId");
//REST
@@ -132,7 +130,7 @@ const WallItemsGroup = ({
// organization,
// currentItem?.model?.uuid,
// currentItem.modelName,
// currentItem.modelfileID,
// currentItem.assetId,
// currentItem.type!,
// currentItem.csgposition!,
// currentItem.csgscale!,
@@ -146,7 +144,7 @@ const WallItemsGroup = ({
const data = {
organization: organization,
modelUuid: currentItem.model?.uuid!,
modelfileID: currentItem.modelfileID,
assetId: currentItem.assetId,
modelName: currentItem.modelName!,
type: currentItem.type!,
csgposition: currentItem.csgposition!,
@@ -191,12 +189,12 @@ const WallItemsGroup = ({
const onMouseUp = (evt: any) => {
if (evt.button === 0) {
isLeftMouseDown = false;
if (!drag && deleteTool && activeModule === "builder") {
if (!drag && toolMode === '3D-Delete' && activeModule === "builder") {
DeleteWallItems(
hoveredDeletableWallItem,
setWallItems,
wallItems,
socket,projectId
socket, projectId
);
}
}
@@ -248,10 +246,10 @@ const WallItemsGroup = ({
canvasElement.removeEventListener("drop", onDrop);
canvasElement.removeEventListener("dragover", onDragOver);
};
}, [deleteTool, wallItems, selectedItem, camera]);
}, [toolMode, wallItems, selectedItem, camera]);
useEffect(() => {
if (deleteTool && activeModule === "builder") {
if (toolMode && activeModule === "builder") {
handleMeshMissed(
currentWallItem,
setSelectedWallItem,
@@ -260,7 +258,7 @@ const WallItemsGroup = ({
setSelectedWallItem(null);
setSelectedItemsIndex(null);
}
}, [deleteTool]);
}, [toolMode]);
return (
<>