3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: A New Dketchup Plugin - Now you can rotate anything with ease - Group_Rotate  (Read 1027 times)

jestermon

« on: November 22, 2011, 12:17:03 AM »
Where to post this. It's not 3D Rad stuff, so show your work makes no sense. Hmm. Useful scripts.. probably goes here... anyway

Mike's rotation requirement got me to thinking. Heck, why not wrtte my own plugin, it's only Ruby, so should be pretty straight forward, once I understand the SU API.
So I downloaded the Sketchup API, spent about an hour with it, and laughed at myself for not having done this earlier. After playing with the Ruby console, and testing the API, a light-bulb flashed on, and the innards of Sketchup split open like a can of beans.
To keep a long story short, here's my first home-grown Sketchup plugin

Drop the plugin 'Group_Rotate' into the sketchup plugin folder, and you are all set to run.

1.. Create a group
2.. Run the Group_Rotate plugin, and a dialog pops up (The Sketchup UI class is fun)
3.. Enter a value in degrees for any or all of the axis you wish to rotate the object around
4.. Remember Z is UP in sketchup. And X=Red. Y=Green
5.. Click the Ok button, and it's all over over before you even know it. And does not hurt at all.
6.. The plugin does not accept negative values, so subtract your rotation from 360, to rotate the other way.

That's all folks.
Enjoy
« Last Edit: November 22, 2011, 12:44:19 AM by jestermon »

jestermon

« Reply #1 on: November 22, 2011, 01:24:32 AM »
The Rotation plugin I made is used to rotate an object around the world coordinate system. If however you wish to rotate the object around it's local coordinate system, you can do the following.

1.. Select a group
2.. Forget that the stupid rotation tool even exists - It is more confusing than a square wheel - and even less practical than a rock sandwich.
3.. The group bounding box should be displayed, once it is selected
4.. Select the MOVE tool - Yea it is great for rotating as well.
5.. Hover the MOVE tool over the 'face' of one of the bounding box sides, and you will see 4 little red crosses appear - See attached image.
6.. Grab one of those crosses with the MOVE tool, and rotate the object by dragging the little cross with the mouse around the 'protractor'
7.. Click when done, or type in the degrees and press Enter.

Can't get any simpler than that.

Hint: If you wish Sketchup to set the current rotated orientation of an object as the default orientation, then Explode the group, and reform it into a new group. The new bounding box will show the change.
« Last Edit: November 22, 2011, 01:33:14 AM by jestermon »
« Reply #2 on: November 22, 2011, 03:01:07 AM »
Awesome. That was "Jestermon's daily useful thingy".

You should get your own jingle!
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0

psikoT

« Reply #3 on: November 22, 2011, 04:05:50 AM »
then... can't you rotate anything with sketchsucks? ???

OMG... that's another 'missing' feature of this great software... LOL :D

jestermon

« Reply #4 on: November 22, 2011, 04:11:47 AM »
then... can't you rotate anything with sketchsucks? ???

Sure you can rotate stuff, but the rotation tool is tricky to place exactly onto the correct axis, if you wish to rotate on a curved surface. It's so 'dynamic' it jumps all over the place - and you must not have any beer in your body when you use it - It's like trying to thread a needle in the dark, while wearing thick woolen gloves.

psikoT

« Reply #5 on: November 22, 2011, 07:22:10 AM »
but that program (let's put it a name to that thing...) has a numeric transform tool somewhere, if I remember well... ::)

anyway, nice job... sometimes I feel (evil) envy of your talent... :P :D

jestermon

« Reply #6 on: November 22, 2011, 07:51:59 AM »
Quote
has a numeric transform tool somewhere, if I remember well
Yea you move, scale rotate - or whatever, then type in a value and Enter, instead of closing the action with a mouse-click. That's about it... Unless there is another interface, which I'm not aware of.. (It's my quick and dirty tool for block stuff - that is sometimes faster to do, than in C4D: my fav)
« Last Edit: November 22, 2011, 07:55:45 AM by jestermon »
Pages: [1]