Drivers don't update properly #74242

Open
opened 2020-02-26 22:09:05 +01:00 by Johan Walles · 27 comments

System Information
Operating system: macOS Catalina 10.15.3
Graphics card: NVIDIA GeForce GT 750M 2 GB / Intel Iris Pro 1536 MB

Blender Version
Broken: Version 2.82 (2.82 2020-02-12)
Worked: (optional)

Short description of error
My rolling ball is sliding, a lot when I render a whole animation and a little when I jump frames with left / right arrow keys.

Exact steps for others to reproduce the error

  • Load this file: driver-repro.blend
  • Make sure you're in LookDev / Rendered / Wireframe to be able to see the ball's rotation
  • Behold the checkered ball
  • Press right arrow five times, notice how the ball rolls (rotates right while moving right), this is good
  • BAD: Now, press left arrow once, notice how the ball moves left but rotates right, this is bad
  • Press left arrow once more, I think this puts the ball back on track but I'm unsure
  • Now, render the animation for frames 359-461 (preset) and watch it
  • BAD: Notice how the ball just slides in the animation, even though it rolls when using the arrow keys

I would like:

  • Right and left arrow to always roll the ball in the right direction
  • Rendering the whole animation to produce a rolling ball, not a sliding one
**System Information** Operating system: macOS Catalina 10.15.3 Graphics card: NVIDIA GeForce GT 750M 2 GB / Intel Iris Pro 1536 MB **Blender Version** Broken: Version 2.82 (2.82 2020-02-12) Worked: (optional) **Short description of error** My rolling ball is sliding, a lot when I render a whole animation and a little when I jump frames with left / right arrow keys. **Exact steps for others to reproduce the error** * Load this file: [driver-repro.blend](https://archive.blender.org/developer/F8373951/driver-repro.blend) * Make sure you're in LookDev / Rendered / Wireframe to be able to see the ball's rotation * Behold the checkered ball * Press right arrow five times, notice how the ball rolls (rotates right while moving right), this is good * BAD: Now, press left arrow once, notice how the ball moves left but rotates right, this is bad * Press left arrow once more, I think this puts the ball back on track but I'm unsure * Now, render the animation for frames 359-461 (preset) and watch it * BAD: Notice how the ball just slides in the animation, even though it rolls when using the arrow keys I would like: * Right and left arrow to always roll the ball in the right direction * Rendering the whole animation to produce a rolling ball, not a sliding one
Author

Added subscriber: @Walles

Added subscriber: @Walles
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Do you have any indicator on the ball to indicate its sense of rotation ?

Do you have any indicator on the ball to indicate its sense of rotation ?
Author

In LookDev / Rendered the ball is checkered:

checkered-ball.png

In wireframe you can see the rotation as well.

In LookDev / Rendered the ball is checkered: ![checkered-ball.png](https://archive.blender.org/developer/F8374690/checkered-ball.png) In wireframe you can see the rotation as well.
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

since I am not aware of the expected behaviour, or if this task is suited for any other feature in blender, marking as needs triage

since I am not aware of the expected behaviour, or if this task is suited for any other feature in blender, marking as needs triage
Author

@ankitm were you able to repro using the provided instructions?

@ankitm were you able to repro using the provided instructions?
Member

yes, I did. but I cannot assess the seriousness of the first case (one left after some rights); and don't know what to ask for, in the second case (render: ball not rolling, only sliding ).

yes, I did. but I cannot assess the seriousness of the first case (one left after some rights); and don't know what to ask for, in the second case (render: ball not rolling, only sliding ).

Added subscriber: @sozap

Added subscriber: @sozap

I've modified the drivers's expression to use self.location- [x] instead of getting it through a variable :
driver-repro2.blend

@Walles can you double check that it's working correctly now ?

I'm not sure it's a bug , but I agree that's a bit confusing ... I've already seen a report with the same issue a few month ago...

I've modified the drivers's expression to use self.location- [x] instead of getting it through a variable : [driver-repro2.blend](https://archive.blender.org/developer/F8375552/driver-repro2.blend) @Walles can you double check that it's working correctly now ? I'm not sure it's a bug , but I agree that's a bit confusing ... I've already seen a report with the same issue a few month ago...
Member

@sozap the file crashes immediately, before even opening . could you please set its render engine to cycles, and not keep material properties active. set it to render properties, or physics.

@sozap the file crashes immediately, before even opening . could you please set its render engine to cycles, and not keep material properties active. set it to render properties, or physics.

Try this one : driver-repro3.blend

Thanks Ankit !

Try this one : [driver-repro3.blend](https://archive.blender.org/developer/F8375985/driver-repro3.blend) Thanks Ankit !
Member

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'
Ankit Meel self-assigned this 2020-02-27 18:54:20 +01:00
Member

seems good!

seems good!
Author

It works with your changes @ankitm.

But following the example here...
https://docs.blender.org/manual/en/latest/animation/drivers/workflow_examples.html#transform-driver
... but using the own object's x coordinate as driver input, fails with the same symptoms:
driver-repro4.blend

Symptom is still that rendering the animation slides the cube rather than rolling it.

Not sure how precisely documented something has to be to be considered a bug, but are you sure this example should be "Invalid"?

It works with your changes @ankitm. But following the example here... https://docs.blender.org/manual/en/latest/animation/drivers/workflow_examples.html#transform-driver ... but using the own object's x coordinate as driver input, fails with the same symptoms: [driver-repro4.blend](https://archive.blender.org/developer/F8376202/driver-repro4.blend) Symptom is still that rendering the animation slides the cube rather than rolling it. Not sure how precisely documented something has to be to be considered a bug, but are you *sure* this example should be "Invalid"?
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Changed status from 'Archived' to: 'Needs Triage'

Changed status from 'Archived' to: 'Needs Triage'
Member

I will look into the documentation tomorrow if I get a chance.

I will look into the documentation tomorrow if I get a chance.

Added subscriber: @WilliamReynish

Added subscriber: @WilliamReynish

The main difference between the example and your case is that in the example it take a property of object A to drive object B.
In your case it's a property from object A that drives object A.

In the example, it's easy for blender to know the order of evaluation, A needs to be evaluated first , then B.

In your case, blender needs to know the position of object A to get the rotation of object A. This is a common problem known as cyclic dependency, this is also why you always have a 1 frame lag in transform evaluation of your object.
This is why you must use self property in the driver, so blender know that object transforms needs to be evaluated twice to get the final transform.

In the end it's not a bug, but ideally the documentation needs to be updated to take that particular case into account, or the driver interface need to be more clear , or in case similar to yours blender should automatically evaluate twice the transforms.
So it's more in the lines of improvements rather than a feature not working as intended, I think this is why there is the "use self" toggle . I totally agree that this is quite confusing for users and ideally they shouldn't need to understand all that dependencies stuff to do what they want. But things are working as they should even if they are a bit confusing in that particular case.

I'm poking @WilliamReynish so he can look at this to see if it's possible to make the UI more clear (maybe by showing a warning in such cases) as I've already seen a bug report with exactly the same issue.

The main difference between the example and your case is that in the example it take a property of object A to drive object B. In your case it's a property from object A that drives object A. In the example, it's easy for blender to know the order of evaluation, A needs to be evaluated first , then B. In your case, blender needs to know the position of object A to get the rotation of object A. This is a common problem known as cyclic dependency, this is also why you always have a 1 frame lag in transform evaluation of your object. This is why you must use self property in the driver, so blender know that object transforms needs to be evaluated twice to get the final transform. In the end it's not a bug, but ideally the documentation needs to be updated to take that particular case into account, or the driver interface need to be more clear , or in case similar to yours blender should automatically evaluate twice the transforms. So it's more in the lines of improvements rather than a feature not working as intended, I think this is why there is the "use self" toggle . I totally agree that this is quite confusing for users and ideally they shouldn't need to understand all that dependencies stuff to do what they want. But things are working as they should even if they are a bit confusing in that particular case. I'm poking @WilliamReynish so he can look at this to see if it's possible to make the UI more clear (maybe by showing a warning in such cases) as I've already seen a bug report with exactly the same issue.
Author

Thanks for the clarification @sozap!

I ended up adding an empty, and tying both the ball's rotation and its x coordinate to that empty.

Rather unobvious as you said, but works like a charm. TIL :)

Thanks for the clarification @sozap! I ended up adding an empty, and tying both the ball's rotation and its x coordinate to that empty. Rather unobvious as you said, but works like a charm. TIL :)
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

I took a look at this yesterday, and was trying to find the right report to merge this into (looks like blender/blender#64793 is the chosen one), and another report to link that gave the explanation (found it: blender/blender#72899). Glad @sozap appeared with the explanation and the updated blend!

I took a look at this yesterday, and was trying to find the right report to merge this into (looks like blender/blender#64793 is the chosen one), and another report to link that gave the explanation (found it: blender/blender#72899). Glad @sozap appeared with the explanation and the updated blend!
Ankit Meel removed their assignment 2020-02-28 14:13:01 +01:00
Author

@sozap, I think I know why "self" worked for you.

"self" becomes a Python expression, but without self it's a "simple expression".

My guess is that Python expressions and simple expressions are triggered at different times.

@sozap, I think I know why "self" worked for you. "self" becomes a Python expression, but without self it's a "simple expression". My guess is that Python expressions and simple expressions are triggered at different times.

When using "self" you explicitly reference the owner of the driver as 'self'.
When using the variable's target it may not evaluate the target the same way, but the expression 'complexity' in itself doesn't change anything ...
There are "simple expression" based only on math that are evaluated faster, and full python expression but they are only slower to evaluate, when blender compute the value should append at the same time in both cases.
Unless I'm unaware of some stuff in the code source. Indeed I'm only guessing here and only someone familiar with the animation system or dependency graph code could explain what is really happening here.
Feel free to continue this conversation at blenderartists (you can poke me here) this is more appropriate as the tracker is not meant to be a forum for discussions.

When using "self" you explicitly reference the owner of the driver as 'self'. When using the variable's target it may not evaluate the target the same way, but the expression 'complexity' in itself doesn't change anything ... There are "simple expression" based only on math that are evaluated faster, and full python expression but they are only slower to evaluate, when blender compute the value should append at the same time in both cases. Unless I'm unaware of some stuff in the code source. Indeed I'm only guessing here and only someone familiar with the animation system or dependency graph code could explain what is really happening here. Feel free to continue this conversation at blenderartists (you can poke me here) this is more appropriate as the tracker is not meant to be a forum for discussions.
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-manual#74242
No description provided.