Begin rendering driver interface

This commit is contained in:
unknown 2018-01-03 15:09:55 +01:00
parent b7fa285452
commit 90a6be24fe
6 changed files with 40 additions and 1 deletions

View File

View File

@ -4,6 +4,8 @@ import arm.utils
import arm.log as log
import arm.make_state as state
make_hook = None
def add_world_defs():
wrd = bpy.data.worlds['Arm']
rpdat = arm.utils.get_rp()
@ -110,6 +112,10 @@ def add_world_defs():
break
def build():
if make_hook != None:
make_hook()
return
assets_path = arm.utils.get_sdk_path() + 'armory/Assets/'
wrd = bpy.data.worlds['Arm']
rpdat = arm.utils.get_rp()

View File

@ -15,6 +15,7 @@ import arm.material.make_decal as make_decal
import arm.material.make_voxel as make_voxel
rpass_hook = None
make_rpass = None
def build(material, mat_users, mat_armusers):
mat_state.mat_users = mat_users
@ -60,7 +61,15 @@ def build(material, mat_users, mat_armusers):
bind_textures[rp] = tar
mat_state.bind_textures = tar
if rp == 'mesh':
con = None
if make_rpass != None:
con = make_rpass(rp)
if con != None:
pass
elif rp == 'mesh':
con = make_mesh.make(rp)
elif rp == 'rect':

View File

@ -6,6 +6,15 @@ import bpy
from bpy.types import Menu, Panel, UIList
from bpy.props import *
drivers = ['Armory']
driver_props = dict()
def add_driver(d, draw_props):
global drivers
if d not in drivers:
drivers.append(d)
driver_props[d] = draw_props
def update_preset(self, context):
rpdat = arm.utils.get_rp()
if self.rp_preset == 'Low':
@ -301,6 +310,8 @@ class ArmRPListItem(bpy.types.PropertyGroup):
description="A name for this item",
default="Path")
rp_driver_list = bpy.props.CollectionProperty(type=bpy.types.PropertyGroup)
rp_driver = bpy.props.StringProperty(name="Driver", default="Armory")
rp_renderer = EnumProperty(
items=[('Forward', 'Forward', 'Forward'),
('Deferred', 'Deferred', 'Deferred'),

View File

@ -8,6 +8,7 @@ import arm.make_state as state
import arm.assets as assets
import arm.log as log
import arm.proxy
import arm.props_renderpath
# Menu in object region
class ObjectPropsPanel(bpy.types.Panel):
@ -950,6 +951,16 @@ class ArmRenderPathPanel(bpy.types.Panel):
if wrd.arm_rplist_index >= 0 and len(wrd.arm_rplist) > 0:
rpdat = wrd.arm_rplist[wrd.arm_rplist_index]
drivers = arm.props_renderpath.drivers
if len(drivers) > 1:
if len(rpdat.rp_driver_list) == 0:
for s in drivers:
rpdat.rp_driver_list.add().name = s
layout.prop_search(rpdat, "rp_driver", rpdat, "rp_driver_list", "Driver")
layout.separator()
if rpdat.rp_driver != 'Armory':
arm.props_renderpath.driver_props[rpdat.rp_driver](layout)
return
layout.prop(wrd, "rp_preset")
layout.separator()
layout.prop(rpdat, "rp_renderer")

View File

@ -319,6 +319,8 @@ class Main {
pathpack = 'armory'
if os.path.isfile(arm.utils.get_fp() + '/Sources/' + wrd.arm_project_package + '/renderpath/RenderPathCreator.hx'):
pathpack = wrd.arm_project_package
elif rpdat.rp_driver != 'Armory':
pathpack = rpdat.rp_driver.lower()
f.write("""
iron.RenderPath.setActive(""" + pathpack + """.renderpath.RenderPathCreator.get());