-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SwitchNode driver update overridden by ControlDriver #18
Comments
alex-Symbroson
changed the title
DriverUpdate overridden
SwitchNode driver update overridden by ControlDriver
Oct 27, 2022
I added a series of debug logs in order to understand the resolution process - maybe it helps to understand what I tried to achieve Text Log: ra res1 state: 9 % 11
ra res2 state: 9 # root switch - selects '9' for 'blocking'
ra t_root -> t_block
ra [nextState] merge2 idle = 4 # set block frame of idle animation
ra [nextState] merge2 crouch = 2 # set block frame of crouch animation
ra res1 t_crouch: 0 % 2
ra res2 t_crouch: 0
ra t_block -> p_idle # 'block' SwitchNode selects idle animation node
ra [nextState] merge2 t_block = 0
ra [nextState] merge2 t_block = 0
ra res1 idle: 1 % 9 # ResolveDriver reads previousState
ra [nextState] set idle = 2 # ResolveDriver autoIncrement call
ra res2 idle: 1 # ResolveDriver return value
ra cell: 1 # dispalyed frame - I want this to be 4 from above Full log
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello there, I stumbled over this neat animation project and decided to give it a try
It was a bit of a struggle to understand the driver concept but I think I got it
Until I stumbled across an issue where a node driver update appeared to not be applied.
In my case I have multiple animation states in a single animation to reduce the overhead of creating animation scripts a bit
You only need to read the bold text below, the next two paragraphs are just to describe the context of the problem
in my case I have a temporary move (blocking) which can be performed when in the 'idle' or the 'crouching' state
I tried to achieve this by appending the blocking frames to the idle and the crouching animation, but they aren't reachable by default
the IDLE and the crouch animation loops between frame 0-2 and the blocking animation starts at frame 3-5
when going into blocking state the graph goes to a switch node which updates the idle and crouch driver to the 3 to start the correspondig blocking animation at frame 3
This did not work however and I struggled to find out why until I logged the objects HashCode along with each Set call in the ReanimatorState class.
This finally lead me to the source of the problem - the ResolveDriver method in the ControlDriver class always uses previousState to update nextState, but in my case the switch updated the driver variable in nextState but it got overridden by the previousState
To clarify - the issue appears to be that SwitchNode driver updates are overridden by ControlDriver.ResolveDriver in a single frame.
I'm not sure how to resolve this correctly or if this method is even intended to work in your library
My goal was to reduce the amount of animation scripts in some way
I'm looking forward to hear from you regarding this issue :)
thanks and best regards,
Symbroson
The text was updated successfully, but these errors were encountered: