Blenderproc: Problem while creating coco anotation: error log Mesh does not have the attribute: cp_category_id

Created on 15 Oct 2020  Â·  4Comments  Â·  Source: DLR-RM/BlenderProc

Screenshot from 2020-10-15 11-29-11(1)

Scene consist of 3 mesh: Cube, Cylinder and Sphere with three different materials. (you can have a look at the attached zip file which consist config file and blend file.

test_coco.zip

Solved by adding:
"add_properties": {

      "cp_category_id": 1 
    }

How to add a category_id in blender?

question

Most helpful comment

Can you provide a documentation about each parameters,

Each parameter of the config is already explained, please check the corresponding class file. So for example for getter.Material
https://github.com/DLR-RM/BlenderProc/blob/81e1dd53d63b20c5cbef8bb6946ff359a2788911/src/provider/getter/Material.py#L61-L79

Parameters, which are of internal blender objects for those you have to check the open source blender API:

https://docs.blender.org/api/current/index.html

Generally, I wanted to change a color of a mesh randomly but even after following example. I am unable create a one.

If you want to create a module, you have to understand how the bpy API works, check the link above.

Luckily, we already have a module for that:

https://github.com/DLR-RM/BlenderProc/blob/81e1dd53d63b20c5cbef8bb6946ff359a2788911/src/manipulators/EntityManipulator.py#L200-L214

All 4 comments

If I check your config, you don't set the cp_category_id of the objects anywhere? The only thing you set is the background.

And none of the objects have a saved custom property in the .blend file, see red circle. Be aware if you set it there directly in blender to not use the cp_.

Bildschirmfoto von 2020-10-15 09-57-37

If you want to set the cp_category_id you can use the entity manipulation example:

    {
      "module": "manipulators.EntityManipulator",
      "config": {
        "selector": {
          "provider": "getter.Entity",
          "conditions": { 
            "name": "Sphere", # with this you can only select the sphere
            "type": "MESH"  # this guarantees that the object is a mesh, and not for example a camera
          }
        },
        "cp_category_id": 1
      }
    },

Thank you for the prompt reply. Can you provide a documentation about each
parameters, I would like to create some module . BlenderProc is awesome
though, I kind of felt like lack of information on different parameters or
may be I am missing something where I can find. I am following your
examples but as a blender user there is a lot of things that can be
manipulated. For now it would be great if you can create something a basic
video or pdf which explains a way to create a module.

Generally, I wanted to change a color of a mesh randomly but even after
following example. I am unable create a one.

Thanks for your help. Looking forward to hearing from you.

On Thu, Oct 15, 2020 at 17:06 Maximilian Denninger notifications@github.com
wrote:

If I check your config, you don't set the cp_category_id of the objects
anywhere? The only thing you set is the background.

And none of the objects have a saved custom property in the .blend file,
see red circle. Be aware if you set it there directly in blender to not use
the cp_.

[image: Bildschirmfoto von 2020-10-15 09-57-37]
https://user-images.githubusercontent.com/6104887/96094063-2b271c00-0ecd-11eb-9428-15e3a3eb7776.png

If you want to set the cp_category_id you can use the entity manipulation
example:

{
  "module": "manipulators.EntityManipulator",
  "config": {
    "selector": {
      "provider": "getter.Entity",
      "conditions": {
        "name": "Sphere", # with this you can only select the sphere
        "type": "MESH"  # this guarantees that the object is a mesh, and not for example a camera
      }
    },
    "cp_category_id": 1
  }
},

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/DLR-RM/BlenderProc/issues/81#issuecomment-708977646,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMOPWIX2NQCQ6TVHQWPWP7TSK2URVANCNFSM4SRMKONQ
.

Can you provide a documentation about each parameters,

Each parameter of the config is already explained, please check the corresponding class file. So for example for getter.Material
https://github.com/DLR-RM/BlenderProc/blob/81e1dd53d63b20c5cbef8bb6946ff359a2788911/src/provider/getter/Material.py#L61-L79

Parameters, which are of internal blender objects for those you have to check the open source blender API:

https://docs.blender.org/api/current/index.html

Generally, I wanted to change a color of a mesh randomly but even after following example. I am unable create a one.

If you want to create a module, you have to understand how the bpy API works, check the link above.

Luckily, we already have a module for that:

https://github.com/DLR-RM/BlenderProc/blob/81e1dd53d63b20c5cbef8bb6946ff359a2788911/src/manipulators/EntityManipulator.py#L200-L214

I hope this closed the issue, if not please open a new one.

Was this page helpful?
0 / 5 - 0 ratings