Compare commits
11 Commits
version-1.
...
version-1.
Author | SHA1 | Date | |
---|---|---|---|
843667e612 | |||
cf3f7234eb | |||
4647175a7e | |||
33da5195f3 | |||
3814fb2683 | |||
15484a65cd | |||
d9e2b36204 | |||
cc690ec8c9 | |||
0422070d55 | |||
8cefb4fb07 | |||
23549fa676 |
@@ -21,7 +21,7 @@
|
|||||||
bl_info = {
|
bl_info = {
|
||||||
'name': 'Blender Cloud',
|
'name': 'Blender Cloud',
|
||||||
"author": "Sybren A. Stüvel, Francesco Siddi, Inês Almeida, Antony Riakiotakis",
|
"author": "Sybren A. Stüvel, Francesco Siddi, Inês Almeida, Antony Riakiotakis",
|
||||||
'version': (1, 5, 99999),
|
'version': (1, 6, 0),
|
||||||
'blender': (2, 77, 0),
|
'blender': (2, 77, 0),
|
||||||
'location': 'Addon Preferences panel, and Ctrl+Shift+Alt+A anywhere for texture browser',
|
'location': 'Addon Preferences panel, and Ctrl+Shift+Alt+A anywhere for texture browser',
|
||||||
'description': 'Texture library browser and Blender Sync. Requires the Blender ID addon '
|
'description': 'Texture library browser and Blender Sync. Requires the Blender ID addon '
|
||||||
|
@@ -390,9 +390,13 @@ class BlenderCloudPreferences(AddonPreferences):
|
|||||||
|
|
||||||
path_box = job_output_box.row(align=True)
|
path_box = job_output_box.row(align=True)
|
||||||
output_path = render_output_path(context)
|
output_path = render_output_path(context)
|
||||||
|
if output_path:
|
||||||
path_box.label(str(output_path))
|
path_box.label(str(output_path))
|
||||||
props = path_box.operator('flamenco.explore_file_path', text='', icon='DISK_DRIVE')
|
props = path_box.operator('flamenco.explore_file_path', text='', icon='DISK_DRIVE')
|
||||||
props.path = str(output_path.parent)
|
props.path = str(output_path.parent)
|
||||||
|
else:
|
||||||
|
path_box.label('Blend file is not in your project path, '
|
||||||
|
'unable to give output path example.')
|
||||||
|
|
||||||
flamenco_box.prop(self, 'flamenco_open_browser_after_submit')
|
flamenco_box.prop(self, 'flamenco_open_browser_after_submit')
|
||||||
|
|
||||||
|
@@ -128,24 +128,13 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
|
|||||||
if not await self.authenticate(context):
|
if not await self.authenticate(context):
|
||||||
return
|
return
|
||||||
|
|
||||||
from pillarsdk import exceptions as sdk_exceptions
|
|
||||||
from ..blender import preferences
|
from ..blender import preferences
|
||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
|
|
||||||
# The file extension should be determined by the render settings, not necessarily
|
# Save to a different file, specifically for Flamenco.
|
||||||
# by the setttings in the output panel.
|
|
||||||
scene.render.use_file_extension = True
|
|
||||||
|
|
||||||
# Save to a different file, specifically for Flamenco. We shouldn't overwrite
|
|
||||||
# the artist's file. We can compress, since this file won't be managed by SVN
|
|
||||||
# and doesn't need diffability.
|
|
||||||
context.window_manager.flamenco_status = 'PACKING'
|
context.window_manager.flamenco_status = 'PACKING'
|
||||||
filepath = Path(context.blend_data.filepath).with_suffix('.flamenco.blend')
|
filepath = await self._save_blendfile(context)
|
||||||
self.log.info('Saving copy to temporary file %s', filepath)
|
|
||||||
bpy.ops.wm.save_as_mainfile(filepath=str(filepath),
|
|
||||||
compress=True,
|
|
||||||
copy=True)
|
|
||||||
|
|
||||||
# Determine where the render output will be stored.
|
# Determine where the render output will be stored.
|
||||||
render_output = render_output_path(context, filepath)
|
render_output = render_output_path(context, filepath)
|
||||||
@@ -165,11 +154,22 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
|
|||||||
|
|
||||||
context.window_manager.flamenco_status = 'COMMUNICATING'
|
context.window_manager.flamenco_status = 'COMMUNICATING'
|
||||||
settings = {'blender_cmd': '{blender}',
|
settings = {'blender_cmd': '{blender}',
|
||||||
'chunk_size': scene.flamenco_render_chunk_size,
|
'chunk_size': scene.flamenco_render_fchunk_size,
|
||||||
'filepath': str(outfile),
|
'filepath': str(outfile),
|
||||||
'frames': scene.flamenco_render_frame_range,
|
'frames': scene.flamenco_render_frame_range,
|
||||||
'render_output': str(render_output),
|
'render_output': str(render_output),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Add extra settings specific to the job type
|
||||||
|
if scene.flamenco_render_job_type == 'blender-render-progressive':
|
||||||
|
samples = scene.cycles.samples
|
||||||
|
if scene.cycles.use_square_samples:
|
||||||
|
samples **= 2
|
||||||
|
|
||||||
|
settings['cycles_num_chunks'] = scene.flamenco_render_schunk_count
|
||||||
|
settings['cycles_sample_count'] = samples
|
||||||
|
settings['format'] = 'EXR'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
job_info = await create_job(self.user_id,
|
job_info = await create_job(self.user_id,
|
||||||
prefs.attract_project.project,
|
prefs.attract_project.project,
|
||||||
@@ -178,7 +178,7 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
|
|||||||
settings,
|
settings,
|
||||||
'Render %s' % filepath.name,
|
'Render %s' % filepath.name,
|
||||||
priority=scene.flamenco_render_job_priority)
|
priority=scene.flamenco_render_job_priority)
|
||||||
except sdk_exceptions.ResourceInvalid as ex:
|
except Exception as ex:
|
||||||
self.report({'ERROR'}, 'Error creating Flamenco job: %s' % ex)
|
self.report({'ERROR'}, 'Error creating Flamenco job: %s' % ex)
|
||||||
self.quit()
|
self.quit()
|
||||||
return
|
return
|
||||||
@@ -219,6 +219,43 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
|
|||||||
|
|
||||||
self.quit()
|
self.quit()
|
||||||
|
|
||||||
|
async def _save_blendfile(self, context):
|
||||||
|
"""Save to a different file, specifically for Flamenco.
|
||||||
|
|
||||||
|
We shouldn't overwrite the artist's file.
|
||||||
|
We can compress, since this file won't be managed by SVN and doesn't need diffability.
|
||||||
|
"""
|
||||||
|
|
||||||
|
render = context.scene.render
|
||||||
|
|
||||||
|
# Remember settings we need to restore after saving.
|
||||||
|
old_use_file_extension = render.use_file_extension
|
||||||
|
old_use_overwrite = render.use_overwrite
|
||||||
|
old_use_placeholder = render.use_placeholder
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
# The file extension should be determined by the render settings, not necessarily
|
||||||
|
# by the setttings in the output panel.
|
||||||
|
render.use_file_extension = True
|
||||||
|
|
||||||
|
# Rescheduling should not overwrite existing frames.
|
||||||
|
render.use_overwrite = False
|
||||||
|
render.use_placeholder = False
|
||||||
|
|
||||||
|
filepath = Path(context.blend_data.filepath).with_suffix('.flamenco.blend')
|
||||||
|
self.log.info('Saving copy to temporary file %s', filepath)
|
||||||
|
bpy.ops.wm.save_as_mainfile(filepath=str(filepath),
|
||||||
|
compress=True,
|
||||||
|
copy=True)
|
||||||
|
finally:
|
||||||
|
# Restore the settings we changed, even after an exception.
|
||||||
|
render.use_file_extension = old_use_file_extension
|
||||||
|
render.use_overwrite = old_use_overwrite
|
||||||
|
render.use_placeholder = old_use_placeholder
|
||||||
|
|
||||||
|
return filepath
|
||||||
|
|
||||||
def quit(self):
|
def quit(self):
|
||||||
super().quit()
|
super().quit()
|
||||||
bpy.context.window_manager.flamenco_status = 'IDLE'
|
bpy.context.window_manager.flamenco_status = 'IDLE'
|
||||||
@@ -395,7 +432,11 @@ def _render_output_path(
|
|||||||
is fast.
|
is fast.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
project_path = Path(bpy.path.abspath(local_project_path)).resolve()
|
project_path = Path(bpy.path.abspath(local_project_path)).resolve()
|
||||||
|
except FileNotFoundError:
|
||||||
|
# Path.resolve() will raise a FileNotFoundError if the project path doesn't exist.
|
||||||
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
proj_rel = blend_filepath.parent.relative_to(project_path)
|
proj_rel = blend_filepath.parent.relative_to(project_path)
|
||||||
@@ -404,11 +445,18 @@ def _render_output_path(
|
|||||||
|
|
||||||
rel_parts = proj_rel.parts[flamenco_job_output_strip_components:]
|
rel_parts = proj_rel.parts[flamenco_job_output_strip_components:]
|
||||||
output_top = Path(flamenco_job_output_path)
|
output_top = Path(flamenco_job_output_path)
|
||||||
dir_components = output_top.joinpath(*rel_parts) / blend_filepath.stem
|
|
||||||
|
# Strip off '.flamenco' too; we use 'xxx.flamenco.blend' as job file, but
|
||||||
|
# don't want to have all the output paths ending in '.flamenco'.
|
||||||
|
stem = blend_filepath.stem
|
||||||
|
if stem.endswith('.flamenco'):
|
||||||
|
stem = stem[:-9]
|
||||||
|
|
||||||
|
dir_components = output_top.joinpath(*rel_parts) / stem
|
||||||
|
|
||||||
# Blender will have to append the file extensions by itself.
|
# Blender will have to append the file extensions by itself.
|
||||||
if is_image_type(render_image_format):
|
if is_image_type(render_image_format):
|
||||||
return dir_components / '#####'
|
return dir_components / '######'
|
||||||
return dir_components / flamenco_render_frame_range
|
return dir_components / flamenco_render_frame_range
|
||||||
|
|
||||||
|
|
||||||
@@ -453,9 +501,6 @@ class FLAMENCO_PT_render(bpy.types.Panel):
|
|||||||
|
|
||||||
prefs = preferences()
|
prefs = preferences()
|
||||||
|
|
||||||
layout.prop(context.scene, 'flamenco_render_job_priority')
|
|
||||||
layout.prop(context.scene, 'flamenco_render_chunk_size')
|
|
||||||
|
|
||||||
labeled_row = layout.split(0.25, align=True)
|
labeled_row = layout.split(0.25, align=True)
|
||||||
labeled_row.label('Job Type:')
|
labeled_row.label('Job Type:')
|
||||||
labeled_row.prop(context.scene, 'flamenco_render_job_type', text='')
|
labeled_row.prop(context.scene, 'flamenco_render_job_type', text='')
|
||||||
@@ -466,6 +511,12 @@ class FLAMENCO_PT_render(bpy.types.Panel):
|
|||||||
prop_btn_row.prop(context.scene, 'flamenco_render_frame_range', text='')
|
prop_btn_row.prop(context.scene, 'flamenco_render_frame_range', text='')
|
||||||
prop_btn_row.operator('flamenco.scene_to_frame_range', text='', icon='ARROW_LEFTRIGHT')
|
prop_btn_row.operator('flamenco.scene_to_frame_range', text='', icon='ARROW_LEFTRIGHT')
|
||||||
|
|
||||||
|
layout.prop(context.scene, 'flamenco_render_job_priority')
|
||||||
|
layout.prop(context.scene, 'flamenco_render_fchunk_size')
|
||||||
|
|
||||||
|
if getattr(context.scene, 'flamenco_render_job_type', None) == 'blender-render-progressive':
|
||||||
|
layout.prop(context.scene, 'flamenco_render_schunk_count')
|
||||||
|
|
||||||
readonly_stuff = layout.column(align=True)
|
readonly_stuff = layout.column(align=True)
|
||||||
labeled_row = readonly_stuff.split(0.25, align=True)
|
labeled_row = readonly_stuff.split(0.25, align=True)
|
||||||
labeled_row.label('Storage:')
|
labeled_row.label('Storage:')
|
||||||
@@ -500,11 +551,6 @@ class FLAMENCO_PT_render(bpy.types.Panel):
|
|||||||
else:
|
else:
|
||||||
layout.label('Unknown Flamenco status %s' % flamenco_status)
|
layout.label('Unknown Flamenco status %s' % flamenco_status)
|
||||||
|
|
||||||
if not context.scene.render.use_overwrite:
|
|
||||||
warnbox = layout.box().column(align=True)
|
|
||||||
warnbox.label('Please enable "Overwrite" in the Output panel,')
|
|
||||||
warnbox.label('or re-queueing this job might not do anything.')
|
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
from ..utils import redraw
|
from ..utils import redraw
|
||||||
@@ -518,24 +564,34 @@ def register():
|
|||||||
bpy.utils.register_class(FLAMENCO_PT_render)
|
bpy.utils.register_class(FLAMENCO_PT_render)
|
||||||
|
|
||||||
scene = bpy.types.Scene
|
scene = bpy.types.Scene
|
||||||
scene.flamenco_render_chunk_size = IntProperty(
|
scene.flamenco_render_fchunk_size = IntProperty(
|
||||||
name='Chunk size',
|
name='Frame Chunk Size',
|
||||||
description='Maximum number of frames to render per task',
|
description='Maximum number of frames to render per task',
|
||||||
default=10,
|
min=1,
|
||||||
|
default=1,
|
||||||
|
)
|
||||||
|
scene.flamenco_render_schunk_count = IntProperty(
|
||||||
|
name='Number of Sample Chunks',
|
||||||
|
description='Number of Cycles samples chunks to use per frame',
|
||||||
|
min=2,
|
||||||
|
default=3,
|
||||||
|
soft_max=10,
|
||||||
)
|
)
|
||||||
scene.flamenco_render_frame_range = StringProperty(
|
scene.flamenco_render_frame_range = StringProperty(
|
||||||
name='Frame range',
|
name='Frame Range',
|
||||||
description='Frames to render, in "printer range" notation'
|
description='Frames to render, in "printer range" notation'
|
||||||
)
|
)
|
||||||
scene.flamenco_render_job_type = EnumProperty(
|
scene.flamenco_render_job_type = EnumProperty(
|
||||||
name='Job type',
|
name='Job Type',
|
||||||
items=[
|
items=[
|
||||||
('blender-render', 'Simple Blender render', 'Not tiled, not resumable, just render'),
|
('blender-render', 'Simple Render', 'Simple frame-by-frame render'),
|
||||||
],
|
('blender-render-progressive', 'Progressive Render',
|
||||||
description='Flamenco render job type',
|
'Each frame is rendered multiple times with different Cycles sample chunks, then combined'),
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
scene.flamenco_render_job_priority = IntProperty(
|
scene.flamenco_render_job_priority = IntProperty(
|
||||||
name='Job priority',
|
name='Job Priority',
|
||||||
min=0,
|
min=0,
|
||||||
default=50,
|
default=50,
|
||||||
max=100,
|
max=100,
|
||||||
@@ -558,7 +614,11 @@ def unregister():
|
|||||||
bpy.utils.unregister_module(__name__)
|
bpy.utils.unregister_module(__name__)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
del bpy.types.Scene.flamenco_render_chunk_size
|
del bpy.types.Scene.flamenco_render_fchunk_size
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
del bpy.types.Scene.flamenco_render_schunk_count
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
|
2
setup.py
2
setup.py
@@ -227,7 +227,7 @@ setup(
|
|||||||
'wheels': BuildWheels},
|
'wheels': BuildWheels},
|
||||||
name='blender_cloud',
|
name='blender_cloud',
|
||||||
description='The Blender Cloud addon allows browsing the Blender Cloud from Blender.',
|
description='The Blender Cloud addon allows browsing the Blender Cloud from Blender.',
|
||||||
version='1.5.99999',
|
version='1.6.0',
|
||||||
author='Sybren A. Stüvel',
|
author='Sybren A. Stüvel',
|
||||||
author_email='sybren@stuvel.eu',
|
author_email='sybren@stuvel.eu',
|
||||||
packages=find_packages('.'),
|
packages=find_packages('.'),
|
||||||
|
Reference in New Issue
Block a user