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

[Proposal] Changes to BGE API for 2.8 #532

Open
sdfgeoff opened this issue Jul 11, 2017 · 4 comments
Open

[Proposal] Changes to BGE API for 2.8 #532

sdfgeoff opened this issue Jul 11, 2017 · 4 comments

Comments

@sdfgeoff
Copy link

sdfgeoff commented Jul 11, 2017

With the upcoming change to blender 2.8, and the breakages this will cause, I think it is a good time to also change/tidy blender's API.

The Problems

  • There is a mix of conventions: camelCase, MostlyCaps, snake_case and so on.
  • There are deprecated functions like KX_GameObject.position (which has been deprecated since, oh, 2.4x or so). Some are not marked as deprecated, such as bge.constraints.setGravity
  • There are constants of all types in bge.logic. Some could be moved into bge.texture, or bge.events, or the classes they are specific to.
  • Some parameters are spread out, like ik_min_x, ik_min_y, ik_min_z. These could be combined into a single ikMin parameter.
  • Lots of linked getters and setters. These could be condensed into properties. One example is vert.getRGBA and vert.setRGBA

The Solution
I have built up a massive list of proposed API changes in a google docs spreadsheet. Things in yellow are things that I want feedback on.

I propose five steps:

  1. Get approval for proposed changes
  2. Remove deprecated functions
  3. Replace naming conventions (eg some_variable into someVariable)
  4. Collapse split up variables (eg x, y, z into position or normal)
  5. Collapse split up getters/setters

As mentioned in IRC, I am willing to do the monkey work in renaming, but first would like to get approval on the massive spreadsheet.

@panzergame
Copy link
Contributor

Very nice work, thanks.

Why is this KX_SCA not just SCA
Some actuator access to KX data instead of only SCA data.

is3D --> is3d
This is right as in the camel case rules acronyms are words.

In KX_VertexProxy``uv and uv2 can be removed and replaced by vert.uvs[i].

setGravitycan be removed as it do implicitly and obscurely scene.gravity = .

About function in modules, never forget that python can't define getter/setter in modules, it's what we have only functions (excepted object as keyboardand mouse whose are not getter/setter)

I'm not sure to keep in futur the functions we use to define the python API, but at least cleaning it will allow to reduce the work at conversion.

@sdfgeoff
Copy link
Author

This is taking process in this branch of my fork:
https://github.com/sdfgeoff/blender/tree/ge_api_deprecation

@sdfgeoff
Copy link
Author

sdfgeoff commented Jul 17, 2017

Removed:

  • bge.logic.setGravity
  • bge.constraints.setGravity

It has been superseded by scene.gravity = <new_gravity_vector>

@panzergame
Copy link
Contributor

Thanks you so much for API modifications and name tracking. We will manage the vector properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants