I have made an animation with a water flow. I want it to start and stop with Arduino, I have thought about making it with a sensor that triggers the animation of "start and stop". Is it possible to do that? I have seen that the animation of the "start and stop" flow only works if you refresh the cash. And I was thinking that maybe a sensor is not enough, cause I need it to start and stop the flow (so trigger the keyframes I suppose) and I believe that I need to refresh the cash. Is blender appropriate to make this project or I should stick to another software? If it's appropriate, what should I do? I'm new to Arduino.
-
I'm not sure if this question is appropriate for this site since it seems to be more related to Arduino instead of Blender... – Gordon Brinkmann Oct 05 '21 at 12:40
-
I think the question is OK here, because it's about stuff that happens in Blender. I'll attempt an answer. – Martynas Žiemys Oct 05 '21 at 12:49
1 Answers
Blender could interact with Arduino, because Blender has Python API. You could use Pyserial to communicate with your Arduino via serial connection through USB. You would need to install this external Python module to Blender's Python - see Using 3rd party Python modules.
If it's a playing animation you need to somehow interact with, you could check serial on every frame change using an Application Handler:
import bpy
def my_handler(scene):
#Serial communication could happen here
print("Frame change")
bpy.app.handlers.frame_change_pre.append(my_handler)
#bpy.app.handlers.frame_change_pre.clear()
I haven't tested any of this, so this is only a possible solution, that you would need to look into and you might face some unforeseen problems, but I think this should be possible.
This question about serial communication might be of interest to you as well.
- 24,274
- 2
- 34
- 77