Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

1 REPLY 1
Reply
Message 1 of 2
joeTCN99
343 Views, 1 Reply

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

 

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

Tags (2)
Labels (1)
  • bake
1 REPLY 1
Message 2 of 2

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report