Skip to content

Conversation

@robin-gdwl
Copy link
Contributor

@robin-gdwl robin-gdwl commented Feb 5, 2021

Simple fix for the blender RobotmodelArtist.
Responds to this Issue: #759

Changed:

  • Fixed bug where initialising a compas_blender.artists.Robotmodelartist would create a new collection for each mesh and then also not put the mesh iton the created collection.
  • Changed the initialisation of compas_blender.artists.Robotmodelartist to include a collection-parameter instead of a layer-parameter to be more consistent with Blender's nomenclature.
  • Used a utility function from compas_blender.utilities to create the collection if none exists instead of using a new call to a bpy-method.

What type of change is this?

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

Checklist

  • 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 have added necessary documentation (if appropriate)

- linting
- added comment
Use the utility function to create blender collection instead of a new bpy-method
This may be more involved than necessary at this point in the Tutorial, but it should be there for completeness IMO.
went through CONTRIBUTING.md

Also ran:
invoke clean
invoke check
invoke lint
invoke docs
invoke test
Comment on lines +23 to +25
def __init__(self, model, collection=None, layer=None):
self.view_layer = layer
self.collection = collection
Copy link
Member

Choose a reason for hiding this comment

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

the term layer was introduced here to be consistent with Rhino. internally it is supposed to be used as the name for the collection. if that is confusing we should change this to collection for all blender artists...

Copy link
Member

Choose a reason for hiding this comment

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

actually i need to take that back.

it seems we already removed this from the other artist in favor of implicitly named collections. perhaps this would be a good time to decide on a global strategy

Copy link
Member

Choose a reason for hiding this comment

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

I think it makes more sense to use collection and that layer should be removed from RobotModelArtist.

Copy link
Contributor Author

@robin-gdwl robin-gdwl Feb 5, 2021

Choose a reason for hiding this comment

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

It would be great if (in the future) one could port a script from Rhino to Blender just by changing the import statement, this would only work if all Robotmodelartists use the same parameter names. However using the word "layer" in the Blender context is generally confusing.

Copy link
Member

Choose a reason for hiding this comment

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

agreed, but perhaps the solution to this is that we take a step back and use our own conventions, rather than transplanting the conventions from one system onto another. but i imagine that will be part of a lengthy discussion :)

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.

Looks good! The documentation is nice, especially the formatting. And now the Blender artist will behave as expected. Thanks! Just one or two comments (in particular, with the CHANGELOG.md) to address, and we can merge.

@beverlylytle
Copy link
Member

Another review comment: I noticed that only one check was run because the default branch name changed since your fork last pulled. So it would be good if you could merge the main branch into your fork.

sync with remote repository
@robin-gdwl robin-gdwl closed this Feb 8, 2021
@robin-gdwl robin-gdwl deleted the master branch February 8, 2021 10:47
@robin-gdwl robin-gdwl restored the master branch February 8, 2021 10:49
@robin-gdwl robin-gdwl reopened this Feb 8, 2021
@tomvanmele
Copy link
Member

this ready to be merged?

@beverlylytle
Copy link
Member

this ready to be merged?

I think not. @robin-gdwl said he would make one more change to the robot tutorial.

@robin-gdwl
Copy link
Contributor Author

robin-gdwl commented Feb 9, 2021

Sorry for the wait, I was creating a section about importing urdf-files and got stuck because importing into Rhino had issues with the unit scale.
Then I remembered that importing URDF-files is already covered quite well in the same tutorial a few lines down....

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.

Looks good! Let's get this merged!

@beverlylytle beverlylytle merged commit 7dce88d into compas-dev:main Feb 9, 2021
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.

3 participants