Skip to content

Instantly share code, notes, and snippets.

View stilobique's full-sized avatar
🎮
Make Video Game... or not

Aurelien Vaillant stilobique

🎮
Make Video Game... or not
View GitHub Profile
@stilobique
stilobique / BatchPlacement.py
Last active March 15, 2022 09:41
Blender Batch Placement by name correspondance
import bpy
import bmesh
import math
from mathutils import Euler
def get_rotation_from_source(ob: bpy.types.Object) -> Euler:
"""Get rotation from Cursor or Object, and set-it to the new items"""
bm = bmesh.new()
bm.from_object(ob, bpy.context.evaluated_depsgraph_get())
@stilobique
stilobique / rename_with_prefix.py
Created March 9, 2022 15:37
Python to rename all files in a dedicated folder
import os
def rename_with_prefix(path_rename, prefix: str = 'T_QUAJ_HDRI_'):
for root, folders, files in os.walk(path_rename):
for file in files:
print(f'Rename {os.path.join(root, file)}')
os.rename(os.path.join(root, file), os.path.join(root, f'{prefix}{file}'))
@stilobique
stilobique / livebox-ip.py
Created September 11, 2021 13:08 — forked from pabluk/livebox-ip.py
Livebox IP
#!/usr/bin/env python
"""
This file provides a class to connect to the Livebox router
and get his public IP address.
The Livebox router is provided by Orange, a French ISP.
Usage
-----
$ python livebox-ip.py
@stilobique
stilobique / scratch_exception.py
Created August 10, 2021 15:21
Setup a dedicated exception
class ErrorTest(Exception):
""" A message about one error"""
pass
class ExceptTest(Exception):
""" A message about one error"""
pass
@stilobique
stilobique / lockview.py
Created August 2, 2019 11:56 — forked from Fweeb/lockview.py
Blender add-on for exposing the 3D View's rotation locking feature
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of