parent
62221c9e49
commit
38f06683be
@ -35,7 +35,7 @@ class BlFont(BlDatablock):
|
|||||||
|
|
||||||
def _construct(self, data):
|
def _construct(self, data):
|
||||||
if data['filepath'] == '<builtin>':
|
if data['filepath'] == '<builtin>':
|
||||||
return bpy.data.fonts[data['name']]
|
return bpy.data.fonts.load(data['filepath'])
|
||||||
elif 'font_file' in data.keys():
|
elif 'font_file' in data.keys():
|
||||||
prefs = utils.get_preferences()
|
prefs = utils.get_preferences()
|
||||||
font_name = f"{self.uuid}.ttf"
|
font_name = f"{self.uuid}.ttf"
|
||||||
|
@ -57,13 +57,11 @@ def get_datablock_users(datablock):
|
|||||||
|
|
||||||
|
|
||||||
def clean_scene():
|
def clean_scene():
|
||||||
builtin = ['Bfont']
|
|
||||||
for type_name in dir(bpy.data):
|
for type_name in dir(bpy.data):
|
||||||
try:
|
try:
|
||||||
type_collection = getattr(bpy.data, type_name)
|
type_collection = getattr(bpy.data, type_name)
|
||||||
for item in type_collection:
|
for item in type_collection:
|
||||||
if item.name not in builtin:
|
type_collection.remove(item)
|
||||||
type_collection.remove(item)
|
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user