0

I am looking for a way to convert this MEL line mel.eval('cameraMakeNode 2 "";') into Python.

I can't find anything in the documentation, is used to convert a camera to camera aim.

  • How is this not Python already? – mkrieger1 Oct 28 '22 at 11:49
  • yes but I was looking for a built in python command for it.. since sometimes I get this error ```# Error: RuntimeError: Error occurred during execution of MEL script``` – user19769290 Oct 28 '22 at 13:44
  • The "cameraMakeNode" is a mel script. You would to have to write a new script which does the same if you need it for python. The script expects either a camera as argument or that you have a camera selected. – haggi krey Oct 28 '22 at 14:35
  • if you type the mel command : whatis, it will print the path of this mel script – DrWeeny Nov 02 '22 at 17:07

2 Answers2

0

I hope this finds you well. Here is the code that worked for me:

import pymel.core as pm
pm.mel.cameraMakeNode(3, "")
Guy Micciche
  • 378
  • 1
  • 4
  • 11
0

Perhaps I'm missing something, but doesn't this work?:

    import maya.mel
    maya.mel.eval("cameraMakeNode 2 '';")
  • Please don't add "thank you" as an answer. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation), you will be able to [vote up questions and answers](https://stackoverflow.com/help/privileges/vote-up) that you found helpful. - [From Review](/review/late-answers/33735667) – Debayan Feb 05 '23 at 03:57