Inkscape.org
Beyond the Basics Rotating Multiple Objects using the command line
  1. #1
    Sayse Sayse @Sayse

    I'm having trouble rotating multiple objects using the command line.
    If I try something like:

    --actions="select-by-id:In;transform-rotate:-%x" --actions="select-by-id:Out;transform-rotate:%x" 

    or

    --actions="select-by-id:In;transform-rotate:-%x;select-by-id:Out;transform-rotate:%x" 
    

    It will only apply the rotation to the last selected object, no matter what order I put them in.

    Anyone able to give advice on how to use the command line to get multiple objects to rotate?

  2. #2
    inklinea inklinea @inklinea⛰️

    inkscape --actions="select-by-id:rect4882;transform-rotate:30;select-by-id:rect4884;transform-rotate:45;export-filename:rotated.svg;export-do;" rotate_test.svg

     

    Rotate Test
  3. #3
    inklinea inklinea @inklinea⛰️

    Although, I'm not sure how useful command line rotate is. As far as I can tell it adds a rotate(deg) to the element. 

    However unless specified svg rotate is rotate(deg, 0, 0 ).

    I don't know if it's possible to set a rotation centre from the command line.

  4. #4
    Sayse Sayse @Sayse

    Unfortunately, the above command doesn't work for me.  It rotated neither of the objects before exporting the new file (checked the IDs too, they were correct)


    I'm using command line rotate in a for loop in order to output a bunch of PNGs at different stages to make gif and apng animations, which is why I'm using command line.

  5. #5
    Sayse Sayse @Sayse

    I figured out my issue for anyone else looking for a solution.

    I wasn't calling select-clear in between selecting IDs.  So I was constantly undoing or redoing and totally messing up transformations when I tried to apply it to more than one.

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Rotating Multiple Objects using the command line