This article replaces the operations in CG Boost's 100+ Tips to Boost Modeling in Blender with Python.
0.BlenderPython tips
0.BlenderPython tips
Info location: Scripting → Info (bottom left of screen)
How to enable: Check Edit → preferences → Tooltips and Python Tooltips
Object mode and edit mode ↓
#Set to Object Mode
bpy.ops.object.mode_set(mode='OBJECT')
#Set to Edit Mode
bpy.ops.object.mode_set(mode='EDIT')
#Set to Sculpt Mode
bpy.ops.object.mode_set(mode='SCULPT')
#Make it Vertex Paint
bpy.ops.object.mode_set(mode='VERTEX_PAINT')
#Set to Weight Mode
bpy.ops.object.mode_set(mode='WEIGHT_PAINT')
#Set to Texture Mode
bpy.ops.object.mode_set(mode='TEXTURE_PAINT')
Wireframe and render mode ↓
#Switch to WIREFRAME mode
bpy.context.space_data.shading.type = 'WIREFRAME'
#Set to SOLID mode
bpy.context.space_data.shading.type = 'SOLID'
#Set to MATERIAL mode
bpy.context.space_data.shading.type = 'MATERIAL'
#Set to RENDERED mode
bpy.context.space_data.shading.type = 'RENDERED'
#Set to transparent mode
bpy.ops.view3d.toggle_xray()
It becomes easier to see dents on the surface ↓
bpy.context.space_data.shading.type = 'SOLID'
bpy.context.space_data.shading.light = 'MATCAP'
#Choose the one you like
bpy.context.space_data.shading.studio_light = 'metal_carpaint.exr'
The structure becomes easier to see ↓
bpy.context.space_data.shading.show_cavity = True
bpy.context.space_data.shading.cavity_type = 'WORLD'
#ridge is a ridge
bpy.context.space_data.shading.cavity_ridge_factor = 1
#valley is a depression
bpy.context.space_data.shading.cavity_valley_factor = 1
bpy.context.space_data.shading.type = 'SOLID'
bpy.context.space_data.shading.color_type = 'RANDOM'
bpy.ops.view3d.view_selected(use_all_regions = False)
PreferencesInput.use_zoom_to_mouse
PreferencesInput.use_mouse_depth_navigate
● Can also be used in edit mode
PreferencesInput.use_rotate_around_active
bpy.ops.view3d.localview()
#TOP for the following types,BOTTOM,FRONT,BACK,RIGHT,Contains one of LEFT.
bpy.ops.view3d.view_axis(type = 'TOP',align_active = True)
Recommended Posts