Open GoogleCodeExporter opened 9 years ago
Hi,
The unsigned int are currently not renamed, this type is missing from the
rename list. If these would be renamed there will be no set function in python,
u.set(1.0) will cause an AttributeError. and u.set_float must then be used.
If the renames would simply be removed, swig will take care of the overloading
for set, however get will then have many problems like this:
1>C:\tmp\win64_local\OpenSceneGraph-2.8.3\include\osg\Uniform(345) : Warning
509: Overloaded method osg::Uniform::get(int &) const effectively ignored,
1>C:\tmp\win64_local\OpenSceneGraph-2.8.3\include\osg\Uniform(344) : Warning
509: as it is shadowed by osg::Uniform::get(float &) const.
a solution could be renaming only the get functions (and add the get unsigned
int renames).
don't know what caused the 'don't work anymore'. Could be a change in the osg
version or in the swig version.
see:
http://www.swig.org/Doc2.0/Python.html#Python_nn23
René
Original comment by Megamill...@gmail.com
on 25 Mar 2011 at 9:25
It can't be a change in the OSG version, because it worked with 2.8.3 before
the aforementioned changesets.
I should mention that when I said "typemaps" in the problem description and
title, I mistakingly assumed the typemaps for Uniform in osg.i were for
Uniform.set. Naturally they are for Uniform.get. Perhaps these typemaps are
also what's causing the shadowing problems with Uniform.get, since they
effectively transform all differently typed get methods to just get().
I personally have no problem with using the "set_<typename>" renames, BTW. When
I read your explanation, it seems very odd that it used to work at all!
Original comment by yunarai...@gmail.com
on 26 Mar 2011 at 11:55
Uniform.getElement and uniform.setElement suffer from the same issue, BTW. And
the typemaps for Uniform near the bottom of osg.i actually don't do anything
anymore, so if the renames end up being the selected solution, the "apply"s
around line 1100 can be removed, I think.
Original comment by yunarai...@gmail.com
on 27 Mar 2011 at 12:10
I think I know why the behaviour changed. In revision f193ce9245d7 the set
renames were apparently added. I probably had an older and/or branched revision
built myself, although I seem to remember seeing the set renames in osg.i.
Original comment by yunarai...@gmail.com
on 28 Mar 2011 at 1:28
Original issue reported on code.google.com by
yunarai...@gmail.com
on 25 Mar 2011 at 6:46