bp-20100 -CodeSamples
====location rotation dimensions scale======================
p1=====================
p3_dimx=bpy.data.objects[“p3”].dimensions[0]
p3_dimy=bpy.data.objects[“p3”].dimensions[1]
p1_z=0
p1_locx = (p3_dimx / 2)
bpy.data.objects[“p1”].location = (p1_locx,0,0)
print (p1_locx )
========== FOR LOOP ========
x=0
x1=0
for x in range(3):
bpy.ops.mesh.primitive_uv_sphere_add(radius=1, enter_editmode=False, align=’WORLD’, location=(x1,0,0), scale=(5,5,5))
x1= x1 + 10
==============
bpy.data.materials[“Blue”].node_tree.nodes[“Principled BSDF”].inputs[0].default_value = (0, 0, 1, 1)