Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

BakeResult command fails to bake single camera shape attribute driven by expression

BakeResult command fails to bake single camera shape attribute driven by expression

joeTCN99
Participant Participant
536 Views
1 Reply
Message 1 of 2

BakeResult command fails to bake single camera shape attribute driven by expression

joeTCN99
Participant
Participant

 

Hi All,

 

I'm having an issue where a bakeResult call fails when called on a camera shape with a expression driven attribute. Specifically it seems to bake the channel, but fails to connect the curve throwing this error:

 

# Error: Connection not made: 'animCurveTU1.output' -> 'cameraShape1.horizontalFilmAperture'.  Destination attribute must be writable.
# # Traceback (most recent call last):
# #   File "<maya console>", line 1, in <module>
# # RuntimeError: Connection not made: 'animCurveTU1.output' -> 'cameraShape1.horizontalFilmAperture'.  Destination attribute must be writable.

 

  This can be repeated by running the following code:

 

import maya.cmds as cmds
camera = cmds.camera()

cmds.expression(s="cameraShape1.horizontalFilmAperture=time", o="cameraShape1", ae=1, uc="all")

cmds.bakeResults(
        *camera,
        simulation=True, 
        t = (1, 30),
        sampleBy=1,
        disableImplicitControl=True, 
        preserveOutsideKeys=True, 
        sparseAnimCurveBake=False,
        removeBakedAttributeFromLayer=False,
        removeBakedAnimFromLayer=False,
        bakeOnOverrideLayer=False,
        minimizeRotation=True,
        at=["horizontalFilmAperture"]

    )


 

This is in maya 2023. The same result can be achieved with any attribute on the shape.

 

Here are a few related observations:

- Doesn't happen to the transform node and attributes such as "tx"

- Doesn't happen if you specify more than one shape node attribute ["fStop", "focusDistance"]

- Weirdly doesn't happen if you use the bake simulation user interface and select one specific attribute from the channel box.

 

There are enough options here that I can work around it, I just wanted to flag the issue!

 

Thanks

537 Views
1 Reply
  • bake
Reply (1)
Message 2 of 2

kolja.huebschmann
Explorer
Explorer

Same issue here:

* Linux Centos7 > maya 2019, 2022 and 2023.

 

@joeTCN99 thank you for the hint with:

- Doesn't happen if you specify more than one shape node attribute

 

did try to build some enhancements to only baking "attribues" that have incomming connections, what made me run into the same issue.

0 Likes