mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-21 11:11:37 +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
|
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):
|
def entity_box(entityclass):
|
||||||
name = entityclass.name
|
name = entityclass.name
|
||||||
size = entityclass.size
|
size = entityclass.size
|
||||||
|
@ -57,7 +71,7 @@ def add_entity(self, context, entclass):
|
||||||
if entity_class.size:
|
if entity_class.size:
|
||||||
mesh = entity_box(entity_class)
|
mesh = entity_box(entity_class)
|
||||||
else:
|
else:
|
||||||
mesh = None
|
mesh = default_brush_entity(entity_class)
|
||||||
obj = bpy.data.objects.new(entity_class.name, mesh)
|
obj = bpy.data.objects.new(entity_class.name, mesh)
|
||||||
obj.location = context.scene.cursor_location
|
obj.location = context.scene.cursor_location
|
||||||
obj.select = True
|
obj.select = True
|
||||||
|
|
Loading…
Reference in a new issue