[osg-users] OSGExp custom preview

2011-06-16 Thread Jean-Sébastien Guay

Hello,

I would like to be able to use a custom command to preview what is being 
/ has been exported by OSGExp. The toolbar contains an Export and 
Preview button, but would it be possible to specify a custom command in 
the options? That way I could preview objects in a lite version of our 
engine and show artists exactly how it will look once in the actual 
simulator.


Comments / objections? I can do the actual work, just asking if you're 
ok with this. Also, I have no idea *how* to do this (I've not poked in 
the plugin code much yet), so any hints of where to put the field and 
what I'll need to change would be appreciated.


Thanks in advance,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSGExp custom preview

2011-06-16 Thread Farshid Lashkari
Hi Jean-Sebastien,

I would like to be able to use a custom command to preview what is being /
 has been exported by OSGExp. The toolbar contains an Export and Preview
 button, but would it be possible to specify a custom command in the options?
 That way I could preview objects in a lite version of our engine and show
 artists exactly how it will look once in the actual simulator.


I'm pretty sure MAXScript supports automating the export process and
executing arbitrary shell commands. You could write a script that exports
the model to the temp folder and then passes the model to your application.
I've never actually done this myself, but I'd be interested to see this
working. Our artist here has dabbled with MAXScript before, so I can ask him
for help if you run into any problems. This is probably the best way to go,
since it does not require any custom modifications to the actual plugin.

Cheers,
Farshid
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSGExp custom preview

2011-06-16 Thread Jean-Sébastien Guay

Hi Farshid,


I'm pretty sure MAXScript supports automating the export process and
executing arbitrary shell commands. You could write a script that
exports the model to the temp folder and then passes the model to your
application. I've never actually done this myself, but I'd be interested
to see this working. Our artist here has dabbled with MAXScript before,
so I can ask him for help if you run into any problems. This is probably
the best way to go, since it does not require any custom modifications
to the actual plugin.


Agreed, though I was hoping to do it in the plugin mainly because I'm 
infinitely more familiar with C++ than with MaxScript (anything divided 
by 0 gives infinity right?) :-)


But I guess that has to change someday, as I've been learning MEL 
(Maya's scripting language) lately too, so MaxScript is next I guess. 
I'll have a look at how I could get this done.


Thanks,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSGExp custom preview

2011-06-16 Thread Farshid Lashkari
Hi Jean-Sébastien Guay,

On Thu, Jun 16, 2011 at 11:29 AM, Jean-Sébastien Guay 
jean-sebastien.g...@cm-labs.com wrote:

 Agreed, though I was hoping to do it in the plugin mainly because I'm
 infinitely more familiar with C++ than with MaxScript (anything divided by 0
 gives infinity right?) :-)

 But I guess that has to change someday, as I've been learning MEL (Maya's
 scripting language) lately too, so MaxScript is next I guess. I'll have a
 look at how I could get this done.


With help from my artist I was able to come up with a MAXScript that
automatically exports the scene and opens the model with a custom
application. Follow these steps:

- Download the attached MAXScript file and open in a text editor
- Change the value of the filename and application variables to the file
you want to export to and the application you want to open with
- In Max select MAXScript - Run Script... from the menu
- Select the download script file in the file explorer
- Right-click on the empty toolbar area and select Customize
- In the Category drop-down menu select Scripts
- There should be an action item called Export to OpenSceneGraph format and
preview
- Click and drag the item onto the toolbar
- Now you can click the button to automatically export and preview the
current scene

Let me know if you have any problems or improvements. I think this is a
useful script and will probably include it with the next release.

Cheers,
Farshid


OSGExportPreview.ms
Description: Troff MS-macros document
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSGExp custom preview

2011-06-16 Thread Jean-Sébastien Guay

Hi Farshid,


With help from my artist I was able to come up with a MAXScript that
automatically exports the scene and opens the model with a custom
application.


Wow, that was quick! And I can probably start learning from this very 
script to adapt it to our needs. Thanks a lot! I'll let you know how it 
goes.


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSGExp custom preview

2011-06-16 Thread Jean-Sébastien Guay

Hi again,


With help from my artist I was able to come up with a MAXScript that
automatically exports the scene and opens the model with a custom
application.


I've tried to modify the script to export to the current project's 
export folder. It doesn't seem to export anything. So I tried testing 
with a simple script, like so:


filename = pathConfig.getCurrentProjectFolder() + \\export\\test.osg
print filename
exportfile filename #noPrompt

The output I get from this (in the MaxScript listener) is:

C:\Users\jeang\Documents\3dsMax\export\test.osg
C:\Users\jeang\Documents\3dsMax\export\test.osg
C:\Users\jeang\Documents\3dsMax\export\test.osg
true

Why does it print my variable 3 times? I assume the true is the return 
value from exportfile? And (most importantly) why is there no test.osg 
in the directory above?


Thanks in advance,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSGExp custom preview

2011-06-16 Thread Jean-Sébastien Guay

Hi Farshid,


Why does it print my variable 3 times? I assume the true is the return
value from exportfile? And (most importantly) why is there no test.osg
in the directory above?


Argh, sorry, for some reason I had unchecked Save file in the export 
options...


All is well once again with the world. ;-)

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org