Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
|
logiciels:blender:accueil [2018/06/13 21:18] resonance [python] |
logiciels:blender:accueil [2019/10/02 12:17] (Version actuelle) resonance [Ressources] |
||
|---|---|---|---|
| Ligne 8: | Ligne 8: | ||
| En français : | En français : | ||
| - | * [[http:// | ||
| * [[http:// | * [[http:// | ||
| + | * [[https:// | ||
| * [[http:// | * [[http:// | ||
| * [[http:// | * [[http:// | ||
| Ligne 79: | Ligne 79: | ||
| ob.name = ob.name.upper() | ob.name = ob.name.upper() | ||
| </ | </ | ||
| + | select all hidden objects that have ' | ||
| <code python> | <code python> | ||
| + | import bpy | ||
| + | # Selectionner les objects cachés qui ont ' | ||
| + | bpy.ops.object.select_all(action=' | ||
| + | for ob in bpy.context.scene.objects: | ||
| + | if not ob.hide: | ||
| + | continue | ||
| + | |||
| + | if ' | ||
| + | continue | ||
| + | |||
| + | ob.select = True | ||
| + | ob.hide = False | ||
| + | </ | ||
| + | |||
| + | # boucle for | ||
| + | <code python> | ||
| + | import bpy | ||
| + | |||
| + | # Create 600 tiny Monkeys rows of 25, having 1 unit between each Monkey. | ||
| + | for idx in range(600): | ||
| + | x = idx % 25 | ||
| + | y = idx // 25 | ||
| + | bpy.ops.mesh.primitive_monkey_add(radius=0.2, | ||
| + | </ | ||
| + | |||
| + | === modulo et entiers === | ||
| + | <code python> | ||
| + | idx idx % 4 idx // 4 | ||
| + | 0 0 0 | ||
| + | 1 1 0 | ||
| + | 2 2 0 | ||
| + | 3 3 0 | ||
| + | 4 0 1 | ||
| + | 5 1 1 | ||
| + | 6 2 1 | ||
| + | 7 3 1 | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | import bpy | ||
| + | |||
| + | # Create 600 tiny Monkeys in rows of 25, having 1 unit between each Monkey. | ||
| + | for idx in range(600): | ||
| + | x = idx % 25 | ||
| + | y = idx // 25 | ||
| + | bpy.ops.mesh.primitive_monkey_add(radius=0.2, | ||
| + | bpy.ops.object.modifier_add(type=' | ||
| + | bpy.ops.object.shade_smooth() | ||
| </ | </ | ||
| ===== Moteur de jeu ===== | ===== Moteur de jeu ===== | ||