feat: Add MaterialInstances component for rendering animated materials based on active curves

refactor: Clean up console logs in ProcessAnimator for better readability
fix: Update group visibility logic in Agv and PathNavigator components
This commit is contained in:
2025-04-16 13:22:47 +05:30
parent 43d21a522c
commit a59aa1d61c
6 changed files with 76 additions and 39 deletions

View File

@@ -169,9 +169,6 @@ const ProcessAnimator: React.FC<ProcessContainerProps> = ({
const spawnPoint = findSpawnPoint(process);
if (!spawnPoint || !spawnPoint.actions) {
console.log(
`Process ${process.id} has no valid spawn point or actions`
);
return;
}
@@ -255,10 +252,6 @@ const ProcessAnimator: React.FC<ProcessContainerProps> = ({
// Check connection status with debugging
const isConnected = isConnectedToActiveArmBot(process.id);
console.log(
`Process ${process.id} animation - connected:`,
isConnected
);
if (isConnected) {
// Stop all animations when connected to active arm bot
@@ -293,9 +286,6 @@ const ProcessAnimator: React.FC<ProcessContainerProps> = ({
currentTime - processState.processDelayStartTime >=
effectiveDelayTime
) {
console.log(
`Process ${process.id} delay completed, resuming animation`
);
newStates[process.id] = {
...processState,
isProcessDelaying: false,
@@ -331,9 +321,6 @@ const ProcessAnimator: React.FC<ProcessContainerProps> = ({
[];
if (path.length < 2) {
console.log(
`Process ${process.id} has insufficient path points: ${path.length}`
);
return;
}
@@ -348,9 +335,6 @@ const ProcessAnimator: React.FC<ProcessContainerProps> = ({
const currentRef = gltf?.scene ? obj.ref.current : obj.ref.current;
if (!currentRef) {
console.log(
`No reference for object ${objectId}, skipping animation`
);
return;
}
@@ -378,9 +362,6 @@ const ProcessAnimator: React.FC<ProcessContainerProps> = ({
stateRef.currentDelayDuration / speedRef.current;
if (currentTime - stateRef.delayStartTime >= effectiveDelayTime) {
console.log(
`Delay complete for object ${objectId}, resuming animation`
);
stateRef.isDelaying = false;
stateRef.delayComplete = true;
stateRef.isAnimating = true;
@@ -408,9 +389,6 @@ const ProcessAnimator: React.FC<ProcessContainerProps> = ({
// Skip non-animating objects
if (!stateRef.isAnimating) {
console.log(
`Object ${objectId} not animating, skipping animation updates`
);
return;
}
@@ -454,9 +432,6 @@ const ProcessAnimator: React.FC<ProcessContainerProps> = ({
if (shouldHide) {
if (isAgvPicking) {
console.log(
`AGV picking at last point for object ${objectId}, hiding object`
);
updatedObjects[objectId] = {
...obj,
visible: false,
@@ -517,14 +492,8 @@ const ProcessAnimator: React.FC<ProcessContainerProps> = ({
if (stateRef.delayComplete && stateRef.progress < 0.01) {
stateRef.progress = 0.05;
stateRef.delayComplete = false;
console.log(
`Boosting progress for object ${objectId} after delay`
);
} else {
stateRef.progress += movement / distance;
console.log(
`Object ${objectId} progress: ${stateRef.progress.toFixed(3)}`
);
}
// Handle point transition
@@ -564,9 +533,9 @@ const ProcessAnimator: React.FC<ProcessContainerProps> = ({
// Log if no animation is occurring when it should
if (!animationOccurring && !isConnected) {
console.log(
`Warning: No animation occurring for process ${process.id} despite not being connected`
);
// console.log(
// `Warning: No animation occurring for process ${process.id} despite not being connected`
// );
}
newStates[process.id] = {