A. Patterson
Guide
A. Patterson
Guide
Activity
Sep 24, 2024
05:13 PM
I believe so. You can save binary data to dictionary entries in art or the document itself. I don't know what the upper limit is, but it maybe possible to store any amount of binary data -- that would effectively let you store whatever you want in an AI document.
... View more
Aug 29, 2024
05:43 PM
The Illustrator AI arrowheads are located in the Required Resources folder, which you can find using the AIFoldersSuite::FindFolder -- the one you want is kAIRequiredLocalizedResourcesFolderType. Once you have that path, it's Arrowheads.ai. You can use AIPathStyleSuite::ImportSytles() to get a document handle to the file, and use that with AISymbolSuite::GetNthSymbolPatternFromDocument() to load specific arrowheads.
... View more
Aug 29, 2024
05:40 PM
This is a bit annoying to do, but you basically have to get the path's AIArtStyle, parse it (AIArtStyleParser) get the stroke you want to update and then modify its paint field with the AIBeautifulStrokes::SetArrowheadOptions. The arrow heads themselves are a style you'll have to pull in somehow, and you apply something like this: error = sAIBeautifulStrokes->SetArrowheadOptions(strokeEffectsDictionary, 0, &arrowHeadStyle, kAIRealUnknown, arrowHeadScale, alignment); I'd post more code but (a) it's internal code I'm not allowed to share and (b) it's riddled with helper classes I've written to make this tedious code easier to manage. Hopefully that's enough to get you to where you need to be though.
... View more
Mar 20, 2024
10:37 AM
3 Upvotes
You're looking for art of type 'kPluginGroupArt' -- look at AIPluginGroup.h (not the most intuitive name, I know) and that should have everything you need to make one. I'll warn you, it's a bit rough around the edges, but we use it in our plugin for three or four kinds of custom artwork.
... View more
Jan 08, 2024
06:58 AM
Yes, there's a way and it's very easy fortunately. Use the AIRuntimeSuite (AIRuntime.h) like this: const auto majorVersion = sAIRuntime->GetAppMajorVersion();
const auto minorVersion = sAIRuntime->GetAppMinorVersion();
const auto revisionVersion = sAIRuntime->GetAppRevisionVersion();
... View more
Oct 02, 2023
10:48 AM
1 Upvote
The missing piece you're looking for is AIPathStyle::ImportStyles(). That lets you specify a path to an AI document and gives you an AIDocumentHandle that you can use with the GetNthSymbolPatternFromDocument() function.
... View more
Aug 10, 2023
03:44 PM
1 Upvote
Reading an Illustrator document is quite difficult. There are no public APIs for doing so available from Adobe. Three is a free library that can do it, but does not support versions newer than nearly twenty years ago. They was a proprietary library that could do the job about fifteen years ago but I don't know if it still exists, and even if it does, it was very exprensive ($25k/year). Bottom line is that using the Illustrator format as a payload is very dicey, maybe not even possible.
... View more
Jun 25, 2023
10:37 AM
Oh, and our plugins require a license or trial, which you can receive in-application. We use a third party licensing system that I've heavily wrapped in our own custom code & UI. So not something that is easily replicated. For years we just used an 'enter a code' system which had a built in end date (or not), indicated the feature level and could be verified as valid or not. We left that behind about twenty years ago, but it might be a good solution. Though it it won't work if your code is readily available. If the code isn't obfuscated somehow, any licensing will heavily rely on good ill 🙂
... View more
Jun 25, 2023
10:32 AM
Sorry, late to this thread -- been sick all week -- but we use a full blown installer using WiX and a custom written installer start screen (basically a window that lets you pick a language and then runs an MSI). But our plugin is probably far more complicated than all but maybe two or three third party plugins in the world. If you're just looking to deploy CEP & a plugin, ZXP might suit you, even if you're not using Adobe Exchange. It still lets you just double-click install (I think! It's been a while!). We worked with Adobe years ago to try and use ZXP, but we had way too many components that had to go to the right place for it to work. But it should handle a 'standard' plugin without many (or any) dependencies and a supported UI framework.
... View more
Jun 25, 2023
10:27 AM
I agree, it's an interesting topic. I've been doing the icons on our plugin for years (though we have other people who do that now) and it's always been a "try this and see how it looks". More explicit guidelines like what you're trying to do would have been useful to me years ago, and would probably still be useful us today (we do update the icons from time to time). I've had no luck either getting SVGs working for panel icons on Windows. I never bothered to try Mac at that point. It's not clear why that is; SVGs work for every other UI element just fine. Literally the only PNGs left in our plugin are for the panels. I'd love to replace them with SVGs too. To be fair, I haven't tried for a few years. Next time I find myself with someone from Adobe (this happens with some reasonable frequency!) I'll try and remember to ask about this.
... View more
Jun 14, 2023
08:18 AM
I don't see any obvious interface for that in the AI headers, but I'm sure there are platform-dependent ways to do it. I use CORE, which allows you to set up notifiers for when any particular key is pressed, or it can check the state of modier keys at any time. One thing to watch for is that it doesn't "steal" key presses from other parts of AI, rendering other keyboard shortcuts useless. By @Rick E Johnson 100% on this. We still have issues where we somestimes steal focus from the main AI document window and CTRL+Z stops working.
... View more
Jun 14, 2023
08:15 AM
The SDK has no functionality for this as far as I know. We have done it, but it requires you to use platform SDKs (Windows, OSX) to find the window whose keystrokes you want to capture (when it has focus). We use Qt in our plugin and that helps us, but it's still tricky.
... View more
Jun 05, 2023
08:09 AM
You can create your own toolbars but to the best of my knowledge you can't add to the Control panel one that updates based on context.
... View more
Jun 01, 2023
06:42 AM
There's a list of keys in illustratorapi\illustrator\actions\AIPDFFormatAction.h but it's meant for use with AIActionManager::PlayActionEvent(), but maybe they're also relevant to your context?
... View more
May 23, 2023
05:23 AM
1 Upvote
If you're basing your code of the sample code, you can see that in samplecode\common\Suites.cpp it defines the actual suite pointers like so: extern "C" {
SPAccessSuite *sSPAccess;
SPPluginsSuite *sSPPlugins;
AINotifierSuite *sAINotifier;
AIAppContextSuite *sAIAppContext;
AIUserSuite *sAIUser;
AIFilePathSuite *sAIFilePath;
AIFoldersSuite *sAIFolders;
} If you're following the pattern from the sample code, the suite in the header is just a forward declaration of the suite pointer, you need to actually define the actual suite pointer like above.
... View more
May 21, 2023
05:04 AM
EXC_BAD_ACCESS means you're talking to memory you don't own. Based on the image you posted, I'd say you haven't properly acquired the AIAppContextSuite and assigned it to sAIAppContext.
... View more
May 18, 2023
05:33 AM
This sounds even more likely to be the context problem I described in your other thread. Give that a try for this as well.
... View more
May 18, 2023
05:32 AM
You may have a context problem. See this thread for a solution if that's the case: https://community.adobe.com/t5/illustrator-discussions/window-button-and-aishapeconstructionsuite-newrect-function/m-p/10292083
... View more
May 16, 2023
06:00 AM
2 Upvotes
I just found out that someone has done a rewrite of that tool, which you can find here. I just tried it out and it's about 1000x faster and seems to work more or less the same. So if you find the other tool too slow, give it a try. Their version of that dialog I mentioned is "Options" > "Customize Search Folders" Minor note: your run DependenciesGui.exe not Dependencies.exe in the unzipped folder. I'll hang on to this and I suspect I'll be advocating for it in the future instead.
... View more
May 16, 2023
05:49 AM
1 Upvote
Figuring out why your plugin isn't being loaded is a time-honoured tradition in AI plugin development 😛 The first thing I always do is put a breakpoint in the shell.cpp or whatever the entry point source file is. If you hit that, everything else I'm about to tell you is unnecessary. But assuming you don't hit the breakpoint, it can only be either (i) your PIPL is missing/bad or it can't find a dependency. The tool I use to debug the latter kind of problem is DependencyWalker. Basically, you open the AIP file and it will show you its depenencies. It's fairly slow so be patient as it loads (it might look like it's hung for two or three minutes, but it is working). It will initially show most everything as missing, but you can add a path for it to consider: namely, the Illustrator.exe location where you put your DLLs. Once it loads, you press the explorer button at (1). Then you click the Browse button on the dialog that pops up (2) and pick the Illustrator folder (as you see I've done). Then you click the 'Add Directory' button at (3). Hit OK and you will be prompted to refresh the current file. Say 'Yes' and you will have to wait that two or three minutes again, but now it will be accurate. You can right-click and ask it to collapse everything, which will again take a minute or so but is probably worth it. That will leave you with your AIP as the only item, which you can expand see your immediate dependencies. Expanding them in turn will show their dependencies. You likely won't need to go more than one or two levels deep. The icon you're looking for is a yellow circle with a ? in it. You can ignore system ones, they'll work fine. You're interested in seeing DLLs you expect to be loaded, like Qt6Core.DLL or something that you know should be found. It will also flag them as x64 (if not shown, it's 32-bit) in case you've accidentally mixed your binaries. You shouldn't need anything that isn't in the tree in the upper left window. If everything looks good, then take a second look at the PIPL. If you have any questions about the tool, post them here with a screenshot and I might be able to help clarify. Good luck!
... View more
May 15, 2023
08:49 AM
Illustrator will not look in the plugins folder for DLLs. Try moving all your required support DLLs into the folder with Illustrator.exe (Support Files/Windows, something like that).
... View more
May 12, 2023
09:04 AM
So then it's definitely not including the resources at all. Odd, because I checked how we added our .rc file and it looks the same. We switched to CMake earlier this year, so I should be well situated to help here. I use nested CMakeLists.txt files and here's the one for our .rc file: cmake_minimum_required(VERSION 3.21)
target_sources(MAPublisher
PRIVATE
MAPublisher_cmake.rc
resource.h
) I don't see any real difference. If you're not already generating an MSVC project, I'd do that and see if the .rc file is included properly. I suspect it's not. That makes this less an AI thing and more a CMake thing -- there should be lots of help for that problem on StackOverflow. If you can get resources into the AIP and it's still not working, then we're back in AI SDK territory!
... View more
May 12, 2023
05:33 AM
This usually happens because it's missing the PIPL. You can check if it's in there by opening the AIP file in Visual Studio in the Resource editor. File > Open as usual. Make sure you pick the AIP but don't click Open yet. Now you can click on the Open's arrow button and pick "Open with...". Choose 'Resource Editor' (last entry). You should see something like this: If you don't, your PIPL isn't being included, and Illustrator will ignore your AIP. P.S. You don't need: set(CMAKE_AUTOMOC ON) That's for Qt (unless you are going to add Qt later, we do!)
... View more
May 09, 2023
07:09 AM
This is what I was about to post. You need to include the relevant CPP. If you ever get an `Undefined symbol` that means you are missing code, which is either a library or a .cpp file.
... View more
May 02, 2023
05:36 AM
1 Upvote
Yes, you can pretty much add a menuitem anywhere in the application menu system. I'm not sure if there are any off-limit spots, but I don't think so.
... View more
May 02, 2023
05:29 AM
1 Upvote
Unfortunately, no, there is no way to add menuitems to the Adobe context menus. If you have your panel where you control the UI, yes, but otherwise no.
... View more
Apr 01, 2023
06:32 AM
That's a fair answer. Playing an action is often a workaround to a missing C++ API, though it can come with constraints. For something like this though, it probably does the job. @Rick E Johnson is right as well about examples on the forum: I know I've read & answered many questions on PlayAction, just do a search for that.
... View more
Apr 01, 2023
05:33 AM
You can't do what you're trying to do. That API is purely so you can create & manage your own panels, not manipulate other plugin's panels. There is no C++ API for interacting with the UI of any shipped pluign directly.
... View more
Mar 24, 2023
06:20 AM
There's no SDK for this, you just have to grab the path & determine its direction by calculating the area. I forget which type Adobe uses (right or left) but I think negative is clockwise & positive is counter-clockwise. Obviously this only works for closed areas.
... View more
Mar 23, 2023
03:42 PM
Huh, you're right: none of them are in v24. So there must have been a few releases without anything. Funny! Good thing I never needed it! And good thing you can use it now 😁
... View more