armbot position updated

This commit is contained in:
Gomathi 2025-05-02 18:33:27 +05:30
parent 53055a0b82
commit 80e7bf4bf9
7 changed files with 16 additions and 16 deletions

View File

@ -282,8 +282,8 @@ function processLoadedModel(
actionName: "Action 1", actionName: "Action 1",
actionType: "pickAndPlace", actionType: "pickAndPlace",
process: { process: {
startPoint: [0, 0, 0], startPoint: null,
endPoint: [0, 0, 0] endPoint: null
}, },
triggers: [] triggers: []
} }

View File

@ -121,7 +121,8 @@ export default async function assetManager(
const model = gltf; const model = gltf;
model.uuid = item.modelUuid; model.uuid = item.modelUuid;
model.userData = { name: item.modelName, modelId: item.modelfileID, modelUuid: item.modelUuid }; console.log('item: ', item);
model.userData = { name: item.modelName, modelId: item.modelfileID, modelUuid: item.modelUuid, eventData: item.eventData };
model.scale.set(...CONSTANTS.assetConfig.defaultScaleBeforeGsap); model.scale.set(...CONSTANTS.assetConfig.defaultScaleBeforeGsap);
model.position.set(...item.position); model.position.set(...item.position);
model.rotation.set(item.rotation.x, item.rotation.y, item.rotation.z); model.rotation.set(item.rotation.x, item.rotation.y, item.rotation.z);

View File

@ -222,6 +222,8 @@ function MoveControls({ movedObjects, setMovedObjects, itemsGroupRef, copiedObje
event event
); );
} }
newFloorItem.eventData = eventData;
} }
} }

View File

@ -222,6 +222,8 @@ function RotateControls({ rotatedObjects, setRotatedObjects, movedObjects, setMo
event event
); );
} }
newFloorItem.eventData = eventData;
} }
} }

View File

@ -146,8 +146,8 @@ function RoboticArmInstance({ armBot }: { armBot: ArmBotStatus }) {
logStatus(armBot.modelUuid, "Waiting to trigger CurrentAction") logStatus(armBot.modelUuid, "Waiting to trigger CurrentAction")
const timeoutId = setTimeout(() => { const timeoutId = setTimeout(() => {
let actionId=armBot.point.actions[0].actionUuid let actionId=armBot.point.actions[0].actionUuid
// addCurrentAction(armBot.modelUuid,actionId); addCurrentAction(armBot.modelUuid,actionId);
addCurrentAction(armBot.modelUuid, selectedAction?.actionId); // addCurrentAction(armBot.modelUuid, selectedAction?.actionId);
}, 3000); }, 3000);
return () => clearTimeout(timeoutId); return () => clearTimeout(timeoutId);
} }

View File

@ -8,8 +8,8 @@ import { usePlayButtonStore } from "../../../store/usePlayButtonStore";
import ArmBotUI from "../ui/arm/armBotUI"; import ArmBotUI from "../ui/arm/armBotUI";
function RoboticArm() { function RoboticArm() {
const { armBots, addArmBot, removeArmBot } = useArmBotStore(); const { armBots, addArmBot, clearArmBots } = useArmBotStore();
const { getProductById } = useProductStore(); const { products, getProductById } = useProductStore();
const { selectedProduct } = useSelectedProduct(); const { selectedProduct } = useSelectedProduct();
const { selectedEventSphere } = useSelectedEventSphere(); const { selectedEventSphere } = useSelectedEventSphere();
const { selectedEventData } = useSelectedEventData(); const { selectedEventData } = useSelectedEventData();
@ -161,20 +161,15 @@ function RoboticArm() {
if (selectedProduct.productId) { if (selectedProduct.productId) {
const product = getProductById(selectedProduct.productId); const product = getProductById(selectedProduct.productId);
if (product) { if (product) {
clearArmBots();
product.eventDatas.forEach(events => { product.eventDatas.forEach(events => {
if (events.type === 'roboticArm') { if (events.type === 'roboticArm') {
removeArmBot(events.modelUuid);
addArmBot(selectedProduct.productId, events); addArmBot(selectedProduct.productId, events);
} }
}); });
} }
} }
}, [selectedProduct]); }, [selectedProduct, products]);
// useEffect(()=>{
// // removeArmBot("123", armBotStatusSample[0]);
// addArmBot("123", armBotStatusSample[0]);
// },[])
useEffect(() => { useEffect(() => {

View File

@ -29,14 +29,14 @@ function Simulation() {
return ( return (
<> <>
<Products />
{activeModule === 'simulation' && {activeModule === 'simulation' &&
<> <>
<Points /> <Points />
<Products />
<Materials /> <Materials />
<Trigger /> <Trigger />