This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from math import pi | |
from random import random | |
from mathutils import Vector | |
bpy.ops.mesh.primitive_monkey_add() | |
instance_obj = bpy.context.active_object | |
bpy.ops.mesh.primitive_cube_add() | |
instancer_obj = bpy.context.active_object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
""" | |
C poll method : | |
RegionView3D *CTX_wm_region_view3d(const bContext *C) | |
{ | |
ScrArea *area = CTX_wm_area(C); | |
ARegion *region = CTX_wm_region(C); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from bpy.props import EnumProperty | |
def Dynamic_Enum(context): | |
Dynamic_Enum.enum_items = [] | |
for line in bpy.data.texts['Text'].lines: | |
Dynamic_Enum.enum_items.append((line.body, line.body,"")) | |
def pick_enum(self, context): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import sys | |
py_exec = sys.executable | |
# ensure pip is installed | |
subprocess.call([str(py_exec), "-m", "ensurepip", "--user" ]) | |
# update pip | |
subprocess.call([str(py_exec), "-m", "pip", "install", "--upgrade", "pip" ]) | |
# install packages | |
subprocess.call([str(py_exec),"-m", "pip", "install", f"--target={str(py_exec)[:-14]}" + "lib", "pytest"]) |