Skip to content

Commit

Permalink
mmImagePlaneShape2 - Unlock/Relock color space attributes
Browse files Browse the repository at this point in the history
This will fix an error caused when the user changes the Image Sequence
slot.
  • Loading branch information
david-cattermole committed Jun 21, 2024
1 parent e5ce45e commit 349b592
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions python/mmSolver/tools/createimageplane/_lib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ def _set_image_sequence_v1(mm_image_plane_node, image_sequence_path, attr_name=N
return


def _set_locked_string_attr(node_attr, value):
maya.cmds.setAttr(node_attr, lock=False)
maya.cmds.setAttr(node_attr, value, type='string')
maya.cmds.setAttr(node_attr, lock=True)
return


def _set_image_sequence_v2(mm_image_plane_node, image_sequence_path, attr_name=None):
if attr_name is None:
attr_name = lib_const.DEFAULT_IMAGE_SEQUENCE_ATTR_NAME
Expand Down Expand Up @@ -208,16 +215,11 @@ def _set_image_sequence_v2(mm_image_plane_node, image_sequence_path, attr_name=N
input_color_space = _guess_color_space(first_frame_file_seq)
output_color_space = maya.cmds.mmColorIO(roleSceneLinear=True)

maya.cmds.setAttr(
shp + '.' + lib_const.INPUT_COLOR_SPACE_ATTR_NAME,
input_color_space,
type='string',
)
maya.cmds.setAttr(
shp + '.' + lib_const.OUTPUT_COLOR_SPACE_ATTR_NAME,
output_color_space,
type='string',
)
node_attr = shp + '.' + lib_const.INPUT_COLOR_SPACE_ATTR_NAME
_set_locked_string_attr(node_attr, input_color_space)

node_attr = shp + '.' + lib_const.OUTPUT_COLOR_SPACE_ATTR_NAME
_set_locked_string_attr(node_attr, output_color_space)

return

Expand Down

0 comments on commit 349b592

Please sign in to comment.