Hi Gerrit,

I don't have any experience making python bindings, but I do with creating
Lua bindings for OpenSG.  In the search for good libraries to automate the
creation of the bindings I found SWIG <http://www.swig.org/> to be the most
useful for my purposes. This allowed most of the bindings to be automated.
However, I did find it useful to code a few by hand.

Given that Lua, and Python, are dynamically typed, it was possible to
simplify the binding interface considerably. For all FieldContainers a
single method can be used for getting a field value and setting a field
value.  As an example (In LUA):

local NewMaterial = OSG.createFieldContainer("SimpleMaterial")

NewMaterial:setFieldValue("ambient", OSG.Color3f(1.0,0.0,0.0))
NewMaterial:setFieldValue("diffuse", OSG.Color3f(0.0,1.0,0.0))

local NewGeometry = OSG.createFieldContainer("Geometry")
NewGeometry:setFieldValue("material", NewMaterial)

The setFieldValue method is generic and can be used to change the value of
any field of any FieldContainer.  I don't know if this is any help for you,
but I wanted to mention it.  The Lua support libraries can be found on my
github for of OpenSG
here<http://github.com/djkabala/OpenSGToolbox/tree/master/Source/Contrib/Lua>
.

On Tue, Jan 11, 2011 at 1:49 AM, Gerrit Voß <[email protected]> wrote:

>
> Hi,
>
> as this came up internally, can somebody give me a hint as to
> the status and where I can get started to look at it. It seems
> more sooner than later that I will need some form of (at least basic)
> script support. So I would like to have another structured go at it ;)
>
> kind regards
>  gerrit
>
> --
>
> Gerrit Voß
> 盖瑞客
> ---------------------------------------------------
> Fraunhofer IDM @ NTU
> 南洋理工大学, Nanyang Technological University, (NTU)
> 新加坡,      Singapore
> --------------------------------------------------
>
> If we communicate everything we ever think, speech
> just becomes static. And all of us become bores.
>
> J. Clarkson
>
>
>
>
> ------------------------------------------------------------------------------
> Gaining the trust of online customers is vital for the success of any
> company
> that requires sensitive data to be transmitted over the Web.   Learn how to
> best implement a security strategy that keeps consumers' information secure
> and instills the confidence they need to proceed with transactions.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Opensg-core mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-core
>
------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core

Reply via email to