PDA

View Full Version : Edit Save As UI to add notes to file


Plumer
08-09-2012, 11:29 PM
Hello,

I am relatively new to mel scripting.

I constantly save iterations and forget what small tweak I made.

I have been reading mel resources and was wondering if anyone advanced in mel could tell me if this idea could be done.

I would like to add to the Save Scene As Option menu on the right side, under the "File Type Specific Options" a text box for adding notes. With a clear all button.

My initial thought was that I could add to the SSA UI a textbox that would save the text inside the field as a global string variable that would write to the file. So any text you added or deleted would change the global string variable value on that file.

And I know I would have to add this to the Open UI as well, but when you clicked open, you could select a filename, and the Global Strings value would display your notes in the textbox.

My problem so far is I can not locate the save scene as UI, and my mel scripting needs work.

So my questions are to someone more advanced than I in mel and in general, is this a feasible thing? Is this a realistic solution? Help?

Thanks!

Plumer
08-13-2012, 01:54 AM
Should I post this in the UI sticky?

NaughtyNathan
08-13-2012, 09:16 AM
Maya already provides plenty of different ways to embed user-data and notes into files, but if I'm understanding you correctly you want to see the notes before you open any files right?

This is going to result in a problem whatever way you decide to do it inside the file as it means you will have to somehow fully or partially parse your Maya files before you open them. What would probably be far simpler would be to write out a text file with every Maya scene. If you save "char_anims_WIP_03.ma" it also writes out: "char_anims_WIP_03.txt" that have all your notes inside. This way you can browse, open, display all your scene notes without having to parse or open Maya files.

I think editing the default save and open dialogs would be slightly tricky, especially now they are all QT (although maybe this makes it easier..?). I'm guessing it would be more straightforward to simply write a new save and open dialog that saved your notes.txt files and displayed them before opening... I reckon this would be pretty easy in MEL or python.

Plumer
08-14-2012, 10:07 PM
Maya already provides plenty of different ways to embed user-data and notes into files, but if I'm understanding you correctly you want to see the notes before you open any files right?

Yes I want to able to add notes when saving, and see those notes when opening.


This is going to result in a problem whatever way you decide to do it inside the file as it means you will have to somehow fully or partially parse your Maya files before you open them. What would probably be far simpler would be to write out a text file with every Maya scene. If you save "char_anims_WIP_03.ma" it also writes out: "char_anims_WIP_03.txt" that have all your notes inside. This way you can browse, open, display all your scene notes without having to parse or open Maya files.

If I understand parsing correctly, I would have to have maya separately analyze the text apart from the file itself when loading?

Why wouldn't adding a global procedure to save a string variable onto each file work?

I think editing the default save and open dialogs would be slightly tricky, especially now they are all QT (although maybe this makes it easier..?). I'm guessing it would be more straightforward to simply write a new save and open dialog that saved your notes.txt files and displayed them before opening... I reckon this would be pretty easy in MEL or python.

I haven't touched QT and don't know anything about it so I can't use that. Maybe that is why I couldn't find the interface file to try editing in mel :). I'm starting further back from where maya exists currently.
I will try writing a new save and open UI in mel.

Thank you so much for the help Nathan!

CGTalk Moderation
08-14-2012, 10:07 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.