Merge branch '194-smooth-brush-size-reset' into 'develop'
Resolve "Brush deleted on join" See merge request slumber/multi-user!124
This commit is contained in:
commit
ff1630f9cc
@ -101,13 +101,19 @@ def get_state_str(state):
|
|||||||
|
|
||||||
|
|
||||||
def clean_scene():
|
def clean_scene():
|
||||||
for type_name in dir(bpy.data):
|
to_delete = [f for f in dir(bpy.data) if f not in ['brushes', 'palettes']]
|
||||||
|
for type_name in to_delete:
|
||||||
try:
|
try:
|
||||||
|
sub_collection_to_avoid = [bpy.data.linestyles['LineStyle'], bpy.data.materials['Dots Stroke']]
|
||||||
type_collection = getattr(bpy.data, type_name)
|
type_collection = getattr(bpy.data, type_name)
|
||||||
for item in type_collection:
|
items_to_remove = [i for i in type_collection if i not in sub_collection_to_avoid]
|
||||||
|
for item in items_to_remove:
|
||||||
|
try:
|
||||||
type_collection.remove(item)
|
type_collection.remove(item)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
except:
|
||||||
|
continue
|
||||||
|
|
||||||
# Clear sequencer
|
# Clear sequencer
|
||||||
bpy.context.scene.sequence_editor_clear()
|
bpy.context.scene.sequence_editor_clear()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user