[Bf-python] Attribute casing

Gilbert, Joseph jgilbert at tigr.ORG
Mon Aug 1 14:29:50 CEST 2005


Yea I agree with stivs. The lowerUpperUpper is nice. My only preference
is that attribute names follow the User Interface convention naming (as
opposed to data structure names). 

Buttons_shading.c (world_panel_mapto()) has the UI names for many of the
MTex variables. Unfortunately colfFac is the name of the datastruct
member. We don't really use the pseudo-hungarian notation of mtCol in
any module in blender. Although correctNor might be nice it gets hairy
at times trying to describe the method function in the name of the
attribute - of the 3 you listed I think this one is the best. However,
the safest thing is to name the attributes after the UI name imo. The UI
names are 'Col', 'Nor', 'Var'. Therefore appropriate names imho are
mtex.col, mtex.nor, and mtex.var. Although these are not the best most
descriptive names in the world - many blender users will be familiar
with them at least :)

-----Original Message-----
From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Yehoshua
Sapir
Sent: Friday, July 29, 2005 4:12 AM
To: Blender Foundation Python list
Subject: [Bf-python] Attribute casing

How should attributes be cased?

For my MTex patch 
(https://projects.blender.org/tracker/index.php?func=detail&aid=2869&gro
up_id=9&atid=127) 
I have for example the following:

mtex.colfac (factor for color mixing)
mtex.correctNor (the "correct nor" button)
mtex.mtCol (mapto "Col" button)

Some thoughts:

- I remember reading somewhere on the wiki that to conform to Python, 
everything should be cased like "correctNor".

- colFac looks odd and is slightly harder to type than colfac. Perhaps 
it should be named "colFactor" or something like that anyway?

_______________________________________________
Bf-python mailing list
Bf-python at projects.blender.org
http://projects.blender.org/mailman/listinfo/bf-python



More information about the Bf-python mailing list