[Bf-taskforce25] RNA Naming convention

Campbell Barton ideasman42 at gmail.com
Wed Dec 3 05:23:47 CET 2008


On Wed, Dec 3, 2008 at 3:18 PM, GSR <gsr.b3d at infernal-iceberg.com> wrote:
> Hi,
> aligorith at gmail.com (2008-12-03 at 1716.27 +1300):
>> On Wed, Dec 3, 2008 at 5:10 PM, GSR <gsr.b3d at infernal-iceberg.com> wrote:
>>
>> > Hi,
>> > ideasman42 at gmail.com (2008-12-03 at 1451.33 +1100):
>> > > Could identifier names starting with numbers be forbidden with RNA?,
>> > > this is messing up python which cant do
>> > >   bpy.curves['MyCurve'].3d = True
>> > >
>> > > (using setattr works but is ugly syntax)
>> >
>> > Instead of making it special and as per
>> >
>> > http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA#Naming_Conventions
>> > "Don't shorten names unnecessarily." use three_d instead of 3d (and
>> > this example can be used to add the rule that identifiers must start
>> > with lower case, for compability).
>>
>> Ewwww.... I'd rather go with Campbell's suggestion than use something as
>> vulgar as this.
>
> And next time it is not a toggle? What prefix gets added?
>
> GSR

Your right my suggestion doesn't cover this.
GSR - Do you have an example of a blender attribute like this?

I cant think of any, but it probably ok to re-arrange an attribute
name so it dosnt start with a number.
2D_loc -> loc_2D or whatever.

For bool options I missed one prefix.
item.isSpam || item.isntSpam

Id be interested to know what others think of having a TOGN option for bools.


More information about the Bf-taskforce25 mailing list