Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Vegdahl <cessen@cessen.com>2011-03-10 12:18:09 +0300
committerNathan Vegdahl <cessen@cessen.com>2011-03-10 12:18:09 +0300
commit887868444d4b4cec6fdae8a3b6f277e5e35527be (patch)
treeed107dfb35d74a82d4b7b9506b0ee0e83855a942 /rigify/generate.py
parente9efe82cd0af0a99567340bf1d8e458dfe1acb86 (diff)
Rigify:
Clean-up of the IK/FK snapping code. Should be much more maintainable now. Also changed rig id generation. Rig id's now consist of a random alphanumeric string 8 characters long, with the smallest 8 digits of seconds since the epoc (in hex) at the time of rig generation appended on the end. This results in a 16-character string that is ludicrously unlikely to have any collisions between rigs. 36^8 * 16^8, with the 16^8 being very well distributed over time. Ah... paranoia.
Diffstat (limited to 'rigify/generate.py')
-rw-r--r--rigify/generate.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/rigify/generate.py b/rigify/generate.py
index a439d357..d5f6fee8 100644
--- a/rigify/generate.py
+++ b/rigify/generate.py
@@ -52,7 +52,10 @@ def generate_rig(context, metarig):
"""
t = Timer()
- rig_id = random_string(12) # Random so that different rigs don't collide id's
+
+ # Random string with time appended so that
+ # different rigs don't collide id's
+ rig_id = random_string(8) + str(hex(int(time.time())))[2:][-8:].rjust(8, '0')
# Initial configuration
mode_orig = context.mode