Skip to content
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

Fix the pybind reference bug of get_view_control() #6116

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

eamonn-zh
Copy link
Contributor

@eamonn-zh eamonn-zh commented Apr 26, 2023

Type

  • Bug fix (non-breaking change which fixes an issue): Fixes Visualizer.get_view_control() gives a copy. #6009
  • New feature (non-breaking change which adds functionality). Resolves #
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #

Motivation and Context

Resolves the issue reported in #6009 that Visualizer.get_view_control() is expected to return a reference but it actually returns a copy, this problem does not exist in older versions of Open3D.

Checklist:

  • I have run python util/check_style.py --apply to apply Open3D code style
    to my code.
  • This PR changes Open3D behavior or adds new functionality.
    • Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is
      updated accordingly.
    • I have added or updated C++ and / or Python unit tests OR included test
      results
      (e.g. screenshots or numbers) here.
  • I will follow up and update the code if CI fails.
  • For fork PRs, I have selected Allow edits from maintainers.

Description

Updated the pybind code and fixed the reference issue.


This change is Reviewable

@update-docs
Copy link

update-docs bot commented Apr 26, 2023

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

@stephendb
Copy link

this is a pretty nasty bug, is this repo dead?

@ubt0001
Copy link

ubt0001 commented Jun 7, 2023

Any progress on this pull request?

@ssheorey
Copy link
Member

Thanks @eamonn-zh for this bug fix and to @Kemo-Huang @identxxy and others for investigating this.

@ssheorey ssheorey merged commit 9f6b982 into isl-org:master Jun 12, 2023
@alessiocancian
Copy link

@ssheorey can this be released to pypi?

@PieroV
Copy link
Contributor

PieroV commented Aug 11, 2023

Hi, this PR breaks the const correctness on the C++ side.

Have you tried to explicit the lambda return type before removing the const overload?

Something like:

            .def(
                    "get_view_control",
                    [](Visualizer &vis) -> &GetViewControl { return vis.GetViewControl(); },
                    "Function to retrieve the associated ``ViewControl``",
                    py::return_value_policy::reference_internal)

@zhangshuoneu
Copy link

The bug refixed of version 1.7.0 hasn't been released to pypi. I also countered this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Visualizer.get_view_control() gives a copy.
9 participants