Some General Questions About Plugins



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

    On 01/07/2011 at 08:55, xxxxxxxx wrote:

    So I've been experimenting with plugin creation and have finally gotten a super simple plugin to work (thanks to this very helpful post) but I've come away with a few questions on the fundamentals.

    Also note I'm very new to this, I took a few months to learn the basics of Python but I'm only now over the last couple weeks actually applying that knowledge to C4D.

    How does the plugin actually get executed?  That is, how do all those methods get called?  In my limited understanding of Python, when I've created a class or used a class I have always explicitly called methods. But with these plugins the methods don't seem to be explicitly called, they just seem to executed.  What am I missing?

    I suppose that's enough of a question for right now, thanks for your input.



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

    On 01/07/2011 at 12:31, xxxxxxxx wrote:

    Hy Jiveon,

    the difference between code you write and execute yourself and the code you write here for a plugin/script/Node, is that the code is being called by Cinema.

    Assume you had written Cinema. How would you integrate foreign code?

    You would write some Classes that can be extended by a "user-class". In these classes you define methods that will get called. Like on plugin start or when you have to redraw something ...

    So, what you get from Cinema is an API which defines these classes and methods and you extend them. These methods are also called Hooks, because that is the point where you "hook up" your code with Cinema. From within these methods you can then call your own methods, but the entry point is always a hook.

    The same applies for example for Nodes. A node is always "getting called" when it is necessary (say, the frame gets changed).

    Hope this helps,
    maxx



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

    On 07/07/2011 at 08:16, xxxxxxxx wrote:

    Thanks maxx - that definitely helps.  As I've experimented a bit more I've been able to understand this concept a lot better.


Log in to reply