I'm creating a stop motion animation that requires to Insert Keyframes of visibility. I was attempting to work out a script to make this process faster for me, but being new to python this has evaded me. Any help would be appreciated.
My work flow goes as:
- Select object (with mouse)
- Insert key frame on both viewport and rendering visibility
- Hide Viewport
bpy.context.object.hide = True
- Hide Rendering
bpy.context.object.hide_render = True
- Move Next Frame
- Un-hide Viewport
bpy.context.object.hide = False
- Un-hide Rendering
bpy.context.object.hide_render = False
- Insert key frame on both viewport and rendering visibility
Update based on accepted answer
Other then the following comments, I can't find any other issues.
- If you run the script multiple times It will continue to add buttons.
- Also I agree with you on Just inserting a keyframe instead of hiding and adding a keyframe.
- Is there any way to apply the Hide keyframes to multiple items at once? It seems only the last selected item receives the keyframe change.
Also once again a huge thanks, here is a frame of how it turned out!