Skip to content

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

{
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