Fix #6 add simplify conflict checker

This commit is contained in:
pullusb 2025-07-22 16:30:13 +02:00
parent 4626f5c15d
commit d08557a7b7
3 changed files with 82 additions and 17 deletions

View File

@ -3,6 +3,7 @@ from . import (
outputs_setup, outputs_setup,
outputs_search_and_replace, outputs_search_and_replace,
visibility_conflicts, visibility_conflicts,
simplify_conflicts,
) )
mods = ( mods = (
@ -10,6 +11,7 @@ mods = (
outputs_setup, outputs_setup,
outputs_search_and_replace, outputs_search_and_replace,
visibility_conflicts, visibility_conflicts,
simplify_conflicts,
) )
def register(): def register():

View File

@ -118,6 +118,13 @@ class RT_OT_list_object_affected_by_simplify(Operator):
layout.use_property_decorate = False layout.use_property_decorate = False
layout.use_property_split = True layout.use_property_split = True
render = context.scene.render render = context.scene.render
# Get current simplify settings
simplify_viewport = render.simplify_subdivision
simplify_render = render.simplify_subdivision_render
max_child_particles = min(render.simplify_child_particles, render.simplify_child_particles_render)
volume_limit_resolution = render.simplify_volumes
## Show simplify settings ## Show simplify settings
# layout.label(text="Simplify Settings:") # layout.label(text="Simplify Settings:")
@ -146,8 +153,15 @@ class RT_OT_list_object_affected_by_simplify(Operator):
if data['type'] == 'SUBSURF': if data['type'] == 'SUBSURF':
mod = data['modifier'] mod = data['modifier']
# Check if currently affected by simplify
viewport_limited = mod.levels > simplify_viewport
render_limited = mod.render_levels > simplify_render
is_currently_affected = viewport_limited or render_limited
# Modifier name row # Modifier name row
row = col.row() row = col.row()
row.active = is_currently_affected
if i == 0: if i == 0:
# Show object name and icon for first item # Show object name and icon for first item
op = row.operator('rt.select_object_by_name', text=obj.name, icon=icon, emboss=False) op = row.operator('rt.select_object_by_name', text=obj.name, icon=icon, emboss=False)
@ -161,21 +175,37 @@ class RT_OT_list_object_affected_by_simplify(Operator):
op.object_name = obj.name op.object_name = obj.name
op.modifier_name = mod.name op.modifier_name = mod.name
row.label(text="Viewport:") row.label(text="Viewport:")
row.prop(mod, "levels", text="")
# Create subrow for viewport setting
subrow = row.row()
subrow.active = viewport_limited
subrow.prop(mod, "levels", text="")
# Render levels row (indented) # Render levels row (indented)
row = col.row() row = col.row()
row.active = is_currently_affected
# Indent to match # Indent to match
row.label(text=' ', icon='BLANK1') row.label(text=' ', icon='BLANK1')
row.label(text=' ', icon='BLANK1') row.label(text=' ', icon='BLANK1')
row.label(text="Render:") row.label(text="Render:")
row.prop(mod, "render_levels", text="")
# Create subrow for render setting
subrow = row.row()
subrow.active = render_limited
subrow.prop(mod, "render_levels", text="")
elif data['type'] == 'MULTIRES': elif data['type'] == 'MULTIRES':
mod = data['modifier'] mod = data['modifier']
# Check if currently affected by simplify
viewport_limited = mod.levels > simplify_viewport
render_limited = mod.render_levels > simplify_render
is_currently_affected = viewport_limited or render_limited
# Modifier name row # Modifier name row
row = col.row() row = col.row()
row.active = is_currently_affected
if i == 0: if i == 0:
# Show object name and icon for first item # Show object name and icon for first item
op = row.operator('rt.select_object_by_name', text=obj.name, icon=icon, emboss=False) op = row.operator('rt.select_object_by_name', text=obj.name, icon=icon, emboss=False)
@ -189,18 +219,32 @@ class RT_OT_list_object_affected_by_simplify(Operator):
op.object_name = obj.name op.object_name = obj.name
op.modifier_name = mod.name op.modifier_name = mod.name
row.label(text="Viewport:") row.label(text="Viewport:")
row.prop(mod, "levels", text="")
# Create subrow for viewport setting
subrow = row.row()
subrow.active = viewport_limited
subrow.prop(mod, "levels", text="")
# Render levels row (indented) # Render levels row (indented)
row = col.row() row = col.row()
# Indent to match row.active = is_currently_affected
# Indent to match
row.label(text=' ', icon='BLANK1') row.label(text=' ', icon='BLANK1')
row.label(text=' ', icon='BLANK1') row.label(text=' ', icon='BLANK1')
row.label(text="Render:") row.label(text="Render:")
row.prop(mod, "render_levels", text="")
# Create subrow for render setting
subrow = row.row()
subrow.active = render_limited
subrow.prop(mod, "render_levels", text="")
elif data['type'] == 'PARTICLE': elif data['type'] == 'PARTICLE':
# Check if currently affected by simplify
is_currently_affected = max_child_particles < 1.0
row = col.row() row = col.row()
row.active = is_currently_affected
if i == 0: if i == 0:
# Show object name and icon for first item # Show object name and icon for first item
op = row.operator('rt.select_object_by_name', text=obj.name, icon=icon, emboss=False) op = row.operator('rt.select_object_by_name', text=obj.name, icon=icon, emboss=False)
@ -210,9 +254,12 @@ class RT_OT_list_object_affected_by_simplify(Operator):
row.label(text=' ', icon='BLANK1') row.label(text=' ', icon='BLANK1')
psys = data['particle_system'] psys = data['particle_system']
row.label(text=f"Particles: {psys.name}", icon='PARTICLES')
row.label(text=f"Type: {data['particle_type']}") # Create subrow for particle info
row.label(text=f"Count: {data['count']}") subrow = row.row()
subrow.label(text=f"Particles: {psys.name}", icon='PARTICLES')
subrow.label(text=f"Type: {data['particle_type']}")
subrow.label(text=f"Count: {data['count']}")
elif data['type'] == 'HAIR': elif data['type'] == 'HAIR':
row = col.row() row = col.row()
@ -225,8 +272,11 @@ class RT_OT_list_object_affected_by_simplify(Operator):
row.label(text=' ', icon='BLANK1') row.label(text=' ', icon='BLANK1')
mod = data['modifier'] mod = data['modifier']
row.label(text=f"Hair: {mod.name}", icon='HAIR')
row.label(text=f"Node Group: {data['node_group']}") # Create subrow for hair info
subrow = row.row()
subrow.label(text=f"Hair: {mod.name}", icon='HAIR')
subrow.label(text=f"Node Group: {data['node_group']}")
elif data['type'] == 'SUBSURFACE': elif data['type'] == 'SUBSURFACE':
row = col.row() row = col.row()
@ -239,8 +289,11 @@ class RT_OT_list_object_affected_by_simplify(Operator):
row.label(text=' ', icon='BLANK1') row.label(text=' ', icon='BLANK1')
mat = data['material'] mat = data['material']
row.label(text=f"Material: {mat.name}", icon='MATERIAL')
row.label(text=f"Subsurface: {data['subsurface_value']:.3f}") # Create subrow for material info
subrow = row.row()
subrow.label(text=f"Material: {mat.name}", icon='MATERIAL')
subrow.label(text=f"Subsurface: {data['subsurface_value']:.3f}")
elif data['type'] == 'VOLUME_MAT': elif data['type'] == 'VOLUME_MAT':
row = col.row() row = col.row()
@ -253,10 +306,18 @@ class RT_OT_list_object_affected_by_simplify(Operator):
row.label(text=' ', icon='BLANK1') row.label(text=' ', icon='BLANK1')
mat = data['material'] mat = data['material']
row.label(text=f"Volume Material: {mat.name}", icon='MATERIAL')
# Create subrow for volume material info
subrow = row.row()
subrow.label(text=f"Volume Material: {mat.name}", icon='MATERIAL')
elif data['type'] == 'VOLUME_OBJ': elif data['type'] == 'VOLUME_OBJ':
# Check if currently affected by simplify
is_currently_affected = volume_limit_resolution < 1.0
row = col.row() row = col.row()
row.active = is_currently_affected
if i == 0: if i == 0:
# Show object name and icon for first item # Show object name and icon for first item
op = row.operator('rt.select_object_by_name', text=obj.name, icon=icon, emboss=False) op = row.operator('rt.select_object_by_name', text=obj.name, icon=icon, emboss=False)
@ -265,7 +326,9 @@ class RT_OT_list_object_affected_by_simplify(Operator):
# Subsequent rows, show empty space # Subsequent rows, show empty space
row.label(text=' ', icon='BLANK1') row.label(text=' ', icon='BLANK1')
row.label(text="Volume Object", icon='VOLUME_DATA') # Create subrow for volume object info
subrow = row.row()
subrow.label(text="Volume Object", icon='VOLUME_DATA')
def execute(self, context): def execute(self, context):
return {'FINISHED'} return {'FINISHED'}

4
ui.py
View File

@ -32,8 +32,8 @@ class RT_PT_visibility_check(Panel):
layout.operator("rt.list_collection_visibility_conflicts", text="List Collections Visibility Conflicts", icon="OUTLINER_COLLECTION") layout.operator("rt.list_collection_visibility_conflicts", text="List Collections Visibility Conflicts", icon="OUTLINER_COLLECTION")
# layout.separator() layout.separator()
# layout.operator("rt.list_object_affected_by_simplify", text="List Object Affected By Simplify", icon="MOD_SIMPLIFY") layout.operator("rt.list_object_affected_by_simplify", text="List Object Affected By Simplify", icon="MOD_SIMPLIFY")
## Unused, only exposed in Create output panel ## Unused, only exposed in Create output panel