Re: [Maya2osg-users] Add osg::Switch support to Maya2Osg
Status: Alpha
Brought to you by:
jtaibo
From: Javier T. <jav...@gm...> - 2014-11-18 21:01:38
|
Hi David, Create custom Maya nodes is a bit overkill for what you want, if I am understanding it correctly what you are trying to do. I suppose all you need to do is check for the "script" attribute(s) and create a osg::Switch when present or an osg::Transform otherwise. It seems a light modification to the exporter, and should not break anything, so I would be happy to add it to the trunk. Send me the modified file(s) and I will review and commit them. Just follow the OSG submission rules (whole files, not patches). Thank you! Regards, On Tue, Nov 18, 2014 at 10:05 AM, BOYREL David <dav...@ok...> wrote: > Hi Javier, > > > Thank you very much for your quick answer. > > > Your suggestion is wise. I'm not experienced enough with maya to be sure > the solution I choose is the right one. But I saw that introducing new kind > of nodes in Maya will indeed results in errors when loading the Maya scene > in absence of maya2osg. > > > Using custom attributes seems good to me. > > > Do you think that I could submit to maya2osg the support of osg::Switch > using custom attributes? > > > Because I need anyway to perform some custom operations on the generated > OSG scene graph, so I could manage osg::Switch at that time, based on the > OSG nodes description, and leave the maya2osg exporter as it is. > > > Tell me if osg::Switch support may interest some other users of maya2osg. > > > Thank you again for your answer. > > > 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 > > ------------------------------ > *De :* Javier Taibo <jav...@gm...> > *Envoyé :* vendredi 14 novembre 2014 20:43 > *À :* may...@li... > *Objet :* Re: [Maya2osg-users] Add osg::Switch support to Maya2Osg > > Hi David, > > IMHO the best way to do what you want is by far the third one. It is > quite easy to add an extra attribute to a Maya transform node and later > check in the exporter whether the transform is marked as a switch and > create a Switch or a Transform depending on the case. > > From mel you can do it with something like that: > > addAttr -ln "isSwitch" -at bool | pSphere1; > > > Regards, > > > On Fri, Nov 14, 2014 at 4:53 PM, BOYREL David <dav...@ok...> > wrote: > >> 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 >> >> >> >> ------------------------------------------------------------------------------ >> Comprehensive Server Monitoring with Site24x7. >> Monitor 10 servers for $9/Month. >> Get alerted through email, SMS, voice calls or mobile push notifications. >> Take corrective actions from your mobile device. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk >> _______________________________________________ >> Maya2osg-users mailing list >> May...@li... >> https://lists.sourceforge.net/lists/listinfo/maya2osg-users >> >> > > > -- > Javier Taibo > > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Maya2osg-users mailing list > May...@li... > https://lists.sourceforge.net/lists/listinfo/maya2osg-users > > -- Javier Taibo |