1
$\begingroup$

Mast is the entire model, It has sub meshes as can been seen from the figure, like eyes, clothes, but belonging to the same human model. I need to get the mesh of all of that together, so as to draw a 2d bounding box around the object on rendered image (like in this link 2d-bounding box on images)

enter image description here

My object is a human model with armature , imported. I am trying to get 2D bounding box using the code here . In this only object meshes can be passed? How can I pass the complete model to this?

when I pass armature object, this gives error : Object does not have geometry data in the line

me = me_ob.to_mesh(scene, True, 'PREVIEW')

Is there any other way to do it? Could some one please help?

$\endgroup$
  • $\begingroup$ You want the bounding box of the armature or mesh? $\endgroup$ – Tak Mar 15 '17 at 23:38
  • $\begingroup$ It seems the armature "Mast" is what you try to convert to a mesh. Armatures have no geometry and can not be converted directly with "to_mesh". If this is really the armature you want to convert, you can use a script like this one: blender.stackexchange.com/questions/75040/… $\endgroup$ – lemon Mar 16 '17 at 5:23
  • $\begingroup$ @lemon Thanks, Actually no, not the armature. Mast is the entire model, It has sub meshes as can been seen from the figure, like eyes, clothes, but belonging to the same human model. i need to get the mesh of all of that together. $\endgroup$ – p.Neu Mar 16 '17 at 8:13
  • $\begingroup$ @Tak I need the bounding box for the whole model,(so, i think armature +mesh), so that I get bounding boxes at each frames of animation. $\endgroup$ – p.Neu Mar 16 '17 at 8:15
0
$\begingroup$

You can use this addon made by @sambler's answer found here, which creates a bounding box for the selected objects. So you can select both armature and mesh in your script and modify the addon to get the bounding box data without creating the bounding box cube.

$\endgroup$
  • $\begingroup$ thanks for the link. Before I start, can I also get the 2D bounding box of an object in rendered image ? Moreover , I need to do it via python script $\endgroup$ – p.Neu Mar 16 '17 at 9:55
  • $\begingroup$ @p.Neu I'm not sure about getting the bounding box in the rendered image. Better ask another question about that. $\endgroup$ – Tak Mar 16 '17 at 10:09
  • $\begingroup$ there is something already here link, but I can't use it when I have a group of meshes corresponding to one object, $\endgroup$ – p.Neu Mar 16 '17 at 10:11
  • $\begingroup$ @p.Neu then try commenting on codeman's answer and see if he can help you. $\endgroup$ – Tak Mar 16 '17 at 10:31
  • $\begingroup$ I don't have enough reputations to comment :( $\endgroup$ – p.Neu Mar 16 '17 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.