Render path background prop
This commit is contained in:
parent
363478fc1a
commit
dd83705aa9
|
@ -67,7 +67,7 @@ class DebugConsole extends Trait {
|
|||
ui.begin(g);
|
||||
var hwin = Id.handle();
|
||||
if (ui.window(hwin, 0, 0, 250, iron.App.h(), true)) {
|
||||
ui.text('Console ' + lastTrace);
|
||||
ui.text('Console: ' + lastTrace);
|
||||
var avg = Math.round(frameTimeAvg * 10000) / 10;
|
||||
var fpsAvg = avg > 0 ? Math.round(1000 / avg) : 0;
|
||||
if (ui.panel(Id.handle(), 'Profile ($avg ms / $fpsAvg fps)')) {
|
||||
|
|
|
@ -35,8 +35,7 @@ def set_preset(self, context, preset):
|
|||
rpdat.rp_decals_state = 'Off'
|
||||
rpdat.rp_sss_state = 'Off'
|
||||
rpdat.rp_hdr = False
|
||||
rpdat.rp_world = False
|
||||
rpdat.rp_clearbackground = True
|
||||
rpdat.rp_background = 'World'
|
||||
rpdat.rp_stereo = False
|
||||
rpdat.rp_greasepencil = False
|
||||
rpdat.rp_voxelgi = False
|
||||
|
@ -63,8 +62,7 @@ def set_preset(self, context, preset):
|
|||
rpdat.rp_decals_state = 'Auto'
|
||||
rpdat.rp_sss_state = 'Auto'
|
||||
rpdat.rp_hdr = True
|
||||
rpdat.rp_world = True
|
||||
rpdat.rp_clearbackground = False
|
||||
rpdat.rp_background = 'World'
|
||||
rpdat.rp_stereo = False
|
||||
rpdat.rp_greasepencil = False
|
||||
rpdat.rp_voxelgi = False
|
||||
|
@ -91,8 +89,7 @@ def set_preset(self, context, preset):
|
|||
rpdat.rp_decals_state = 'Auto'
|
||||
rpdat.rp_sss_state = 'Auto'
|
||||
rpdat.rp_hdr = True
|
||||
rpdat.rp_world = True
|
||||
rpdat.rp_clearbackground = False
|
||||
rpdat.rp_background = 'World'
|
||||
rpdat.rp_stereo = False
|
||||
rpdat.rp_greasepencil = False
|
||||
rpdat.rp_voxelgi = False
|
||||
|
@ -119,8 +116,7 @@ def set_preset(self, context, preset):
|
|||
rpdat.rp_decals_state = 'Auto'
|
||||
rpdat.rp_sss_state = 'Auto'
|
||||
rpdat.rp_hdr = True
|
||||
rpdat.rp_world = True
|
||||
rpdat.rp_clearbackground = False
|
||||
rpdat.rp_background = 'World'
|
||||
rpdat.rp_stereo = False
|
||||
rpdat.rp_greasepencil = False
|
||||
rpdat.rp_voxelgi = False
|
||||
|
@ -146,8 +142,7 @@ def set_preset(self, context, preset):
|
|||
rpdat.rp_decals_state = 'Auto'
|
||||
rpdat.rp_sss_state = 'Auto'
|
||||
rpdat.rp_hdr = True
|
||||
rpdat.rp_world = True
|
||||
rpdat.rp_clearbackground = False
|
||||
rpdat.rp_background = 'World'
|
||||
rpdat.rp_stereo = False
|
||||
rpdat.rp_greasepencil = False
|
||||
rpdat.rp_voxelgi = True
|
||||
|
@ -178,8 +173,7 @@ def set_preset(self, context, preset):
|
|||
rpdat.rp_decals_state = 'Auto'
|
||||
rpdat.rp_sss_state = 'Auto'
|
||||
rpdat.rp_hdr = True
|
||||
rpdat.rp_world = True
|
||||
rpdat.rp_clearbackground = False
|
||||
rpdat.rp_background = 'World'
|
||||
rpdat.rp_stereo = False
|
||||
rpdat.rp_greasepencil = False
|
||||
rpdat.rp_voxelgi = False
|
||||
|
@ -206,8 +200,7 @@ def set_preset(self, context, preset):
|
|||
rpdat.rp_decals_state = 'Off'
|
||||
rpdat.rp_sss_state = 'Off'
|
||||
rpdat.rp_hdr = False
|
||||
rpdat.rp_world = False
|
||||
rpdat.rp_clearbackground = True
|
||||
rpdat.rp_background = 'World'
|
||||
rpdat.rp_stereo = True
|
||||
rpdat.rp_greasepencil = False
|
||||
rpdat.rp_voxelgi = False
|
||||
|
@ -234,8 +227,7 @@ def set_preset(self, context, preset):
|
|||
rpdat.rp_decals_state = 'Off'
|
||||
rpdat.rp_sss_state = 'Off'
|
||||
rpdat.rp_hdr = False
|
||||
rpdat.rp_world = False
|
||||
rpdat.rp_clearbackground = True
|
||||
rpdat.rp_background = 'World'
|
||||
rpdat.rp_stereo = False
|
||||
rpdat.rp_greasepencil = False
|
||||
rpdat.rp_voxelgi = False
|
||||
|
@ -262,8 +254,7 @@ def set_preset(self, context, preset):
|
|||
rpdat.rp_decals_state = 'Off'
|
||||
rpdat.rp_sss_state = 'Off'
|
||||
rpdat.rp_hdr = False
|
||||
rpdat.rp_world = False
|
||||
rpdat.rp_clearbackground = True
|
||||
rpdat.rp_background = 'World'
|
||||
rpdat.rp_stereo = False
|
||||
rpdat.rp_greasepencil = True
|
||||
rpdat.rp_render_to_texture = False
|
||||
|
@ -355,14 +346,14 @@ def make_forward(rpdat):
|
|||
links.new(nodes['Clear Target Mesh'].outputs[0], nodes['Draw Grease Pencil'].inputs[0])
|
||||
links.new(nodes['Draw Grease Pencil'].outputs[0], nodes['Draw Meshes Mesh'].inputs[0])
|
||||
|
||||
if not rpdat.rp_world:
|
||||
if rpdat.rp_background != 'World':
|
||||
relink('Draw World', 'Set Target Accum')
|
||||
if rpdat.rp_clearbackground:
|
||||
if rpdat.rp_background == 'Clear':
|
||||
nodes['Clear Target Mesh'].inputs[1].default_value = True
|
||||
|
||||
if not rpdat.rp_render_to_texture:
|
||||
links.new(nodes['Framebuffer'].outputs[0], nodes['Set Target Mesh'].inputs[1])
|
||||
if rpdat.rp_world:
|
||||
if rpdat.rp_background == 'World':
|
||||
l = nodes['Draw World'].outputs[0].links[0]
|
||||
elif rpdat.rp_greasepencil:
|
||||
l = nodes['Draw Grease Pencil'].outputs[0].links[0]
|
||||
|
@ -447,9 +438,9 @@ def make_deferred(rpdat):
|
|||
l = nodes['Deferred Indirect'].inputs[3].links[0]
|
||||
links.remove(l)
|
||||
|
||||
if not rpdat.rp_world:
|
||||
if rpdat.rp_background != 'World':
|
||||
relink('Draw World', 'Water')
|
||||
if rpdat.rp_clearbackground:
|
||||
if rpdat.rp_background == 'Clear':
|
||||
nodes['Clear Target Mesh'].inputs[1].default_value = True
|
||||
|
||||
if not rpdat.rp_ocean:
|
||||
|
|
|
@ -299,6 +299,9 @@ def init_properties():
|
|||
bpy.types.Material.is_cached = bpy.props.BoolProperty(name="Material Cached", description="No need to reexport material data", default=False, update=update_mat_cache)
|
||||
bpy.types.Material.lock_cache = bpy.props.BoolProperty(name="Lock Material Cache", description="Prevent is_cached from updating", default=False)
|
||||
|
||||
# Deprecated
|
||||
bpy.types.World.arm_play_viewport_camera = BoolProperty(name="Viewport Camera", description="Start player at viewport camera position", default=False)
|
||||
|
||||
if not 'Arm' in bpy.data.worlds:
|
||||
wrd = bpy.data.worlds.new('Arm')
|
||||
wrd.use_fake_user = True # Store data world object, add fake user to keep it alive
|
||||
|
@ -339,8 +342,7 @@ def init_properties_on_load():
|
|||
print('Project updated to sdk v' + arm_version)
|
||||
wrd.arm_version = arm_version
|
||||
arm.make.clean_project()
|
||||
make_renderer.make_renderer(bpy.data.worlds['Arm'])
|
||||
# Deprecated: migrate traits
|
||||
# Deprecated: migrate props
|
||||
for bobject in bpy.data.objects:
|
||||
if not hasattr(bobject, 'my_traitlist'):
|
||||
continue
|
||||
|
@ -353,6 +355,9 @@ def init_properties_on_load():
|
|||
t.canvas_name_prop = trait.canvas_name_prop
|
||||
t.jsscript_prop = trait.jsscript_prop
|
||||
t.nodes_name_prop = trait.nodes_name_prop
|
||||
if hasattr(wrd, 'arm_play_viewport_camera'):
|
||||
if wrd.arm_play_viewport_camera:
|
||||
wrd.arm_play_camera = 'Viewport'
|
||||
# Set url for embedded player
|
||||
if arm.utils.with_krom():
|
||||
barmory.set_files_location(arm.utils.get_fp_build() + '/krom')
|
||||
|
|
|
@ -115,8 +115,9 @@ class ArmExporterList(bpy.types.UIList):
|
|||
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
||||
row = layout.row()
|
||||
row.prop(item, "name", text="", emboss=False, icon=custom_icon)
|
||||
row.alignment = 'RIGHT'
|
||||
row.label(item.arm_project_target)
|
||||
col = row.column()
|
||||
col.alignment = 'RIGHT'
|
||||
col.label(item.arm_project_target)
|
||||
|
||||
elif self.layout_type in {'GRID'}:
|
||||
layout.alignment = 'CENTER'
|
||||
|
|
|
@ -45,8 +45,9 @@ class ArmLodList(bpy.types.UIList):
|
|||
name = 'None'
|
||||
row = layout.row()
|
||||
row.label(name, icon=custom_icon)
|
||||
row.alignment = 'RIGHT'
|
||||
row.label("{:.2f}".format(item.screen_size_prop))
|
||||
col = row.column()
|
||||
col.alignment = 'RIGHT'
|
||||
col.label("{:.2f}".format(item.screen_size_prop))
|
||||
|
||||
elif self.layout_type in {'GRID'}:
|
||||
layout.alignment = 'CENTER'
|
||||
|
|
|
@ -65,8 +65,12 @@ class ArmRPListItem(bpy.types.PropertyGroup):
|
|||
rp_depthprepass = bpy.props.BoolProperty(name="Depth Prepass", description="Depth Prepass for mesh context", default=False, update=update_renderpath)
|
||||
rp_hdr = bpy.props.BoolProperty(name="HDR", description="Render in HDR Space", default=True, update=update_renderpath)
|
||||
rp_render_to_texture = bpy.props.BoolProperty(name="Post Process", description="Render scene to texture for further processing", default=True, update=update_renderpath)
|
||||
rp_world = bpy.props.BoolProperty(name="World", description="Draw world nodes", default=True, update=update_renderpath)
|
||||
rp_clearbackground = bpy.props.BoolProperty(name="Clear", description="Clear background with solid color", default=False, update=update_renderpath)
|
||||
rp_background = EnumProperty(
|
||||
items=[('World', 'World', 'World'),
|
||||
('Clear', 'Clear', 'Clear'),
|
||||
('None', 'None', 'None'),
|
||||
],
|
||||
name="Background", description="Background type", default='World', update=update_renderpath)
|
||||
rp_compositornodes = bpy.props.BoolProperty(name="Compositor", description="Draw compositor nodes", default=True, update=update_renderpath)
|
||||
rp_shadowmap = EnumProperty(
|
||||
items=[('None', 'None', 'None'),
|
||||
|
|
|
@ -857,11 +857,8 @@ class ArmRenderPathPanel(bpy.types.Panel):
|
|||
layout.prop(rpdat, "rp_overlays_state")
|
||||
layout.prop(rpdat, "rp_decals_state")
|
||||
layout.prop(rpdat, "rp_sss_state")
|
||||
layout.prop(rpdat, "rp_background")
|
||||
layout.prop(rpdat, "rp_hdr")
|
||||
layout.prop(rpdat, "rp_world")
|
||||
col = layout.column()
|
||||
col.enabled = not rpdat.rp_world
|
||||
col.prop(rpdat, "rp_clearbackground")
|
||||
layout.prop(rpdat, "rp_stereo")
|
||||
layout.prop(rpdat, "rp_greasepencil")
|
||||
layout.prop(rpdat, 'rp_voxelgi')
|
||||
|
|
Loading…
Reference in a new issue