RCG: debug fixes
This commit is contained in:
parent
8aeb802ec8
commit
31f5810bef
5 changed files with 17 additions and 12 deletions
|
@ -63,7 +63,7 @@ def export_assembly_trees(doc, clones_dic=None) -> list:
|
|||
logger.warning('RootLocator attribute not found for %s LCS! '
|
||||
'So %s used as Root Locator!',
|
||||
lcs.Label, lcs.InList[0].Label)
|
||||
root_locators.append(lcs.InList[0].Label)
|
||||
root_locators.append(lcs.InList[0])
|
||||
else:
|
||||
root_locators = [
|
||||
root for root in doc.Objects
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
# nixGL /nix/store/gd3shnza1i50zn8zs04fa729ribr88m9-python3-3.11.8/bin/python3
|
||||
|
||||
import sys
|
||||
sys.path.append('/nix/store/ip49yhfl2l8gphylj4i43kdpq5qnq93i-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('/nix/store/x1rqfn240xn6m6p6077gxfqxdxxj1cmc-python3.11-numpy-1.26.4/lib/python3.11/site-packages')
|
||||
sys.path.append('/nix/store/<hash>-bpy-4.1.0/lib/python3.11/site-packages')
|
||||
sys.path.append('/path/to/rcg_pipeline')
|
||||
sys.path.append('/nix/store/<hash>-python3.11-numpy-1.26.4/lib/python3.11/site-packages')
|
||||
import rcg_pipeline
|
||||
project_dir = '/path/to/<my_project_dir>'
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ license = {file = "LICENSE"}
|
|||
authors = [{name = "Ilia Kurochkin", email = "brothermechanic@yandex.com"}]
|
||||
maintainers = [{name = "Igor Brylyov", email = "movefasta@dezcom.org"}]
|
||||
requires-python = ">= 3.10"
|
||||
dependencies = ["numpy >= 1.26.4"]
|
||||
dependencies = ["numpy >= 1.26.4", "bpy >= 4.1.0"]
|
||||
classifiers = [
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Programming Language :: Python :: 3",
|
||||
|
|
|
@ -75,6 +75,7 @@ def export(**kwargs):
|
|||
export_animations=False,
|
||||
# custom
|
||||
export_morph=False,
|
||||
export_skins=False,
|
||||
export_hierarchy_flatten_bones=False,
|
||||
export_original_specular=False,
|
||||
will_save_settings=False,
|
||||
|
|
|
@ -201,6 +201,14 @@ def build_render_assets(project_dir):
|
|||
with open(trees_path, encoding='utf-8') as 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:
|
||||
# start from stratch
|
||||
bpy.ops.wm.read_homefile()
|
||||
|
@ -220,13 +228,9 @@ def build_render_assets(project_dir):
|
|||
# rebuild to LCS hierarchy
|
||||
assembly_rebuilder()
|
||||
|
||||
# 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)
|
||||
# mark as asset
|
||||
render_collection.asset_mark()
|
||||
# TODO collection thumbnail
|
||||
|
||||
blend_path = os.path.join(render_assets_dir, tree_item['name'] + '.blend')
|
||||
bpy.ops.wm.save_as_mainfile(filepath=blend_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue