Python: GUI and scriptJob Maya python sample codes.
Setting values to/from GUI.
This is one of Maya python sample codes from my technical animation lectures in 2017.
I hope this will help you further explore to create your scripting tools in Maya.
A) Getting values to GUI.
Press left button to get translateX value to the right floatField.
*One object must be selected.
B) Setting values from GUI.
Enter a new float value in right floatField to set it to the translateX of a selected object.
Python command in Maya.
import i3d_samples as _samp;_samp._GUI()._main("_samp");
Link to the sample codes of python file you save in your user folder.
https://drive.google.com/file/d/1uzcm8aFGVbvYK6jYTMEsE-wexXTyFZGg
scriptJob using uiDeleted flag.
Sample scripts using "Selection Changed" event and uiDeleted flag.
When selection is changed, it prints the updated selection of object(s) in script editor.
The scriptJob ID is displayed on the button, and it will kill the ID job when button is pressed.
It also kills the ID job when window is closed.
Python command in Maya.
import i3d_samples as _samp;_samp._sJobs()._main("_samp");
Link to the sample codes of python file you save in your user folder.
https://drive.google.com/file/d/1uzcm8aFGVbvYK6jYTMEsE-wexXTyFZGg


Comments
Post a Comment