Parameter name clashing when connecting shading fragments to MShaderInstance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to build an MShaderInstance by connecting multiple shading fragments together using the MShaderInstance::addInputFragment and MShaderInstance::addOutputFragment methods of the C++ API. If I try to connect fragments with identically named input parameters (e.g. fragmentA and fragmentB both have parameter "foo"), the resulting MShaderInstance will still have one such parameter with the same name which doesn't seem to control any of the fragments (e.g. the MShaderInstance has "foo", but setting it does nothing). E.g.:
// fragmentA and fragmentB each has a parameter named "foo".
shader_instance->addInputFragment("fragmentA", "x", "y"); shader_instance->addInputFragment("fragmentB", "z", "w"); // shader_instance now has a single parameter named "foo" (no renaming has taken place), // but shader_instance->setParameter("foo", whatever); has no effect.
I'm using Maya 2015.
Is this observation correct? Do I have other options for handling parameter name clashes besides building and registering a fragment graph XML which renames the parameters for each fragment I want to use?
Cheers,
Zoltan