20STechnique::STechnique(
SMaterial* material, Ogre::Technique* ogreTechniqueRef) :
SData(ogreTechniqueRef->getName())
24 if (ogreTechniqueRef->getSchemeName() ==
"" || ogreTechniqueRef->getSchemeName() ==
"Default" || ogreTechniqueRef->getSchemeName() == Ogre::Root::getSingleton().getRenderSystem()->_getDefaultViewportMaterialScheme())
25 ogreTechniqueRef->setSchemeName(
"SO3_LEGACY");
32 Ogre::Material::Techniques techs = ogreTechniqueRef->getParent()->getTechniques();
33 for (
unsigned int techid = 0; techid < techs.size() &&
name.empty(); techid++)
35 if (techs[techid] == ogreTechniqueRef)
36 name = boost::str(boost::format(
"%1%") % techid);
42 for (
unsigned int passid = 0; passid < passes.size(); passid++)
44 Ogre::Pass* ogrePass = passes[passid];
46 ogrePass->getUserObjectBindings().setUserAny(
"SPass", Ogre::Any(pass));
64 for (
unsigned int passid = 0; passid < passes.size(); passid++)
66 Ogre::Pass* ogrePass = passes[passid];
67 Ogre::Any bindedSPass = ogrePass->getUserObjectBindings().getUserAny(
"SPass");
68 if (bindedSPass.has_value())
70 SPass* pass = Ogre::any_cast<SPass*> (bindedSPass);
71 SO3_SAFE_DELETE(pass);
75 Ogre::Any bindedSTechnique =
ogreTechnique->getUserObjectBindings().getUserAny(
"STechnique");
76 if(bindedSTechnique.has_value())
77 ogreTechnique->getUserObjectBindings().eraseUserAny(
"STechnique");