Refactor VehicleMechanics component for improved state management and event handling

- Simplified state initialization and effect hooks for better readability.
- Enhanced event handling functions for speed, action type, and action renaming.
- Updated current values retrieval logic to utilize getEventByModelUuid.
- Cleaned up JSX structure for better maintainability.

Update addAssetModel to remove unnecessary console log

- Removed debug logging for roboticArmEvent in addAssetModel.

Enhance copyPasteControls and duplicationControls with event handling

- Integrated useEventsStore to manage events during copy and paste operations.
- Updated event data structure for Conveyor, Vehicle, ArmBot, and StaticMachine types.
- Ensured proper UUID generation for new events and actions.

Refactor PointsCreator to ensure event sphere clearing

- Re-enabled clearSelectedEventSphere on pointer miss events for better UX.

Add logging in Products component for debugging

- Added console log to inspect data fetched from getAllProductsApi.

Update useProductStore to return updated events after modifications

- Modified updateEvent, addAction, removeAction, updateAction, and renameAction to return updated event data.
- Ensured consistency in event handling across the product store.
This commit is contained in:
2025-04-30 15:58:23 +05:30
parent 304d6689c1
commit a704be77d3
11 changed files with 1004 additions and 512 deletions

View File

@@ -94,7 +94,7 @@ function PointsCreator() {
}}
onPointerMissed={() => {
if (selectedEventData?.data.type !== 'vehicle') {
// clearSelectedEventSphere();
clearSelectedEventSphere();
}
setTransformMode(null);
}}
@@ -123,7 +123,7 @@ function PointsCreator() {
);
}}
onPointerMissed={() => {
// clearSelectedEventSphere();
clearSelectedEventSphere();
setTransformMode(null);
}}
position={new THREE.Vector3(...event.point.position)}
@@ -149,7 +149,7 @@ function PointsCreator() {
);
}}
onPointerMissed={() => {
// clearSelectedEventSphere();
clearSelectedEventSphere();
setTransformMode(null);
}}
position={new THREE.Vector3(...event.point.position)}
@@ -175,7 +175,7 @@ function PointsCreator() {
);
}}
onPointerMissed={() => {
// clearSelectedEventSphere();
clearSelectedEventSphere();
setTransformMode(null);
}}
position={new THREE.Vector3(...event.point.position)}