Blenderproc: EntityManipulator varies location, scale but not rotation_euler

Created on 26 Apr 2021  路  6Comments  路  Source: DLR-RM/BlenderProc

I have the following snippet in my config file:

    {
      "module": "manipulators.EntityManipulator",
      "config": {
        "selector": {
          "provider": "getter.Entity",
          "conditions": {
            "name": "test_bolt.*"
          }
        },
        "rotation_euler": [2, 25, 100],
      }
    },

The rest of the config is tested and works fine.
It works for location = [a,b,c], scale = [a,b,c], but not for rotation_euler.
The config has no issues finding the entities.
I've also tried floats, no improvement.
There are no other manipulators in the config.

question first answer provided

Most helpful comment

Seems that my format (gltf) encodes rotations in WXYZ.
Anyway, thanks a lot for mentioning the debug script!

All 6 comments

Hey @rvorias,

the entity manipulator should also work for rotation_euler, however rotation_euler expects radians, not degrees.
So if you convert your angle values, it should work.

You can also take a look at the entity_manipulation example, which also sets the rotation of an object.

Let me know if you need any further help.

Hi,

I've put in numbers of different orders of magnitude just as a sanity check.
2 (x-axis) would also be a valid rotation in radians. However, it still does not rotate.

To be sure: I've just verified with something like "rotation_euler": [0.3, 0.2, 0.1],. I can't see any rotations.

Hey,

this is strange. The config snippet seems correct and as also setting the rotation is working in the entity_manipulation example, it probably has something to do with your specific object(s). Maybe there are constraints on the object which prohibit it to rotate?

I would suggest to debug your config inside the blender UI (see here).
In this way you can see what is actually going on and inspect if it sets any rotation values at all.

I think I've found some unwanted behavior:
I seems that the euler rotations are set, but not visible because the rotation mode is set to quaternions.
image
When I change to eulerXYZ - the values disappear.

update:
My original file seems to have rotations in Q format! It might transfer over. Will run a test.

Seems that my format (gltf) encodes rotations in WXYZ.
Anyway, thanks a lot for mentioning the debug script!

Fixed it by enforcing bpy.data.objects[entity.name].rotation_mode = 'XYZ'
(in EntityManipulator)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shreeramsigdel77 picture shreeramsigdel77  路  4Comments

mikkeljakobsen picture mikkeljakobsen  路  6Comments

b-yogesh picture b-yogesh  路  3Comments

albertotono picture albertotono  路  3Comments

chrisxu1995 picture chrisxu1995  路  5Comments