RCG: Тест нового пайплайна на захвате #258
1 changed files with 18 additions and 2 deletions
|
@ -71,7 +71,7 @@ def assembly_builder(item, libs_data, libs_data_dir, collection=None, parent=Non
|
||||||
if item['type'] == 'LOCATOR':
|
if item['type'] == 'LOCATOR':
|
||||||
item_obj = bpy.data.objects.new(item['name'], None)
|
item_obj = bpy.data.objects.new(item['name'], None)
|
||||||
item_obj.empty_display_type = 'CUBE'
|
item_obj.empty_display_type = 'CUBE'
|
||||||
item_obj.empty_display_size = 0.01
|
item_obj.empty_display_size = 0.0005
|
||||||
collection.objects.link(item_obj)
|
collection.objects.link(item_obj)
|
||||||
|
|
||||||
elif item['type'] == 'LCS':
|
elif item['type'] == 'LCS':
|
||||||
|
@ -117,7 +117,7 @@ def assembly_builder(item, libs_data, libs_data_dir, collection=None, parent=Non
|
||||||
if local_obj:
|
if local_obj:
|
||||||
local_obj[0].name = item['base_name']
|
local_obj[0].name = item['base_name']
|
||||||
item_obj.empty_display_type = 'PLAIN_AXES'
|
item_obj.empty_display_type = 'PLAIN_AXES'
|
||||||
item_obj.empty_display_size = 0.01
|
item_obj.empty_display_size = 0.0005
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logger.error('Unknown object type %s of %s', item['type'], item['name'])
|
logger.error('Unknown object type %s of %s', item['type'], item['name'])
|
||||||
|
@ -190,6 +190,8 @@ def assembly_rebuilder():
|
||||||
def build_render_assets(project_dir):
|
def build_render_assets(project_dir):
|
||||||
'''
|
'''
|
||||||
'''
|
'''
|
||||||
|
assets_data = []
|
||||||
|
|
||||||
libs_data_path = os.path.join(project_dir, 'libs.json')
|
libs_data_path = os.path.join(project_dir, 'libs.json')
|
||||||
if not os.path.exists(libs_data_path):
|
if not os.path.exists(libs_data_path):
|
||||||
raise Exception('No libs database found! Check %s directory' % project_dir)
|
raise Exception('No libs database found! Check %s directory' % project_dir)
|
||||||
|
@ -236,5 +238,19 @@ def build_render_assets(project_dir):
|
||||||
bpy.ops.wm.save_as_mainfile(filepath=blend_path)
|
bpy.ops.wm.save_as_mainfile(filepath=blend_path)
|
||||||
logger.info('Render asset %s generated!', tree_item['name'])
|
logger.info('Render asset %s generated!', tree_item['name'])
|
||||||
|
|
||||||
|
assets_data.append(
|
||||||
|
{
|
||||||
|
'type': 'RENDER',
|
||||||
|
'name': tree_item['name'],
|
||||||
|
'path': os.path.relpath(blend_path, project_dir),
|
||||||
|
'thumbnail': ''
|
||||||
|
}
|
||||||
|
)
|
||||||
logger.info('%s Render Assets was generated!', len(tree_item_list))
|
logger.info('%s Render Assets was generated!', len(tree_item_list))
|
||||||
|
# write db file
|
||||||
|
assets_data_path = os.path.join(project_dir, 'assets.json')
|
||||||
|
with open(assets_data_path, 'w', encoding='utf-8') as assets_data_file:
|
||||||
|
json.dump(assets_data, assets_data_file, ensure_ascii=False, indent=4)
|
||||||
|
logger.info('Database saved successfully to %s!', assets_data_path)
|
||||||
|
|
||||||
return render_assets_dir
|
return render_assets_dir
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue