[Maya2osg-users] Add osg::Switch support to Maya2Osg
Status: Alpha
Brought to you by:
jtaibo
From: BOYREL D. <dav...@ok...> - 2014-11-14 16:07:49
|
Hello people, My name is David Boyrel from Oktal company. We develop a driving simulation software (SCANeR Studio), which visual application is based on OSG. You can find some (old) images on the OSG website : http://www.openscenegraph.org/index.php/gallery?AG_MK=0&AG_form_paginInitPages_1=1&AG_form_albumInitFolders_1=Screenshots/SCANeRII&AG_form_scrollTop=456&AG_form_scrollLeft=0&AG_MK=0 I am currently testing maya2osg in order to provide to some of our customers a way to export their database and vehicle production from Maya to our simulation software. For now, they use the OpenFlight exporter. Maya2osg seems to be more flexible. In order to add some logical informations into the scene graph, I'm currently searching a way to add osg::Switch support to maya2osg. Since I'm not very familiar with both Maya modeler and Maya API, I thought about 3 ways to do this. But I'm not sure if these methods are correct. Here are my thoughts : 1. Adding to the plugin a new custom DAG node, and to the exporter shelf a command to create this kind of node, as a child of the currently selected node. I managed to do this by creating a custom node that inherits MPxTransform. This node will become an osg::Switch when exported by maya2osg. However, I understood DAG nodes are only Transforms or Shapes. So my new DAG node does not seem to fit the Maya approach. And I would have to convert this node to an osg::Switch above an osg::MatrixTransform. 2. Adding to the plugin a new custom node (not a DAG node), and to the exporter shelf a command to create this kind of node. This new type of node will have an output attribute (maybe a table, I don't know if its possible), that could be plugged to a DAG node "visibility" attribute. So this new node will not be a DAG node, and so will not have any parent or children. I feel this is more the "Maya way" to give to maya users the ability to create switches. 3. Just adding a custom attribute to maya nodes. I saw the maya2osg exporter writes custom attributes to the OSG nodes description. I could then use a traverser to find the nodes having the switch attribute description, and then modify the scene graph to insert a Switch above the node. But adding a custom attribute in Maya does not seem to be very intuitive. I do not know Maya and its API very well, so maybe I'm totally wrong. So if you could please tell me what you think about this, or how would you do this, I would be grateful. My hope is to submit this development to maya2osg. That's why I tell you about this. Regards, -- David BOYREL OKTAL Paris 19 Bd des Nations Unies - 92190 Meudon (France) Tél. : +33 (0)1 46 94 93 52 Fax : +33 (0)1 41 41 91 44 http://www.oktal.fr |