samedi 15 février 2020

RIG - Head Follow and Tail



head follow switch rig from p2design
One only bendy bone Tail inspired by Tal Hershkovich


>> download


dimanche 19 janvier 2020

mardi 14 janvier 2020

Blender code : functions

useful for calling several time the same code
import bpy

def funk1(bla,blu):
    print("function with external references")
    print('sum of it =', bla+blu)

def funk2():
    print('basic function')   

bla=3
blu=5
funk1(bla,blu)

bla=20
blu=30
funk1(bla,blu)

funk2()

Result in the console is:
function with external references
sum of it = 8
function with external references
sum of it = 50
basic function

mercredi 20 novembre 2019

PROCEDURAL BLOC DISSOLVE

A setup for a cool block dissolve animation
I use a driver expression for animation: frame/4

>>download the scene








jeudi 17 octobre 2019

MULTIPLE CURVE FOLLOW RIG

Here 's a trick to control multiple curves path switch and stationnary location too within pose mode of your rig.


>> download the scene


trick: To avoid anoying twist on curve just set Twist Method to Z-Up for each curves






 



mercredi 26 juin 2019

Blender code: dealing with list

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
import bpy
list = []
sel = bpy.context.selected_objects    
for ob in sel:
    list.append(ob) #or list+=[ob]
    print(list)
for i in list:
    print(i)
    #action:
    #bpy.context.object.data.auto_smooth_angle = 0.436332
    i.data.auto_smooth_angle = 0.43633212

Blender code: Manage texts

Managing text settings on selection
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import bpy

newfont = bpy.data.fonts.load("//FONTS/ariblk.ttf")
Sel = bpy.context.selected_objects
for obj in Sel:
    if obj.type == 'FONT':
        print(obj)
        obj.data.font = newfont
        obj.data.size = 0.5
        obj.data.space_character = 1.4

Removing text parts on selection (a bit tricky but many possibilities)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
import bpy

Sel = bpy.context.selected_objects
for obj in Sel:
    if obj.type == 'FONT':
    #remove first 7 characters
        obj.data.body = obj.data.body[7:]
        
    #remove all but 7 first characters
        obj.data.body = obj.data.body[:7]
        
    #remove from 3rd character to 7 from start
        obj.data.body = obj.data.body[:3] + obj.data.body[7:]
        
    #remove first 3 and copy first 7 to the end
        obj.data.body = obj.data.body[3:] + obj.data.body[:7]
        
    #remove first 3 and copy from after first 7 to the end
        obj.data.body = obj.data.body[3:] + obj.data.body[7:]    
    

Rename texts objects by their content (first 10 characters)
1
2
3
4
5
6
import bpy
print("*****************")
print("rename text objects by content")
for ob in bpy.data.objects:
    if ob.type == 'FONT':
        ob.name = ob.data.body[:10]