Search This Blog

Showing posts with label bpy. Show all posts
Showing posts with label bpy. Show all posts

Thursday 29 October 2020

SCRIPT TO DELETE ALL OBJECTS IN 3D WINDOW

Script to delete all objects in 3D window:


import bpy


bpy.ops.object.select_all(action='TOGGLE')
bpy.ops.object.delete(use_global=False)

BPY SCRIPT TO ADD A CUBE AND A MATERIAL TO IT

The following script can be used  to add  a cube and a material to it:

 

import bpy

bpy.ops.mesh.primitive_cube_add(location=(0,0,0))
obj_matl=bpy.data.materials.new("obj_clr")
obj_matl.diffuse_color=(1,0,0)
mesh=bpy.context.object.data
mesh.materials.append(obj_matl)

TO MIRROR ARMATURE BONES ON X AXIS 1. Assume that we are making a human rig in standing position. 2. Set the view to front view. 3. Create t...