Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python API via SWIG (WIP) #265

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

rpaciorek
Copy link
Contributor

Hi,

this is proposition to add Python API to Ogre-next generated by SWIG.

The SWIG as Ogre Component approach is inspired by Python API from Ogre 1.x. This is updated (and reworked) version of my PR for 2.1 from bitbucket (abandoned with 2.1 and bitbucket).

The main question is if we want the Python API in Ogre itself or maybe as separated project (it use only headers and linking to OgreMain.so)?

API can be used to manipulate Ogre objects from python script system in C++ (where most of the Ogre related stuff is made in C++, main use case for me) or to init and use Ogre from pure Python (see testRun.py example).

Currently API is working, but incomplete and need some cleanup too (e.g. move testRun.py to samples and use Media from Ogre in it).

While creating and testing API I found some problem in Ogre itself (see FIXME notes in Ogre.i - mostly protected types used in public interface and missing reference by declared but not define functions), I can create PR to fix this if you want.

I use HLMS init code from samples as Python API element (see initHLMS.i), maybe Ogre should provide such helper function?

@darksylinc darksylinc added the enhancement New feature or request label Feb 10, 2022
darksylinc added a commit that referenced this pull request Feb 10, 2022
The struct ScheduledTasks is protected, hence functions that use it as
arguments can never be used.

Additionally, those functions made no sense to be called externally
@darksylinc
Copy link
Member

I fixed all the FIXME is not defined + MovableObject::calculateCameraDistance.
I also just fixed FIXME ScheduledTasks

@rpaciorek
Copy link
Contributor Author

Thanks. You probably missed protected typedef CameraList vs public getCameras() problem in OgreSceneManager.h.

Any comments about idea to add Python API via SWIG?

WIP:
	* working but incomplete
	* need some cleanup (e.g. move testRun.py to samples)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants