Skip to content

Fix ovis module building error with OGRE 1.12.9 #3271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2022
Merged

Fix ovis module building error with OGRE 1.12.9 #3271

merged 1 commit into from
Jun 9, 2022

Conversation

twistedfall
Copy link

Hi, this fixes the build error that I started to get while building the ovis module with OGRE 1.12.9 since OpenCV 4.6.0.
The error was:

/home/pro/projects/opencv-lib/opencv-4.6/opencv_contrib-4.6.0/modules/ovis/src/ovis.cpp: In member function ‘virtual void cv::ovis::WindowSceneImpl::setBackground(cv::InputArray)’:
/home/pro/projects/opencv-lib/opencv-4.6/opencv_contrib-4.6.0/modules/ovis/src/ovis.cpp:456:65: error: cannot convert ‘std::__shared_ptr_access<Ogre::Material, __gnu_cxx::_S_atomic, false, false>::element_type’ {aka ‘Ogre::Material’} to ‘const String&’
  456 |                 RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME, *bgplane->getMaterial());
      |                                                                 ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                                 |
      |                                                                 std::__shared_ptr_access<Ogre::Material, __gnu_cxx::_S_atomic, false, false>::element_type {aka Ogre::Material}
In file included from /usr/include/OGRE/RTShaderSystem/OgreRTShaderSystem.h:32,
                 from /usr/include/OGRE/Bites/OgreSGTechniqueResolverListener.h:32,
                 from /usr/include/OGRE/Bites/OgreApplicationContextBase.h:41,
                 from /usr/include/OGRE/Bites/OgreApplicationContext.h:33,
                 from /home/pro/projects/opencv-lib/opencv-4.6/opencv_contrib-4.6.0/modules/ovis/src/ovis.cpp:7:

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@alalek
Copy link
Member

alalek commented Jun 8, 2022

/cc @paroj

@@ -453,7 +453,7 @@ class WindowSceneImpl : public WindowScene
if(tus->getTextureName() != name)
{
RTShader::ShaderGenerator::getSingleton().invalidateMaterial(
RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME, *bgplane->getMaterial());
RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME, bgplane->getMaterial()->getName());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should also pass RESOURCEGROUP_NAME, so the Material is uniquely identified

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@opencv-pushbot opencv-pushbot merged commit 98f6a2e into opencv:4.x Jun 9, 2022
@alalek alalek mentioned this pull request Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants