Jump to content
Welcome to InsanelyMac Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    • Allan

      Forum Rules   04/13/2018

      Hello folks! As some things are being fixed, we'll keep you updated. Per hour the Forum Rules don't have a dedicated "Tab", so here is the place that we have our Rules back. New Users Lounge > [READ] - InsanelyMac Forum Rules - The InsanelyMac Staff Team. 
Sign in to follow this  
Slice

[How to] Make Photoshop Plugin

3 posts in this topic

Recommended Posts

I did this and I want to share my achievements.
 
I speak about Photoshop CS4 because it allows to use smart plugins. CS6 has reduced plugins system.
CS4 works fine under 10.6 - 10.9.2 as well. The application is 32bits and so it accepts plugins only 32bits.
 
For the development you need XCode from 3.1 up to modern 5.0.2 but you need to take somewhere MacOS10.6SDK.
Only this SDK is good for the purpose! Take here or extract official way

If it cannot be found there you will need to extract and copy it from Xcode 4.3. To do this:

  • Download the XCode 4.3 .dmg file from the Apple Developer portal (you'll need an Apple Developer account).
  • Download the utility Pacifist and use it to extract the 10.6 SDK from the XCode 4.3 .dmg file. Click on the "Extract Package" button, find the SDK by searching for 10.6 in the search box, then Ctrl + click on the MacOSX10.6.sdk directory and Extract it to a suitable location.
  • Add a symlink from the 10.6 SDK location to the/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ directory. 

 
Next you have to download adobe_photoshop_cs4_sdk_mac.zip. It is available for free.
The SDK is written for Carbon and contains PowerPC technologies and code  B)  We should cleanup this to do it compilable.
Adobe Photoshop CS4 SDK/photoshopapi/photoshop/PIActions.h:

-#include "AERegistry.h"
+//#include "AERegistry.h"

In many places make a replace

-#include <Carbon.h>
+#include <Carbon/Carbon.h>

Adobe Photoshop CS4 SDK/photoshopapi/photoshop/PITypes.h


-typedef unsigned32	uint32;
+//typedef unsigned32	uint32;

Adobe Photoshop CS4 SDK/samplecode/common/includes/DialogUtilities.h


 #else // Macintosh and others
-	#include <Dialogs.h>			// Macintosh standard dialogs
-	#include <Types.h>				// Macintosh standard types
-	#include <Gestalt.h>			// Macintosh gestalt routines
-	#include <TextUtils.h>			// Macintosh text utilities (GetString())
-	#include <OSUtils.h>			// Macintosh OS Utilities (Delay())
-	#include <Menus.h>				// Macintosh Menu Manager routines (DelMenuItem())
+//	#include <Dialogs.h>			// Macintosh standard dialogs
+//	#include <Types.h>				// Macintosh standard types
+//	#include <Gestalt.h>			// Macintosh gestalt routines
+//	#include <TextUtils.h>			// Macintosh text utilities (GetString())
+//	#include <OSUtils.h>			// Macintosh OS Utilities (Delay())
+//	#include <Menus.h>				// Macintosh Menu Manager routines (DelMenuItem())
 #endif

Adobe Photoshop CS4 SDK/samplecode/common/includes/PIUFile.h


-#include <Folders.h>
+//#include <Folders.h>

Adobe Photoshop CS4 SDK/samplecode/common/includes/PIUI.h


-	#include "Lists.h"
+//	#include "Lists.h"

Adobe Photoshop CS4 SDK/samplecode/common/includes/PIUtilities.h


- 	#include <LowMem.h>
-	#include <ToolUtils.h>
-	#include <FixMath.h>
+// 	#include <LowMem.h>
+//	#include <ToolUtils.h>
+//	#include <FixMath.h>

After that you can compile sample projects and see how it works.
In XCode you have to set
BaseSDK = OS10.6
arch=i386
Other CC flags = -DMAC_ENV
 
Now I wish to show you my sample: OpenEXR format plugin. CS4 already contain it but with some differences.
And my version is customizable.
Sources of the format is available at official site http://www.openexr.com/
There is also photoshop plugin version 1.2.1 but it is intended for very old SDK and PowerPC Mac. I spend some time to rewrite it for new SDK CS4 and new OpenEXR 2.1.0.
How it works.
Initial view. You see overexposure in window
Screen Shot 2014-04-10 at 14.03.32.png
Tuning exposure you can take a view in the window but dark in the room.
Screen Shot 2014-04-10 at 14.03.58.png
Tuning Gamma you can compress brightness range
Screen Shot 2014-04-10 at 14.04.29.png
The final image can be saved with different compressions
Screen Shot 2014-04-10 at 15.35.12.png
 
This is the plugin. For sources ask in PM.
MyExr2.plugin.zip

Share this post


Link to post
Share on other sites

Wow.. great guide. what kind of basic coding to apply/create with xcode? really.. i'm noob about coding world.

Nice share slice..!

 

:thumbsup_anim:  :thumbsup_anim:

Share this post


Link to post
Share on other sites

After XCode update to 5.1.1 it became impossible. Apple decided to not support 32 bit developement.  :thumbsdown_anim:

 

 

EDITED.

So I had to install XCode 4.4.1 on Maverics  :P . It works. Apple, you may run forward.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.



×