RCG: debug fixes

This commit is contained in:
brothermechanic 2024-04-11 19:16:08 +03:00
parent 8aeb802ec8
commit 31f5810bef
No known key found for this signature in database
GPG key ID: 9C59EF9503ACD106
5 changed files with 17 additions and 12 deletions

View file

@ -63,7 +63,7 @@ def export_assembly_trees(doc, clones_dic=None) -> list:
logger.warning('RootLocator attribute not found for %s LCS! ' logger.warning('RootLocator attribute not found for %s LCS! '
'So %s used as Root Locator!', 'So %s used as Root Locator!',
lcs.Label, lcs.InList[0].Label) lcs.Label, lcs.InList[0].Label)
root_locators.append(lcs.InList[0].Label) root_locators.append(lcs.InList[0])
else: else:
root_locators = [ root_locators = [
root for root in doc.Objects root for root in doc.Objects

View file

@ -24,9 +24,9 @@
# nixGL /nix/store/gd3shnza1i50zn8zs04fa729ribr88m9-python3-3.11.8/bin/python3 # nixGL /nix/store/gd3shnza1i50zn8zs04fa729ribr88m9-python3-3.11.8/bin/python3
import sys import sys
sys.path.append('/nix/store/ip49yhfl2l8gphylj4i43kdpq5qnq93i-bpy-4.1.0/lib/python3.11/site-packages') sys.path.append('/nix/store/<hash>-bpy-4.1.0/lib/python3.11/site-packages')
sys.path.append('/media/disk/robossembler/project/collab/150-cg-render-assets/rcg_pipeline') sys.path.append('/path/to/rcg_pipeline')
sys.path.append('/nix/store/x1rqfn240xn6m6p6077gxfqxdxxj1cmc-python3.11-numpy-1.26.4/lib/python3.11/site-packages') sys.path.append('/nix/store/<hash>-python3.11-numpy-1.26.4/lib/python3.11/site-packages')
import rcg_pipeline import rcg_pipeline
project_dir = '/path/to/<my_project_dir>' project_dir = '/path/to/<my_project_dir>'

View file

@ -14,7 +14,7 @@ license = {file = "LICENSE"}
authors = [{name = "Ilia Kurochkin", email = "brothermechanic@yandex.com"}] authors = [{name = "Ilia Kurochkin", email = "brothermechanic@yandex.com"}]
maintainers = [{name = "Igor Brylyov", email = "movefasta@dezcom.org"}] maintainers = [{name = "Igor Brylyov", email = "movefasta@dezcom.org"}]
requires-python = ">= 3.10" requires-python = ">= 3.10"
dependencies = ["numpy >= 1.26.4"] dependencies = ["numpy >= 1.26.4", "bpy >= 4.1.0"]
classifiers = [ classifiers = [
"Development Status :: 3 - Alpha", "Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",

View file

@ -75,6 +75,7 @@ def export(**kwargs):
export_animations=False, export_animations=False,
# custom # custom
export_morph=False, export_morph=False,
export_skins=False,
export_hierarchy_flatten_bones=False, export_hierarchy_flatten_bones=False,
export_original_specular=False, export_original_specular=False,
will_save_settings=False, will_save_settings=False,

View file

@ -201,6 +201,14 @@ def build_render_assets(project_dir):
with open(trees_path, encoding='utf-8') as data: with open(trees_path, encoding='utf-8') as data:
tree_item_list = json.load(data) tree_item_list = json.load(data)
# render assets dir
render_assets_dir = os.path.join(project_dir, 'assets', 'render')
if os.path.exists(render_assets_dir):
shutil.rmtree(render_assets_dir)
os.makedirs(render_assets_dir)
else:
os.makedirs(render_assets_dir)
for tree_item in tree_item_list: for tree_item in tree_item_list:
# start from stratch # start from stratch
bpy.ops.wm.read_homefile() bpy.ops.wm.read_homefile()
@ -220,13 +228,9 @@ def build_render_assets(project_dir):
# rebuild to LCS hierarchy # rebuild to LCS hierarchy
assembly_rebuilder() assembly_rebuilder()
# render assets dir # mark as asset
render_assets_dir = os.path.join(project_dir, 'assets', 'render') render_collection.asset_mark()
if os.path.exists(render_assets_dir): # TODO collection thumbnail
shutil.rmtree(render_assets_dir)
os.makedirs(render_assets_dir)
else:
os.makedirs(render_assets_dir)
blend_path = os.path.join(render_assets_dir, tree_item['name'] + '.blend') blend_path = os.path.join(render_assets_dir, tree_item['name'] + '.blend')
bpy.ops.wm.save_as_mainfile(filepath=blend_path) bpy.ops.wm.save_as_mainfile(filepath=blend_path)