Login / Register  0 items | $0.00 NewWhat is KVR? Submit News Advertise

Knob rotation script for Photoshop

joshb
KVRist
 
58 posts since 13 Apr, 2016

Postby joshb; Wed Mar 01, 2017 11:13 am Knob rotation script for Photoshop

Hey guys,

After scouring the web yesterday for something to help me create a filmstrip for UI knob rotations, I looked into scripting Photoshop. Turns out Photoshop will execute a javascript file. Who knew?

I've attached the script I came up with as well as a sample Photoshop knob for an example. Hope this helps someone. I have to tell you that I'm so thankful to this forum for all the help and advice I've received. Consider this a tiny gift back.

Instructions:
- Open a file in Photoshop.
- Turn off all the layers you don't want as part of the knob (background, etc)
- Put everything you want rotated in one Layer Group (folder) and make sure that layer is selected.
- Leave that file as the frontmost window.
- In Photoshop go to File/Scripts/Browse to open knobRotate.jsx and it will run immediately
- It will ask for start & end angle (in degrees) and how many frames to render. Try the default values to test.
- It will work for a little while and create a new file, leaving the original (essentially) alone
- When it's done, it will pop up an alert window with info on the final frame sizes.
- That's it.

A few notes about the script:
- It's not bulletproof and does no error checking, so proceed with caution.
- The original Photoshop file is used during the process, but it's eventually left back to where it started.
- The real beauty of this is that when you use layer styles for shading and shadows, they stay correct as the knob gets rotated. Try the exampleKnob.psd that's attached to see what I mean.

Cheers gents!
You do not have the required permissions to view the files attached to this post.
User Data
KVRist
 
39 posts since 27 Feb, 2016

Postby User Data; Thu Mar 02, 2017 4:43 am Re: Knob rotation script for Photoshop

Will try, thanks!
joshb
KVRist
 
58 posts since 13 Apr, 2016

Postby joshb; Fri Mar 03, 2017 7:32 am Re: Knob rotation script for Photoshop

Here's an updated version that does vertical as well as horizontal.
You do not have the required permissions to view the files attached to this post.
User avatar
crimsonmerry
KVRist
 
63 posts since 23 Jul, 2013

Postby crimsonmerry; Fri Mar 03, 2017 8:51 am Re: Knob rotation script for Photoshop

Both vertical and horizontal worked fine here, Thank you very much! :tu:
gassle
KVRist
 
195 posts since 17 Jan, 2003

Postby gassle; Fri Mar 10, 2017 3:19 pm Re: Knob rotation script for Photoshop

Hi! Thanks for the script!

As I test it I have the following issue with it.

In case I have some elements in the knob file that I want to be in the strip but I don't want them animated, those appear only in the first frame. I attached an example, you can see the layer named Marks (purple dots around the knob) which is intended to be in the strip but doesn't show up.
You do not have the required permissions to view the files attached to this post.
"when you have nothing to say - shut up." -A friend of Luc Besson
joshb
KVRist
 
58 posts since 13 Apr, 2016

Postby joshb; Fri Mar 10, 2017 3:38 pm Re: Knob rotation script for Photoshop

Ah, forgot about that.

Until I can fix it, a workaround is:

Put the marks in a folder and turn everything else off. Run the script again, this time with a start & end angle of 0. It will create another file with none of the marks rotated that you can simply composite together with the original.

Hope that helps for now.
gassle
KVRist
 
195 posts since 17 Jan, 2003

Postby gassle; Fri Mar 10, 2017 4:21 pm Re: Knob rotation script for Photoshop

Ah thanks! That will help for sure!
"when you have nothing to say - shut up." -A friend of Luc Besson

Moderator: Moderators (Main)

Return to DSP and Plug-in Development

Who is online

Users browsing this forum: CCBot (commoncrawl), drybar, Kraku, mystran, noizebox, RSSOwl [Bot]