diff options
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 24 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 37 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 14 |
3 files changed, 62 insertions, 13 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index b53f85c3266..fed1524a816 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -129,6 +129,16 @@ enum_device_type = ( ('OPENCL', "OpenCL", "OpenCL", 2) ) +enum_texture_limit = ( + ('OFF', "No Limit", "No texture size limit", 0), + ('128', "128", "Limit texture size to 128 pixels", 1), + ('256', "256", "Limit texture size to 256 pixels", 2), + ('512', "512", "Limit texture size to 512 pixels", 3), + ('1024', "1024", "Limit texture size to 1024 pixels", 4), + ('2048', "2048", "Limit texture size to 2048 pixels", 5), + ('4096', "4096", "Limit texture size to 4096 pixels", 6), + ('8192', "8192", "Limit texture size to 8192 pixels", 7), + ) class CyclesRenderSettings(bpy.types.PropertyGroup): @classmethod @@ -608,6 +618,20 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): min=0.0, max=1.0, ) + cls.texture_limit = EnumProperty( + name="Viewport Texture Limit", + default='OFF', + description="Limit texture size used by viewport rendering", + items=enum_texture_limit + ) + + cls.texture_limit_render = EnumProperty( + name="Render Texture Limit", + default='OFF', + description="Limit texture size used by final rendering", + items=enum_texture_limit + ) + # Various fine-tuning debug flags def devices_update_callback(self, context): diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 1856b278c89..3f7730efbb0 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1587,29 +1587,40 @@ class CyclesScene_PT_simplify(CyclesButtonsPanel, Panel): cscene = scene.cycles layout.active = rd.use_simplify - split = layout.split() - col = split.column() - col.label(text="Viewport:") - col.prop(rd, "simplify_subdivision", text="Subdivision") - col.prop(rd, "simplify_child_particles", text="Child Particles") + col = layout.column(align=True) + col.label(text="Subdivision") + row = col.row(align=True) + row.prop(rd, "simplify_subdivision", text="Viewport") + row.prop(rd, "simplify_subdivision_render", text="Render") - col = split.column() - col.label(text="Render:") - col.prop(rd, "simplify_subdivision_render", text="Subdivision") - col.prop(rd, "simplify_child_particles_render", text="Child Particles") + col = layout.column(align=True) + col.label(text="Child Particles") + row = col.row(align=True) + row.prop(rd, "simplify_child_particles", text="Viewport") + row.prop(rd, "simplify_child_particles_render", text="Render") - layout.separator() + col = layout.column(align=True) + split = col.split() + sub = split.column() + sub.label(text="Texture Limit Viewport") + sub.prop(cscene, "texture_limit", text="") + sub = split.column() + sub.label(text="Texture Limit Render") + sub.prop(cscene, "texture_limit_render", text="") split = layout.split() - col = split.column() col.prop(cscene, "use_camera_cull") - col.prop(cscene, "camera_cull_margin", text="Margin") + row = col.row() + row.active = cscene.use_camera_cull + row.prop(cscene, "camera_cull_margin") col = split.column() col.prop(cscene, "use_distance_cull") - col.prop(cscene, "distance_cull_margin", text="Distance") + row = col.row() + row.active = cscene.use_distance_cull + row.prop(cscene, "distance_cull_margin", text="Distance") def draw_device(self, context): scene = context.scene diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 6118cc72239..38b2ce19e8a 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -504,6 +504,20 @@ SceneParams BlenderSync::get_scene_params(BL::Scene& b_scene, else params.persistent_data = false; + int texture_limit; + if(background) { + texture_limit = RNA_enum_get(&cscene, "texture_limit_render"); + } + else { + texture_limit = RNA_enum_get(&cscene, "texture_limit"); + } + if(texture_limit > 0 && b_scene.render().use_simplify()) { + params.texture_limit = 1 << (texture_limit + 6); + } + else { + params.texture_limit = 0; + } + #if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) if(is_cpu) { params.use_qbvh = DebugFlags().cpu.qbvh && system_cpu_support_sse2(); |