[Bf-python] Attribute casing
Gilbert, Joseph
jgilbert at tigr.ORG
Mon Aug 1 18:12:57 CEST 2005
Yes correctNorMap sounds like it should be correct for the texture
button.
Col, Nor, etc are part of a bit toggle regarding mtex->mapto. These
should be module constants. Col, Nor, Var are attributes that relate to
mtex->colFac, mtex->norFac, and mtex->varFac attributes of the Mtex
struct.
-----Original Message-----
From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Yehoshua
Sapir
Sent: Monday, August 01, 2005 11:31 AM
To: Blender Foundation Python list
Subject: Re: [Bf-python] Attribute casing
Gilbert, Joseph wrote:
>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,
>
>
Well, the button in Blender says "Correct Nor Map" so I'm pretty close.
;) Maybe it should be correctNorMap.
>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 :)
>
>
Unfortunately, 'Col', 'Nor', and 'Var' are the names of both the factor
slider buttons (which I named colFac, etc.) and the 'map to' buttons
(which I named mtCol, etc.) In addition, my patch uses mtex.col for the
color in the center of the UI 'Map To' panel.
>-----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&gr
o
>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