0
$\begingroup$

empty's are ignored when rendering in eevee (but not in sound engine)

I made a some drivers with empties to determine the speed and acceleration of the object, but when rendering, the behavior of the objects on the desired object indicates that the dummies are standing still. https://youtu.be/1HdPOXR1qCs But sound engine understand that empties is moving and work's right. on the sides of the machine there is a display of speed (rear) and slip (front) The colors of the speed display should match the volume of the acceleration sound

Upd ok, I realized that in rendering mode the dummy does not execute the driver as I want because the position of the dummy is taken every time from a static scene and the formula(EmptyposX*0.5 + targetX)/1.5 does not work as in the viewport where the position of the empty is taken from the past of its position

How to make it so that when rendering the position of the dummy is taken from its past position?

$\endgroup$
4

1 Answer 1

0
$\begingroup$

enter image description here

Image Above. Graph View shows an FCurve and its attributes. Location {X,Y,Z} components. Each of {X,Y,Z} has a different F-Curve. The Python Console View shows querying the active object for an fcurve by name. Your object name will appear differently. Next the curve is evaluated at different points. Note that {0:X, 1:Y, 2:Z} shows the [conceptual] map between the array index and the concept of axis in the [find] function. This number is labelled RNA axis in the image above. Please Click on image to see a larger version for improved readability.

Thus you can

  • Find the FCurve by name and axis index
  • Evaluate the FCurve value at a chosen frame.
  • Use the notion of current frame as an integer value in Python
  • Calculate Vector V1 at frame (X) and V2 at frame (X+N). X and N may be integers.
  • Calculate velocity vector (V2-V1)/N

Some quick snippets to help you search further at BSE. Sorry I can not find a simple example in my personal documents.

object_bq = bpy.data.objects[name]
test = object_bq.animation_data.action if (None != object_bq.animation_data and (None != object_bq.animation_data.action)) else None;
if (test):
 fc =       object_bq.animation_data.action.fcurves.find("Some Curve Name Visible in the FCurves Editor Panel");
fc.evaluate(framenumber)

The above old pseudo code is not claimed to be Pythonic or immediately usable. You will need to improve the code. The code above is intended to establish that the FCurve exist for the provided textual name.

$\endgroup$
1
  • $\begingroup$ it was easier, i can just offset animation strip in NLA editor $\endgroup$
    – Slime Ball
    Commented Mar 27, 2023 at 16:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .