Show navmesh in viewport

This commit is contained in:
Lubos Lenco 2016-12-07 21:13:54 +01:00
parent 1377d02c0d
commit fe1b5aa89a
3 changed files with 14 additions and 15 deletions

View file

@ -16,7 +16,7 @@ precision highp float;
in vec3 pos;
in vec3 nor;
#ifdef _BaseTex
#ifdef _Tex
in vec2 tex;
#endif
#ifdef _VCols

View file

@ -842,7 +842,7 @@ class ArmoryExporter:
# We might still be exporting sampled animation below.
o['transform'] = {}
if (sampledAnimation):
if sampledAnimation:
o['transform']['target'] = "transform"
o['transform']['values'] = self.write_matrix(bobject.matrix_local)
@ -2009,7 +2009,7 @@ class ArmoryExporter:
o['shadows_bias'] = objref.lamp_shadows_bias
if o['type'] == 'sun': # Scale bias for ortho light matrix
o['shadows_bias'] *= 10.0
if objtype == 'POINT' and objref.shadow_soft_size > 0.1: # Point only for now
if (objtype == 'POINT' or objtype == 'SPOT') and objref.shadow_soft_size > 0.1: # No sun for now
lamp_size = objref.shadow_soft_size
# Slightly higher bias for high sizes
if lamp_size > 1:

View file

@ -12,18 +12,18 @@ class ArmoryGenerateNavmeshButton(bpy.types.Operator):
if obj == None or obj.type != 'MESH':
return{'CANCELLED'}
# TODO: build tilecache instead
# export_obj()
# For visualization
# bpy.ops.mesh.navmesh_make('EXEC_DEFAULT')
# obj = context.active_object
# obj.hide_render = True
# TODO: build tilecache here
# Navmesh trait
# obj.my_traitlist.add()
# obj.my_traitlist[-1].type_prop = 'Bundled Script'
# obj.my_traitlist[-1].class_name_prop = 'NavMesh'
obj.my_traitlist.add()
obj.my_traitlist[-1].type_prop = 'Bundled Script'
obj.my_traitlist[-1].class_name_prop = 'NavMesh'
# For visualization
bpy.ops.mesh.navmesh_make('EXEC_DEFAULT')
obj = context.active_object
obj.hide_render = True
obj.game_export = False
return{'FINISHED'}
@ -43,8 +43,7 @@ class ScenePropsPanel(bpy.types.Panel):
def register():
pass
# bpy.utils.register_module(__name__)
bpy.utils.register_module(__name__)
def unregister():
bpy.utils.unregister_module(__name__)