You could use Build instead of Skeleton.
This would make sense since you already have skeleton in the rbskeleton, then you will have rbs.Build()
It would also work well with other functions like rbs.Destroy()
--
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f6a528d2-d2ee-4cfa-9c9c-dbe8beda6bf6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
But a class named Skeleton is more descriptive than Build.
hmmm, interesting.
But a class named Skeleton is more descriptive than Build.
I might be overthinking all that, but I am curious about it.
El sábado, 24 de septiembre de 2016, 19:47:28 (UTC+1), ynedelin escribió:
You could use Build instead of Skeleton.
This would make sense since you already have skeleton in the rbskeleton, then you will have rbs.Build()
It would also work well with other functions like rbs.Destroy()
On Sep 24, 2016 12:20 PM, "Rudi Hammad" <rudih...@gmail.com> wrote:
Hi,--
so I guess that in the end every one has his one logical way for the nomenclature. pep 8 says that packages should always be lowercase with no underscore, and module lowercase with underscore if needed.
I have a package call rbskeleton, "rb" stands for rig builder. And the module is name skeleton. and the class inside the module is Skeleton .(or I could also name the class BuildSkeleton to add som variety , I don´t know)
I have then
import rbskeleton.skeleton as rbs
mySkeleton = rbs.Skeleton()
I don´t like repeating all the time skeleton, but there is no other way to describe it. what do you thing? Do you follow pep 8 convention on packages and modules
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 python_inside_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f6a528d2-d2ee-4cfa-9c9c-dbe8beda6bf6%40googlegroups.com.
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1ca75171-3b86-4dc1-939f-ad35c0337ad2%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f6a528d2-d2ee-4cfa-9c9c-dbe8beda6bf6%40googlegroups.com.
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1ca75171-3b86-4dc1-939f-ad35c0337ad2%40googlegroups.com.
----
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPaTLMTagdxQr2cMtbh8YUVTat%3D0f0%3Dsskkz4A_rwvb9-JAWQg%40mail.gmail.com.
I think "Build" is a strange name for a class
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f6a528d2-d2ee-4cfa-9c9c-dbe8beda6bf6%40googlegroups.com.
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1ca75171-3b86-4dc1-939f-ad35c0337ad2%40googlegroups.com.
----
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPaTLMTagdxQr2cMtbh8YUVTat%3D0f0%3Dsskkz4A_rwvb9-JAWQg%40mail.gmail.com.
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2JRo0v0OB-F-TNbvCyGrzfnqZna4tws4juB82YG3BYFQ%40mail.gmail.com.
I agree too.
Based on limited knowledge of what you’re up to, here’s how I might have expected it to look.
from rigbuilder import skeleton
skeleton.build()
Personally, I might name my package something more interesting and less generic than “rigbuilder”. Like “flame” or “panzar”.
from panzar import skeleton
skeleton.build()
Putting a name on it adds personality and flavour but perhaps more importantly enables other rig builders with different personalities and flavours to coexist with yours. Just a thought!
Consider how it would affect the readability of your project if you:
a) removed the rb prefix and
b) made each class into a module
At the moment, rb is used as a namespace. In languages such as C, you need those to avoid nameclashes and to make your code look readable. But Python has a nicer way of representing namespaces already, with a dot. And your classes are verbs, which suggests to me that instantiating it “does something”, rather than “becomes something”.
For example, instead of:
from guides import Guides
guides = Guides()
guides.create_guides()
You could write:
import guides
guides.create()
In fact, I might encourage you to remove all of your classes entirely, and see what becomes of it.
The 80 characters per line, is definitely crazy
# When faced with this def a_very_big_fucntion_name(some_big_argument_name, another_big_argument, and_yet_another_huge_argument_name, this_seems_to_end_nowehere, what_should_I_do_with_these_arguments): pass # Do this def a_very_big_fucntion_name( some_big_argument_name, another_big_argument, and_yet_another_huge_argument_name, this_seems_to_end_nowehere, what_should_I_do_with_these_arguments, ): pass
# Instead of this condition = some_condition_that_is_very_long == long_condition and another_very_long_condition == another_long_condition or yet_another_long_condition != short_condition # Do this condition = ( some_condition_that_is_very_long == long_condition and another_very_long_condition == another_long_condition or yet_another_long_condition != short_condition )
# Instead of this raise ValueError("Some error that is so huge that it cannot be wrapped up in 80 characters. You have to show full error message otherwise it is not worth reporting at all. What to do now!") # Do this msg = ("Some error that is so huge that it cannot be wrapped " "up in 80 characters. You have to show full error message" " otherwise it is not worth reporting at all. What to do now!") raise ValueError(msg)
A lot of hard core programmers that I´ve woked with, don´t give a f*** about pep-8
About style, that is all fine. But if you're in a team, maybe try to think less about what you prefer, and consider the preference of those reading, and potentially maintaining your code.Even amazing programmers will appreciate having their preference considered.
--
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCH5a4hW7QY8wZAS8PQngbJur%3DpEYCrGfPHP5gFtCwiig%40mail.gmail.com.
class MyClass(object):
def someMethod(
some_big_argument_name,
another_big_argument,
and_yet_another_huge_argument_name
):
cmds.parentConstraint('L_armA_shoulder_fk_JNT',
'L_armA_shoulder_fk_JNT', mo=1, sr=1,
n='L_armA_shoulder_fk_parentConstraint')
class MyClass(object):
def someMethod(some_big_argument_name, another_big_argument,and_yet_another_huge_argument_name):
cmds.parentConstraint('L_armA_shoulder_fk_JNT', 'L_armA_shoulder_fk_JNT', mo=1, sr=1,
n='L_armA_shoulder_fk_parentConstraint')
Strawberry isn't wrong. But tastes differ, and best you can do is cook something that the largest amount of family members will like.
--
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODaYsxN6Xd88c2mVNq_%3Dg2h_pKa90RPLMHmPf1bLaBtbA%40mail.gmail.com.
And I don´t think it is uglier
def someMethod(
some_big_argument_name,
another_big_argument,
and_yet_another_huge_argument_name, # Note the ',' (not technically needed)
):and_yet_another_huge_argument_name,If you have chosen the style, such as strawberry, preferred by the highest percentage of your family, then you are doing it right. :)
strawberry: 7/10 <- winner!
pear: 2/10
marmite: 1/10
Thanks Alok.
See, some people think that, because they have a lot experience and talent(like marcus, and obviously he is very talented), they have they right to insult, using sarcastic comments, the people who are learning and asking questions.
( or maybe it is just with me, who knows). I am very stupid. So I have to ask and doubt the rules, no matter how many people follow them. In this forum, there are gods, that will just trash my opinion because I am nobody.
Thank you for taking the time to explain in a reasonable way all that, and not trashing my point of view with sarcasm.
I don´t think I will write in this forum anymore. I am sick of arrogance in programmers.
But I want to thank all of you, who helped me when I have doubts(Justin,Cesar, Alok, and many more I am forgetting). Thanks guys
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ea187457-11d7-4a34-acb7-434dec3a790c%40googlegroups.com.
Thanks Alok.
See, some people think that, because they have a lot experience and talent(like marcus, and obviously he is very talented), they have they right to insult, using sarcastic comments, the people who are learning and asking questions.
( or maybe it is just with me, who knows). I am very stupid. So I have to ask and doubt the rules, no matter how many people follow them. In this forum, there are gods, that will just trash my opinion because I am nobody.
Thank you for taking the time to explain in a reasonable way all that, and not trashing my point of view with sarcasm.
I don´t think I will write in this forum anymore. I am sick of arrogance in programmers.
But I want to thank all of you, who helped me when I have doubts(Justin,Cesar, Alok, and many more I am forgetting). Thanks guys
cheers.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPaTLMR%2B_bcXF93%3DB%3DgiABopTPGSGg3bhqCP%3D-yzvvgOUrDG8Q%40mail.gmail.com.