- if(x_auto) (*x_auto) = 0;
- if(y_auto) (*y_auto) = 0;
- if(z_auto) (*z_auto) = 0;
-
- if(!track) return;
-
- if(use_camera)
- {
- if(x_auto) (*x_auto) = (FloatAuto*)calculate_affected_auto(
- track->automation->autos[AUTOMATION_CAMERA_X], create_x);
- if(y_auto) (*y_auto) = (FloatAuto*)calculate_affected_auto(
- track->automation->autos[AUTOMATION_CAMERA_Y], create_y);
- if(z_auto) (*z_auto) = (FloatAuto*)calculate_affected_auto(
- track->automation->autos[AUTOMATION_CAMERA_Z], create_z);
- }
- else
- {
- if(x_auto) (*x_auto) = (FloatAuto*)calculate_affected_auto(
- track->automation->autos[AUTOMATION_PROJECTOR_X], create_x);
- if(y_auto) (*y_auto) = (FloatAuto*)calculate_affected_auto(
- track->automation->autos[AUTOMATION_PROJECTOR_Y], create_y);
- if(z_auto) (*z_auto) = (FloatAuto*)calculate_affected_auto(
- track->automation->autos[AUTOMATION_PROJECTOR_Z], create_z);
- }
+ if( x_auto ) *x_auto = 0;
+ if( y_auto ) *y_auto = 0;
+ if( z_auto ) *z_auto = 0;
+ if( !track ) return;
+
+ int ix = use_camera ? AUTOMATION_CAMERA_X : AUTOMATION_PROJECTOR_X, x_created = 0;
+ int iy = use_camera ? AUTOMATION_CAMERA_Y : AUTOMATION_PROJECTOR_Y, y_created = 0;
+ int iz = use_camera ? AUTOMATION_CAMERA_Z : AUTOMATION_PROJECTOR_Z, z_created = 0;
+
+ if( x_auto )
+ *x_auto = (FloatAuto*) calculate_affected_auto(track->automation->autos[ix],
+ create_x, &x_created, redraw);
+ if( y_auto )
+ *y_auto = (FloatAuto*) calculate_affected_auto(track->automation->autos[iy],
+ create_y, &y_created, redraw);
+ if( z_auto )
+ *z_auto = (FloatAuto*) calculate_affected_auto(track->automation->autos[iz],
+ create_z, &z_created, redraw);