[Bf-committers] RNA Rename Proposal

Nathan Letwory nathan at letworyinteractive.com
Mon Aug 16 23:08:35 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 16.8.2010 21:29, Campbell Barton wrote:
> Here is a list of RNA properties to rename edited by Brecht, Luca and
> myself (as mentioned last meeting).
> The lines which are colored have been changed from there original
> values, sorted by Class/attr.
> 
> http://wiki.blender.org/index.php/User:Ideasman42/rna_rename
> 
> Of 4605 names 1471 have changed, I'll need to write up some docs so
> theres better guidelines for naming new RNA properties based on the
> changes made here.

I think in general it's going into the right direction. What I think I
sometimes miss is information encoded in property naming (further usage
of verbs and other denoters) that tells you what properties are
read-only, what not.

For instance in current default scene, add a twenty-frame animation of
default cube to location, then try in console

for frame in range(1, 21):
    bpy.data.scenes[0].frame_current = frame
    print(bpy.data.objects[1].location)

When instead using .set_frame(frame) you'll see location properly
update. Yes, documentation goes a long way, but it is rightfully
confusing for developers when looking at dir(sometype) output and
gleaning from there potential properties to use in scripts only to find
out it doesn't do what one expects it to do (disclaimer: this could be a
bug, dunno, but I'm using this as a handy illustratory example ;)

Point in case: it'd be nice to be able to see directly from API naming
what a property (and function, come to that) actually can do and cannot do.

Again, I think in general the proposal is on the right track, unifying
naming will go a long way in helping developers write scripts in a fast
way without having to constantly consult documentation.

Some slight inconsistancy:
In some places words are written fully (texture, vertex), other places
words are abbreviated as in code (co, verts). Can we instead have
everywhere the full versions? That way one doesn't have to guess when
something is abbreviated or not (thus increasing uniformity throughout API).

There. Feedback written.

> Tomorrow I'll start to go ahead and apply the naming changes for
> UserPrefs, Themes and SpaceTypes since they are unlikely to be
> controversial or break peoples scripts.
> 
> In the meantime any developers who added RNA into blender could look
> at this list and make sure the names are ok.

Spotted a typo:

m|Itasc.dampmax -> dampimg_max.

make that damping_max.

/Nathan

- -- 
Nathan Letwory
Letwory Interactive
http://www.letworyinteractive.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMaajTAAoJEKtfN7KsE0TtjFUH/1ntMJuICna88Fq3UiahfZa9
Fdz0CM+ZZ98BizrJm7LLani7vb/Bf9PKaqq1jbckiVpq+JHHhjyVtV2QUXsdM6Q6
o/qexsT/uLkVv0pKftzNTXaE7Ajq1UQzTYGIYeFgcycz/6vVVt20crCAIOuopNbd
qZh4CD0QxrcLujAsktmV34iF+EB1X+b9RduDSf0hSLRebjvbJ/ZDKggPFvqyY5La
8mjIUFmyEvb3QkCDOazMv79dQgqLDmgCyqZYjrbDEM/jdSc5i8Rt58GqMk9lsIam
LhpxbXga223Aci1IqTGCdk1UUrMHHMnnVS7Df9ULb+T3MtAXOFIQKOxPLTbIuPc=
=swJk
-----END PGP SIGNATURE-----


More information about the Bf-committers mailing list