question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

blender Robotmodelartist does not create collections correctly

See original GitHub issue

The function draw_geometry from the compas_blender.artists.RobotModelArtist creates a new collection every time it is called. Since the method create() of the base_artist calls draw_geometry for every mesh in the urdf file the blender artist creates a new collection each time (at least thats how I understand it). In addition: the mesh is also not put into the collection that was created.

Location of the draw_geometry call in the base artist: https://github.com/compas-dev/compas/blob/416e490caf4bfb11a47d8e208d19f04e1d76eb16/src/compas/robots/base_artist/_artist.py#L153

blender Robotmodelartist method: https://github.com/compas-dev/compas/blob/416e490caf4bfb11a47d8e208d19f04e1d76eb16/src/compas_blender/artists/robotmodelartist.py#L42-L44

A possible solution could be to simply check if a collection with the name defined in self.layer already exists and use that one instead of creating a new one.

It appears to me that the blender robotartist is at an early stage in the developement. I might implement a fix for this and create a pull request if a rewrite of the robotartist is not already under way. image

example script tested in Blender 2.9.1 and compas 1.0.0 on Windows 10:

import compas
from compas.robots import GithubPackageMeshLoader
from compas.robots import RobotModel
import compas_blender
from compas_blender.artists import RobotModelArtist, BaseArtist

compas_blender.clear()
#compas_blender.draw()

compas.PRECISION = '12f'
github = GithubPackageMeshLoader('ros-industrial/abb', 'abb_irb6600_support', 'kinetic-devel')
model = RobotModel.from_urdf_file(github.load_urdf('irb6640.urdf'))
model.load_geometry(github)

artist = RobotModelArtist(model, layer='COMPAS FAB::Example')

artist.draw_visual()

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
robin-gdwlcommented, Jan 26, 2021

Thank you for your answer. I am currently familiarizing myself with the compas codebase. I will create a pull request once I created a solution to the problems.

the draw_visual - problem probably stems from the fact that any geometry loaded into Blender is displayed by default. I would check if the mesh has a colour and make it invisible if it doesnt. Currently, if color is None a white material with full alpha is created. However, Blender does not use the material for the normal display in the viewport, which is why it is visible.

https://github.com/compas-dev/compas/blob/416e490caf4bfb11a47d8e208d19f04e1d76eb16/src/compas/robots/base_artist/_artist.py#L143

https://github.com/compas-dev/compas/blob/416e490caf4bfb11a47d8e208d19f04e1d76eb16/src/compas_blender/artists/robotmodelartist.py#L35-L40

1reaction
brgcodecommented, Feb 5, 2021

I don’t see where in compas_blender layer is used except in RobotModelArtist. Every other reference is commented out or seems to have been changed to collection.

yes you are right. i just noticed this as well. updated my comment on the PR. in the other artists, the base collection is named after the data or data structure name, with implicitly named sub-collections for the various components of the object.

perhaps we should add the option to give the parent collection a name explicitly via the collection parameter.

but we don’t need to keep layer for consistency with Rhino because that is not really a goal anymore per se…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Easy World Building with over 600 FREE 3D MODELS ...
In this Blender tutorial i will show you how to use a huge library of free models and materials and give you a...
Read more >
Top 3 Things Every Beginner Blender Artist Should Model
Top 3 Things Every Beginner Blender Artist Should Model · Not all practice is created equal · The devil is in the detail...
Read more >
How to model a robot In Blender - tutorial - Evermotion
You have the right to demand an access to your personal data, to correct or to delete the data if there is no...
Read more >
Retro Robot 1/3: Modeling from Concept in Blender | Daniel Kim
3D Artist and Designer ... Please share the robot model you've created here in the Student Projects ... Realtime, minimal video cuts and...
Read more >
Better FBX Importer & Exporter - Blender Market
Blender is lack of native FBX support, when we import some older and newer FBX files, it often fails. So I made a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found