Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bpy
- item='MESH'
- bpy.ops.object.select_all(action='DESELECT')
- bpy.ops.object.select_by_type(type=item)
- # Subcontexts.
- subcontexts_list = ['INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS',
- 'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN',
- 'EXEC_DEFAULT', 'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS',
- 'EXEC_REGION_PREVIEW', 'EXEC_AREA', 'EXEC_SCREEN']
- # Subcontext.
- for sub_context in subcontexts_list:
- try:
- bpy.ops.object.join(sub_context)
- except Exception as e:
- print('{}: {}'.format(sub_context, e))
- INVOKE_DEFAULT: Operator bpy.ops.object.join.poll() failed, context is incorrect
- INVOKE_REGION_WIN: Operator bpy.ops.object.join.poll() failed, context is incorrect
- INVOKE_REGION_CHANNELS: Operator bpy.ops.object.join.poll() failed, context is incorrect
- INVOKE_REGION_PREVIEW: Operator bpy.ops.object.join.poll() failed, context is incorrect
- INVOKE_AREA: Operator bpy.ops.object.join.poll() failed, context is incorrect
- INVOKE_SCREEN: Operator bpy.ops.object.join.poll() failed, context is incorrect
- EXEC_DEFAULT: Operator bpy.ops.object.join.poll() failed, context is incorrect
- EXEC_REGION_WIN: Operator bpy.ops.object.join.poll() failed, context is incorrect
- EXEC_REGION_CHANNELS: Operator bpy.ops.object.join.poll() failed, context is incorrect
- EXEC_REGION_PREVIEW: Operator bpy.ops.object.join.poll() failed, context is incorrect
- EXEC_AREA: Operator bpy.ops.object.join.poll() failed, context is incorrect
- EXEC_SCREEN: Operator bpy.ops.object.join.poll() failed, context is incorrect
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement