Get a list of palettes currently in the scene.Once that is in place, you can use its xgg.Maya variable to determine that you are in Maya and protect your Maya code within these conditionals. This brings in the XGen global module, which has the ability to detect Maya. # Do something maya specific like using XGen's Maya API ![]() A safe way to handle this is to use XGen's Maya detection: If your script is going to run inside and outside of Maya and you are calling methods from the Maya only portion of the API, you should put those within a conditional block. This brings in the xgen module which detects Maya and optionally brings in the Maya layer of the API. The best approach is to let XGen handle the decision for you by using the following command: import xgenm as xg It is important to bring in the correct API for the task, or you may obtain unexpected results. There is a separate UI component, but the API is essentially made up of the underlying C++ code, a Python layer that constitutes the Base API, and then another Python layer that brings in necessary Maya additions as well as extra API functions that constitutes the Maya API. The API is divided into two parts: Base and Maya.
0 Comments
Leave a Reply. |