dfki-ric / phobos

An add-on for Blender allowing to create URDF, SDF and SMURF robot models in a WYSIWYG environment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[pre_v2.0.0] Create links by "selected object" depend on the size of the object

brothermechanic opened this issue · comments

Describe the bug
"Create Links" button created 1m size Armature bone every time

To Reproduce
Steps to reproduce the behavior:

  1. Select object
  2. Push "Create Links" (bpy.ops.phobos.create_links()) by "selected object"
  3. There is bone 1m

Expected behavior
It will be cool to have bone size depend on the size of the object. May be depended by boject's bounding box.

Screenshots
Screenshot_20230510_145122

Currently it's created on the objects scale/the size of the visuals. I think in your case the box is not yet a visual. Please try to make it a visual first and then create the link from it. Please let me know if it works as expected.

I'm talking about that big bones

2023-05-11.11-02-14.mp4

Thanks for the video, The way you did it is absolutely correct. This seems to be a bug then.
I had a quick look:
The creation the way you did it, happens here: https://github.com/dfki-ric/phobos/blob/pre_v2.0.0/phobos/blender/model/links.py#L46
And currently the scaling happens only when createLink is called (e.g. when importing from file): https://github.com/dfki-ric/phobos/blob/pre_v2.0.0/phobos/blender/io/phobos2blender.py#L221

It would be nice to have this functionality similarly in deriveLinkFromObject. Do you want to give it a try to fix this?

Solved with 1bb14ae