Re: [Maya2osg-users] Discussion of next changes
Status: Alpha
Brought to you by:
jtaibo
|
From: Jean-Sébastien G. <jea...@cm...> - 2011-05-16 18:31:38
|
Hi Javier, Peter,
Thanks a lot for the discussions! My intent when I sent my message on
Saturday was just to explain what I had in mind and maybe get a few
ideas, I didn't want you to start doing anything in my place! :-)
> Well. We should know what does J-S exactly needs, but I was thinking
> that if the target is to replace the Maya2OSG shader with a custom
> one, Maya node attributes could contain the information indicating
> that this custom shader must be used and the extra information needed
> for the shader. In any case, when you reach a bump2D node you already
> have the shader half created, thats why I didn't see it. But of course
> a previous traversal can be done in the shading network to check for
> the attribute.
My idea was to simply store the information needed (normal map texture
filename, bump amount) somewhere, which could be read by our engine at
file load time. I cannot generate the shader at export time, as our
products generally use different shaders... So we just need to store the
information somewhere appropriate (osg::Material or osg::StateSet
description list for the normal map stuff, for example) and our engine
will do the rest.
> Mmm... I still think we are mixing too much things there. I'd prefer
> the custom attributes approach. I don't know what you mean with
> "create some new window". You can create attributes without any new
> development, just in the Attribute editor with Attributes> Add
> attributes... option. And it is quite easy to manage from MEL:
>
> addAttr -ln "normal_map" -at double |pSphere1;
> setAttr -e-keyable true |pSphere1.normal_map;
>
> Or course, once you have designed the attributes you need, you
> should develop the artists tools to automate this (maybe just some
> shelf buttons).
>
I was actually thinking we don't need anything special in Maya. The
plugin would just see that the Maya material has a Bump2D node attached
to the bump attribute, and would add a string in the description at the
appropriate place (as I said, osg::Material or osg::StateSet) with a
special tag saying that this is metadata. Something like:
maya2osg NormalMap filename:<some filename>.jpg bump:30
As I said, our engine would then parse this when loading the .osg file
and load the normal map and appropriate shaders.
>> So, this is done, a first draft, Pre Post Export Mel and Preview Mel. Pre
>> and
>> Pre and Post will substitute $path to filepath, $file to filename and $type
>> to filetype
That's great, it will be very useful to us! Thanks!
> I think this discussion would be much more productive with some
> usage examples and so we can work on several prototypes to see which
> one we like most.
I can give you some examples of what I would like, but I hope the
description I gave above makes what I had in mind clearer.
> I'll take a look at it ASAP. Right now my daughters are dragging me
> out of home. Quite a challenge was to be able to answer this message!
> :)))
I understand, I have 3 boys myself :-)
Thanks for your help,
J-S
--
______________________________________________________
Jean-Sebastien Guay jea...@cm...
http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
|