Create dialog for a shader plugin



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 26/06/2012 at 02:34, xxxxxxxx wrote:

    Hey everybody!
    I'm not new to programming but to using the c4d sdk...
    I just began to develop a shader plugin, but now I have a hard time finding any information about how to connect a settings dialog (I assume it's some kind of GeDialog?) with the plugin.

    I think there must be some function, event or anything which is toggled when I want to access the shader settings... but I couldn't find any info about it.

    Hope someone here knows how to do this?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 26/06/2012 at 02:54, xxxxxxxx wrote:

    Hi and welcome to Plugin Cafe!

    You have to pass a description name to RegisterShaderPlugin() for your ShaderData plugin to edit it in the attribute manager.

    You can take a look at the "Description resource" page in the C++ documentation and the Python plugins examples.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 26/06/2012 at 07:27, xxxxxxxx wrote:

    Thank you, I'll check if I find everything I need soon!



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 26/06/2012 at 07:31, xxxxxxxx wrote:

    Check this out when you want to create descriptions. :)
    Description Editor 0.9 BETA



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/06/2012 at 07:22, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Check this out when you want to create descriptions. :)
    Description Editor 0.9 BETA

    Danke das sieht sehr interessant aus!
    (*Thanks* )

    Now I got one more question. My Shader Description file and gui is working fine. However trying to learn from the example plugins I saw the parameter IDs can be accessed via c4d.MY_PARAMETER_NAME.

    So for example, I've defined the constant "MYSHADER_BLUR" in res/c4d_symbols.h and res/description/Xmyshader.h and added the fitting gui in res/description/Xmyshader.res. The Gui is shown in the shader editor; everything is fine so far. But when I try to access the constant using c4d.MYSHADER_BLUR I get an error message: 
    "AttributeError: 'module' object has no attribute 'MYSHADER_BLUR'".
    When I drag the element into the command line, it says "Myshader[c4d.MYSHADER_BLUR]".
    But when hitting return I get the same attribute error.

    Does anyone know what's wrong?
    Thanks!



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/06/2012 at 07:58, xxxxxxxx wrote:

    Hi,

    This is a know issue. Browse to your C4d preferences folder and the 'prefs' dir. Delete 'symbolcache' file. This will force the symbolcache to be regenerated.

    Also there's no need to define your shader description IDs in res/c4d_symbols.h (In the description header it's enough.)



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/06/2012 at 09:29, xxxxxxxx wrote:

    Thank you Yannick! Just found out about these two by myself a few minutes ago after browsing a bunch of threads in here. One addition for anyone who reads this:

    res/c4d_symbols.h is not used by python scripts but C++/COFFEE.

    Now that the frame is set up I can finally get to work! :D



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/06/2012 at 09:43, xxxxxxxx wrote:

    Addition: Don't know why, but when I remove the enumeration of my plugin constants from res/c4d_symbols.h I get a runtime error - it says the plugins' global resource couldn't be initiated.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/06/2012 at 10:46, xxxxxxxx wrote:

    @Yannick: Really? Never heard of that before. Dors Cinema just assigns random values to the symbols, then?
    @jbjhjm: Freut mich. ;)
    In order to recognize it a resource folder, the c4d_symbols.h must exist. :)



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/06/2012 at 11:09, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Hi,

    This is a know issue. Browse to your C4d preferences folder and the 'prefs' dir. Delete 'symbolcache' file. This will force the symbolcache to be regenerated.

    Also there's no need to define your shader description IDs in res/c4d_symbols.h (In the description header it's enough.)

    Hy there,

    seems I have the same problem. But I can't see any symbolcache file in my prefs. There is only a "coffeesymbolcache" and "directorycache" file, but no file named "symbolcache". Also, if the problem happens on my system, can it happen to customers too, that use that plugin?

    Cheers,
    maxx



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 29/06/2012 at 07:27, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Hy there,

    seems I have the same problem. But I can't see any symbolcache file in my prefs. There is only a "coffeesymbolcache" and "directorycache" file, but no file named "symbolcache". Also, if the problem happens on my system, can it happen to customers too, that use that plugin?

    Cheers,
    maxx

    Nope it will just happen during development. When C4D recognizes a new plugin it reads the resource/string/description files and caches them. If these files are changed after that (which will only happen during development) Cinema still uses the old, cached files. No problem for customers though.

    The cache file names seem to have changed over the last versions. Just rename or remove the cache files you can find and everything should work fine. If you didn't define libraries/custom shortcuts/custom layouts or anything you can even remove the whole appdata/c4d folder. Cinema will just create new files/settings from scratch.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/07/2012 at 07:05, xxxxxxxx wrote:

    ok, thanx for the infos!

    Cheers,
    maxx



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/07/2012 at 16:32, xxxxxxxx wrote:

    ... unfortunately, it just happened to my client too :(

    I had to tell him, how to delete the cache, after an update to the descriptions in a python plugin. Is there no way to prevent this from happening?

    Thank you,
    maxx



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/07/2012 at 02:41, xxxxxxxx wrote:

    Btw, this can of course also happend when a C++ plugin was updated and a Python script want to access a Symbolthat came along with the new version. When the symbolcache wasn't updated, the Symbol is not available.

    -nik


Log in to reply