PDA

View Full Version : Distribute Plugin Source



parker
10-06-2004, 10:49 AM
Composing simple plugins is fairly easy, but "real world" plugins are daunting.

Numerous plugin tutorials are available, but they mostly demonstrate technique without descibing how to process the data structures in LW.

PROPOSAL: Distribute the C and H source for the plugins in the LW SDK.

faulknermano
10-06-2004, 10:09 PM
there are some simple ones included with the SDK documentation. but i do agree that having more source codes to learn from would help tremendously.

Karmacop
10-07-2004, 10:14 AM
Maybe an SDK manual and user guide like script would be good for the SDK?

Deep Purple
10-08-2004, 02:52 PM
Is somebody using C++ wrappers to make development of new plugins easier?
There was an opensource package available ( happylib ) which was quite nice.

I wrote my own template system to create LightWave plugins with a single line of code.

fyffe
10-09-2004, 05:12 PM
Hiya. I still keep HappyLib up to date. It wraps nearly the entire LW 7.5 SDK, and also the LW 6.0 SDK, plus has a lot of extra goodies. I'd be interested in hearing about how you used templates. I use a template to register the plugin now, such as:

RegisterPlugin<HappyInstance> happyInstance;

However, the individual plugin classes are base classes with virtual functions, such as LWPShader, LWPVolumetric, etc.

- Graham Fyffe

ceej
10-16-2004, 09:21 PM
Hmm, I was about to curse myself for spending the last week writing C++ wrappers for everything I wanted to use in the Lightwave SDK. Then I read in your forums that you haven't wrapped any of the panel stuff in HappyLib, and I felt better again. That's mostly what I concentrated on.

I'll probably release my stuff with a Creative Commons attribution/sharealike license when it's done. I'm not really being systematic about it, though. I've just wrapped the things I've needed for the plugin set I'm writing. I also wrote a little message-sending system so controls can notify their containers when they've been changed.

Usage looks something like this:


mScaleFactorField = new LightwaveFloatControl(IMPORT_SCALE_FACTOR_CHOSEN, "Scaling factor:");
mScaleFactorField->setInitialPosition(20, 90);
addChild(mScaleFactorField);
// later on to actually create and position it:
mScaleFactorField->initialize(panf, panel);
// to get what's in the field
float scale = mScaleFactorField->getValue();

Is there a handy download link for HappyLib for curious people? Google wasn't helpful.

Deep Purple
10-17-2004, 06:16 AM
I wrote a template class hierarchy which is able to wrap most plugin classes.

These three lines result in a basic generic plugin:



#include "genericplugin_adaptor.h"
#include "genericpluginpanel.h"
GenericPlugin_Adaptor<GenericPluginPanel> MyGenericPlugin("Empty panel");


The GenericPlugin_Adaptor will register a generic plugin named "Empty panel"

GenericPluginPanel is a specialization of my Panel class,
which is very simple to use, similar to ceej's class description.

I am using a generic Observer pattern base class to be able to
concentrate controls into more complex ones and notify Observers.
It is very convenient when developing user interfaces.


For the creation of a custom object the code is similar:



#include "customobject_adaptor"
#include "genericcustomobject.h"
CustomObject_Adaptor<GenericCustomObject> MyCustomObject( "does nothing" );


This woud register a custom object plugin named "does nothing".
To put funcionality into the plugin you would have to specialize GenericCustomObject and use that class as the template parameter.

Maybe we could put our efforts together and create an open source project on one of those sites who provide a free source control environment?

- David

fyffe
10-17-2004, 08:16 PM
Interesting. I like that style of using templates. It eliminates the macro I use in my plugins to generate some tedious virtual functions. It's possible we could combine my base classes, and use a template method similar to yours instead of the macros. that would be even easier than the way mine is now. I like having a base class, becaues there is default functionality already implemented and all kinds of helper functions.

- Graham




Maybe we could put our efforts together and create an open source project on one of those sites who provide a free source control environment?

- David

Lightwolf
11-03-2004, 03:56 PM
Let me just chime in here...

Since I switched to C++ starting this year (...and I love it :) ), I'm _also_ working on a bunch of wrappers (currently wrapping a couple of globals and adding generic functionality).

I'm also thinking about linking ui elements and variables including save/load methods, because I'm lazy ;) (and I like the way DF handles controls...)

So, I'd volunteer to pitch in code and join a dev team. As long as the resulting library can be used for commercial projects, I'm in.

Sourceforge?

Cheers,
Mike

carllooper
11-03-2004, 07:51 PM
Hey - I'm into being part of a Dev team as well.

Carl

Lightwolf
11-04-2004, 02:46 AM
Sounds good.

Is anyone interested in donating some base code?
Should we create a new thread? (Here or on www.splinecage.com ?)
Any name suggestions? (Important ! ;) my fav: LightWrap++ )

Cheers,
Mike

Deep Purple
11-09-2004, 12:30 PM
LightWrap++ sounds cool to me ;-)

I am a little busy at the moment,
but I would contribute what I got to start an open
Lightwave SDK C++ Wrapper Project ( at Sourceforge or
a similar provider of free source control )

Lightwolf
11-09-2004, 12:57 PM
Neat. I'm quite busy at the moment too. I would like to open up a small forum on Splinecage concerning LightWrap++ if that is o.k. with you guys ( 'n'gals? ). I'll try to set it up within the next couple of days, and we could discuss anything further from there onward.
I guess we'd probably collect some sources first, then agree on nomenclature and general design on the system and work our way forward from that.
To be honest, I never took part in more than a one man programming effort...
SourceForge is a pretty decent idea I guess.

Cheers,
Mike

Deep Purple
11-09-2004, 01:23 PM
A dedicated thread at splinecage.com would be all right with me.

- David

carbon8
11-09-2004, 02:40 PM
:D This is very exciting. I've setup the forum at splinecage.com just for LightWrap++
The link to it is http://www.splinecage.com/forums/forumdisplay.php?f=141
Attachments are enabled, so you can attach code or put it in the thread post. Either way is fine.

Post away. Let's get this going.