Fix baking to world space

This commit is contained in:
Roy Nieterau 2018-10-09 13:12:52 +02:00
parent 4e760c593d
commit 3de333ef67
2 changed files with 7 additions and 6 deletions

View file

@ -1856,7 +1856,7 @@ def bake(nodes,
Args:
nodes (list): Names of transform nodes, eg. camera, light.
frame_range (tuple): frame range with start and end frame.
frame_range (list): frame range with start and end frame.
or if None then takes timeSliderRange
simulation (bool): Whether to perform a full simulation of the
attributes over time.
@ -1878,9 +1878,10 @@ def bake(nodes,
assert isinstance(nodes, (list, tuple)), "Nodes must be a list or tuple"
# If frame range is None fall back to time slider range
# If frame range is None fall back to time slider playback time range
if frame_range is None:
frame_range = getTimeSliderRange()
frame_range = [cmds.playbackOptions(query=True, minTime=True),
cmds.playbackOptions(query=True, maxTime=True)]
# If frame range is single frame bake one frame more,
# otherwise maya.cmds.bakeResults gets confused

View file

@ -97,8 +97,8 @@ class ExtractCameraMayaAscii(colorbleed.api.Extractor):
# TODO: Implement a bake to non-world space
# Currently it will always bake the resulting camera to world-space
# and it does not allow to include the parent hierarchy, even though
# with `bake_to_world_space` set to False it should include its hierarchy
# to be correct with the family implementation.
# with `bake_to_world_space` set to False it should include its
# hierarchy to be correct with the family implementation.
if not bake_to_worldspace:
self.log.warning("Camera (Maya Ascii) export only supports world"
"space baked camera extractions. The disabled "
@ -128,7 +128,7 @@ class ExtractCameraMayaAscii(colorbleed.api.Extractor):
with avalon.maya.maintained_selection():
with lib.evaluation("off"):
with lib.no_refresh():
baked = lib.bake_to_worldspace(
baked = lib.bake_to_world_space(
transform,
frameRange=range_with_handles,
step=step