OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

access to viewer instances in plugins


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission
View previous topic :: View next topic  
Author Message
Ralf Habacker
Guest





PostPosted: Mon Aug 14, 2017 7:07 am    Post subject:
access to viewer instances in plugins
Reply with quote

Hi,

for
http://www.openscenegraph.org/index.php/gallery/use-cases/189-fm-profil
we are trying to add animation trigger support to the scene by a
specific plugins. Animation trigger support means to start an animation
if the user clicks a specific object. The recent implementation uses a
dedicated pick handler to be called if a user selects an object and
starts an animation by using the preset class
AnimationViewerModelController. The connection between the trigger
object and the related animation has been designed by using a specific
object name postfix including the animation name to make the pick
handler to find the related animation. The animation itself is created
with blender and exported with the osgexport plugin
(https://github.com/cedricpinson/osgexport).

The pick handler needs to be added to the viewer, which is normally
instantiated in the main application. Because we need to support several
viewers and we do not want to patch all related viewer (some of them are
3rdparty like https://github.com/ChrisDenham/osgopenvrviewer) we are
looking for a way to place all this mentioned stuff into an osg plugin,
which could be loaded by any viewer by appending the plugin extension
(which is animtrigger) to the model files e.g. osgviewer
test.osgt.animtrigger.

The mentioned pick handler needs to be added to the viewer like shown below

AnimationPickHandler *pickHandler = new AnimationPickHandler();
viewer->addEventHandler(pickHandler);

To have it in a plugin the plugin needs access to the global viewer
instances, which is not possible with recent code and I'm looking for a
way to add such support to osg.

Quote:
From my recent osg knowledge I would say that one of the available
viewer classes needs to be extended to register itself into some global
accessable list or "viewer manager" class.

Are there any hints for implementing this ?

Regards
Ralf






------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11152

PostPosted: Tue Aug 15, 2017 10:59 am    Post subject:
access to viewer instances in plugins
Reply with quote

Hi Ralf,


osg-submissions is for actual code changes/fixes not general discussion, the best place for this on osg-users mailing list/forum.  Could you repost on osg-users and I'll answer there.


Thanks,

Robert


On 14 August 2017 at 08:06, Ralf Habacker < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi,

for
http://www.openscenegraph.org/index.php/gallery/use-cases/189-fm-profil
we are trying to add animation trigger support to the scene by a
specific plugins. Animation trigger support means to start an animation
if the user clicks a specific object.  The recent implementation uses a
dedicated pick handler to be called if a user selects an object and
starts an animation by using the preset class
AnimationViewerModelController. The connection between the trigger
object and the related animation has been designed by using a specific
object name postfix including the animation name to make the pick
handler to find the related animation. The animation itself is created
with blender and exported with the osgexport plugin
(https://github.com/cedricpinson/osgexport).

The pick handler needs to be added to the viewer, which is normally
instantiated in the main application. Because we need to support several
viewers and we do not want to patch all related viewer (some of them are
3rdparty like https://github.com/ChrisDenham/osgopenvrviewer) we are
looking for a way to place all this mentioned stuff into an osg plugin,
which could be loaded by any viewer by appending the plugin extension
(which is animtrigger) to the model files e.g. osgviewer
test.osgt.animtrigger.

The mentioned pick handler needs to be added to the viewer like shown below

    AnimationPickHandler *pickHandler = new AnimationPickHandler();
    viewer->addEventHandler(pickHandler);

To have it in a plugin the plugin needs access to the global viewer
instances, which is not possible with recent code and I'm looking for a
way to add such support to osg.

Quote:
From my recent osg knowledge I would say that one of the available
viewer classes needs to be extended to register itself into some global
accessable list or "viewer manager" class.

Are there any hints for implementing this ?

Regards
Ralf




_______________________________________________
osg-submissions mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts How to access the view parameters fro... Miguel General 0 Fri Sep 22, 2017 5:31 pm View latest post
No new posts Passing input to viewer/camera (using... antiro42 General 2 Sat Sep 16, 2017 11:07 am View latest post
No new posts Passing input to viewer/camera (using... antiro42 General 0 Sat Sep 16, 2017 11:06 am View latest post
No new posts access to viewer instances in plugins Ralf Habacker General 2 Wed Aug 16, 2017 7:32 am View latest post
No new posts Having an issue with OSG plugins error. Brigham Keys, Esq. General 2 Wed Apr 12, 2017 5:24 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP