mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-20 10:43:29 +00:00
Use a tetrahedron for the default brush entity.
It seems to be a reasonable shape to show that editing is needed.
This commit is contained in:
parent
18fcdb0ce7
commit
468f96902f
1 changed files with 15 additions and 1 deletions
|
@ -21,6 +21,20 @@
|
|||
|
||||
import bpy
|
||||
|
||||
def default_brush_entity(entityclass):
|
||||
name = entityclass.name
|
||||
verts = [(-8, -8, -8),
|
||||
( 8, 8, -8),
|
||||
(-8, 8, 8),
|
||||
( 8, -8, 8)]
|
||||
faces = [(0, 2, 1),
|
||||
(0, 3, 2),
|
||||
(0, 1, 3),
|
||||
(1, 2, 3)]
|
||||
mesh = bpy.data.meshes.new(name)
|
||||
mesh.from_pydata(verts, [], faces)
|
||||
return mesh
|
||||
|
||||
def entity_box(entityclass):
|
||||
name = entityclass.name
|
||||
size = entityclass.size
|
||||
|
@ -57,7 +71,7 @@ def add_entity(self, context, entclass):
|
|||
if entity_class.size:
|
||||
mesh = entity_box(entity_class)
|
||||
else:
|
||||
mesh = None
|
||||
mesh = default_brush_entity(entity_class)
|
||||
obj = bpy.data.objects.new(entity_class.name, mesh)
|
||||
obj.location = context.scene.cursor_location
|
||||
obj.select = True
|
||||
|
|
Loading…
Reference in a new issue