Get the latest Blender, older versions, or experimental builds.
Stay up-to-date with the new features in the latest Blender releases.
Access production assets and knowledge from the open movies.
Documentation on the usage and features in Blender.
Latest development updates, by Blender developers.
Guidelines, release notes and development docs.
A platform to collect and share results of the Blender Benchmark.
The yearly event that brings the community together.
Support core development with a monthly contribution.
Perform a single donation with more payment options available.
import bpy
class PhysicButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__region_type__ = "WINDOW"
__context__ = "physics"
def poll(self, context):
return (context.object != None)
class PHYSICS_PT_field(PhysicButtonsPanel):
__idname__ = "PHYSICS_PT_field"
__label__ = "Field"
def draw(self, context):
layout = self.layout
ob = context.object
field = ob.field
layout.itemR(field, "type")
if field.type != "NONE":
layout.itemR(field, "strength")
if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "LENNARDj"):
if ob.type in ("MESH", "SURFACE", "FONT", "CURVE"):
layout.itemR(field, "surface")
class PHYSICS_PT_collision(PhysicButtonsPanel):
__idname__ = "PHYSICS_PT_collision"
__label__ = "Collision"
__default_closed__ = True
return (ob and ob.type == 'MESH')
def draw_header(self, context):
settings = context.object.collision
self.layout.itemR(settings, "enabled", text="")
md = context.collision
layout.active = settings.enabled
split = layout.split()
col = split.column()
col.itemL(text="Damping:")
col.itemR(settings, "damping_factor", text="Factor");
col.itemR(settings, "random_damping", text="Random");
col.itemL(text="Friction:")
col.itemR(settings, "friction_factor", text="Factor");
col.itemR(settings, "random_friction", text="Random");
layout.itemR(settings, "permeability");
layout.itemR(settings, "kill_particles");
bpy.types.register(PHYSICS_PT_field)
bpy.types.register(PHYSICS_PT_collision)