1
$\begingroup$

I want to set the rotation on the x- and y-axis to 0° to multiple objects.

So if object a has x:10°,y:20°,z:30°, and object b has x:40°,y:50°,z:60° they should all have x:0°,y:0°;z:...° after the transformation.

How can I do that?

I already selected all of my objects at a time (pivot point set to individual origins), pressed r for rotation and x to rotate around the x-axis, but then all of my objects rotated for example 10 degrees around the x-axis. But that is not the result that I want. I want every single object to have their rotation set to x:0°, y:0°; z:...°

I am currently working with a particle system, which emits cubes along a path.

When converting the particle system I am left with tons of cubes, which should all have the following rotation properties: x=0, y=0, z=(stays like it is).

If I click on one single cube, I can adjust the rotation value for x, y, (and z) which gives me what I want. But I really do not want to do this for every single object this way. Is there a faster way to change the rotation of multiple objects simultaneously?

I already tried to work with ctrl-c, copy rotation. But as I said, I want the z-axis to be unchanged! This should only affect the x- and y-axis.

(To better understand why I want to do this: You have to look at this like it would be an architecture. You don't want to walk on a tilted floor. It should be even.)

enter image description here

enter image description here

enter image description here

Thank you for your support!

$\endgroup$
  • 1
    $\begingroup$ Please include a screen capture of your Blender work for this question and all future questions. I do not fully understand what you want to do or why that would be useful. What is the larger goal for you? If you explain your larger goal then there may be more answers. I have made some guesses in the candidate answer below. $\endgroup$ – atomicbezierslinger Jan 5 at 16:15
2
$\begingroup$

Select via name, zero x and y euler rotations.

Test script. Finds all objects in scene with name starting with "Cube Emitter" and sets the x and y components of Euler rotation to zero.

import bpy

pattern = "Cube Emitter"
#pattern = "Cube"
scene = bpy.context.scene

cubes = [o for o in scene.objects 
        if o.name.startswith(pattern)]

for cube in cubes:
    cube.rotation_euler.x = 0
    cube.rotation_euler.y = 0
$\endgroup$
0
$\begingroup$

The best scriptless way I've found is:

  • Create an empty (with 0 rotation)
  • Add a 'Copy Rotation' constraint to one of the tiles, empty as target, in X & Y only.
  • With all tiles selected, constrained tile active: Header > 'Object' menu > 'Constraints' > 'Copy Constraints to Selected'
  • All selected, CtrlA > 'Apply visual Transforms'
  • All selected, CtrlAltC - Clear Constraints
  • X Delete empty.

... but there must be a better one?

$\endgroup$
-1
$\begingroup$
  • You can [apply] rotation to the object from the menu
  • You can manually type in the rotation values for XYZ to be zero
  • A Script can do the two actions above
$\endgroup$

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.