2016-10-19 13:28:06 +02:00
|
|
|
import bpy
|
2017-03-15 12:30:14 +01:00
|
|
|
import webbrowser
|
2018-08-07 08:56:48 +02:00
|
|
|
import os
|
2016-10-19 13:28:06 +02:00
|
|
|
from bpy.types import Menu, Panel, UIList
|
|
|
|
from bpy.props import *
|
2017-03-15 12:30:14 +01:00
|
|
|
import arm.utils
|
|
|
|
import arm.make as make
|
|
|
|
import arm.make_state as state
|
|
|
|
import arm.assets as assets
|
|
|
|
import arm.log as log
|
2017-10-10 09:58:03 +02:00
|
|
|
import arm.proxy
|
2018-01-04 16:22:16 +01:00
|
|
|
import arm.api
|
2018-11-18 21:52:50 +01:00
|
|
|
import arm.props_properties
|
2016-10-19 13:28:06 +02:00
|
|
|
|
|
|
|
# Menu in object region
|
|
|
|
class ObjectPropsPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Props"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "object"
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
obj = bpy.context.object
|
|
|
|
if obj == None:
|
|
|
|
return
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(obj, 'arm_export')
|
2017-08-21 12:17:55 +02:00
|
|
|
if not obj.arm_export:
|
2016-10-19 13:28:06 +02:00
|
|
|
return
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(obj, 'arm_spawn')
|
|
|
|
layout.prop(obj, 'arm_mobile')
|
|
|
|
layout.prop(obj, 'arm_animation_enabled')
|
2017-08-19 03:08:42 +02:00
|
|
|
|
|
|
|
if obj.type == 'MESH':
|
2017-08-19 12:10:06 +02:00
|
|
|
layout.prop(obj, 'arm_instanced')
|
2017-09-21 18:30:02 +02:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
2018-09-05 10:20:02 +02:00
|
|
|
layout.prop_search(obj, "arm_tilesheet", wrd, "arm_tilesheetlist", text="Tilesheet")
|
2017-09-21 18:30:02 +02:00
|
|
|
if obj.arm_tilesheet != '':
|
|
|
|
selected_ts = None
|
|
|
|
for ts in wrd.arm_tilesheetlist:
|
|
|
|
if ts.name == obj.arm_tilesheet:
|
|
|
|
selected_ts = ts
|
|
|
|
break
|
2018-09-05 10:20:02 +02:00
|
|
|
layout.prop_search(obj, "arm_tilesheet_action", selected_ts, "arm_tilesheetactionlist", text="Action")
|
2017-09-21 18:30:02 +02:00
|
|
|
|
2018-11-18 21:52:50 +01:00
|
|
|
# Properties list
|
|
|
|
arm.props_properties.draw_properties(layout, obj)
|
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
class ModifiersPropsPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Props"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "modifier"
|
2018-12-19 13:33:17 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2016-10-19 13:28:06 +02:00
|
|
|
obj = bpy.context.object
|
|
|
|
if obj == None:
|
|
|
|
return
|
2016-11-07 00:31:48 +01:00
|
|
|
layout.operator("arm.invalidate_cache")
|
|
|
|
|
2017-09-29 01:18:57 +02:00
|
|
|
class ParticlesPropsPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Props"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "particle"
|
2018-12-19 13:33:17 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-09-29 01:18:57 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2017-09-29 01:18:57 +02:00
|
|
|
obj = bpy.context.particle_system
|
|
|
|
if obj == None:
|
|
|
|
return
|
|
|
|
|
2017-10-15 18:16:55 +02:00
|
|
|
layout.prop(obj.settings, 'arm_loop')
|
2017-09-29 17:00:21 +02:00
|
|
|
layout.prop(obj.settings, 'arm_count_mult')
|
2017-09-29 01:18:57 +02:00
|
|
|
|
2017-01-10 10:41:06 +01:00
|
|
|
class PhysicsPropsPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Props"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "physics"
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-01-10 10:41:06 +01:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2017-01-10 10:41:06 +01:00
|
|
|
obj = bpy.context.object
|
|
|
|
if obj == None:
|
|
|
|
return
|
|
|
|
|
2017-11-06 13:01:08 +01:00
|
|
|
if obj.rigid_body != None:
|
|
|
|
layout.prop(obj, 'arm_rb_linear_factor')
|
|
|
|
layout.prop(obj, 'arm_rb_angular_factor')
|
2017-12-12 20:07:31 +01:00
|
|
|
layout.prop(obj, 'arm_rb_trigger')
|
2017-11-06 13:01:08 +01:00
|
|
|
layout.prop(obj, 'arm_rb_force_deactivation')
|
2018-10-30 12:56:49 +01:00
|
|
|
layout.prop(obj, 'arm_rb_ccd')
|
2017-11-06 13:01:08 +01:00
|
|
|
|
|
|
|
if obj.soft_body != None:
|
|
|
|
layout.prop(obj, 'arm_soft_body_margin')
|
2017-01-10 10:41:06 +01:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
# Menu in data region
|
|
|
|
class DataPropsPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Props"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "data"
|
2018-12-19 13:33:17 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2016-10-19 13:28:06 +02:00
|
|
|
obj = bpy.context.object
|
|
|
|
if obj == None:
|
|
|
|
return
|
|
|
|
|
2017-08-19 03:08:42 +02:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
2016-10-19 13:28:06 +02:00
|
|
|
if obj.type == 'CAMERA':
|
2017-08-21 12:17:55 +02:00
|
|
|
layout.prop(obj.data, 'arm_frustum_culling')
|
2016-11-28 14:40:07 +01:00
|
|
|
elif obj.type == 'MESH' or obj.type == 'FONT' or obj.type == 'META':
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(obj.data, 'arm_dynamic_usage')
|
2016-10-19 13:28:06 +02:00
|
|
|
layout.operator("arm.invalidate_cache")
|
2018-12-19 13:33:17 +01:00
|
|
|
elif obj.type == 'LIGHT':
|
|
|
|
layout.prop(obj.data, 'arm_clip_start')
|
|
|
|
layout.prop(obj.data, 'arm_clip_end')
|
|
|
|
layout.prop(obj.data, 'arm_fov')
|
|
|
|
layout.prop(obj.data, 'arm_shadows_bias')
|
2018-08-28 15:10:28 +02:00
|
|
|
layout.prop(wrd, 'arm_light_ies_texture')
|
|
|
|
layout.prop(wrd, 'arm_light_clouds_texture')
|
2016-10-19 13:28:06 +02:00
|
|
|
elif obj.type == 'SPEAKER':
|
2018-01-02 22:29:51 +01:00
|
|
|
layout.prop(obj.data, 'arm_play_on_start')
|
2017-10-13 15:21:36 +02:00
|
|
|
layout.prop(obj.data, 'arm_loop')
|
|
|
|
layout.prop(obj.data, 'arm_stream')
|
2016-10-19 13:28:06 +02:00
|
|
|
elif obj.type == 'ARMATURE':
|
2018-12-18 16:46:36 +01:00
|
|
|
pass
|
2016-10-19 13:28:06 +02:00
|
|
|
|
|
|
|
class ScenePropsPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Props"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "scene"
|
2018-12-19 13:33:17 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2016-10-19 13:28:06 +02:00
|
|
|
scene = bpy.context.scene
|
|
|
|
if scene == None:
|
|
|
|
return
|
2017-08-19 03:08:42 +02:00
|
|
|
row = layout.row()
|
|
|
|
column = row.column()
|
2017-11-20 15:59:22 +01:00
|
|
|
row.prop(scene, 'arm_export')
|
2016-10-19 13:28:06 +02:00
|
|
|
|
|
|
|
class InvalidateCacheButton(bpy.types.Operator):
|
|
|
|
'''Delete cached mesh data'''
|
|
|
|
bl_idname = "arm.invalidate_cache"
|
|
|
|
bl_label = "Invalidate Cache"
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
def execute(self, context):
|
2017-08-21 12:17:55 +02:00
|
|
|
context.object.data.arm_cached = False
|
2016-10-19 13:28:06 +02:00
|
|
|
return{'FINISHED'}
|
|
|
|
|
2016-12-21 00:51:04 +01:00
|
|
|
class InvalidateMaterialCacheButton(bpy.types.Operator):
|
|
|
|
'''Delete cached material data'''
|
|
|
|
bl_idname = "arm.invalidate_material_cache"
|
|
|
|
bl_label = "Invalidate Cache"
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-12-21 00:51:04 +01:00
|
|
|
def execute(self, context):
|
2018-12-19 20:10:34 +01:00
|
|
|
context.material.arm_cached = False
|
2018-05-24 22:16:28 +02:00
|
|
|
context.material.signature = ''
|
2016-12-21 00:51:04 +01:00
|
|
|
return{'FINISHED'}
|
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
class MaterialPropsPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Props"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "material"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2016-10-19 13:28:06 +02:00
|
|
|
mat = bpy.context.material
|
|
|
|
if mat == None:
|
|
|
|
return
|
|
|
|
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(mat, 'arm_cast_shadow')
|
|
|
|
columnb = layout.column()
|
2018-08-08 22:43:14 +02:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
columnb.enabled = len(wrd.arm_rplist) > 0 and arm.utils.get_rp().rp_renderer == 'Forward'
|
|
|
|
columnb.prop(mat, 'arm_receive_shadow')
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(mat, 'arm_two_sided')
|
|
|
|
columnb = layout.column()
|
2017-08-21 12:17:55 +02:00
|
|
|
columnb.enabled = not mat.arm_two_sided
|
|
|
|
columnb.prop(mat, 'arm_cull_mode')
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(mat, 'arm_material_id')
|
|
|
|
layout.prop(mat, 'arm_overlay')
|
|
|
|
layout.prop(mat, 'arm_decal')
|
|
|
|
layout.prop(mat, 'arm_discard')
|
|
|
|
columnb = layout.column()
|
2017-08-21 12:17:55 +02:00
|
|
|
columnb.enabled = mat.arm_discard
|
|
|
|
columnb.prop(mat, 'arm_discard_opacity')
|
|
|
|
columnb.prop(mat, 'arm_discard_opacity_shadows')
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(mat, 'arm_custom_material')
|
|
|
|
layout.prop(mat, 'arm_skip_context')
|
|
|
|
layout.prop(mat, 'arm_particle_fade')
|
|
|
|
layout.prop(mat, 'arm_billboard')
|
2018-08-08 22:43:14 +02:00
|
|
|
layout.prop(mat, 'arm_blending')
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = mat.arm_blending
|
|
|
|
col.prop(mat, 'arm_blending_source')
|
|
|
|
col.prop(mat, 'arm_blending_destination')
|
|
|
|
col.prop(mat, 'arm_blending_operation')
|
|
|
|
col.prop(mat, 'arm_blending_source_alpha')
|
|
|
|
col.prop(mat, 'arm_blending_destination_alpha')
|
|
|
|
col.prop(mat, 'arm_blending_operation_alpha')
|
2017-09-17 16:59:00 +02:00
|
|
|
|
2017-08-19 03:08:42 +02:00
|
|
|
layout.operator("arm.invalidate_material_cache")
|
2016-12-21 00:51:04 +01:00
|
|
|
|
2017-01-17 18:13:54 +01:00
|
|
|
class ArmoryPlayerPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Player"
|
2016-10-19 13:28:06 +02:00
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2016-10-19 13:28:06 +02:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
2017-01-17 18:13:54 +01:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.alignment = 'EXPAND'
|
2018-06-19 23:21:53 +02:00
|
|
|
if state.proc_play == None and state.proc_build == None:
|
2017-02-23 13:30:11 +01:00
|
|
|
row.operator("arm.play", icon="PLAY")
|
|
|
|
else:
|
|
|
|
row.operator("arm.stop", icon="MESH_PLANE")
|
2017-01-17 18:13:54 +01:00
|
|
|
row.operator("arm.clean_menu")
|
2018-11-13 14:17:47 +01:00
|
|
|
layout.prop(wrd, 'arm_runtime')
|
2018-06-19 23:21:53 +02:00
|
|
|
layout.prop(wrd, 'arm_play_camera')
|
2016-10-19 13:28:06 +02:00
|
|
|
|
2017-08-19 03:08:42 +02:00
|
|
|
class ArmoryExporterPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Exporter"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-08-19 03:08:42 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2017-08-19 03:08:42 +02:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
2017-01-23 20:41:45 +01:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.alignment = 'EXPAND'
|
|
|
|
row.operator("arm.build_project")
|
2018-05-24 22:16:28 +02:00
|
|
|
# row.operator("arm.patch_project")
|
2018-03-15 23:24:48 +01:00
|
|
|
row.operator("arm.publish_project", icon="EXPORT")
|
2017-08-21 15:36:21 +02:00
|
|
|
row.enabled = wrd.arm_exporterlist_index >= 0 and len(wrd.arm_exporterlist) > 0
|
|
|
|
|
|
|
|
rows = 2
|
|
|
|
if len(wrd.arm_exporterlist) > 1:
|
|
|
|
rows = 4
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list("ArmExporterList", "The_List", wrd, "arm_exporterlist", wrd, "arm_exporterlist_index", rows=rows)
|
|
|
|
col = row.column(align=True)
|
2018-12-18 23:48:38 +01:00
|
|
|
col.operator("arm_exporterlist.new_item", icon='ADD', text="")
|
|
|
|
col.operator("arm_exporterlist.delete_item", icon='REMOVE', text="")
|
2018-03-22 21:43:22 +01:00
|
|
|
col.menu("arm_exporterlist_specials", icon='DOWNARROW_HLT', text="")
|
2017-08-21 15:36:21 +02:00
|
|
|
|
2018-11-22 13:31:15 +01:00
|
|
|
if len(wrd.arm_exporterlist) > 1:
|
|
|
|
col.separator()
|
|
|
|
op = col.operator("arm_exporterlist.move_item", icon='TRIA_UP', text="")
|
|
|
|
op.direction = 'UP'
|
|
|
|
op = col.operator("arm_exporterlist.move_item", icon='TRIA_DOWN', text="")
|
|
|
|
op.direction = 'DOWN'
|
|
|
|
|
2017-08-21 15:36:21 +02:00
|
|
|
if wrd.arm_exporterlist_index >= 0 and len(wrd.arm_exporterlist) > 0:
|
|
|
|
item = wrd.arm_exporterlist[wrd.arm_exporterlist_index]
|
2018-03-15 23:24:48 +01:00
|
|
|
box = layout.box().column()
|
|
|
|
box.prop(item, 'arm_project_target')
|
2018-12-05 10:36:36 +01:00
|
|
|
if item.arm_project_target == 'custom':
|
|
|
|
box.prop(item, 'arm_project_khamake')
|
2018-03-15 23:24:48 +01:00
|
|
|
box.prop(item, arm.utils.target_to_gapi(item.arm_project_target))
|
2017-08-21 20:16:06 +02:00
|
|
|
wrd.arm_rpcache_list.clear() # Make UIList work with prop_search()
|
|
|
|
for i in wrd.arm_rplist:
|
|
|
|
wrd.arm_rpcache_list.add().name = i.name
|
2018-09-05 10:20:02 +02:00
|
|
|
box.prop_search(item, "arm_project_rp", wrd, "arm_rpcache_list", text="Render Path")
|
|
|
|
box.prop_search(item, 'arm_project_scene', bpy.data, 'scenes', text='Scene')
|
2018-01-23 19:42:06 +01:00
|
|
|
layout.separator()
|
2018-03-15 23:24:48 +01:00
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(wrd, 'arm_project_name')
|
|
|
|
col.prop(wrd, 'arm_project_package')
|
|
|
|
col.prop(wrd, 'arm_project_version')
|
2018-06-13 14:00:01 +02:00
|
|
|
col.prop(wrd, 'arm_project_bundle')
|
|
|
|
col.prop(wrd, 'arm_project_icon')
|
2018-12-15 19:03:11 +01:00
|
|
|
col.prop(wrd, 'arm_dce')
|
|
|
|
col.prop(wrd, 'arm_compiler_inline')
|
|
|
|
col.prop(wrd, 'arm_minify_js')
|
|
|
|
col.prop(wrd, 'arm_optimize_data')
|
2018-12-18 16:46:36 +01:00
|
|
|
col.prop(wrd, 'arm_asset_compression')
|
2017-08-19 03:08:42 +02:00
|
|
|
|
|
|
|
class ArmoryProjectPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Project"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-08-19 03:08:42 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2017-08-10 14:10:37 +02:00
|
|
|
row = layout.row(align=True)
|
2017-08-19 03:08:42 +02:00
|
|
|
row.operator("arm.kode_studio")
|
2018-03-15 23:24:48 +01:00
|
|
|
row.operator("arm.open_project_folder", icon="FILE_FOLDER")
|
2017-08-19 03:08:42 +02:00
|
|
|
|
2018-12-24 16:26:43 +01:00
|
|
|
class ArmProjectFlagsPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Flags"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_parent_id = "ArmoryProjectPanel"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
wrd = bpy.data.worlds['Arm']
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(wrd, 'arm_debug_console')
|
|
|
|
layout.prop(wrd, 'arm_cache_build')
|
|
|
|
layout.prop(wrd, 'arm_stream_scene')
|
|
|
|
layout.prop(wrd, 'arm_batch_meshes')
|
|
|
|
layout.prop(wrd, 'arm_batch_materials')
|
|
|
|
layout.prop(wrd, 'arm_write_config')
|
|
|
|
layout.prop(wrd, 'arm_minimize')
|
|
|
|
layout.prop(wrd, 'arm_deinterleaved_buffers')
|
|
|
|
layout.prop(wrd, 'arm_export_tangents')
|
|
|
|
layout.prop(wrd, 'arm_loadscreen')
|
|
|
|
layout.prop(wrd, 'arm_texture_quality')
|
|
|
|
layout.prop(wrd, 'arm_sound_quality')
|
2017-08-19 03:08:42 +02:00
|
|
|
|
2018-12-24 16:26:43 +01:00
|
|
|
class ArmProjectWindowPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Window"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "ArmoryProjectPanel"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
wrd = bpy.data.worlds['Arm']
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(wrd, 'arm_winmode')
|
|
|
|
layout.prop(wrd, 'arm_winorient')
|
|
|
|
layout.prop(wrd, 'arm_winresize')
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = wrd.arm_winresize
|
|
|
|
col.prop(wrd, 'arm_winmaximize')
|
|
|
|
layout.prop(wrd, 'arm_winminimize')
|
|
|
|
layout.prop(wrd, 'arm_vsync')
|
2017-08-19 03:08:42 +02:00
|
|
|
|
2018-12-24 16:26:43 +01:00
|
|
|
class ArmProjectModulesPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Modules"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "ArmoryProjectPanel"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
wrd = bpy.data.worlds['Arm']
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(wrd, 'arm_audio')
|
|
|
|
layout.prop(wrd, 'arm_physics')
|
2018-06-24 13:05:24 +02:00
|
|
|
if wrd.arm_physics != 'Disabled':
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(wrd, 'arm_physics_engine')
|
|
|
|
layout.prop(wrd, 'arm_navigation')
|
2018-06-24 13:05:24 +02:00
|
|
|
if wrd.arm_navigation != 'Disabled':
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(wrd, 'arm_navigation_engine')
|
|
|
|
layout.prop(wrd, 'arm_ui')
|
|
|
|
layout.prop(wrd, 'arm_hscript')
|
|
|
|
layout.prop(wrd, 'arm_formatlib')
|
|
|
|
layout.prop_search(wrd, 'arm_khafile', bpy.data, 'texts', text='Khafile')
|
|
|
|
layout.prop(wrd, 'arm_project_root')
|
2016-10-19 13:28:06 +02:00
|
|
|
|
2017-08-19 03:08:42 +02:00
|
|
|
class ArmVirtualInputPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Virtual Input"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-08-19 03:08:42 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2017-08-19 03:08:42 +02:00
|
|
|
|
|
|
|
class ArmNavigationPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Navigation"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "scene"
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-08-19 03:08:42 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2017-08-19 03:08:42 +02:00
|
|
|
scene = bpy.context.scene
|
|
|
|
if scene == None:
|
|
|
|
return
|
|
|
|
|
|
|
|
layout.operator("arm.generate_navmesh")
|
2019-01-22 09:48:22 +01:00
|
|
|
layout.operator("arm.remove_navmesh")
|
2017-08-19 03:08:42 +02:00
|
|
|
|
|
|
|
class ArmoryGenerateNavmeshButton(bpy.types.Operator):
|
|
|
|
'''Generate navmesh from selected meshes'''
|
|
|
|
bl_idname = 'arm.generate_navmesh'
|
|
|
|
bl_label = 'Generate Navmesh'
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-08-19 03:08:42 +02:00
|
|
|
def execute(self, context):
|
|
|
|
obj = context.active_object
|
|
|
|
if obj == None or obj.type != 'MESH':
|
|
|
|
return{'CANCELLED'}
|
|
|
|
|
2019-01-22 09:51:40 +01:00
|
|
|
# Prevent duplicates
|
|
|
|
for t in obj.arm_traitlist:
|
|
|
|
if t.class_name_prop == 'NavMesh':
|
|
|
|
return{'FINISHED'}
|
|
|
|
|
2017-08-19 03:08:42 +02:00
|
|
|
# TODO: build tilecache here
|
|
|
|
|
2018-10-12 17:32:51 +02:00
|
|
|
# Navmesh trait
|
2017-08-21 12:17:55 +02:00
|
|
|
obj.arm_traitlist.add()
|
|
|
|
obj.arm_traitlist[-1].type_prop = 'Bundled Script'
|
|
|
|
obj.arm_traitlist[-1].class_name_prop = 'NavMesh'
|
2017-08-19 03:08:42 +02:00
|
|
|
|
|
|
|
# For visualization
|
2019-01-22 09:48:22 +01:00
|
|
|
# Removed in b28
|
2018-12-18 23:48:38 +01:00
|
|
|
# bpy.ops.mesh.navmesh_make('EXEC_DEFAULT')
|
|
|
|
# obj = context.active_object
|
|
|
|
# obj.hide_render = True
|
|
|
|
# obj.arm_export = False
|
2017-08-19 03:08:42 +02:00
|
|
|
|
|
|
|
return{'FINISHED'}
|
2016-10-19 13:28:06 +02:00
|
|
|
|
2019-01-22 09:48:22 +01:00
|
|
|
class ArmoryRemoveNavmeshButton(bpy.types.Operator):
|
|
|
|
'''Remove generated navmesh from selected mesh'''
|
|
|
|
bl_idname = 'arm.remove_navmesh'
|
|
|
|
bl_label = 'Remove Navmesh'
|
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
obj = context.active_object
|
|
|
|
if obj == None or obj.type != 'MESH':
|
|
|
|
return{'CANCELLED'}
|
|
|
|
|
|
|
|
# Navmesh trait
|
|
|
|
for i in range(len(obj.arm_traitlist)):
|
|
|
|
if obj.arm_traitlist[i].class_name_prop == 'NavMesh':
|
|
|
|
obj.arm_traitlist.remove(i)
|
|
|
|
break
|
|
|
|
|
|
|
|
return{'FINISHED'}
|
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
class ArmoryPlayButton(bpy.types.Operator):
|
|
|
|
'''Launch player in new window'''
|
|
|
|
bl_idname = 'arm.play'
|
|
|
|
bl_label = 'Play'
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
def execute(self, context):
|
2018-06-19 23:21:53 +02:00
|
|
|
if state.proc_build != None:
|
2017-01-10 15:06:46 +01:00
|
|
|
return {"CANCELLED"}
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-03-15 12:30:14 +01:00
|
|
|
if not arm.utils.check_saved(self):
|
2016-11-11 23:05:17 +01:00
|
|
|
return {"CANCELLED"}
|
|
|
|
|
2017-03-15 12:30:14 +01:00
|
|
|
if not arm.utils.check_sdkpath(self):
|
2017-01-08 00:56:49 +01:00
|
|
|
return {"CANCELLED"}
|
2017-07-27 10:23:59 +02:00
|
|
|
|
2019-01-21 16:57:38 +01:00
|
|
|
arm.utils.check_projectpath(None)
|
|
|
|
|
2018-08-15 15:42:25 +02:00
|
|
|
arm.utils.check_default_props()
|
2016-12-09 02:08:01 +01:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
assets.invalidate_enabled = False
|
2018-06-19 23:21:53 +02:00
|
|
|
make.play(is_viewport=False)
|
2016-10-19 13:28:06 +02:00
|
|
|
assets.invalidate_enabled = True
|
|
|
|
return{'FINISHED'}
|
|
|
|
|
|
|
|
class ArmoryStopButton(bpy.types.Operator):
|
|
|
|
'''Stop currently running player'''
|
|
|
|
bl_idname = 'arm.stop'
|
|
|
|
bl_label = 'Stop'
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
def execute(self, context):
|
2018-06-19 23:21:53 +02:00
|
|
|
if state.proc_play != None:
|
|
|
|
state.proc_play.terminate()
|
|
|
|
state.proc_play = None
|
|
|
|
elif state.proc_build != None:
|
|
|
|
state.proc_build.terminate()
|
|
|
|
state.proc_build = None
|
2016-10-19 13:28:06 +02:00
|
|
|
return{'FINISHED'}
|
|
|
|
|
2017-01-23 20:41:45 +01:00
|
|
|
class ArmoryBuildProjectButton(bpy.types.Operator):
|
|
|
|
'''Build and compile project'''
|
|
|
|
bl_idname = 'arm.build_project'
|
|
|
|
bl_label = 'Build'
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-01-23 20:41:45 +01:00
|
|
|
def execute(self, context):
|
2017-03-15 12:30:14 +01:00
|
|
|
if not arm.utils.check_saved(self):
|
2017-01-23 20:41:45 +01:00
|
|
|
return {"CANCELLED"}
|
|
|
|
|
2017-03-15 12:30:14 +01:00
|
|
|
if not arm.utils.check_sdkpath(self):
|
2017-01-23 20:41:45 +01:00
|
|
|
return {"CANCELLED"}
|
|
|
|
|
2017-09-08 14:07:41 +02:00
|
|
|
arm.utils.check_projectpath(self)
|
|
|
|
|
2018-08-15 15:42:25 +02:00
|
|
|
arm.utils.check_default_props()
|
2017-08-21 20:16:06 +02:00
|
|
|
|
2017-08-21 15:36:21 +02:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
2017-08-21 20:16:06 +02:00
|
|
|
item = wrd.arm_exporterlist[wrd.arm_exporterlist_index]
|
|
|
|
if item.arm_project_rp == '':
|
|
|
|
item.arm_project_rp = wrd.arm_rplist[wrd.arm_rplist_index].name
|
2019-01-24 15:09:49 +01:00
|
|
|
if item.arm_project_scene == None:
|
|
|
|
item.arm_project_scene = context.scene
|
2017-08-21 20:16:06 +02:00
|
|
|
# Assume unique rp names
|
|
|
|
rplist_index = wrd.arm_rplist_index
|
|
|
|
for i in range(0, len(wrd.arm_rplist)):
|
|
|
|
if wrd.arm_rplist[i].name == item.arm_project_rp:
|
|
|
|
wrd.arm_rplist_index = i
|
|
|
|
break
|
2017-08-21 15:36:21 +02:00
|
|
|
assets.invalidate_shader_cache(None, None)
|
2017-01-23 20:41:45 +01:00
|
|
|
assets.invalidate_enabled = False
|
2018-06-19 23:21:53 +02:00
|
|
|
make.build(item.arm_project_target, is_export=True)
|
|
|
|
make.compile()
|
2017-10-12 20:21:10 +02:00
|
|
|
wrd.arm_rplist_index = rplist_index
|
|
|
|
assets.invalidate_enabled = True
|
|
|
|
return{'FINISHED'}
|
|
|
|
|
2017-09-04 12:14:14 +02:00
|
|
|
class ArmoryPublishProjectButton(bpy.types.Operator):
|
|
|
|
'''Build project ready for publishing'''
|
|
|
|
bl_idname = 'arm.publish_project'
|
|
|
|
bl_label = 'Publish'
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-09-04 12:14:14 +02:00
|
|
|
def execute(self, context):
|
|
|
|
if not arm.utils.check_saved(self):
|
|
|
|
return {"CANCELLED"}
|
|
|
|
|
|
|
|
if not arm.utils.check_sdkpath(self):
|
|
|
|
return {"CANCELLED"}
|
|
|
|
|
2017-09-08 14:07:41 +02:00
|
|
|
self.report({'INFO'}, 'Publishing project, check console for details.')
|
|
|
|
|
|
|
|
arm.utils.check_projectpath(self)
|
|
|
|
|
2018-08-15 15:42:25 +02:00
|
|
|
arm.utils.check_default_props()
|
2017-09-04 12:14:14 +02:00
|
|
|
|
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
item = wrd.arm_exporterlist[wrd.arm_exporterlist_index]
|
|
|
|
if item.arm_project_rp == '':
|
|
|
|
item.arm_project_rp = wrd.arm_rplist[wrd.arm_rplist_index].name
|
2019-01-25 08:07:35 +01:00
|
|
|
if item.arm_project_scene == None:
|
|
|
|
item.arm_project_scene = context.scene
|
2017-09-04 12:14:14 +02:00
|
|
|
# Assume unique rp names
|
|
|
|
rplist_index = wrd.arm_rplist_index
|
|
|
|
for i in range(0, len(wrd.arm_rplist)):
|
|
|
|
if wrd.arm_rplist[i].name == item.arm_project_rp:
|
|
|
|
wrd.arm_rplist_index = i
|
|
|
|
break
|
|
|
|
|
2018-05-24 22:16:28 +02:00
|
|
|
make.clean()
|
2017-09-04 12:14:14 +02:00
|
|
|
assets.invalidate_enabled = False
|
2018-06-19 23:21:53 +02:00
|
|
|
make.build(item.arm_project_target, is_publish=True, is_export=True)
|
|
|
|
make.compile()
|
2017-08-21 20:16:06 +02:00
|
|
|
wrd.arm_rplist_index = rplist_index
|
2017-09-04 12:14:14 +02:00
|
|
|
assets.invalidate_enabled = True
|
2017-01-23 20:41:45 +01:00
|
|
|
return{'FINISHED'}
|
|
|
|
|
2017-02-28 13:48:19 +01:00
|
|
|
class ArmoryOpenProjectFolderButton(bpy.types.Operator):
|
2016-10-19 13:28:06 +02:00
|
|
|
'''Open project folder'''
|
2017-02-28 13:48:19 +01:00
|
|
|
bl_idname = 'arm.open_project_folder'
|
2016-10-19 13:28:06 +02:00
|
|
|
bl_label = 'Project Folder'
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
def execute(self, context):
|
2017-03-15 12:30:14 +01:00
|
|
|
if not arm.utils.check_saved(self):
|
2016-10-31 19:29:03 +01:00
|
|
|
return {"CANCELLED"}
|
|
|
|
|
2017-03-15 12:30:14 +01:00
|
|
|
webbrowser.open('file://' + arm.utils.get_fp())
|
2016-10-19 13:28:06 +02:00
|
|
|
return{'FINISHED'}
|
|
|
|
|
|
|
|
class ArmoryKodeStudioButton(bpy.types.Operator):
|
|
|
|
'''Launch this project in Kode Studio'''
|
|
|
|
bl_idname = 'arm.kode_studio'
|
|
|
|
bl_label = 'Kode Studio'
|
|
|
|
bl_description = 'Open Project in Kode Studio'
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
def execute(self, context):
|
2017-03-15 12:30:14 +01:00
|
|
|
if not arm.utils.check_saved(self):
|
2016-10-31 19:29:03 +01:00
|
|
|
return {"CANCELLED"}
|
|
|
|
|
2018-09-27 12:38:54 +02:00
|
|
|
arm.utils.check_default_props()
|
|
|
|
|
2018-09-21 21:32:45 +02:00
|
|
|
if not os.path.exists(arm.utils.get_fp() + "/khafile.js"):
|
|
|
|
print('Generating Krom project for Kode Studio')
|
|
|
|
make.build('krom')
|
2018-08-07 08:56:48 +02:00
|
|
|
|
2017-11-20 14:32:36 +01:00
|
|
|
arm.utils.kode_studio()
|
2016-10-19 13:28:06 +02:00
|
|
|
return{'FINISHED'}
|
|
|
|
|
2016-12-01 18:46:48 +01:00
|
|
|
class CleanMenu(bpy.types.Menu):
|
|
|
|
bl_label = "Ok?"
|
|
|
|
bl_idname = "OBJECT_MT_clean_menu"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.operator("arm.clean_project")
|
|
|
|
|
|
|
|
class CleanButtonMenu(bpy.types.Operator):
|
|
|
|
'''Clean cached data'''
|
|
|
|
bl_label = "Clean"
|
|
|
|
bl_idname = "arm.clean_menu"
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-12-01 18:46:48 +01:00
|
|
|
def execute(self, context):
|
|
|
|
bpy.ops.wm.call_menu(name=CleanMenu.bl_idname)
|
|
|
|
return {"FINISHED"}
|
|
|
|
|
2016-11-05 14:12:36 +01:00
|
|
|
class ArmoryCleanProjectButton(bpy.types.Operator):
|
|
|
|
'''Delete all cached project data'''
|
|
|
|
bl_idname = 'arm.clean_project'
|
|
|
|
bl_label = 'Clean Project'
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
def execute(self, context):
|
2017-03-15 12:30:14 +01:00
|
|
|
if not arm.utils.check_saved(self):
|
2016-10-31 19:29:03 +01:00
|
|
|
return {"CANCELLED"}
|
|
|
|
|
2018-05-24 22:16:28 +02:00
|
|
|
make.clean()
|
2016-10-19 13:28:06 +02:00
|
|
|
return{'FINISHED'}
|
|
|
|
|
|
|
|
def draw_view3d_header(self, context):
|
2018-06-19 23:21:53 +02:00
|
|
|
if state.proc_build != None:
|
2018-09-05 10:20:02 +02:00
|
|
|
self.layout.label(text='Compiling..')
|
2018-05-24 22:16:28 +02:00
|
|
|
elif log.info_text != '':
|
2018-09-05 10:20:02 +02:00
|
|
|
self.layout.label(text=log.info_text)
|
2016-10-19 13:28:06 +02:00
|
|
|
|
2017-08-19 12:10:06 +02:00
|
|
|
class ArmRenderPathPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Render Path"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-08-21 20:16:06 +02:00
|
|
|
|
2017-08-19 12:10:06 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2017-08-19 12:10:06 +02:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
|
2017-08-21 20:16:06 +02:00
|
|
|
rows = 2
|
|
|
|
if len(wrd.arm_rplist) > 1:
|
|
|
|
rows = 4
|
2017-08-21 12:17:55 +02:00
|
|
|
row = layout.row()
|
2017-08-21 20:16:06 +02:00
|
|
|
row.template_list("ArmRPList", "The_List", wrd, "arm_rplist", wrd, "arm_rplist_index", rows=rows)
|
|
|
|
col = row.column(align=True)
|
2018-12-18 23:48:38 +01:00
|
|
|
col.operator("arm_rplist.new_item", icon='ADD', text="")
|
|
|
|
col.operator("arm_rplist.delete_item", icon='REMOVE', text="")
|
2017-08-21 20:16:06 +02:00
|
|
|
|
2018-11-22 13:31:15 +01:00
|
|
|
if len(wrd.arm_rplist) > 1:
|
|
|
|
col.separator()
|
|
|
|
op = col.operator("arm_rplist.move_item", icon='TRIA_UP', text="")
|
|
|
|
op.direction = 'UP'
|
|
|
|
op = col.operator("arm_rplist.move_item", icon='TRIA_DOWN', text="")
|
|
|
|
op.direction = 'DOWN'
|
|
|
|
|
2018-03-15 16:02:56 +01:00
|
|
|
if wrd.arm_rplist_index < 0 or len(wrd.arm_rplist) == 0:
|
|
|
|
return
|
2017-08-21 20:16:06 +02:00
|
|
|
|
2018-03-15 16:02:56 +01:00
|
|
|
rpdat = wrd.arm_rplist[wrd.arm_rplist_index]
|
|
|
|
if len(arm.api.drivers) > 0:
|
|
|
|
rpdat.rp_driver_list.clear()
|
|
|
|
rpdat.rp_driver_list.add().name = 'Armory'
|
|
|
|
for d in arm.api.drivers:
|
|
|
|
rpdat.rp_driver_list.add().name = arm.api.drivers[d]['driver_name']
|
2018-09-05 10:20:02 +02:00
|
|
|
layout.prop_search(rpdat, "rp_driver", rpdat, "rp_driver_list", text="Driver")
|
2017-08-23 23:37:55 +02:00
|
|
|
layout.separator()
|
2018-03-15 16:02:56 +01:00
|
|
|
if rpdat.rp_driver != 'Armory' and arm.api.drivers[rpdat.rp_driver]['draw_props'] != None:
|
|
|
|
arm.api.drivers[rpdat.rp_driver]['draw_props'](layout)
|
2018-12-19 13:33:17 +01:00
|
|
|
return
|
2018-11-15 14:07:03 +01:00
|
|
|
|
2018-12-19 13:33:17 +01:00
|
|
|
class ArmRenderPathRendererPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Renderer"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "ArmRenderPathPanel"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2018-12-19 13:33:17 +01:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
2019-01-09 21:25:09 +01:00
|
|
|
if len(wrd.arm_rplist) <= wrd.arm_rplist_index:
|
|
|
|
return
|
2018-12-19 13:33:17 +01:00
|
|
|
rpdat = wrd.arm_rplist[wrd.arm_rplist_index]
|
|
|
|
|
|
|
|
layout.prop(rpdat, 'rp_renderer')
|
2018-12-10 09:46:46 +01:00
|
|
|
if rpdat.rp_renderer == 'Forward':
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(rpdat, 'rp_depthprepass')
|
|
|
|
layout.prop(rpdat, 'arm_material_model')
|
|
|
|
layout.prop(rpdat, 'rp_translucency_state')
|
|
|
|
layout.prop(rpdat, 'rp_overlays_state')
|
|
|
|
layout.prop(rpdat, 'rp_decals_state')
|
|
|
|
layout.prop(rpdat, 'rp_blending_state')
|
|
|
|
layout.prop(rpdat, 'rp_draw_order')
|
|
|
|
layout.prop(rpdat, 'arm_samples_per_pixel')
|
|
|
|
layout.prop(rpdat, 'arm_texture_filter')
|
|
|
|
layout.prop(rpdat, 'rp_sss_state')
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.rp_sss_state != 'Off'
|
|
|
|
col.prop(rpdat, 'arm_sss_width')
|
|
|
|
layout.prop(rpdat, 'arm_rp_displacement')
|
2018-05-07 23:09:38 +02:00
|
|
|
if rpdat.arm_rp_displacement == 'Tessellation':
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.label(text='Mesh')
|
|
|
|
layout.prop(rpdat, 'arm_tess_mesh_inner')
|
|
|
|
layout.prop(rpdat, 'arm_tess_mesh_outer')
|
|
|
|
layout.label(text='Shadow')
|
|
|
|
layout.prop(rpdat, 'arm_tess_shadows_inner')
|
|
|
|
layout.prop(rpdat, 'arm_tess_shadows_outer')
|
|
|
|
|
|
|
|
layout.prop(rpdat, 'arm_particles')
|
|
|
|
layout.prop(rpdat, 'arm_skin')
|
|
|
|
row = layout.row()
|
|
|
|
row.enabled = rpdat.arm_skin.startswith('GPU')
|
|
|
|
row.prop(rpdat, 'arm_skin_max_bones_auto')
|
|
|
|
row = layout.row()
|
|
|
|
row.enabled = not rpdat.arm_skin_max_bones_auto
|
|
|
|
row.prop(rpdat, 'arm_skin_max_bones')
|
|
|
|
layout.prop(rpdat, "rp_hdr")
|
|
|
|
layout.prop(rpdat, "rp_stereo")
|
|
|
|
layout.prop(rpdat, 'arm_culling')
|
|
|
|
|
|
|
|
class ArmRenderPathShadowsPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Shadows"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "ArmRenderPathPanel"
|
2017-08-21 20:16:06 +02:00
|
|
|
|
2018-12-19 13:33:17 +01:00
|
|
|
def draw_header(self, context):
|
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
if len(wrd.arm_rplist) <= wrd.arm_rplist_index:
|
|
|
|
return
|
|
|
|
rpdat = wrd.arm_rplist[wrd.arm_rplist_index]
|
|
|
|
self.layout.prop(rpdat, "rp_shadows", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2018-12-19 13:33:17 +01:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
if len(wrd.arm_rplist) <= wrd.arm_rplist_index:
|
|
|
|
return
|
|
|
|
rpdat = wrd.arm_rplist[wrd.arm_rplist_index]
|
|
|
|
|
|
|
|
layout.enabled = rpdat.rp_shadows
|
|
|
|
layout.prop(rpdat, 'rp_shadowmap_cube')
|
|
|
|
layout.prop(rpdat, 'rp_shadowmap_cascade')
|
|
|
|
layout.prop(rpdat, 'rp_shadowmap_cascades')
|
|
|
|
col = layout.column()
|
|
|
|
col2 = col.column()
|
|
|
|
col2.enabled = rpdat.rp_shadowmap_cascades != '1'
|
|
|
|
col2.prop(rpdat, 'arm_shadowmap_split')
|
|
|
|
col.prop(rpdat, 'arm_shadowmap_bounds')
|
2019-01-24 12:47:51 +01:00
|
|
|
# col.prop(rpdat, 'arm_soft_shadows')
|
|
|
|
# col2 = col.column()
|
|
|
|
# col2.enabled = rpdat.arm_soft_shadows != 'Off'
|
|
|
|
# col2.prop(rpdat, 'arm_soft_shadows_penumbra')
|
|
|
|
# col2.prop(rpdat, 'arm_soft_shadows_distance')
|
2018-12-19 13:33:17 +01:00
|
|
|
col.prop(rpdat, 'arm_pcfsize')
|
|
|
|
|
|
|
|
class ArmRenderPathVoxelsPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Voxels"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "ArmRenderPathPanel"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2018-12-19 13:33:17 +01:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
if len(wrd.arm_rplist) <= wrd.arm_rplist_index:
|
|
|
|
return
|
|
|
|
rpdat = wrd.arm_rplist[wrd.arm_rplist_index]
|
|
|
|
|
|
|
|
layout.prop(rpdat, 'rp_gi')
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.rp_gi != 'Off'
|
|
|
|
col2 = col.column()
|
|
|
|
col2.enabled = rpdat.rp_gi == 'Voxel GI'
|
2019-01-10 21:54:36 +01:00
|
|
|
# col2.prop(rpdat, 'arm_voxelgi_bounces')
|
2018-12-19 13:33:17 +01:00
|
|
|
col2.prop(rpdat, 'rp_voxelgi_relight')
|
2019-01-27 19:12:00 +01:00
|
|
|
col3 = col.column()
|
|
|
|
col3.enabled = rpdat.rp_gi == 'Voxel AO'
|
|
|
|
col3.prop(rpdat, 'arm_voxelgi_shadows')
|
2018-12-19 13:33:17 +01:00
|
|
|
col.prop(rpdat, 'arm_voxelgi_cones')
|
|
|
|
col.prop(rpdat, 'rp_voxelgi_resolution')
|
|
|
|
col.prop(rpdat, 'rp_voxelgi_resolution_z')
|
|
|
|
col.prop(rpdat, 'arm_voxelgi_dimensions')
|
|
|
|
col.prop(rpdat, 'arm_voxelgi_revoxelize')
|
|
|
|
col2 = col.column()
|
|
|
|
col2.enabled = rpdat.arm_voxelgi_revoxelize
|
|
|
|
col2.prop(rpdat, 'arm_voxelgi_camera')
|
|
|
|
col2.prop(rpdat, 'arm_voxelgi_temporal')
|
|
|
|
col.label(text="Light")
|
|
|
|
col2 = col.column()
|
|
|
|
col2.enabled = rpdat.rp_gi == 'Voxel GI'
|
|
|
|
col2.prop(rpdat, 'arm_voxelgi_diff')
|
|
|
|
col2.prop(rpdat, 'arm_voxelgi_spec')
|
|
|
|
col.prop(rpdat, 'arm_voxelgi_occ')
|
|
|
|
col.prop(rpdat, 'arm_voxelgi_env')
|
|
|
|
col.label(text="Ray")
|
|
|
|
col.prop(rpdat, 'arm_voxelgi_step')
|
|
|
|
col.prop(rpdat, 'arm_voxelgi_range')
|
|
|
|
col.prop(rpdat, 'arm_voxelgi_offset')
|
|
|
|
|
|
|
|
class ArmRenderPathWorldPanel(bpy.types.Panel):
|
|
|
|
bl_label = "World"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "ArmRenderPathPanel"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2018-12-19 13:33:17 +01:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
if len(wrd.arm_rplist) <= wrd.arm_rplist_index:
|
|
|
|
return
|
|
|
|
rpdat = wrd.arm_rplist[wrd.arm_rplist_index]
|
|
|
|
|
|
|
|
layout.prop(rpdat, "rp_background")
|
|
|
|
layout.prop(rpdat, 'arm_irradiance')
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.arm_irradiance
|
|
|
|
col.prop(rpdat, 'arm_radiance')
|
|
|
|
colb = col.column()
|
|
|
|
colb.enabled = rpdat.arm_radiance
|
|
|
|
colb.prop(rpdat, 'arm_radiance_size')
|
|
|
|
layout.prop(rpdat, 'arm_clouds')
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.arm_clouds
|
|
|
|
col.prop(rpdat, 'arm_clouds_density')
|
|
|
|
col.prop(rpdat, 'arm_clouds_size')
|
|
|
|
col.prop(rpdat, 'arm_clouds_lower')
|
|
|
|
col.prop(rpdat, 'arm_clouds_upper')
|
|
|
|
col.prop(rpdat, 'arm_clouds_precipitation')
|
|
|
|
col.prop(rpdat, 'arm_clouds_eccentricity')
|
|
|
|
col.prop(rpdat, 'arm_clouds_secondary')
|
|
|
|
col.prop(rpdat, 'arm_clouds_wind')
|
|
|
|
layout.prop(rpdat, "rp_ocean")
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.rp_ocean
|
|
|
|
col.prop(rpdat, 'arm_ocean_level')
|
|
|
|
col.prop(rpdat, 'arm_ocean_fade')
|
|
|
|
col.prop(rpdat, 'arm_ocean_amplitude')
|
|
|
|
col.prop(rpdat, 'arm_ocean_height')
|
|
|
|
col.prop(rpdat, 'arm_ocean_choppy')
|
|
|
|
col.prop(rpdat, 'arm_ocean_speed')
|
|
|
|
col.prop(rpdat, 'arm_ocean_freq')
|
|
|
|
col.prop(rpdat, 'arm_ocean_base_color')
|
|
|
|
col.prop(rpdat, 'arm_ocean_water_color')
|
|
|
|
|
|
|
|
class ArmRenderPathPostProcessPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Post Process"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "ArmRenderPathPanel"
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
if len(wrd.arm_rplist) <= wrd.arm_rplist_index:
|
|
|
|
return
|
|
|
|
rpdat = wrd.arm_rplist[wrd.arm_rplist_index]
|
|
|
|
self.layout.prop(rpdat, "rp_render_to_texture", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2018-12-19 13:33:17 +01:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
if len(wrd.arm_rplist) <= wrd.arm_rplist_index:
|
|
|
|
return
|
|
|
|
rpdat = wrd.arm_rplist[wrd.arm_rplist_index]
|
|
|
|
|
|
|
|
layout.enabled = rpdat.rp_render_to_texture
|
|
|
|
row = layout.row()
|
|
|
|
row.prop(rpdat, "rp_antialiasing")
|
|
|
|
layout.prop(rpdat, "rp_supersampling")
|
|
|
|
layout.prop(rpdat, 'arm_rp_resolution')
|
2018-04-20 00:56:54 +02:00
|
|
|
if rpdat.arm_rp_resolution == 'Custom':
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(rpdat, 'arm_rp_resolution_size')
|
|
|
|
layout.prop(rpdat, 'arm_rp_resolution_filter')
|
|
|
|
layout.prop(rpdat, 'rp_dynres')
|
|
|
|
layout.separator()
|
|
|
|
row = layout.row()
|
|
|
|
row.prop(rpdat, "rp_ssgi")
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.rp_ssgi != 'Off'
|
|
|
|
col.prop(rpdat, 'arm_ssgi_half_res')
|
|
|
|
col.prop(rpdat, 'arm_ssgi_rays')
|
|
|
|
col.prop(rpdat, 'arm_ssgi_radius')
|
|
|
|
col.prop(rpdat, 'arm_ssgi_strength')
|
|
|
|
col.prop(rpdat, 'arm_ssgi_max_steps')
|
|
|
|
layout.separator()
|
|
|
|
layout.prop(rpdat, "rp_ssr")
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.rp_ssr
|
|
|
|
col.prop(rpdat, 'arm_ssr_half_res')
|
|
|
|
col.prop(rpdat, 'arm_ssr_ray_step')
|
|
|
|
col.prop(rpdat, 'arm_ssr_min_ray_step')
|
|
|
|
col.prop(rpdat, 'arm_ssr_search_dist')
|
|
|
|
col.prop(rpdat, 'arm_ssr_falloff_exp')
|
|
|
|
col.prop(rpdat, 'arm_ssr_jitter')
|
|
|
|
layout.separator()
|
|
|
|
layout.prop(rpdat, 'arm_ssrs')
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.arm_ssrs
|
|
|
|
col.prop(rpdat, 'arm_ssrs_ray_step')
|
|
|
|
layout.separator()
|
|
|
|
layout.prop(rpdat, "rp_bloom")
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.rp_bloom
|
|
|
|
col.prop(rpdat, 'arm_bloom_threshold')
|
|
|
|
col.prop(rpdat, 'arm_bloom_strength')
|
|
|
|
col.prop(rpdat, 'arm_bloom_radius')
|
|
|
|
layout.separator()
|
|
|
|
layout.prop(rpdat, "rp_motionblur")
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.rp_motionblur != 'Off'
|
|
|
|
col.prop(rpdat, 'arm_motion_blur_intensity')
|
|
|
|
layout.separator()
|
|
|
|
layout.prop(rpdat, "rp_volumetriclight")
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.rp_volumetriclight
|
|
|
|
col.prop(rpdat, 'arm_volumetric_light_air_color')
|
|
|
|
col.prop(rpdat, 'arm_volumetric_light_air_turbidity')
|
|
|
|
col.prop(rpdat, 'arm_volumetric_light_steps')
|
|
|
|
|
|
|
|
class ArmRenderPathCompositorPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Compositor"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "ArmRenderPathPanel"
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
if len(wrd.arm_rplist) <= wrd.arm_rplist_index:
|
|
|
|
return
|
|
|
|
rpdat = wrd.arm_rplist[wrd.arm_rplist_index]
|
|
|
|
self.layout.prop(rpdat, "rp_compositornodes", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2018-12-19 13:33:17 +01:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
if len(wrd.arm_rplist) <= wrd.arm_rplist_index:
|
|
|
|
return
|
|
|
|
rpdat = wrd.arm_rplist[wrd.arm_rplist_index]
|
|
|
|
|
|
|
|
layout.enabled = rpdat.rp_compositornodes
|
|
|
|
layout.prop(rpdat, 'arm_tonemap')
|
|
|
|
layout.prop(rpdat, 'arm_letterbox')
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.arm_letterbox
|
|
|
|
col.prop(rpdat, 'arm_letterbox_size')
|
|
|
|
layout.prop(rpdat, 'arm_sharpen')
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.arm_sharpen
|
|
|
|
col.prop(rpdat, 'arm_sharpen_strength')
|
|
|
|
layout.prop(rpdat, 'arm_fisheye')
|
|
|
|
layout.prop(rpdat, 'arm_vignette')
|
|
|
|
layout.prop(rpdat, 'arm_lensflare')
|
|
|
|
layout.prop(rpdat, 'arm_grain')
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.arm_grain
|
|
|
|
col.prop(rpdat, 'arm_grain_strength')
|
|
|
|
layout.prop(rpdat, 'arm_fog')
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.arm_fog
|
|
|
|
col.prop(rpdat, 'arm_fog_color')
|
|
|
|
col.prop(rpdat, 'arm_fog_amounta')
|
|
|
|
col.prop(rpdat, 'arm_fog_amountb')
|
|
|
|
layout.separator()
|
|
|
|
layout.prop(rpdat, "rp_autoexposure")
|
|
|
|
col = layout.column()
|
|
|
|
col.enabled = rpdat.rp_autoexposure
|
|
|
|
col.prop(rpdat, 'arm_autoexposure_strength', text='Strength')
|
|
|
|
layout.prop(rpdat, 'arm_lens_texture')
|
|
|
|
layout.prop(rpdat, 'arm_lut_texture')
|
2017-08-19 12:10:06 +02:00
|
|
|
|
2018-03-05 00:24:04 +01:00
|
|
|
class ArmBakePanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Bake"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2019-01-07 20:21:51 +01:00
|
|
|
scn = bpy.data.scenes[context.scene.name]
|
2018-03-13 18:23:00 +01:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.alignment = 'EXPAND'
|
|
|
|
row.operator("arm.bake_textures", icon="RENDER_STILL")
|
|
|
|
row.operator("arm.bake_apply")
|
2018-03-14 13:24:43 +01:00
|
|
|
|
2018-12-19 13:33:17 +01:00
|
|
|
col = layout.column()
|
2018-03-14 13:24:43 +01:00
|
|
|
col.prop(scn, 'arm_bakelist_scale')
|
2018-12-19 13:33:17 +01:00
|
|
|
col.prop(scn.cycles, "samples")
|
2018-03-13 18:23:00 +01:00
|
|
|
|
2018-06-11 21:06:30 +02:00
|
|
|
layout.prop(scn, 'arm_bakelist_unwrap')
|
|
|
|
|
2018-03-13 18:23:00 +01:00
|
|
|
rows = 2
|
2018-03-05 00:24:04 +01:00
|
|
|
if len(scn.arm_bakelist) > 1:
|
|
|
|
rows = 4
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list("ArmBakeList", "The_List", scn, "arm_bakelist", scn, "arm_bakelist_index", rows=rows)
|
|
|
|
col = row.column(align=True)
|
2018-12-18 23:48:38 +01:00
|
|
|
col.operator("arm_bakelist.new_item", icon='ADD', text="")
|
|
|
|
col.operator("arm_bakelist.delete_item", icon='REMOVE', text="")
|
2018-03-13 18:23:00 +01:00
|
|
|
col.menu("arm_bakelist_specials", icon='DOWNARROW_HLT', text="")
|
2018-03-05 00:24:04 +01:00
|
|
|
|
2018-11-22 13:31:15 +01:00
|
|
|
if len(scn.arm_bakelist) > 1:
|
|
|
|
col.separator()
|
|
|
|
op = col.operator("arm_bakelist.move_item", icon='TRIA_UP', text="")
|
|
|
|
op.direction = 'UP'
|
|
|
|
op = col.operator("arm_bakelist.move_item", icon='TRIA_DOWN', text="")
|
|
|
|
op.direction = 'DOWN'
|
|
|
|
|
2018-03-05 00:24:04 +01:00
|
|
|
if scn.arm_bakelist_index >= 0 and len(scn.arm_bakelist) > 0:
|
|
|
|
item = scn.arm_bakelist[scn.arm_bakelist_index]
|
2019-01-07 20:21:51 +01:00
|
|
|
layout.prop_search(item, "obj", bpy.data, "objects", text="Object")
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(item, "res_x")
|
|
|
|
layout.prop(item, "res_y")
|
2018-03-05 00:24:04 +01:00
|
|
|
|
2017-08-19 12:10:06 +02:00
|
|
|
class ArmGenLodButton(bpy.types.Operator):
|
|
|
|
'''Automatically generate LoD levels'''
|
|
|
|
bl_idname = 'arm.generate_lod'
|
|
|
|
bl_label = 'Auto Generate'
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-08-19 12:10:06 +02:00
|
|
|
def lod_name(self, name, level):
|
|
|
|
return name + '_LOD' + str(level + 1)
|
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
obj = context.object
|
|
|
|
if obj == None:
|
|
|
|
return{'CANCELLED'}
|
|
|
|
|
|
|
|
# Clear
|
|
|
|
mdata = context.object.data
|
2017-08-21 12:17:55 +02:00
|
|
|
mdata.arm_lodlist_index = 0
|
|
|
|
mdata.arm_lodlist.clear()
|
2017-08-19 12:10:06 +02:00
|
|
|
|
|
|
|
# Lod levels
|
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
ratio = wrd.arm_lod_gen_ratio
|
|
|
|
num_levels = wrd.arm_lod_gen_levels
|
|
|
|
for level in range(0, num_levels):
|
|
|
|
new_obj = obj.copy()
|
|
|
|
for i in range(0, 3):
|
|
|
|
new_obj.location[i] = 0
|
|
|
|
new_obj.rotation_euler[i] = 0
|
|
|
|
new_obj.scale[i] = 1
|
|
|
|
new_obj.data = obj.data.copy()
|
|
|
|
new_obj.name = self.lod_name(obj.name, level)
|
|
|
|
new_obj.parent = obj
|
2019-01-08 22:49:21 +01:00
|
|
|
new_obj.hide_viewport = True
|
2017-08-19 12:10:06 +02:00
|
|
|
new_obj.hide_render = True
|
|
|
|
mod = new_obj.modifiers.new('Decimate', 'DECIMATE')
|
|
|
|
mod.ratio = ratio
|
|
|
|
ratio *= wrd.arm_lod_gen_ratio
|
2019-01-08 22:49:21 +01:00
|
|
|
context.scene.collection.objects.link(new_obj)
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-08-19 12:10:06 +02:00
|
|
|
# Screen sizes
|
|
|
|
for level in range(0, num_levels):
|
2017-08-21 12:17:55 +02:00
|
|
|
mdata.arm_lodlist.add()
|
|
|
|
mdata.arm_lodlist[-1].name = self.lod_name(obj.name, level)
|
|
|
|
mdata.arm_lodlist[-1].screen_size_prop = (1 - (1 / (num_levels + 1)) * level) - (1 / (num_levels + 1))
|
2017-08-19 12:10:06 +02:00
|
|
|
|
|
|
|
return{'FINISHED'}
|
|
|
|
|
|
|
|
class ArmLodPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Lod"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "object"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-08-19 12:10:06 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2017-08-19 12:10:06 +02:00
|
|
|
obj = bpy.context.object
|
|
|
|
|
|
|
|
# Mesh only for now
|
|
|
|
if obj.type != 'MESH':
|
|
|
|
return
|
|
|
|
|
|
|
|
mdata = obj.data
|
|
|
|
|
|
|
|
rows = 2
|
2017-08-21 12:17:55 +02:00
|
|
|
if len(mdata.arm_lodlist) > 1:
|
2017-08-19 12:10:06 +02:00
|
|
|
rows = 4
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-08-19 12:10:06 +02:00
|
|
|
row = layout.row()
|
2017-08-21 12:17:55 +02:00
|
|
|
row.template_list("ArmLodList", "The_List", mdata, "arm_lodlist", mdata, "arm_lodlist_index", rows=rows)
|
2017-08-19 12:10:06 +02:00
|
|
|
col = row.column(align=True)
|
2018-12-18 23:48:38 +01:00
|
|
|
col.operator("arm_lodlist.new_item", icon='ADD', text="")
|
|
|
|
col.operator("arm_lodlist.delete_item", icon='REMOVE', text="")
|
2017-08-19 12:10:06 +02:00
|
|
|
|
2018-11-22 13:31:15 +01:00
|
|
|
if len(mdata.arm_lodlist) > 1:
|
|
|
|
col.separator()
|
|
|
|
op = col.operator("arm_lodlist.move_item", icon='TRIA_UP', text="")
|
|
|
|
op.direction = 'UP'
|
|
|
|
op = col.operator("arm_lodlist.move_item", icon='TRIA_DOWN', text="")
|
|
|
|
op.direction = 'DOWN'
|
|
|
|
|
2017-08-21 12:17:55 +02:00
|
|
|
if mdata.arm_lodlist_index >= 0 and len(mdata.arm_lodlist) > 0:
|
|
|
|
item = mdata.arm_lodlist[mdata.arm_lodlist_index]
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop_search(item, "name", bpy.data, "objects", text="Object")
|
|
|
|
layout.prop(item, "screen_size_prop")
|
2018-08-01 10:20:42 +02:00
|
|
|
layout.prop(mdata, "arm_lod_material")
|
|
|
|
|
2017-08-19 12:10:06 +02:00
|
|
|
# Auto lod for meshes
|
|
|
|
if obj.type == 'MESH':
|
|
|
|
layout.separator()
|
|
|
|
layout.operator("arm.generate_lod")
|
|
|
|
wrd = bpy.data.worlds['Arm']
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(wrd, 'arm_lod_gen_levels')
|
|
|
|
layout.prop(wrd, 'arm_lod_gen_ratio')
|
2017-08-19 12:10:06 +02:00
|
|
|
|
2019-01-17 21:34:38 +01:00
|
|
|
class ArmGenTerrainButton(bpy.types.Operator):
|
|
|
|
'''Generate terrain sectors'''
|
|
|
|
bl_idname = 'arm.generate_terrain'
|
|
|
|
bl_label = 'Generate'
|
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
scn = context.scene
|
|
|
|
if scn == None:
|
|
|
|
return{'CANCELLED'}
|
|
|
|
sectors = scn.arm_terrain_sectors
|
2019-01-20 18:32:52 +01:00
|
|
|
size = scn.arm_terrain_sector_size
|
|
|
|
height_scale = scn.arm_terrain_height_scale
|
|
|
|
|
|
|
|
# Create material
|
2019-01-17 21:34:38 +01:00
|
|
|
mat = bpy.data.materials.new(name="Terrain")
|
2019-01-20 18:32:52 +01:00
|
|
|
mat.use_nodes = True
|
|
|
|
nodes = mat.node_tree.nodes
|
|
|
|
links = mat.node_tree.links
|
|
|
|
node = nodes.new('ShaderNodeDisplacement')
|
|
|
|
node.location = (-200, 100)
|
|
|
|
node.inputs[2].default_value = height_scale * 10
|
|
|
|
links.new(nodes['Material Output'].inputs[2], node.outputs[0])
|
|
|
|
node = nodes.new('ShaderNodeTexImage')
|
|
|
|
node.location = (-600, 100)
|
|
|
|
node.color_space = 'NONE'
|
|
|
|
node.interpolation = 'Closest'
|
|
|
|
node.arm_material_param = True
|
|
|
|
node.name = '_TerrainHeight'
|
|
|
|
node.label = '_TerrainHeight' # Height-map texture link for this sector
|
|
|
|
links.new(nodes['Displacement'].inputs[0], nodes['_TerrainHeight'].outputs[0])
|
|
|
|
|
|
|
|
# Create sectors
|
2019-01-17 21:34:38 +01:00
|
|
|
root_obj = bpy.data.objects.new("Terrain", None)
|
|
|
|
root_obj.location[0] = 0
|
|
|
|
root_obj.location[1] = 0
|
|
|
|
root_obj.location[2] = 0
|
|
|
|
root_obj.arm_export = False
|
|
|
|
scn.collection.objects.link(root_obj)
|
|
|
|
scn.arm_terrain_object = root_obj
|
|
|
|
|
|
|
|
for i in range(sectors[0] * sectors[1]):
|
|
|
|
j = str(i + 1).zfill(2)
|
|
|
|
x = i % sectors[0]
|
|
|
|
y = int(i / sectors[0])
|
|
|
|
bpy.ops.mesh.primitive_plane_add(location=(x * size, -y * size, 0))
|
|
|
|
slice_obj = bpy.context.active_object
|
|
|
|
slice_obj.scale[0] = size / 2
|
|
|
|
slice_obj.scale[1] = size / 2
|
|
|
|
slice_obj.scale[2] = height_scale
|
|
|
|
slice_obj.data.materials.append(mat)
|
|
|
|
for p in slice_obj.data.polygons:
|
|
|
|
p.use_smooth = True
|
|
|
|
slice_obj.name = 'Terrain.' + j
|
|
|
|
slice_obj.parent = root_obj
|
|
|
|
sub_mod = slice_obj.modifiers.new('Subdivision', 'SUBSURF')
|
|
|
|
sub_mod.subdivision_type = 'SIMPLE'
|
|
|
|
disp_mod = slice_obj.modifiers.new('Displace', 'DISPLACE')
|
|
|
|
disp_mod.texture_coords = 'UV'
|
|
|
|
disp_mod.texture = bpy.data.textures.new(name='Terrain.' + j, type='IMAGE')
|
|
|
|
disp_mod.texture.extension = 'EXTEND'
|
|
|
|
disp_mod.texture.use_interpolation = False
|
|
|
|
disp_mod.texture.use_mipmap = False
|
|
|
|
disp_mod.texture.image = bpy.data.images.load(filepath=scn.arm_terrain_textures+'/heightmap_' + j + '.png')
|
|
|
|
f = 1
|
|
|
|
levels = 0
|
|
|
|
while f < disp_mod.texture.image.size[0]:
|
|
|
|
f *= 2
|
|
|
|
levels += 1
|
|
|
|
sub_mod.levels = sub_mod.render_levels = levels
|
|
|
|
|
|
|
|
return{'FINISHED'}
|
|
|
|
|
|
|
|
class ArmTerrainPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Terrain"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "scene"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
scn = bpy.context.scene
|
|
|
|
if scn == None:
|
|
|
|
return
|
|
|
|
layout.prop(scn, 'arm_terrain_textures')
|
|
|
|
layout.prop(scn, 'arm_terrain_sectors')
|
|
|
|
layout.prop(scn, 'arm_terrain_sector_size')
|
|
|
|
layout.prop(scn, 'arm_terrain_height_scale')
|
|
|
|
layout.operator('arm.generate_terrain')
|
|
|
|
layout.prop(scn, 'arm_terrain_object')
|
|
|
|
|
2017-09-21 18:30:02 +02:00
|
|
|
class ArmTilesheetPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Tilesheet"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "object"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-09-21 18:30:02 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2017-09-21 18:30:02 +02:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
|
|
|
|
rows = 2
|
|
|
|
if len(wrd.arm_tilesheetlist) > 1:
|
|
|
|
rows = 4
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list("ArmTilesheetList", "The_List", wrd, "arm_tilesheetlist", wrd, "arm_tilesheetlist_index", rows=rows)
|
|
|
|
col = row.column(align=True)
|
2018-12-18 23:48:38 +01:00
|
|
|
col.operator("arm_tilesheetlist.new_item", icon='ADD', text="")
|
|
|
|
col.operator("arm_tilesheetlist.delete_item", icon='REMOVE', text="")
|
2017-09-21 18:30:02 +02:00
|
|
|
|
2018-11-22 13:31:15 +01:00
|
|
|
if len(wrd.arm_tilesheetlist) > 1:
|
|
|
|
col.separator()
|
|
|
|
op = col.operator("arm_tilesheetlist.move_item", icon='TRIA_UP', text="")
|
|
|
|
op.direction = 'UP'
|
|
|
|
op = col.operator("arm_tilesheetlist.move_item", icon='TRIA_DOWN', text="")
|
|
|
|
op.direction = 'DOWN'
|
|
|
|
|
2017-09-21 18:30:02 +02:00
|
|
|
if wrd.arm_tilesheetlist_index >= 0 and len(wrd.arm_tilesheetlist) > 0:
|
|
|
|
dat = wrd.arm_tilesheetlist[wrd.arm_tilesheetlist_index]
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(dat, "tilesx_prop")
|
|
|
|
layout.prop(dat, "tilesy_prop")
|
2017-09-21 18:30:02 +02:00
|
|
|
layout.prop(dat, "framerate_prop")
|
|
|
|
|
2018-09-05 10:20:02 +02:00
|
|
|
layout.label(text='Actions')
|
2017-09-21 18:30:02 +02:00
|
|
|
rows = 2
|
|
|
|
if len(dat.arm_tilesheetactionlist) > 1:
|
|
|
|
rows = 4
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list("ArmTilesheetList", "The_List", dat, "arm_tilesheetactionlist", dat, "arm_tilesheetactionlist_index", rows=rows)
|
|
|
|
col = row.column(align=True)
|
2018-12-18 23:48:38 +01:00
|
|
|
col.operator("arm_tilesheetactionlist.new_item", icon='ADD', text="")
|
|
|
|
col.operator("arm_tilesheetactionlist.delete_item", icon='REMOVE', text="")
|
2017-09-21 18:30:02 +02:00
|
|
|
|
2018-11-22 13:31:15 +01:00
|
|
|
if len(dat.arm_tilesheetactionlist) > 1:
|
|
|
|
col.separator()
|
|
|
|
op = col.operator("arm_tilesheetactionlist.move_item", icon='TRIA_UP', text="")
|
|
|
|
op.direction = 'UP'
|
|
|
|
op = col.operator("arm_tilesheetactionlist.move_item", icon='TRIA_DOWN', text="")
|
|
|
|
op.direction = 'DOWN'
|
|
|
|
|
2017-09-21 18:30:02 +02:00
|
|
|
if dat.arm_tilesheetactionlist_index >= 0 and len(dat.arm_tilesheetactionlist) > 0:
|
|
|
|
adat = dat.arm_tilesheetactionlist[dat.arm_tilesheetactionlist_index]
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(adat, "start_prop")
|
|
|
|
layout.prop(adat, "end_prop")
|
2017-09-21 18:30:02 +02:00
|
|
|
layout.prop(adat, "loop_prop")
|
|
|
|
|
2017-10-10 09:58:03 +02:00
|
|
|
class ArmProxyPanel(bpy.types.Panel):
|
|
|
|
bl_label = "Armory Proxy"
|
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "object"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-10-12 20:21:10 +02:00
|
|
|
|
2017-10-10 09:58:03 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2017-10-10 09:58:03 +02:00
|
|
|
layout.operator("arm.make_proxy")
|
2017-10-10 12:13:06 +02:00
|
|
|
obj = bpy.context.object
|
2017-10-16 21:10:33 +02:00
|
|
|
if obj != None and obj.proxy != None:
|
2018-09-05 10:20:02 +02:00
|
|
|
layout.label(text="Sync")
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.prop(obj, "arm_proxy_sync_loc")
|
|
|
|
layout.prop(obj, "arm_proxy_sync_rot")
|
|
|
|
layout.prop(obj, "arm_proxy_sync_scale")
|
|
|
|
layout.prop(obj, "arm_proxy_sync_materials")
|
|
|
|
layout.prop(obj, "arm_proxy_sync_modifiers")
|
|
|
|
layout.prop(obj, "arm_proxy_sync_traits")
|
|
|
|
layout.operator("arm.proxy_toggle_all")
|
|
|
|
layout.operator("arm.proxy_apply_all")
|
2017-10-10 09:58:03 +02:00
|
|
|
|
|
|
|
class ArmMakeProxyButton(bpy.types.Operator):
|
|
|
|
'''Create proxy from linked object'''
|
|
|
|
bl_idname = 'arm.make_proxy'
|
|
|
|
bl_label = 'Make Proxy'
|
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
obj = context.object
|
|
|
|
if obj == None:
|
|
|
|
return{'CANCELLED'}
|
2017-10-10 12:13:06 +02:00
|
|
|
if obj.library == None:
|
2018-03-22 21:43:22 +01:00
|
|
|
self.report({'ERROR'}, 'Select linked object')
|
2017-10-10 09:58:03 +02:00
|
|
|
arm.proxy.make(obj)
|
|
|
|
return{'FINISHED'}
|
|
|
|
|
2017-10-17 14:24:29 +02:00
|
|
|
class ArmProxyToggleAllButton(bpy.types.Operator):
|
|
|
|
bl_idname = 'arm.proxy_toggle_all'
|
|
|
|
bl_label = 'Toggle All'
|
2017-10-16 21:10:33 +02:00
|
|
|
def execute(self, context):
|
2017-10-17 13:39:50 +02:00
|
|
|
obj = context.object
|
|
|
|
b = not obj.arm_proxy_sync_loc
|
|
|
|
obj.arm_proxy_sync_loc = b
|
|
|
|
obj.arm_proxy_sync_rot = b
|
|
|
|
obj.arm_proxy_sync_scale = b
|
|
|
|
obj.arm_proxy_sync_materials = b
|
|
|
|
obj.arm_proxy_sync_modifiers = b
|
|
|
|
obj.arm_proxy_sync_traits = b
|
2017-10-16 21:10:33 +02:00
|
|
|
return{'FINISHED'}
|
|
|
|
|
2017-10-17 13:39:50 +02:00
|
|
|
class ArmProxyApplyAllButton(bpy.types.Operator):
|
|
|
|
bl_idname = 'arm.proxy_apply_all'
|
|
|
|
bl_label = 'Apply to All'
|
2017-10-16 21:10:33 +02:00
|
|
|
def execute(self, context):
|
2017-10-17 13:39:50 +02:00
|
|
|
for obj in bpy.data.objects:
|
|
|
|
if obj.proxy == None:
|
|
|
|
continue
|
|
|
|
if obj.proxy == context.object.proxy:
|
|
|
|
obj.arm_proxy_sync_loc = context.object.arm_proxy_sync_loc
|
|
|
|
obj.arm_proxy_sync_rot = context.object.arm_proxy_sync_rot
|
|
|
|
obj.arm_proxy_sync_scale = context.object.arm_proxy_sync_scale
|
|
|
|
obj.arm_proxy_sync_materials = context.object.arm_proxy_sync_materials
|
|
|
|
obj.arm_proxy_sync_modifiers = context.object.arm_proxy_sync_modifiers
|
|
|
|
obj.arm_proxy_sync_traits = context.object.arm_proxy_sync_traits
|
2017-10-16 21:10:33 +02:00
|
|
|
return{'FINISHED'}
|
|
|
|
|
2017-10-17 13:39:50 +02:00
|
|
|
class ArmSyncProxyButton(bpy.types.Operator):
|
|
|
|
bl_idname = 'arm.sync_proxy'
|
|
|
|
bl_label = 'Sync'
|
2017-10-16 21:10:33 +02:00
|
|
|
def execute(self, context):
|
2017-10-17 13:39:50 +02:00
|
|
|
if len(bpy.data.libraries) > 0:
|
2017-10-16 21:10:33 +02:00
|
|
|
for obj in bpy.data.objects:
|
2017-10-18 10:20:37 +02:00
|
|
|
if obj == None or obj.proxy == None:
|
|
|
|
continue
|
2017-10-17 13:39:50 +02:00
|
|
|
if obj.arm_proxy_sync_loc:
|
|
|
|
arm.proxy.sync_location(obj)
|
|
|
|
if obj.arm_proxy_sync_rot:
|
|
|
|
arm.proxy.sync_rotation(obj)
|
|
|
|
if obj.arm_proxy_sync_scale:
|
|
|
|
arm.proxy.sync_scale(obj)
|
|
|
|
if obj.arm_proxy_sync_materials:
|
|
|
|
arm.proxy.sync_materials(obj)
|
|
|
|
if obj.arm_proxy_sync_modifiers:
|
|
|
|
arm.proxy.sync_modifiers(obj)
|
|
|
|
if obj.arm_proxy_sync_traits:
|
|
|
|
arm.proxy.sync_traits(obj)
|
|
|
|
print('Armory: Proxy objects synchronized')
|
2017-10-16 21:10:33 +02:00
|
|
|
return{'FINISHED'}
|
|
|
|
|
2017-12-03 12:30:14 +01:00
|
|
|
class ArmPrintTraitsButton(bpy.types.Operator):
|
|
|
|
bl_idname = 'arm.print_traits'
|
|
|
|
bl_label = 'Print Traits'
|
|
|
|
def execute(self, context):
|
2017-12-03 13:04:24 +01:00
|
|
|
for s in bpy.data.scenes:
|
2017-12-03 13:28:30 +01:00
|
|
|
print(s.name + ' traits:')
|
2017-12-03 13:04:24 +01:00
|
|
|
for o in s.objects:
|
|
|
|
for t in o.arm_traitlist:
|
2017-12-04 09:40:58 +01:00
|
|
|
if not t.enabled_prop:
|
|
|
|
continue
|
2018-12-21 23:16:20 +01:00
|
|
|
tname = t.node_tree_prop.name if t.type_prop == 'Logic Nodes' else t.class_name_prop
|
2017-12-03 13:04:24 +01:00
|
|
|
print('Object {0} - {1}'.format(o.name, tname))
|
2017-12-03 12:30:14 +01:00
|
|
|
return{'FINISHED'}
|
|
|
|
|
2018-06-12 00:26:52 +02:00
|
|
|
class ArmMaterialNodePanel(bpy.types.Panel):
|
|
|
|
bl_label = 'Armory Material Node'
|
|
|
|
bl_idname = 'ArmMaterialNodePanel'
|
|
|
|
bl_space_type = 'NODE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
2018-12-19 15:47:58 +01:00
|
|
|
bl_category = 'Node'
|
2018-06-12 00:26:52 +02:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-12-19 13:33:17 +01:00
|
|
|
layout.use_property_split = True
|
2018-12-19 20:10:34 +01:00
|
|
|
layout.use_property_decorate = False
|
2018-06-12 00:26:52 +02:00
|
|
|
n = context.active_node
|
|
|
|
if n != None and (n.bl_idname == 'ShaderNodeRGB' or n.bl_idname == 'ShaderNodeValue' or n.bl_idname == 'ShaderNodeTexImage'):
|
|
|
|
layout.prop(context.active_node, 'arm_material_param')
|
|
|
|
|
2016-10-19 13:28:06 +02:00
|
|
|
def register():
|
2017-03-15 12:30:14 +01:00
|
|
|
bpy.utils.register_class(ObjectPropsPanel)
|
|
|
|
bpy.utils.register_class(ModifiersPropsPanel)
|
2017-09-29 01:18:57 +02:00
|
|
|
bpy.utils.register_class(ParticlesPropsPanel)
|
2017-03-15 12:30:14 +01:00
|
|
|
bpy.utils.register_class(PhysicsPropsPanel)
|
|
|
|
bpy.utils.register_class(DataPropsPanel)
|
|
|
|
bpy.utils.register_class(ScenePropsPanel)
|
|
|
|
bpy.utils.register_class(InvalidateCacheButton)
|
|
|
|
bpy.utils.register_class(InvalidateMaterialCacheButton)
|
|
|
|
bpy.utils.register_class(MaterialPropsPanel)
|
|
|
|
bpy.utils.register_class(ArmoryPlayerPanel)
|
2017-08-19 03:08:42 +02:00
|
|
|
bpy.utils.register_class(ArmoryExporterPanel)
|
2017-03-15 12:30:14 +01:00
|
|
|
bpy.utils.register_class(ArmoryProjectPanel)
|
2018-12-24 16:26:43 +01:00
|
|
|
bpy.utils.register_class(ArmProjectFlagsPanel)
|
|
|
|
bpy.utils.register_class(ArmProjectWindowPanel)
|
|
|
|
bpy.utils.register_class(ArmProjectModulesPanel)
|
2017-08-19 12:10:06 +02:00
|
|
|
bpy.utils.register_class(ArmRenderPathPanel)
|
2018-12-19 13:33:17 +01:00
|
|
|
bpy.utils.register_class(ArmRenderPathRendererPanel)
|
|
|
|
bpy.utils.register_class(ArmRenderPathShadowsPanel)
|
|
|
|
bpy.utils.register_class(ArmRenderPathVoxelsPanel)
|
|
|
|
bpy.utils.register_class(ArmRenderPathWorldPanel)
|
|
|
|
bpy.utils.register_class(ArmRenderPathPostProcessPanel)
|
|
|
|
bpy.utils.register_class(ArmRenderPathCompositorPanel)
|
2018-03-05 00:24:04 +01:00
|
|
|
bpy.utils.register_class(ArmBakePanel)
|
2017-08-19 03:08:42 +02:00
|
|
|
# bpy.utils.register_class(ArmVirtualInputPanel)
|
2017-03-15 12:30:14 +01:00
|
|
|
bpy.utils.register_class(ArmoryPlayButton)
|
|
|
|
bpy.utils.register_class(ArmoryStopButton)
|
|
|
|
bpy.utils.register_class(ArmoryBuildProjectButton)
|
|
|
|
bpy.utils.register_class(ArmoryOpenProjectFolderButton)
|
|
|
|
bpy.utils.register_class(ArmoryKodeStudioButton)
|
|
|
|
bpy.utils.register_class(CleanMenu)
|
|
|
|
bpy.utils.register_class(CleanButtonMenu)
|
|
|
|
bpy.utils.register_class(ArmoryCleanProjectButton)
|
2017-09-04 12:14:14 +02:00
|
|
|
bpy.utils.register_class(ArmoryPublishProjectButton)
|
2017-08-19 03:08:42 +02:00
|
|
|
bpy.utils.register_class(ArmoryGenerateNavmeshButton)
|
2019-01-22 09:48:22 +01:00
|
|
|
bpy.utils.register_class(ArmoryRemoveNavmeshButton)
|
2017-08-19 03:08:42 +02:00
|
|
|
bpy.utils.register_class(ArmNavigationPanel)
|
2017-08-19 12:10:06 +02:00
|
|
|
bpy.utils.register_class(ArmGenLodButton)
|
|
|
|
bpy.utils.register_class(ArmLodPanel)
|
2019-01-17 21:34:38 +01:00
|
|
|
bpy.utils.register_class(ArmGenTerrainButton)
|
|
|
|
bpy.utils.register_class(ArmTerrainPanel)
|
2017-09-21 18:30:02 +02:00
|
|
|
bpy.utils.register_class(ArmTilesheetPanel)
|
2017-10-10 09:58:03 +02:00
|
|
|
bpy.utils.register_class(ArmProxyPanel)
|
|
|
|
bpy.utils.register_class(ArmMakeProxyButton)
|
2017-10-17 14:24:29 +02:00
|
|
|
bpy.utils.register_class(ArmProxyToggleAllButton)
|
2017-10-17 13:39:50 +02:00
|
|
|
bpy.utils.register_class(ArmProxyApplyAllButton)
|
|
|
|
bpy.utils.register_class(ArmSyncProxyButton)
|
2017-12-03 12:30:14 +01:00
|
|
|
bpy.utils.register_class(ArmPrintTraitsButton)
|
2018-06-12 00:26:52 +02:00
|
|
|
bpy.utils.register_class(ArmMaterialNodePanel)
|
2016-10-19 13:28:06 +02:00
|
|
|
bpy.types.VIEW3D_HT_header.append(draw_view3d_header)
|
|
|
|
|
|
|
|
def unregister():
|
|
|
|
bpy.types.VIEW3D_HT_header.remove(draw_view3d_header)
|
2017-03-15 12:30:14 +01:00
|
|
|
bpy.utils.unregister_class(ObjectPropsPanel)
|
|
|
|
bpy.utils.unregister_class(ModifiersPropsPanel)
|
2017-09-29 01:18:57 +02:00
|
|
|
bpy.utils.unregister_class(ParticlesPropsPanel)
|
2017-03-15 12:30:14 +01:00
|
|
|
bpy.utils.unregister_class(PhysicsPropsPanel)
|
|
|
|
bpy.utils.unregister_class(DataPropsPanel)
|
|
|
|
bpy.utils.unregister_class(ScenePropsPanel)
|
|
|
|
bpy.utils.unregister_class(InvalidateCacheButton)
|
|
|
|
bpy.utils.unregister_class(InvalidateMaterialCacheButton)
|
|
|
|
bpy.utils.unregister_class(MaterialPropsPanel)
|
|
|
|
bpy.utils.unregister_class(ArmoryPlayerPanel)
|
2017-08-19 03:08:42 +02:00
|
|
|
bpy.utils.unregister_class(ArmoryExporterPanel)
|
2017-03-15 12:30:14 +01:00
|
|
|
bpy.utils.unregister_class(ArmoryProjectPanel)
|
2018-12-24 16:26:43 +01:00
|
|
|
bpy.utils.unregister_class(ArmProjectFlagsPanel)
|
|
|
|
bpy.utils.unregister_class(ArmProjectWindowPanel)
|
|
|
|
bpy.utils.unregister_class(ArmProjectModulesPanel)
|
2017-08-19 12:10:06 +02:00
|
|
|
bpy.utils.unregister_class(ArmRenderPathPanel)
|
2018-12-19 13:33:17 +01:00
|
|
|
bpy.utils.unregister_class(ArmRenderPathRendererPanel)
|
|
|
|
bpy.utils.unregister_class(ArmRenderPathShadowsPanel)
|
|
|
|
bpy.utils.unregister_class(ArmRenderPathVoxelsPanel)
|
|
|
|
bpy.utils.unregister_class(ArmRenderPathWorldPanel)
|
|
|
|
bpy.utils.unregister_class(ArmRenderPathPostProcessPanel)
|
|
|
|
bpy.utils.unregister_class(ArmRenderPathCompositorPanel)
|
2018-03-05 00:24:04 +01:00
|
|
|
bpy.utils.unregister_class(ArmBakePanel)
|
2017-08-19 03:08:42 +02:00
|
|
|
# bpy.utils.unregister_class(ArmVirtualInputPanel)
|
2017-03-15 12:30:14 +01:00
|
|
|
bpy.utils.unregister_class(ArmoryPlayButton)
|
|
|
|
bpy.utils.unregister_class(ArmoryStopButton)
|
|
|
|
bpy.utils.unregister_class(ArmoryBuildProjectButton)
|
|
|
|
bpy.utils.unregister_class(ArmoryOpenProjectFolderButton)
|
|
|
|
bpy.utils.unregister_class(ArmoryKodeStudioButton)
|
|
|
|
bpy.utils.unregister_class(CleanMenu)
|
|
|
|
bpy.utils.unregister_class(CleanButtonMenu)
|
|
|
|
bpy.utils.unregister_class(ArmoryCleanProjectButton)
|
2017-09-04 12:14:14 +02:00
|
|
|
bpy.utils.unregister_class(ArmoryPublishProjectButton)
|
2017-08-19 03:08:42 +02:00
|
|
|
bpy.utils.unregister_class(ArmoryGenerateNavmeshButton)
|
2019-01-22 09:48:22 +01:00
|
|
|
bpy.utils.unregister_class(ArmoryRemoveNavmeshButton)
|
2017-08-19 03:08:42 +02:00
|
|
|
bpy.utils.unregister_class(ArmNavigationPanel)
|
2017-08-19 12:10:06 +02:00
|
|
|
bpy.utils.unregister_class(ArmGenLodButton)
|
|
|
|
bpy.utils.unregister_class(ArmLodPanel)
|
2019-01-17 21:34:38 +01:00
|
|
|
bpy.utils.unregister_class(ArmGenTerrainButton)
|
|
|
|
bpy.utils.unregister_class(ArmTerrainPanel)
|
2017-09-21 18:30:02 +02:00
|
|
|
bpy.utils.unregister_class(ArmTilesheetPanel)
|
2017-10-10 09:58:03 +02:00
|
|
|
bpy.utils.unregister_class(ArmProxyPanel)
|
|
|
|
bpy.utils.unregister_class(ArmMakeProxyButton)
|
2017-10-17 14:24:29 +02:00
|
|
|
bpy.utils.unregister_class(ArmProxyToggleAllButton)
|
2017-10-17 13:39:50 +02:00
|
|
|
bpy.utils.unregister_class(ArmProxyApplyAllButton)
|
|
|
|
bpy.utils.unregister_class(ArmSyncProxyButton)
|
2017-12-03 12:30:14 +01:00
|
|
|
bpy.utils.unregister_class(ArmPrintTraitsButton)
|
2018-06-12 00:26:52 +02:00
|
|
|
bpy.utils.unregister_class(ArmMaterialNodePanel)
|