plugget / plugget-qt-maya-plugin

Apache License 2.0
2 stars 0 forks source link

install on clean machine doesnt work #13

Closed hannesdelbeke closed 1 month ago

hannesdelbeke commented 1 month ago
installing Package(plugget-qt-maya-plugin 0.0.1)
# Warning: root : unsupported kwargs passed to install: {'force': False, 'enable': True}
# Warning: root : target_dir not found, creating: 'C:\Users\H\Documents\maya\Preview Release\plug-ins'
copying C:\Users\H\AppData\Local\Temp\plugget\maya\7d912c7f\plugget-qt-maya-plugin\0.0.1\plugget-qt-maya-plugin\plugget_qt_maya_plugin.py to C:\Users\H\Documents\maya\Preview Release\plug-ins
enabling plugin plugget_qt_maya_plugin.py
# Error: root : error in '<function enable_maya_plugins at 0x0000027B22B70680>': 
# 'Plug-in, "plugget_qt_maya_plugin.py", was not found on MAYA_PLUG_IN_PATH.
# '

installed to C:\Users\H\Documents\maya\Preview Release\plug-ins which is not in MAYA_PLUG_IN_PATH

import os
print(os.environ["MAYA_PLUG_IN_PATH"])

C:/Users/H/Documents/maya/2026/plug-ins;
C:/Users/H/Documents/maya/plug-ins;
D:/Program Files/Autodesk/Maya2026/bin/plug-ins;
D:/Program Files/Autodesk/Maya2026/plug-ins/ATF/plug-ins;
D:/Program Files/Autodesk/Maya2026/plug-ins/BonusTools/plug-ins;
D:/Program Files/Autodesk/Maya2026/plug-ins/MASH/plug-ins;
D:/Program Files/Autodesk/Maya2026/plug-ins/fbx/plug-ins;
D:/Program Files/Autodesk/Maya2026/plug-ins/camd/plug-ins;
D:/Program Files/Autodesk/Maya2026/plug-ins/sweep/plug-ins;
D:/Program Files/Autodesk/Maya2026/plug-ins/xgen/plug-ins
hannesdelbeke commented 1 month ago

it's because this returns Preview Release instead of 2026

import maya.cmds as cmds
print(cmds.about(version=True))

that results plugget creating and installing to the mydocs/Preview Release folder instead of the 2026 folder which is included in the env var.

this will only affect maya preview releases.

hannesdelbeke commented 1 month ago
hannesdelbeke commented 1 month ago

to get the version in Maya, don't use

import maya.cmds as cmds  
version = cmds.about(version=True)

this returns the Maya version (as a string), e.g. u'2026'. But it doesn't work when you run Maya Preview Release, then it returns u'Preview Release'

instead use

import maya.mel as mel
mel.eval('getApplicationVersionAsFloat')

which always returns the correct version (as a float), e.g. 2026.0

hannesdelbeke commented 1 month ago

submitted, not yet tested fix