import bpy
hideObjects = 1
for obj in bpy.context.selected_objects:
obj.hide = hideObjects
obj.keyframe_insert(data_path="hide")
obj.hide_render = hideObjects
obj.keyframe_insert(data_path="hide_render")
This simple script will take the selected objects and if you make 'hideObjects' equal to 1 then it will set the visibility and renderability of those objects and turn them off, then keyframe both properties on the current frame. So doing this I set the value to 0 on my unshattered object and keyed frame 1, went to the frame where it should disappear and set the value to 1 and ran it again. I did the opposite for my shards. Worked like a charm. I hope it helps you out too!
No comments:
Post a Comment