The LFA Scene Manager for MAYA

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

About your new fix convert to mesh script..the fact it does not work :(..
You can check with my scene I have uploaded above to test: There are 386 object to export, we get 386 .XML but never get enough .MESH, usually less than 350 .MESH at the first export

Bringer of Darkness
Halfling
Posts: 98
Joined: Thu May 05, 2005 3:57 pm

Post by Bringer of Darkness »

Apparently, true...
I have tested it on my scene (250 objects), did not work correctly. Now it works fine after a few minor adjustments, though not tested it on larger scenes, the problem might come back in some larger scenes - I suppose this has something to do with .bat files limitations (either in # of commands that can be run via bat file or in size).
Anyway, here is corrected one, please check if it makes troubles with your scene also. Both procedures needs to be replaced...
--------------------------------------------------------------------------

Corrected below...
Last edited by Bringer of Darkness on Mon Aug 08, 2005 6:23 pm, edited 1 time in total.

User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

Oops, the mel run fine :)... I could get 386 MESH now and the way the console run is better :)
-----
However, your procedural is re-write and have a lot of weird thing...
First, can not export .anim :)

Code: Select all

if (`getAttr ($theObject +".anim")` != "NULL") 
{$options += " -skel \"" + encodeString(toNativePath($outputDir+$skeletonFile)) + "\" -anims;";} 
and another thing I must leave out

Code: Select all

if (!`getAttr ($theObject +".shadows")`) //if true compute edges (-e flag means to NOT compute them) 
-----------
and it export each .material file for each MESH
-----------
So :)...it will be better if you just find you hack mod for this problem :)...not the whole procedural :)...
----------
Could you plz post your hack mod...
--------
@metaldev: could you combine all these stuff in a new version of LFA_scenemanager...

Bringer of Darkness
Halfling
Posts: 98
Joined: Thu May 05, 2005 3:57 pm

Post by Bringer of Darkness »

Mhm, I have no idea how the structure of the functions was before.
You are right, these parts have been adapted to our specific functionality...
No way it can work for you of course :P , what a surprise....
But I really cannot say how to modify original procedures to work well. If you put here the original procedures, I can make changes to work it fine this way and place it back to you...
I simply don't know what is the difference with the previous version, sorry... I just do remember that instead of parallel processing files I created a serial flow, if this helps... 8)

User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

Althogh I have manage to make your script run fine with current LFA export. But I think we should keep it original construct for future update :)
-------
Origial Proc exportGeometry

Code: Select all

global proc LFA_exportGeometry(string $theNodes[])
	{
//	checkAllDuplicateEntityNames;
	
	if (`size($theNodes)` == 0) {error "No objects to export.";}
	string $keepTrackOfExportedMeshes[]; //respect instances
	string $currentNode;
	int $exportNum = 0;
	int $instances = 0;
	
	print "\n\nExporting:\n\n";
	
	for ($currentNode in $theNodes)
		{		
		if (`exportable $currentNode`)
			{
			string $type = "null";
			string $shapeName[] = `listRelatives -s -f $currentNode`;
			if (`size($shapeName)` != 0) {$type = `objectType $shapeName[0]`;}
			if ($type == "mesh")
				{
				 
				string $meshToUse[1] = {`returnInstanceOrig $currentNode`};
				$alreadyExported = 0;
				
				for ($anExportedMesh in $keepTrackOfExportedMeshes) //check for an already exported mesh
					{
					if ($anExportedMesh == $meshToUse[0]) 
						$alreadyExported = 1;
					}

				if ($alreadyExported == 0)
					{
					$exportNum ++;
					$keepTrackOfExportedMeshes = `stringArrayCatenate $keepTrackOfExportedMeshes $meshToUse`;
					exportMeshWithOGRE $currentNode;
					}
				else
					{$instances++;}
				}							
			}				
		}
	//print "here\n";
	//print $keepTrackOfExportedMeshes;
	print "done.\n";
	if ($instances != 0) print ($instances+" instances detected.\n");
	print ($exportNum+" meshes exported.");
	if ($exportNum == 0){warning "No objects were exported.";}
	}
	
----------
and Ogrinal of exportMeshWithOGRE

Code: Select all

global proc exportMeshWithOGRE(string $theObject)
	{
	//Here unfortunately, the first thing i have to do is to close the native ogre export window
	//because the actual ogre exporter doesn't get all its info passed through by arguments,
	//it gets some of them by querying the native interface... so i have to shut down
	//the native exporter window to make sure it gets empty rather than erroneous values.
	//this is also why you get some errors printed in the script editor during export...
	//i suppose we can disregard those.
	
	if (`window -exists OgreExportWindow`){deleteUI OgreExportWindow;}
	
	/*
	-duplicate object
	-delete any children
	-lock translate, rotate,scale
	-parent to world
	-unlock transforms
	-move to Origin
	-zero out rotations 
	-make scales = 1
	-triangulate
	-delete history
	-export
	-delete
	*/
	
	//make and prepare duplicate of the tagged object for export... the duplicate is what actually gets exported after a few changes.
	
	string $theDuplicate[1] = `duplicate -rr $theObject`;
	string $children[1] =  `listRelatives -f -type "transform" $theDuplicate[0]`;
	if (`size($children)` > 0 ){delete $children;}
	setAttr -lock 1 ($theDuplicate[0] +".t"); 
	setAttr -lock 1 ($theDuplicate[0] +".r"); 
	setAttr -lock 1 ($theDuplicate[0] +".s");
	string $parents[1] = `listRelatives -p $theDuplicate[0]`;
	if (`size($parents)` > 0 ){parent -world $theDuplicate[0];}
	setAttr -lock 0 ($theDuplicate[0] +".t"); 
	setAttr -lock 0 ($theDuplicate[0] +".r"); 
	setAttr -lock 0 ($theDuplicate[0] +".s");
	LFA_resetTransformations $theDuplicate;
	setAttr ($theDuplicate[0] +".t") 0 0 0; 
	setAttr ($theDuplicate[0] +".r") 0 0 0; 
	setAttr ($theDuplicate[0] +".s") 1 1 1;
	polyTriangulate -ch 0 $theDuplicate[0];
	select -cl;
	delete -ch $theDuplicate[0];
	select $theDuplicate[0];
	//done preparing export object.

	
	string $outputDir = (`parseDirectoryField`+ "/");
	string $meshFile = `getAttr ($theObject +".exportName")`;
	string $meshXML = ($meshFile + ".xml");
	string $materialFile = ($meshFile + ".material");
	string $meshBinFile = ($meshFile + ".mesh");
	string $options = " -sel -mesh";
	
		// Mesh export options
	$options += " \"" + encodeString(toNativePath($outputDir+$meshXML)) + "\"";

	if (`getAttr ($theObject+".exportColors")`) 
		{$options += " -c";}
	
	if (`getAttr ($theObject+".exportNormals")`)
		{$options += " -n";}

	if (`getAttr ($theObject+".exportUV")`)
		{$options += " -t";} 
	
		//  Export
	print ("ogreExport" + $options + ";\n");
	eval ("ogreExport" + $options);
	
		// Create binary files
	string $commands;
	$commands += "set path=" + toNativePath(`internalVar -userScriptDir`) + ";%path%" + "\n";
	
	$commands += "OgreXMLConverter ";
	if (!`getAttr ($theObject +".exportShadows")`) //if true compute edges (-e flag means to NOT compute them) 
		$commands += "-e ";
	if (`getAttr ($theObject +".exportTangentVectors")`)
		$commands += "-t ";
	
	$commands += "\"" + toNativePath($outputDir+$meshXML) + "\" \"" + toNativePath($outputDir+$meshBinFile) + "\"\n";

	string $commandFile = `internalVar -userScriptDir` + "maya2ogre_mel.bat";
	$fileID = `fopen $commandFile "w"`;
	fprint $fileID $commands;
	fclose $fileID;

	system("start \"" + `toNativePath $commandFile` + "\"");  //run binary converter
	
	select -cl;
	print ("Exported "+$theObject+"  (entity name: "+`getAttr ($theObject+".exportName")`+")\n");
	delete $theDuplicate[0];
	}
	

Bringer of Darkness
Halfling
Posts: 98
Joined: Thu May 05, 2005 3:57 pm

Post by Bringer of Darkness »

So, I hope it will work fine - I cannot test it, so no guarantees;-)):
--------------------------------------------------------------------------
global proc LFA_exportGeometry(string $theNodes[])
{
// checkAllDuplicateEntityNames;

if (`size($theNodes)` == 0) {error "No objects to export.";}
string $keepTrackOfExportedMeshes[]; //respect instances
string $currentNode;
int $exportNum = 0;
int $instances = 0;

print "\n\nExporting:\n\n";
string $commandFile = `internalVar -userScriptDir` + "maya2ogre_mel.bat";
$fileID = `fopen $commandFile "w"`;
string $commands;
$commands += "set path=" + toNativePath(`internalVar -userScriptDir`) + ";%path%" + "\n";
fprint $fileID $commands;
fclose $fileID;

for ($currentNode in $theNodes)
{
if (`exportable $currentNode`)
{
string $type = "null";
string $shapeName[] = `listRelatives -s -f $currentNode`;
if (`size($shapeName)` != 0) {$type = `objectType $shapeName[0]`;}
if ($type == "mesh")
{

string $meshToUse[1] = {`returnInstanceOrig $currentNode`};
$alreadyExported = 0;

for ($anExportedMesh in $keepTrackOfExportedMeshes) //check for an already exported mesh
{
if ($anExportedMesh == $meshToUse[0])
$alreadyExported = 1;
}

if ($alreadyExported == 0)
{
$exportNum ++;
$keepTrackOfExportedMeshes = `stringArrayCatenate $keepTrackOfExportedMeshes $meshToUse`;
exportMeshWithOGRE $currentNode;
}
else
{$instances++;}
}
}
}
string $commandFile = `internalVar -userScriptDir` + "maya2ogre_mel.bat";
system("start \"" + `toNativePath $commandFile` + "\""); //run binary converter

print "done.\n";
if ($instances != 0) print ($instances+" instances detected.\n");
print ($exportNum+" meshes exported.");
if ($exportNum == 0){warning "No objects were exported.";}
}
-------------------------------------------------------------------------
global proc exportMeshWithOGRE(string $theObject)
{
//Here unfortunately, the first thing i have to do is to close the native ogre export window
//because the actual ogre exporter doesn't get all its info passed through by arguments,
//it gets some of them by querying the native interface... so i have to shut down
//the native exporter window to make sure it gets empty rather than erroneous values.
//this is also why you get some errors printed in the script editor during export...
//i suppose we can disregard those.

if (`window -exists OgreExportWindow`){deleteUI OgreExportWindow;}

/*
-duplicate object
-delete any children
-lock translate, rotate,scale
-parent to world
-unlock transforms
-move to Origin
-zero out rotations
-make scales = 1
-triangulate
-delete history
-export
-delete
*/

//make and prepare duplicate of the tagged object for export... the duplicate is what actually gets exported after a few changes.

string $theDuplicate[1] = `duplicate -rr $theObject`;
string $children[1] = `listRelatives -f -type "transform" $theDuplicate[0]`;
if (`size($children)` > 0 ){delete $children;}
setAttr -lock 1 ($theDuplicate[0] +".t");
setAttr -lock 1 ($theDuplicate[0] +".r");
setAttr -lock 1 ($theDuplicate[0] +".s");
string $parents[1] = `listRelatives -p $theDuplicate[0]`;
if (`size($parents)` > 0 ){parent -world $theDuplicate[0];}
setAttr -lock 0 ($theDuplicate[0] +".t");
setAttr -lock 0 ($theDuplicate[0] +".r");
setAttr -lock 0 ($theDuplicate[0] +".s");
LFA_resetTransformations $theDuplicate;
setAttr ($theDuplicate[0] +".t") 0 0 0;
setAttr ($theDuplicate[0] +".r") 0 0 0;
setAttr ($theDuplicate[0] +".s") 1 1 1;
polyTriangulate -ch 0 $theDuplicate[0];
select -cl;
delete -ch $theDuplicate[0];
select $theDuplicate[0];
//done preparing export object.


string $outputDir = (`parseDirectoryField`+ "/");
string $meshFile = `getAttr ($theObject +".exportName")`;
string $meshXML = ($meshFile + ".xml");
string $materialFile = ($meshFile + ".material");
string $meshBinFile = ($meshFile + ".mesh");
string $options = " -sel -mesh";

// Mesh export options
$options += " \"" + encodeString(toNativePath($outputDir+$meshXML)) + "\"";

if (`getAttr ($theObject+".exportColors")`)
{$options += " -c";}

if (`getAttr ($theObject+".exportNormals")`)
{$options += " -n";}

if (`getAttr ($theObject+".exportUV")`)
{$options += " -t";}

// Export
print ("ogreExport" + $options + ";\n");
eval ("ogreExport" + $options);

// Create binary files
string $commands;

$commands += "OgreXMLConverter ";
if (!`getAttr ($theObject +".exportShadows")`) //if true compute edges (-e flag means to NOT compute them)
$commands += "-e ";
if (`getAttr ($theObject +".exportTangentVectors")`)
$commands += "-t ";

$commands += "\"" + toNativePath($outputDir+$meshXML) + "\" \"" + toNativePath($outputDir+$meshBinFile) + "\"\n";

string $commandFile = `internalVar -userScriptDir` + "maya2ogre_mel.bat";
$fileID = `fopen $commandFile "a"`;
fprint $fileID $commands;
fclose $fileID;

select -cl;
print ("Exported "+$theObject+" (entity name: "+`getAttr ($theObject+".exportName")`+")\n");
delete $theDuplicate[0];
}

User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

Great, It run and I got 386 MESH...And the exportable option is the same...
---
So, we only have three problem left
  • 1. Duplicate instance group: i have test but seem the theory about transform node was wrong :(..a new node under transform node created and re-have the name of the node of its original node...so duplicate name happen.
    I find a way of a function duplicate that work :)..so could you add this duplicate function to the exporter
    • - Select all child of group
      - Duplicate them as instance
      - Group these new instance and use the name of previous group + number :)
    Surely this is not the method for complicated hiearchery of group and just allow duplicate one group/time

    2. Reset transform for child node
    3. Fix function Fix Duplicate name for lagre scene with tons of object..maya crash when run it... A check box to do this thing when export scene is neccessary too :)
---
@metaldev: could you upgrade these mel and make a new version :). Moreover, I want to ask if current version (1.1) have included skeleton and animation export ...
----
@Bringer of Darkness: Amazing when you have customize this mel a lot...A lot of stuff in the export export parameter: object type, .anim, Could you share your idea about export type for mesh in maya to use in Ogre ?

User avatar
metaldev
Orc Shaman
Posts: 761
Joined: Thu Mar 17, 2005 11:56 pm
Location: Boston
x 12
Contact:

Post by metaldev »

hey guys,

ill have to look at the mel you guys have posted here closely before including stuff...

as far as the maya renaming and objectFOO problem... i am familiar with that but i did not use the maya names because maya allows duplicate names if the objects are under different heirarchies. Something i can't allow because it could cause unpredictable results in our applications. Ill try to find a more elegant solution in the next version... its probably crashing now because your names are exceeding the size that a string can hold (being that you have hundreds of objects)

@bringer of darkness---
could you point out what you changed in the exporting scripts above? so i can see how you fixed the bug where it still doesnt convert all .xml to .mesh




in reference to the other problems:

duplicate instance group
this is really something that is handled in and by maya, i cant see how i could really help you with that one practically through the scene manager... you just have to do like you said maxxoros... select the objects inside the group, instance, group, then parent to world :? so i dont think im going to make any changes to the scene manager as far as this problem.

reset transform for child
ha, this is actually a safety check i put in... sorry but i did it on purpose... when you reset transforms on a child of a parent or grandparent that has bad transforms, resetting the transforms can yield incorrect results... also locked transforms on parents can be problematic... so i simply make you parent your object to world first, so you can KNOW that when you run that script, your transforms will be good. sorry, this one stays.

exporting animations/skeletons
i would like to support this stuff in the future ... but i really have to spend some time on how to handle that properly... it will be a while probably till i get around to implementing these. so for now you will just have to keep using the native ogre exporter for these things.
@bringer of darkness: i would like to see how you included this one


tip for everyone:
386 different meshes in one scene seems like a lot... if your scene has objects that are exactly the same except rotation/ position/ scale you should be using instances.

@maxxoros--
the thing that is taking a long time before you export is the fixdupulicateentitynames script... it has to check every object against every other object before exporting... and since you have tons and tons of objects... its a lot of checking. if you turn it off though you run the risk of having entities with duplicate names. Also, a workaround for now around the FOO issue is to HARD delete parameters for everything.... parent everything to world or 1 group and then use multiple make exportable... then your maya names will be used, with no duplicates.

so i have added to my list:
-fix naming FOOFOOFOO too long issue
-fix bug where not everything gets converted to .mesh
-add support for anim and skeletons

User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

@metaldev: You should let check the reset name function of bringer of Darkness, It prevent not only dupicate name, but also auto rename, prevent us change name to the existing name :)...
----------
And also check for checkduplicatename function problem in large scene...I myself call it a bug because it really crash, not only slow (4h waiting before I decide to ternminate maya :( with a scene about 1000 object :) (It is a real city so that the number of object is acceptable)
-----------
About duplicate instance group, I just want us to create a new function for it... So anyone new can use this function, not by an old and take time way (select, duplicate, group, make exportable :( )...and if we are making a lagre scene, this take down time a lot and make the work less boring (for example I must duplicate instance 300 time tree group :(...oops...nearly die with this work flow :) )

User avatar
metaldev
Orc Shaman
Posts: 761
Joined: Thu Mar 17, 2005 11:56 pm
Location: Boston
x 12
Contact:

Post by metaldev »

ok, ill see if i can find solutions to those problems in the next version.

Bringer of Darkness
Halfling
Posts: 98
Joined: Thu May 05, 2005 3:57 pm

Post by Bringer of Darkness »

@metaldev

1. I created only one .bat file for conversion of the exported files which runs when all objects are exported. When you start .bat file for each object, sometimes the order is not correct and you overwrite .bat file before it is correctly executed.
2. 300 objects is a small scene, I expect to have several thousands of objects in most of scenes, so manager needs to correctly take care of all...
3. Yes, you are right that Maya enables the same names under different hierarchies. But I think it is easy to avoid that in the most of the cases - anyway I am not sure if grouping and using transform hierarchies is a very good idea, it sometimes messes the transformations data and objects are simply not where they supposed to be.
In fact I think the using Maya name convention solves 99% of the issues, 1% is not solved (if same names under different hierarchies) - these can either be taken care manualy (if you have problem with export, or rename it in script - a simple if-else statement would make it :D ).
I had the different solution implemented (script renaming objects with numbers), but I found using Maya names much more elegant and practical - it is much better to have the same names applied in Maya and engine...
Or maybe the solution can be - rename it according to Maya, run check for duplicate names once, in case duplicated names are detected even after "name synchronization with Maya", throw out warning with the detected duplicated names that needs to be taken care of by level designer...
4. In fact there is sometimes something wrong with the duplicating objects - it refers incorrect meshes. But this I haven't figured out what is the problem...

@maxxoros

My idea is very simple - I use generic definition file, that looks something like:
--------------------------------------------------------------------------

//
//First value shows the object attribute is applied to; global applies to all objects
//possible values are: locator, light, ambientLight, pointLight, mesh, spotLight, directionalLight, global, nurbsCurve
//
//Second value presents type of the value - possible values: boolean, string, integer, float, RGB (double3)
//
//third is the name of the attribute - ONE WORD
//
//fourth value shows up the default attribute value
//
//fifth values sets up whether it is exportable, non-exportable or virtual (exportable, existing attribute)
//
//------------------------------------------------------------------------------------------------------
//first variable is always the export flag - if it is exported or not; AND MUST BE GLOBAL AND DEFAULT VALUE 1
//
global bool exportLFA 1 non-exportable
//
//second attribute is the entity export name
//
global string exportName defaultName
mesh bool hidden 0 exportable
mesh bool collision 0 exportable
mesh bool shadows 0 exportable
mesh bool isTerrain 0 exportable
mesh bool isSolid 0 exportable
//
//I recommend these attributes to remain unchanged as it may affect mesh export functionality
//
mesh bool exportColors 0 non-exportable
mesh bool exportNormals 1 non-exportable
mesh bool exportUV 1 non-exportable
mesh bool exportMaterials 1 non-exportable
mesh bool exportTangentVectors 0 non-exportable
//Decides whether to use the values from channel box, or calculate own correct ones...
global bool useChannelValues 0 non-exportable
//
//The rest can be customized according to your needs...
//
mesh string anim NULL exportable
mesh float AnimationSpeed 0 exportable
mesh int AnimationType 0 exportable
mesh bool hideable 0 exportable
locator bool particleSystem 0 non-exportable
particle_locator string particleSystemName ps_name exportable
pointLight bool displayRange 0 non-exportable
pointLight float range 10 exportable
light RGB color 1 virtual
light float lightColorA 0 exportable
light RGB lightSpecular 1 exportable
light float lightSpecA 0 exportable
-------------------------------------------------------------------------------
I pick all attributes from this file, when I need to add any attribute (actualy there will be a plenty of them needed, like if there is character, character orientation, referenced character file, etc....) I simply write one line to the definition file and a new attribute is added to the objects I need....
So far it works well :P
But it means, you will need to have the engine programmer that can handle input you give him, no generic .scene files....

User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

@Bringer of Darkness
Thanks
---
I wonder with maya mel, we could make the option for user to create theire own option with export...and include terrain export for maya...if this could happen, we should change the name LFA_SceneManager to Ogre level Toolkit for Maya :)

Bringer of Darkness
Halfling
Posts: 98
Joined: Thu May 05, 2005 3:57 pm

Post by Bringer of Darkness »

Hmm, I think the above mentioned def file enables users to create their own export parameters, right? :lol:
I am not sure what terrain export do you mean? I have the option "isTerrain", once clicked, it behave as terrain...

User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

@Bringer of Darkness: The fact that I want to customize with a GUI, not with code ...uhm...It seem a plugin will do it...could mel add information to its self and reload ???
-------
yeap,... nowaday...terrain seems difficult with theory about heightmap, Paging scene...so confuse and programer made us feel that these thing MUST be done in coding and we can not see the terrain we want in a 3D program like Max or Maya
---
however, this is the concept for making terrain in Maya, Max and get terrain as we want http://www.ogre3d.org/wiki/index.php/3dsmax_Heightmaps
THis tutorial I myseft think it lost two last step: set UV channel in Max(or we call UV set in Maya) and Render to texture with the UV set we want...so, get the heightmap
You can try this thing with a lambert connect to ram and set UV for object for the lowest is black and highest is white :)
-----------
So...because we can make terrain by hand in maya...No reason we can not automatic generate not only heightmap.bmp, buts also terrain.cfg :)...and develop for more complex terrain type like Paging scene
-------------
Another thing that I want to add in toolkit is FORCE maya must generate lightmap...The fact that there are an ogreaddons name ogre OgreFSRad for .scene
http://www.horza.de/OgreFSRad.shtml
But I still can not test how it work..so no idea how to connect it to toolkit
-------------
And we can add some misc thing to the tool:
align object, show poly, x-ray view, so 1 side model or 2 side (for checking the normal vector)..ect ...I have had script for all of this we can made the combo easy
-------------
And how about something we call object brush..You know, for example in Warcraft editor, we can press on object in a tool and put it on the map. Look at this...this tool (also in mel) can do that...Simply press on the icon and we can place object on scene :)
Image
However, it import the whole object and this seem problem...The rule of leveling must use reference so that if we change the original model (mean the brush), the total scene will be update.
-------------
From the concept of "BRUSH", We could make a tons of thing...For example, I want to say about automatic generate brush..., I want this area will have a lot of tree and place them,re-scale each object to make it naturally...With this function, we will create a DUMMY object and make it the surface for generate brush with the rule there are only one reference and others are instance (for update and exporting purpose :))
-----------
Is it enough for a Ogre level Toolkit for maya
---------
I know this seem large thing...but check this..except the lightmap...seem everything could be solved easily by mel :) (I will start learning mel soon, not only read them like today :roll: )

Bringer of Darkness
Halfling
Posts: 98
Joined: Thu May 05, 2005 3:57 pm

Post by Bringer of Darkness »

It shouldn't be any problem to add GUI to create the code I guess, but it is quite wasting time right now, there are plenty of other more important issues deserving our attentions;) I am not compatible with metaldevs plug anyway.
I am already creating GUI according to the properties, so creating something like level tools shouldn't be any significant roblem also.

User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

Okie, so each of us have each way to develop tool kit... :)
---
But there are two thing I think we still connect in this Exporter :D
---
1. Export terrain
2. Lightmap solution for .scene export

User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

Got how to made lightmap in maya for using in Ogre :)
-----
http://www.ogre3d.org/phpBB2/viewtopic.php?t=11997
the bottom answer of gattu_marrudu
and
http://www.ogre3d.org/phpBB2/viewtopic.php?t=12613
The answer of Falk
=====
So...Export lightmaps with .material for lightmap should be included in the Exporter?
--------
By the way, I have test OgreFSRad, it crash when reading .SCENE...seem it is too old (2003) to read .scene (it is different with format in 2003 now).......

User avatar
metaldev
Orc Shaman
Posts: 761
Joined: Thu Mar 17, 2005 11:56 pm
Location: Boston
x 12
Contact:

Post by metaldev »

maxxoros,

thank you for the information, but i already told you that generating lightmaps is unrelated and too specific a function to be supported natively by the scene manager. Same goes for your 'object brush' post, all that stuff is too specific (those are all things that many people don't need). If you want that stuff handled you can add it yourself... that is the purpose of the custom scripts section i put into the UI and the LFA_sceneManagerCustomScripts.mel file. i would like to politely ask you to please stop posting off-topic stuff here because you are flooding this topic ok ? :? just start new topics about creating lightmaps and about any other things you would like to talk about. Doing this will also make it easier for other interested people to find the information you are providing because it wont be buried in this topic.

User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

Okie, sorry 4 disturb....I will start a new thing :)
----
However,how about export terrain...?

User avatar
metaldev
Orc Shaman
Posts: 761
Joined: Thu Mar 17, 2005 11:56 pm
Location: Boston
x 12
Contact:

Post by metaldev »

as far as i know, there is currently no support for exporting "terrain" from maya:
http://www.ogre3d.org/wiki/index.php/As ... generation


however, i have already included a way to incorporate terrain exported from other programs into your maya .scene by using the 'environment settings' tool i provided.


so until then, i think this is all i can do for us about that :?

User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

export terrain from maya is not so difficult and it really will make the exporter a perfect exporter
----
The way to make them is easy...maybe I will add these code myself :)

User avatar
metaldev
Orc Shaman
Posts: 761
Joined: Thu Mar 17, 2005 11:56 pm
Location: Boston
x 12
Contact:

Post by metaldev »

:) go for it!

Bringer of Darkness
Halfling
Posts: 98
Joined: Thu May 05, 2005 3:57 pm

Post by Bringer of Darkness »

@metaldev
I have about two qustions :) , maybe you may have come out already with some ideas how is that working and why...

1. Why is it, that we have to duplicate object, move it to centre, etc... before exporting it with Ogre?
2. Is there any way how to export skeleton and appropriate animations via mel? So far I haven't found a notice in scripts, it seems to me that the settings data are being taken directly by plugin and not ran by mel script...

User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

@Bringer of Darkness: The reason we must duplicate object, move it to centre ... because of the rule of .scene... mesh file define in .scene must be in scale =1,1,1 and transform = 0,0,0, rotate = 0,0,0...so .scene will tell us where they are, their rotation and scale :)

User avatar
metaldev
Orc Shaman
Posts: 761
Joined: Thu Mar 17, 2005 11:56 pm
Location: Boston
x 12
Contact:

Post by metaldev »

question 1:
maxxoros is basically correct,

the .mesh files define absolute orientation ,rotation, and position... while the .scene defines relative (offset) position to other objects and the world.

Thats how the engine is able to figure out where and how to draw an object that is parented to 10 other objects. It adds each offset to the accumulated offset of the node above it... but add offset from what?... to the absolute postition of the object in the world. :P

question 2:

i believe it is possible. i was planning on adding that functionality to the scene manager within a couple of months. The way that i planned to approach it is by calling functions from the native ogre exporter that was built with the Maya api. I haven't even tried exporting skeletons from maya yet so i dont know the process very thoroughly ...but to export with mel alone i think it would still be possible, although difficult, and you would have to learn very well the .anim file structure.

if you are asking about specific mel commands... i would start by checking out the following:
  • keyframe -q
    rotationInterpolation
but of course that is just the beggining, i would have to really dig in there before i could get you some serious answers.

Post Reply