AFirstPlugin example problem

dakkuuandakkuuan Posts: 305

I'm attempting to run the AFirstPlugin interface example. I've got it to compile and install into the studio. It's lists as enabled but I don't see a new option under Edit. I'm using Daz Studio 4.7, btw, but I didn't think that would matter.Any ideas?

Comments

  • surrealsurreal Posts: 170
    edited December 1969

    Hi,
    It should add a menu item "Hello" to the bottom of the Edit menu. At least it did for me. I think I had to restart DAZ3D after enabling the Plugin.

  • dakkuuandakkuuan Posts: 305
    edited December 1969

    It doesn't show up, oddly. Other examples work but not that one. I've disabled the plugin, renabled it, restarted daz and everything.

  • surrealsurreal Posts: 170
    edited December 1969

    So you created your own unique GUID and put that in pluginmain.cpp [overwriting the GUID in the example].?
    DZ_PLUGIN_CLASS_GUID( DzAFirstPluginAction, ???????????????????????????

    Once you have done that the creator [...DzEditAction( "Hello", ...] in afirstpluginaction.cpp should do the rest!


    If you go to Window > Workspace > Customize...
    Do you see it under Actions - Edit or under Menus - Main Menu > &Edit;
    ?


    I am assuming that the A First Plugin (SDK Example) is showing up in your installed Plugins as Loaded.

    Beyond that it is beyond my limited knowledge, sorry.

  • Cross22Cross22 Posts: 66
    edited December 1969

    paynn said:
    So you created your own unique GUID and put that in pluginmain.cpp [overwriting the GUID in the example].?

    Why overwrite the GUID with a new one? I would expect it to work with the one that was generated by DAZ.
    I am somewhat suspicious that maybe the DzEditAction base class utilized by this sample is working differently in 4.7 than it did in 4.5 causing the sample to break.

    Just like OP I eventually gave up on that project. The other samples in the SDK (including the very simple fullscreen action) appear to work as advertisted.

  • surrealsurreal Posts: 170
    edited December 1969

    If the GUID that was generated by DAZ (the GUID in the sample) is not already used by any other DAZ plugin on your computer then I guess using the DAZ provided GUID should work.

    I have built the sample a couple of times and built a few other Plugins for my own use. For each different plugin I generated my own GUID(s) even when I was using the rest of the sample code exactly as provided in the SDK. I have not had any problems creating the Edit Menu items (DzEditAction) using the sample code in 4.5 or 4.7 (on Windows 7 and 8.1).

    However I am still coming to grips with the rest of the DAZ Studio DzClasses :)

  • MetaGanic DesignsMetaGanic Designs Posts: 51
    edited December 1969

    As paynn mentioned, you should definitely try changing the GUID. I believe there was a GUID duplication issue at one point, followed by some more stringent plugin-loading validation added to Studio. This was fixed on the application side, so if you build that plugin against 4.8.0.x you should be fine.

    That being said, if you ever use one of those samples as a starting point for one of your own plugins, (which is actually a very good idea,) the absolute first thing you should do is change the GUID(s). Both in the project itself, as well as any classes you export using the DZ_PLUGIN and related macros.

    You will save yourself a lot of headache (and heart ache.) Been there, done that, and making sure you do that at the start is a really good way to avoid future issues. As much as you don't intend to muck about specifically with the sample code, you will. ;)

  • Cross22Cross22 Posts: 66
    edited December 1969

    Of course you need to change the GUID for your own plugins, but if DAZ ships this as valid sample code I would expect it to have a valid GUID as well :)

  • MetaGanic DesignsMetaGanic Designs Posts: 51
    edited December 1969

    hey, just trying to help dakkuuan out so he doesn't think it's something he did. I work with this SDK a lot and so offerred up what I knew. There's actually two answers in my post above, and either one will work. If I got carried away making "of course" suggestions then my appologies - just trying to help someone out who is just getting started.

Sign In or Register to comment.