Thread: [Maya2osg-users] osgpreview, UI and flags
Status: Alpha
Brought to you by:
jtaibo
From: Peter W. <pp...@cg...> - 2011-05-21 11:43:17
|
Hi all, first its nice to have the osgpreview as maya command :-) I would like to add some stuff to it. I'm using 2 Monitors and would like to preview on one of them in full screen, this is perfectly possible with the osgpreview flags, but there's no way to pass them from the ui. I would like to add an optionMenu to the preview command textfield, which changes the behavior of the command field, with these options: Mel: current behaviour Pyth: corresponding Python script Exec: which would take an os command ( like "osgviewer --flags file" ) without the need of "exec" infront of it Flag: this would call osgpreview with flags entered inside the textfield, overriding those hardcoded in the export script Edit: ( maybe ) this would pop up a bigger window for editing text, in the case one of the above needs more space Moreover, Javier, I would like to either merge the maya2osg_preview script with maya2osg_export script, or reorganize in both of the scripts, in one UI script and one export commands script, what do you think ? Cheers, PP |
From: Javier T. <jav...@gm...> - 2011-05-21 20:52:15
|
On Sat, May 21, 2011 at 1:43 PM, Peter Wrobel <pp...@cg...> wrote: > Hi all, > > first its nice to have the osgpreview as maya command :-) Now we have to add the features we need to preview animations. Btw, I hope to start next week with blend shapes export. > I would like to add some stuff to it. I'm using 2 Monitors and would > like to preview on one of them in full screen, this is perfectly > possible with the osgpreview flags, but there's no way to pass them from > the ui. OK. All what you suggest is interesting. What about creating a new section "Previewing" or "Previsualization" or something similar in the export options window? > Moreover, Javier, I would like to either merge the maya2osg_preview > script with maya2osg_export script, or reorganize in both of the > scripts, in one UI script and one export commands script, what do you > think ? I don't understand completely what you are proposing. Just two notes: 1. maya2osg_export and maya2osg_preview procs must be in two independent files with these same names to be automatically loaded the first time they are called. This is the same reason I created the "osgFileExportOptions.mel" file (otherwise the Maya Export option failed if you haven't called maya2osg_export before). 2. The maya2osg_preview command is meant to be a "quick preview" and so it has no GUI. It just uses the last options that were set on the plug-in and creates the output files in the temp directory and deletes them after closing the preview window. -- Javier Taibo |
From: Peter W. <pp...@cg...> - 2011-05-23 22:33:10
|
Hi Javier, > Now we have to add the features we need to preview animations. Btw, > I hope to start next week with blend shapes export. > Cool, I will try add the skining module. To be honest, I hope I can overtake the blend shape stuff, as all regarding characters and rigging ( this includes best possible and fatest meshes export ) are my major field of interst. If you know about corrective BlendShapes, I might be writing my Bachelor Thesis about a certain extension to this system which would yield perfect results at joints with more than one degree of freedom. But we should talk about the curent mesh export mechanism, as there are some traps waiting :-) see new thread. . > OK. All what you suggest is interesting. What about creating a new > section "Previewing" or "Previsualization" or something similar in the > export options window? > That can be done, but currently its only one TextField, does it really make sense for now ? > I don't understand completely what you are proposing. Just two notes: > > 1. maya2osg_export and maya2osg_preview procs must be in two > independent files with these same names to be automatically loaded the > first time they are called. This is the same reason I created the > "osgFileExportOptions.mel" file (otherwise the Maya Export option > failed if you haven't called maya2osg_export before). Now I think I can't follow you, neither can reproduce the case you are talking about. I have merged the function already, but just not commited, and it works as expected. Before evaluating a global proc, the file where it is defined needs to be sourced, that's it. And as all settings are stored in environment variables, the UI does not have to be opened or executed, you can directly use the osg_preview command. The only case is, when the whole system is installed, and no envVars are created, so we can catch this case, and generate the default ones. > 2. The maya2osg_preview command is meant to be a "quick preview" and > so it has no GUI. It just uses the last options that were set on the > plug-in and creates the output files in the temp directory and deletes > them after closing the preview window. > As said, all that can be done without the UI opened, or the preview command existing in a seperate file. Btw, I like it very much, that it is a Maya window :-) do you remember the discussion about having a direct connection between Maya and a osg Window ? :-) Cheers, PP |
From: Javier T. <jav...@gm...> - 2011-05-24 15:12:11
|
Hi Peter, On Tue, May 24, 2011 at 12:32 AM, Peter Wrobel <pp...@cg...> wrote: >> Now we have to add the features we need to preview animations. Btw, >> I hope to start next week with blend shapes export. >> > > Cool, I will try add the skining module. To be honest, I hope I can > overtake the blend shape stuff, as all regarding characters and rigging > ( this includes best possible and fatest meshes export ) are my major > field of interst. Don't worry, if you're with the skinning part, its OK. Let me do the blend shape part and I'll ask you for help if I found any problem. > If you know about corrective BlendShapes, I might be writing my Bachelor > Thesis about a certain extension to this system which would yield > perfect results at joints with more than one degree of freedom. I only know the very basic theory about blend shapes, I don't know what corrective blend shapes are. > But we should talk about the curent mesh export mechanism, as there are > some traps waiting :-) see new thread. OK. I'll let you know what I found in my way... >> OK. All what you suggest is interesting. What about creating a new >> section "Previewing" or "Previsualization" or something similar in the >> export options window? >> > > That can be done, but currently its only one TextField, does it really > make sense for now ? Of course not. I thought you were talking about some new options related to preview, that's why I said that. If there is only one, there is no sense in making a new section. >> I don't understand completely what you are proposing. Just two notes: >> >> 1. maya2osg_export and maya2osg_preview procs must be in two >> independent files with these same names to be automatically loaded the >> first time they are called. This is the same reason I created the >> "osgFileExportOptions.mel" file (otherwise the Maya Export option >> failed if you haven't called maya2osg_export before). > > Now I think I can't follow you, neither can reproduce the case you are > talking about. What I mean is: when you start Maya, the procs in these files are not available. When you call for example the "maya2osg_export" proc, as there is still not available, Maya looks for a "maya2osg_export.mel" file in the scripts directories. When Maya founds it and loads it, the procedure is available and executed. From this moment, as the file is already loaded, all global procs in this file are available, but they were not if you haven't called "maya2osg_export" first. > I have merged the function already, but just not commited, and it works > as expected. What have you merged? maya2osg_export and maya2osg_preview? If there are not the two files, then try to call (just after starting Maya, before calling anything else) the proc that has no file with its name and see if it is executed. I think it will not. > Before evaluating a global proc, the file where it is defined needs to > be sourced, that's it. And as all settings are stored in environment > variables, the UI does not have to be opened or executed, you can > directly use the osg_preview command. But who is loading this file when Maya starts? > The only case is, when the whole system is installed, and no envVars are > created, so we can catch this case, and generate the default ones. I think I am not understanding you. It's not about envVars, its about MEL procs. >> 2. The maya2osg_preview command is meant to be a "quick preview" and >> so it has no GUI. It just uses the last options that were set on the >> plug-in and creates the output files in the temp directory and deletes >> them after closing the preview window. > > As said, all that can be done without the UI opened, or the preview > command existing in a seperate file. OK. Commit it then and let's try it. If it works, it's OK. I just thought it wouldn't work, but I am not a Maya expert anyway :) > Btw, I like it very much, that it is a Maya window :-) do you remember > the discussion about having a direct connection between Maya and a osg > Window ? :-) Yes, we only have to add now the animation preview features and it will be great! -- Javier Taibo |
From: Peter W. <pp...@cg...> - 2011-05-25 20:15:34
|
Hi Javier, > What I mean is: when you start Maya, the procs in these files are > not available. When you call for example the "maya2osg_export" proc, > as there is still not available, Maya looks for a > "maya2osg_export.mel" file in the scripts directories. When Maya > founds it and loads it, the procedure is available and executed. From > this moment, as the file is already loaded, all global procs in this > file are available, but they were not if you haven't called > "maya2osg_export" first. > Ah, I see. So for this there is the userSetup.mel, I guess you didn't get in touch with it till now. It gets executed at startup, and is, as the name says, a way to customize maya. This file doesn't exist by default, but only if one requires it. If it exists, user settings should be appended to the command s which are there already. In our case, we could source all the scripts with it. A more elegant way is to create a maya2osg_setup.mel ( will commit it soon ) and add the command source maya2osg_setup.mel to userSetup.mel. Within maya2osg_setup, we can source all the scripts, and maybe do some other setup stuff if requied. With this the preview command would available. I must admit, that I like the fact that there is now a seperated osgFileExportOptions.mel, which is sourced by Maya at plugin load. I would like to keep this seperated, as there might be additional edits. A preview field does not make sens, but the pre and post export commands do. > What have you merged? maya2osg_export and maya2osg_preview? If there > are not the two files, then try to call (just after starting Maya, > before calling anything else) the proc that has no file with its name > and see if it is executed. I think it will not. > Yes, see above. It works in my case, because I added a source m20_export.mel into any shelf icon which requires the sourcing of the script. This makes sens for development, so I was not aware that there is an issue. >> The only case is, when the whole system is installed, and no envVars are >> created, so we can catch this case, and generate the default ones. > I think I am not understanding you. It's not about envVars, its > about MEL procs. > Here I assumed, that all scripts do run, but I noticed issues, errors hen envVars were not setup properly. Point is that the preview command can and should use the envVars, which means that the export and preview and the quick preview in the shelf should basically be the same commands. > OK. Commit it then and let's try it. If it works, it's OK. I just > thought it wouldn't work, but I am not a Maya expert anyway :) > Fine, unfortunatelly again not so much time for committing, as preaseure is going on again. But its not so horrible like the last week any more. I try to get all the discussed stuff checked in comming weekend. I will also add more options to the polygon exporter. Btw, now that custom glsl is supported, are you aware, that we can "paint" VertexAttributes with Maya VertexColor tool ? Cheers, PP |
From: Javier T. <jav...@gm...> - 2011-05-26 15:26:55
|
Hi Peter, On Wed, May 25, 2011 at 10:15 PM, Peter Wrobel <pp...@cg...> wrote: > Hi Javier, >> What I mean is: when you start Maya, the procs in these files are >> not available. When you call for example the "maya2osg_export" proc, >> as there is still not available, Maya looks for a >> "maya2osg_export.mel" file in the scripts directories. When Maya >> founds it and loads it, the procedure is available and executed. From >> this moment, as the file is already loaded, all global procs in this >> file are available, but they were not if you haven't called >> "maya2osg_export" first. >> > > Ah, I see. So for this there is the userSetup.mel, I guess you didn't > get in touch with it till now. It gets executed at startup, and is, as > the name says, a way to customize maya. > This file doesn't exist by default, but only if one requires it. If it > exists, user settings should be appended to the command s which are > there already. > In our case, we could source all the scripts with it. A more elegant way > is to create a maya2osg_setup.mel ( will commit it soon ) and add the > command source maya2osg_setup.mel to userSetup.mel. Within > maya2osg_setup, we can source all the scripts, and maybe do some other > setup stuff if requied. With this the preview command would available. I don't want to force the user to edit/create its userSetup.mel if we can avoid it. Maybe it could be automatically done by the installation process, but I prefer the other option, one file for every "entry point" or procedure directly called by the user and they can source other "utility files" with the procs needed by them. > I must admit, that I like the fact that there is now a seperated > osgFileExportOptions.mel, which is sourced by Maya at plugin load. I > would like to keep this seperated, as there might be additional edits. A > preview field does not make sens, but the pre and post export commands do. I don't understand what you mean here. > Fine, unfortunatelly again not so much time for committing, as preaseure > is going on again. But its not so horrible like the last week any more. > I try to get all the discussed stuff checked in comming weekend. I will > also add more options to the polygon exporter. Btw, now that custom glsl > is supported, are you aware, that we can "paint" VertexAttributes with > Maya VertexColor tool ? I didn't realized that. Cool. Regards, -- Javier Taibo |
From: Peter W. <pp...@cg...> - 2011-05-29 19:49:08
|
Hi all, answering to my own post, as most of the stuff is implemented. > I would like to add an optionMenu to the preview command textfield, > which changes the behavior of the command field, with these options: > > Mel: > current behaviour > > Pyth: > corresponding Python script not done, don`t know if required at all, will implement on request. > Exec: > which would take an os command ( like "osgviewer --flags file" ) without > the need of "exec" infront of it > > Flag: > this would call osgpreview with flags entered inside the textfield, > overriding those hardcoded in the export script > > Edit: ( maybe ) > this would pop up a bigger window for editing text, in the case one of > the above needs more space Same as "Pyth" Javier, you might want to test the behavior of the new options. Have one suggestion to the preview command, that one should be able to pass the count of lights as argument. This would enable GL_Lights up to 8 or turn off GL_Lighting, if no light is present in the test scen. Silly me, was searching quite long for an error, because I couldn't see my content in the preview window. But I just had no Lights created. So with passing 0 lights to the preview command would eliminte such an issue. For the preview command I'm suggesting one more shelf Button, which does the preview based on the settings in the Export Window ( without it being opened of course ). The other preview shelf button should still have default behavior. What do you think ? The preview command an pre/post export mel have annotations that explain the usage of Variables, but you need to turn on Maya Options - Interface - Help - Popup Help - Tooltips. Think I should activate it when opening the UI, and restore window clos. Will do later. The Maya Export All / Selection Options Script has a Bug when cahnging the export file type, couldn't fix this, is on todo list. Polygon Options and Polygon and Export UI Wiki is the next, then, finally, skining. Here is my submission coomment, which explains some more. Export UI Tweaks: Added Flag to turn on/off overwrite confirm dialog Added "Browse Path" command to popup menu of filepath Merged Filename and Filetype into one textField and one optionMenu created optionMenu for preview mode - Off : original preview behavior - Mel : evaluates expected an mel command - Exec : executes expected system command - Flag : overwrites default flags of inbuilt preview command added Variables $tmp and $cam which are substituted with full temp filename and temp camera filename added annotations explaining behavior when hovering mouse pointer above textField ( Maya Option Tooltips must be enabled !!! ) added $full Variable to pre and post export commands and annotation added "clear" command popup menu to custom GLSL textFields Cheers, PP |
From: Javier T. <jav...@gm...> - 2011-05-30 18:17:37
|
Hi Peter, I found some errors when trying to select the files with custom GLSL code from the browser: // Error: Object 'maya2osgUI_vertDeclareFile' not found. // Error: Object 'maya2osgUI_vertComputeFile' not found. // Error: Object 'maya2osgUI_fragDeclareFile' not found. // Error: Object 'maya2osgUI_fragComputeFile' not found. I like how is being organized the UI. I think it is much cleaner and easy to use. Great work! On Sun, May 29, 2011 at 9:48 PM, Peter Wrobel <pp...@cg...> wrote: > Hi all, > > answering to my own post, as most of the stuff is implemented. >> I would like to add an optionMenu to the preview command textfield, >> which changes the behavior of the command field, with these options: >> >> Mel: >> current behaviour >> >> Pyth: >> corresponding Python script > > not done, don`t know if required at all, will implement on request. > >> Exec: >> which would take an os command ( like "osgviewer --flags file" ) without >> the need of "exec" infront of it >> >> Flag: >> this would call osgpreview with flags entered inside the textfield, >> overriding those hardcoded in the export script >> >> Edit: ( maybe ) >> this would pop up a bigger window for editing text, in the case one of >> the above needs more space > > Same as "Pyth" > > Javier, you might want to test the behavior of the new options. Have > one suggestion to the preview command, that one should be able to pass > the count of lights as argument. This would enable GL_Lights up to 8 or > turn off GL_Lighting, if no light is present in the test scen. Silly me, > was searching quite long for an error, because I couldn't see my content > in the preview window. But I just had no Lights created. So with passing > 0 lights to the preview command would eliminte such an issue. The scene lighting set and some other issues are on my to-do list. I'll address it as soon as I have time. I suppose that I will add an export option to set whether we are exporting a model or a whole scene (see the Global Uniforms section in https://sourceforge.net/apps/mediawiki/maya2osg/index.php?title=Shading_Networks#Global_uniforms). An additional option would be to include a default lighting set when previewing. I think that with these two options we solve the lighting problem. > For the preview command I'm suggesting one more shelf Button, which does > the preview based on the settings in the Export Window ( without it > being opened of course ). The other preview shelf button should still > have default behavior. > What do you think ? It is OK for me. By the way. Talking about adding new shelf buttons... It would be really nice if anybody with some artistic skills (that excludes me absolutely) offers to create a cool set of icons :D > The preview command an pre/post export mel have annotations that explain > the usage of Variables, but you need to turn on Maya Options - Interface > - Help - Popup Help - Tooltips. Think I should activate it when opening > the UI, and restore window clos. Will do later. I can see the tooltips with current version (revision 204). > The Maya Export All / Selection Options Script has a Bug when cahnging > the export file type, couldn't fix this, is on todo list. > > Polygon Options and Polygon and Export UI Wiki is the next, then, > finally, skining. Great! -- Javier Taibo |
From: Peter W. <pp...@cg...> - 2011-05-31 15:31:49
|
Hi Javier, all of the bellow has time if you are busy > I found some errors when trying to select the files with custom GLSL > code from the browser: > > // Error: Object 'maya2osgUI_vertDeclareFile' not found. > // Error: Object 'maya2osgUI_vertComputeFile' not found. > // Error: Object 'maya2osgUI_fragDeclareFile' not found. > // Error: Object 'maya2osgUI_fragComputeFile' not found. > Fixed. > I like how is being organized the UI. I think it is much cleaner and > easy to use. Great work! > Thanks, but most of it your ideas. I added those comments after the Checkboxes, but I don't know if we should keep them, they might be disturbing. What do you think ? >> Hi all, >> >> answering to my own post, as most of the stuff is implemented. >>> I would like to add an optionMenu to the preview command textfield, >>> which changes the behavior of the command field, with these options: >>> >>> Mel: >>> current behaviour >>> >>> Pyth: >>> corresponding Python script >> not done, don`t know if required at all, will implement on request. >> >>> Exec: >>> which would take an os command ( like "osgviewer --flags file" ) without >>> the need of "exec" infront of it >>> >>> Flag: >>> this would call osgpreview with flags entered inside the textfield, >>> overriding those hardcoded in the export script >>> >>> Edit: ( maybe ) >>> this would pop up a bigger window for editing text, in the case one of >>> the above needs more space >> Same as "Pyth" >> >> Javier, you might want to test the behavior of the new options. Have >> one suggestion to the preview command, that one should be able to pass >> the count of lights as argument. This would enable GL_Lights up to 8 or >> turn off GL_Lighting, if no light is present in the test scen. Silly me, >> was searching quite long for an error, because I couldn't see my content >> in the preview window. But I just had no Lights created. So with passing >> 0 lights to the preview command would eliminte such an issue. > The scene lighting set and some other issues are on my to-do list. > I'll address it as soon as I have time. I suppose that I will add an > export option to set whether we are exporting a model or a whole scene > (see the Global Uniforms section in > https://sourceforge.net/apps/mediawiki/maya2osg/index.php?title=Shading_Networks#Global_uniforms). Yes, verry good, that's is on my todo / wishlist as well, exporting seperatelly to Geodes or MatrixTransforms. > By the way. Talking about adding new shelf buttons... It would be > really nice if anybody with some artistic skills (that excludes me > absolutely) offers to create a cool set of icons :D > I know some Artists here, I can ask them, but this will take some time :-) I added more flags regarding geometry export, in Particular VertexColor and VertexAttributes. Might need some help with the Vertex Attribute export. The Color Sets in Maya have names, would be cool if this could be used as program -> addBindAttribLocation( "SetName" , location ) ; but at that time there is no programm, just the VertexAttributes. So I can create a Map between the SetNames and the Bind Locations, but where and how could we use it ? Adding new flags is kind of unconfortable, so one suggestion, but would need an OK from your site, as this might go quite deep. Check out new Thread. I also tried to align the flagNames in the Script with those in the plugIn. The Preview Command seems not to work with the default camera "persp", or I am doing something wrong. Can you confirm that its working with the current UI implementation, and/or your preview procedure in maya2osg_preview.mel ? Btw, would it be possible to get the osgpreview flags work without "" ? Like --screen 0 instead of "--screen" 0 ? Readpreview.cpp but have no clue ... Cheers, PP |