Skip to content

Conversation

@gonzalocasas
Copy link
Member

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • I ran all tests on my computer and it's all green (i.e. invoke test).
  • I ran lint on my computer and there are no errors (i.e. invoke lint).
  • I added new functions/classes and made them available on a second-level import, e.g. compas.datastructures.Mesh.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

@gonzalocasas
Copy link
Member Author

This is a pretty annoying bug, so, after review ok and merge, I would suggest to create a 1.9.2 release asap.

Copy link
Member

@beverlylytle beverlylytle left a comment

Choose a reason for hiding this comment

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

review, ok and ...

@gonzalocasas
Copy link
Member Author

@beverlylytle added one more fix: clear() should do the hide_set magic, instead of deleting the objects

@beverlylytle
Copy link
Member

I'm not sure that that's true. In the base BlenderArtist we have

    def clear(self) -> None:
        """Delete all objects created by the artist."""
        compas_blender.delete_objects(self.collection.objects)

@gonzalocasas
Copy link
Member Author

I'm not sure that that's true. In the base BlenderArtist we have

    def clear(self) -> None:
        """Delete all objects created by the artist."""
        compas_blender.delete_objects(self.collection.objects)

yes, and that indeed will delete the objects, but it's not what the robot model artist expects.. I dont recall why, but I remember this was changed long ago for hiding instead of deleting (it was an external contribution).

@beverlylytle
Copy link
Member

beverlylytle commented Oct 29, 2021

I recall that the instantiation of the artist resulted in the drawing of all the collision and visual geometries, without calling draw*. So that was changed... the create method creates all the geometries and then hides them. Then draw* would unhide them. but it feels weird that delete would have different behaviors for different artists. maybe there should be hide_* methods.

@tomvanmele
Copy link
Member

fwiw, i agree with @beverlylytle that the behaviour should be consistent. however, it is not clear to me what the use case for hide/show would be. is this to not have to redraw some of the meshes in between different calls to a script?

@beverlylytle
Copy link
Member

for a robot model, it would be nice to toggle whether you are looking at the collision geometries or the visual geometries, without all the computational effort of reading and parsing the URDF holding all the geometric data. that would be the use case of hid/show.

@gonzalocasas
Copy link
Member Author

alright, changed the artist to really delete when calling clear and added a bit of code to ensure the thing recreates geometry when needed.

@tomvanmele
Copy link
Member

for a robot model, it would be nice to toggle whether you are looking at the collision geometries or the visual geometries, without all the computational effort of reading and parsing the URDF holding all the geometric data. that would be the use case of hid/show.

fair enough, but i guess this toggling would only be possible in an interactive scenario or in gh, no?

@tomvanmele tomvanmele merged commit d3baf87 into main Nov 2, 2021
@tomvanmele tomvanmele deleted the fix-robmod-artist-blender branch September 7, 2022 21:29
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.

4 participants