El domingo, 5 de junio de 2016, 1:15:50 (UTC+2), Rudi Hammad escribió:
>
> ok. I think I get it. I wrote this example to see if I am on the right path
>
> http://pastebin.com/AqVCPpet
>
> you right about the CoreTools with capital "C", I try to follow the python 
> styling. There are somethings I don´t agree with. For instances, I tend to 
> put more blank lines
> than recomended by python gurus. For example I read better
>
> def foo():
>

          bla bla bla bla
          bla blabla bla

than 

   def foo():
          bla bla bla blabla
          bla blablablabla 


or myTuple( "a", "b", "c" ) than ("a", "b", "c")

I know those are minor details, but I don´t know if that might annoy other 
python coders

          bla blab la blabla

    

>
>
>
> El domingo, 5 de junio de 2016, 0:40:31 (UTC+2), Justin Israel escribió:
>>
>>
>>
>> On Sun, 5 Jun 2016 10:35 AM Rudi Hammad <[email protected]> wrote:
>>
>>>
>>>
>>>> If you have a class with only 2 methods, and one of them is __init__(), 
>>>> then you actually want a function:  Stop Writing Classes 
>>>> <https://www.google.co.nz/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwj93brXr4_NAhWh5aYKHcr2A9kQtwIIIzAB&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D5ZKvwuZSiyc&usg=AFQjCNFmZVxxwQizSaiWoIvyttCxF7eNsQ&sig2=KdZ31zIBfmhaOxVsVG14DA>
>>>>
>>>> That was just an example, of course I have a lot of methods. It was 
>>> just to understand if using in the __init__ the args "side" and "name" is 
>>> okey., because the rest of the methods use those variables
>>> at some point.
>>>
>>
>> Oh ok. Then sure, those seem fine. If they are the required variables 
>> that drive the functionality of the other methods then it makes sense to be 
>> able to construct and instance with them. 
>>
>>
>>> They way I am wrote my last code to do the tool in the reel I linked is: 
>>> 1. coreTools class that has methods to gets distances, vectors, 
>>> vertexcountes etc..etc..so generic stuff you use usally
>>> 2. then in another module I have a jointTools class, that has methods to 
>>> do basic rigging stuff, like iks, fk/ik, etc...
>>> 3. a more detailed class that inherits from joint jointTools class to 
>>> make methods like softIk, stretchyIk, bendings etc..etc...
>>>
>>> Is this approach correct for OOP?
>>>
>>
>> If coreTools class needs state for each instance, then sure. If it's just 
>> a bunch of utility methods that don't access "self" other than than to call 
>> another method, then maybe not. And coreTools would be expected to be 
>> CoreTools if it's a class ;-) 
>>
>>
>>> thanks for the tuple()  and _private tips
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Python Programming for Autodesk Maya" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/81667cab-892c-4e07-a0e7-e3c989a7fbdc%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/python_inside_maya/81667cab-892c-4e07-a0e7-e3c989a7fbdc%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/046b0a5e-0300-408c-a23d-ebf8535f05e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to