Thank you!

I never used yaml or any type of parsing yet.
I hope I get it to work.


justin...@gmail.com schrieb am Montag, 29. August 2022 um 07:24:35 UTC+2:

> On Sun, Aug 28, 2022 at 8:28 PM DGFA DAG's GRAPHIC & FOTO ART <
> gerom...@gmail.com> wrote:
>
>> Hi,
>>
>> I got my custom menu in pyton as well in mel but I want to load the menu 
>> structure from a yaml file e.g. like this
>>
>> - command: SetProject
>>   icon: fileOpen.png
>>   label: Set Project
>>   lang: mel
>> - divider: ''
>> - command: IncrementAndSave
>>   icon: saveToShelf.png
>>   label: Save icremental
>>   lang: mel
>> - command: SaveSceneAs
>>   icon: save.png
>>   label: Save as
>>   lang: mel
>> - divider: ''
>>
>> How can I achive this?
>>
>
> In Python you can use PyYAML to read in your file. 
> https://pypi.org/project/PyYAML/
> Then you can iterate over the list of commands and call the appropriate 
> Maya Python menu functions. If you already have this solved in Python then 
> I would say just have your MEL code call this python code and reuse the 
> same logic, since there is no point in trying to write and maintain it in 2 
> places. 
>  
>
>>
>> Thanks!
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to python_inside_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/67fc3631-dce5-45ae-99cb-32333e7bde12n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/67fc3631-dce5-45ae-99cb-32333e7bde12n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/e7b24ad1-7eca-4c4e-b8a3-cb4c65dd9209n%40googlegroups.com.

Reply via email to