How to make an addon?

13 views
Skip to first unread message

matthias

unread,
Mar 14, 2010, 7:48:22 AM3/14/10
to va-users
Hey,
I am trying to get my head around va, and thought i might try to
create my own simple addon for starters?
I wanted to get the tweener class from http://code.google.com/p/cpptweener/
to work in va, which i managed by putting the sourcefiles into the
myApp folders, but when i tried to put them in the addon space, i got
into some troubles.

i tried to give the addon the same structure as i saw i vaMice. The
tweener already uses a namespace ie. tween

thats what i wrote in the CMakeListes.txt file

SET( TWEEN_ROOT ${PROJECT_SOURCE_DIR}/addons/tween )

#set includes, also make available in parent scope
SET( TWEEN_INCLUDES
${TWEEN_ROOT}/include
)
SET( TWEEN_INCLUDES
${TWEEN_ROOT}/include
PARENT_SCOPE
)
INCLUDE_DIRECTORIES( ${TWEEN_INCLUDES} )


ADD_LIBRARY( tween STATIC
${TWEEN_ROOT}/include/tween/CppTweener.h
${TWEEN_ROOT}/src/CppTweener.cpp
)

TARGET_LINK_LIBRARIES( tween
va ${VA_LINK_LIBRARIES}
tween
)

SET_TARGET_PROPERTIES( tween PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${TWEEN_ROOT}/bin
)


And the folder structure in the addon is as follows:

addons
– tween
– – include
– – – tween
– – – – CppTweener.h
– – src
– – – CppTweener.cpp
– – CMakeListes.txt

I also changed the "#include "CppTweener.h" to "#include <tween/
CppTweener.h> in CppTweener.cpp


Then i thought, it should be possible to include the tweener via
#include <tween/CppTweener.h> in my MyApp.h, but xcode told me, that
it couldnt find the file/directory.

What is wrong?

Thanks for any answers.
Matthias

Matthias Rohrbach

unread,
Mar 14, 2010, 4:55:52 PM3/14/10
to va-u...@googlegroups.com
Just realized, it doesnt really make sense to put a tweener into
openscenegraph, since there is already animation, tweening and so much
more inside openscenegraph. Amazing... But would still be interesting
to know how to build an addon in a proper way?

Maybe a tuio connection to community core vision, for example. How
hard would it be, to get this up and running? Will it be worth to put
some effort into this? Or are you working on things like that anyway?

Thanks for listening
Matthias

stefan)

unread,
Mar 14, 2010, 4:56:18 PM3/14/10
to va-u...@googlegroups.com
The cpptweener stuff looks nice. I remember reading a flash book a
long time ago with this kind of animation code.

The way you have set up the tween addon looks correct. How about the
master CMakeListes.txt file? At the end there is a section where all
the addon directories are added. Have you added the tween addon
directory there? Something like ADD_SUBDIRECTORY( addons/tween )
should do the trick so cmake is aware of the new directory.

Let me know how it goes,

/stefan

Matthias Rohrbach

unread,
Mar 14, 2010, 5:14:40 PM3/14/10
to va-u...@googlegroups.com
yes, i added the following lines to CMakeLists.txt in the root
directory:

OPTION( BUILD_ADDON_TWEEN "Build the CPP Tweener addon." ON)
IF( BUILD_ADDON_TWEEN )
ADD_SUBDIRECTORY( addons/tween )
ENDIF()

but still the include through #include <tween/CppTweener.h> doesnt
work. What am i missing?

stefan)

unread,
Mar 14, 2010, 5:24:00 PM3/14/10
to va-u...@googlegroups.com
>animation, tweening and so much more inside openscenegraph.

right, osg has an animation plugin. It's quite extensive. Just be
aware that the current va release only comes with a small selection of
osg plugins (for simplicity). It is relatively easy to compile a
complete osg yourself or just let me know and I can send you binaries.

> Maybe a tuio connection to community core vision

tuio is based on UDP networking and OSC. Networking addon is in the
works ;) but I haven't thought about osc yet. If you want to give it a
shot let me know. I'll get the networking addon ready.

There is also a vaTouchkit addon in the release. It's a minimal ccv
with super clean blob tracking code. Currently it is specific to the
firefly cams though.

/stefan

stefan)

unread,
Mar 14, 2010, 7:50:57 PM3/14/10
to va-u...@googlegroups.com
not sure what's up. Maybe there is a small type somewhere in the cmake
files (there are 3 CMakeLists.txt involved).

For reference, I just uploaded a branch with the tween addon working.
It's in the git repo:
http://github.com/stefanix/VirtualAwesome/tree/cpptweener
There are no support libs in the repo so you will either have to pick
the files you want and copy them to your release copy. Or you will
have to copy all the support libs to the git checkout. Either way
should work.

Let me know if you have questions,

/stefan

matthias

unread,
Mar 21, 2010, 8:13:29 AM3/21/10
to va-users
Hi,thanks for the cpptweener addon, it worked like a charm.

Still playing around with va and osg, slowly getting an understanding
how everything is related.
I would like to try something with shadows, found a nice example in
the osg download package. I am able to compile this under xcode with
the help of the osg osx installation i found here
http://www.cuboslocos.com/tutorials/OSG-GettingStarted

Now, when i try to add pretty much the same code to a va project,
during linking xcode says:

Undefined symbols:

"osgShadow::ShadowedScene::setShadowTechnique(osgShadow::ShadowTechnique*)",
referenced from:
MyApp::MyApp() in MyApp.o
MyApp::MyApp() in MyApp.o

"osgShadow::ShadowedScene::ShadowedScene(osgShadow::ShadowTechnique*)",
referenced from:
MyApp::MyApp() in MyApp.o
MyApp::MyApp() in MyApp.o
"osgShadow::ShadowMap::ShadowMap()", referenced from:
MyApp::MyApp() in MyApp.o
MyApp::MyApp() in MyApp.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

I guess thats because osgShadow is not really part of the VA-project
somehow?

Actually this is mostly an example question for how to access the full
power of osg within va. Maybe this is of interest for others too?
Eventhough it seems i'm the only loudmouth on this list so far?
Do i need another osg-compilation? And where do i put it?

However, thanks for your work!
Matthias

stefan)

unread,
Mar 21, 2010, 1:29:36 PM3/21/10
to va-u...@googlegroups.com
> Hi,thanks for the cpptweener addon, it worked like a charm.

good to hear


> I would like to try something with shadows

> Undefined symbols


> I guess thats because osgShadow is not really part of the VA-project
> somehow?

that is correct. In va-0.4.2 we only included a small selection of osg
plugins. For the next release there is a good chance we include a
complete osg. We'll see. What you can do for now is download a
complete osg and drop it in the va libs directory instead of
'osg-osx'. Here is the download:
http://virtualawesome.googlecode.com/files/osg-2.8.2-osx-10.5-static-release-all.zip

Let us see some shadows if you get it working!

> i'm the only loudmouth on this list so far?

Yes va is still very new ... kudos to the early adopters ... ;)

Reply all
Reply to author
Forward
0 new messages