Compare commits
4 Commits
version-1.
...
version-1.
Author | SHA1 | Date | |
---|---|---|---|
843667e612 | |||
cf3f7234eb | |||
4647175a7e | |||
33da5195f3 |
@@ -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, 999999),
|
'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)
|
||||||
path_box.label(str(output_path))
|
if output_path:
|
||||||
props = path_box.operator('flamenco.explore_file_path', text='', icon='DISK_DRIVE')
|
path_box.label(str(output_path))
|
||||||
props.path = str(output_path.parent)
|
props = path_box.operator('flamenco.explore_file_path', text='', icon='DISK_DRIVE')
|
||||||
|
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)
|
||||||
@@ -230,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'
|
||||||
@@ -406,7 +432,11 @@ def _render_output_path(
|
|||||||
is fast.
|
is fast.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
project_path = Path(bpy.path.abspath(local_project_path)).resolve()
|
try:
|
||||||
|
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)
|
||||||
@@ -521,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
|
||||||
@@ -543,7 +568,7 @@ def register():
|
|||||||
name='Frame Chunk Size',
|
name='Frame Chunk Size',
|
||||||
description='Maximum number of frames to render per task',
|
description='Maximum number of frames to render per task',
|
||||||
min=1,
|
min=1,
|
||||||
default=10,
|
default=1,
|
||||||
)
|
)
|
||||||
scene.flamenco_render_schunk_count = IntProperty(
|
scene.flamenco_render_schunk_count = IntProperty(
|
||||||
name='Number of Sample Chunks',
|
name='Number of Sample Chunks',
|
||||||
|
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.999999',
|
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