Notifications
Clear all

[Closed] SDK: Function publishing actions not working

Success at last! Thanks to your tip to look in the pluginmanager sample. I had actually looked at the other gup samples before, but not at this one. It turns out that there was one parameter missing in the code in the help: the action context id:

const ActionContextId kActionContext         = 0;

IEdgeSmoothImpl edgesmooth_desc(
	EDGESMOOTH_INTERFACE,
	_T("edgesmooth"),
	IDS_CLASS_NAME,
	&edgeSmoothDesc,
	FP_ACTIONS, 
	kActionContext,   //  <-----
		IEdgeSmooth::em_test, _T("test"), IDS_MAKE_SOFT, 0,
		end,
	end
);

This actually exposes it to maxscript as well, which is nice! Now that it is working I think its time to trim all the junk to see what the minimal required code for all this is.

Thanks very much for your help claude!

great, i just did a windows search on the max sdk folder looking for “FN_ACTION” in the file and up popped pluginmanager. Reading the help i thought there must be something implementing this method.

And another thing from that same help page that does not seem to work…

f_iconRes, IDI_CREATE_ICON,

Results in this error when loading the plugin:
Error in FPInterfaceDesc definition. f_iconRes is not yet supported, use f_icon in block …

So does that mean we can’t use resources included in the plugin as icons? 🙁
00833 f_iconRes, // icon as resource ID
00834 f_icon, // icon as UI .bmp filename, index pair, as per CUI icon specifications

Here’s another thing that is puzzling me: the f_shortCut property. It seems to work in the UI, but not for the keyboard. By that I mean that in the Customize User Interface dialog the shortcut shows up as intended, but it does not work when trying to use it. Also, when you assign the same shortcut to it, there are two! E.g. Shift+H, Shift+H.

FP_ACTIONS, 
kActionMainUIContext,
IEdgeSmooth::es_makeHard, _T("MakeHard"), IDS_MAKE_HARD, 0, 
//.....//
f_shortCut, FSHIFT, 72,end, end

Also, I would have thought that I could use a Char or String instead of an int here, but that gives weird results. Any idea what would be nicer than doing it as it is now?

Page 2 / 2