id int64 0 190k | prompt stringlengths 21 13.4M | docstring stringlengths 1 12k ⌀ |
|---|---|---|
20,087 | import bpy
from bpy.types import Context
import bpy
from bpy.types import Context, Object
The provided code snippet includes necessary dependencies for implementing the `show_ui_message_popup` function. Write a Python function `def show_ui_message_popup( message: str = "", title: str = "Sketcher Warning", icon: s... | Trigger a ui popup message NOTE: Perhaps better located in ui.py, but would currently require circular dependency with operators.py |
20,088 | from typing import Tuple
from bpy.types import Context, RegionView3D
from mathutils import Vector
from mathutils.geometry import intersect_line_plane
from bpy_extras.view3d_utils import (
location_3d_to_region_2d,
region_2d_to_location_3d,
region_2d_to_vector_3d,
region_2d_to_origin_3d,
)
def get_picki... | null |
20,089 | from typing import Tuple
from bpy.types import Context, RegionView3D
from mathutils import Vector
from mathutils.geometry import intersect_line_plane
from bpy_extras.view3d_utils import (
location_3d_to_region_2d,
region_2d_to_location_3d,
region_2d_to_vector_3d,
region_2d_to_origin_3d,
)
def get_place... | null |
20,090 | from typing import Tuple
from bpy.types import Context, RegionView3D
from mathutils import Vector
from mathutils.geometry import intersect_line_plane
from bpy_extras.view3d_utils import (
location_3d_to_region_2d,
region_2d_to_location_3d,
region_2d_to_vector_3d,
region_2d_to_origin_3d,
)
def get_pickin... | Returns the coordinates on the workplane the mouse points at |
20,091 | from typing import Tuple
from bpy.types import Context, RegionView3D
from mathutils import Vector
from mathutils.geometry import intersect_line_plane
from bpy_extras.view3d_utils import (
location_3d_to_region_2d,
region_2d_to_location_3d,
region_2d_to_vector_3d,
region_2d_to_origin_3d,
)
def get_2d_co... | null |
20,092 | from typing import Tuple
from bpy.types import Context, RegionView3D
from mathutils import Vector
from mathutils.geometry import intersect_line_plane
from bpy_extras.view3d_utils import (
location_3d_to_region_2d,
region_2d_to_location_3d,
region_2d_to_vector_3d,
region_2d_to_origin_3d,
)
def get_scale... | null |
20,093 | from typing import Tuple
from bpy.types import Context, RegionView3D
from mathutils import Vector
from mathutils.geometry import intersect_line_plane
from bpy_extras.view3d_utils import (
location_3d_to_region_2d,
region_2d_to_location_3d,
region_2d_to_vector_3d,
region_2d_to_origin_3d,
)
The provided ... | Update gizmos |
20,094 | from typing import Tuple
from bpy.types import Context, RegionView3D
from mathutils import Vector
from mathutils.geometry import intersect_line_plane
from bpy_extras.view3d_utils import (
location_3d_to_region_2d,
region_2d_to_location_3d,
region_2d_to_vector_3d,
region_2d_to_origin_3d,
)
def update_cb... | null |
20,095 | import re
from typing import Any, Sequence, Union
import bpy
from bpy.types import Context, Object
from mathutils import Vector
def unique_attribute_setter(self, name: str, value: Any):
def collection_from_element(self):
"""Get the collection containing the element"""
path = self.path_from_id()
... | null |
20,096 | import re
from typing import Any, Sequence, Union
import bpy
from bpy.types import Context, Object
from mathutils import Vector
import bpy
from bpy.types import Context, Object
The provided code snippet includes necessary dependencies for implementing the `add_new_empty` function. Write a Python function `def add_new... | Places an empty at given location, useful for testing |
20,097 | import re
from typing import Any, Sequence, Union
import bpy
from bpy.types import Context, Object
from mathutils import Vector
The provided code snippet includes necessary dependencies for implementing the `setprop` function. Write a Python function `def setprop(data, key, value)` to solve the following problem:
Set ... | Set an id prop without triggering it's update mehtod |
20,098 | import getpass
import logging
from tempfile import gettempdir
from pathlib import Path
from .register import get_name
import logging
def get_name():
return __package__.partition('.')[0]
The provided code snippet includes necessary dependencies for implementing the `setup_logger` function. Write a Python function... | Configures a logger, this is intended to be run on the root logger |
20,099 | import getpass
import logging
from tempfile import gettempdir
from pathlib import Path
from .register import get_name
def get_prefs():
def update_logger(logger):
from .preferences import get_prefs
prefs = get_prefs()
logger.setLevel(prefs.logging_level) | null |
20,100 | from collections import deque
from math import sin, cos
from typing import List
from mathutils import Vector, Matrix
from .. import global_data
from .constants import FULL_TURN
def draw_rect_2d(cx: float, cy: float, width: float, height: float):
# NOTE: this currently returns xyz coordinates, might make sense to re... | null |
20,101 | from collections import deque
from math import sin, cos
from typing import List
from mathutils import Vector, Matrix
from .. import global_data
from .constants import FULL_TURN
def draw_quad_3d(cx: float, cy: float, cz: float, width: float):
half_width = width / 2
coords = (
(cx - half_width, cy - half... | null |
20,102 | from collections import deque
from math import sin, cos
from typing import List
from mathutils import Vector, Matrix
from .. import global_data
from .constants import FULL_TURN
def tris_from_quad_ids(id0: int, id1: int, id2: int, id3: int):
return (id0, id1, id2), (id1, id2, id3)
def draw_cube_3d(cx: float, cy: fl... | null |
20,103 | from collections import deque
from math import sin, cos
from typing import List
from mathutils import Vector, Matrix
from .. import global_data
from .constants import FULL_TURN
FULL_TURN = tau
def coords_circle_2d(x: float, y: float, radius: float, segments: int):
coords = []
m = (1.0 / (segments - 1)) * FULL... | null |
20,104 | from collections import deque
from math import sin, cos
from typing import List
from mathutils import Vector, Matrix
from .. import global_data
from .constants import FULL_TURN
FULL_TURN = tau
def coords_arc_2d(
x: float,
y: float,
radius: float,
segments: int,
angle=FULL_TURN,
offset: float =... | null |
20,105 | from bpy.types import Context
from ..solver import solve_system
def solve_system(context, sketch=None):
solver = Solver(context, sketch)
return solver.solve()
The provided code snippet includes necessary dependencies for implementing the `update_system_cb` function. Write a Python function `def update_system_... | Update scene and re-run the solver, used as a property update callback |
20,106 | import site
import sys
import importlib
import subprocess
from importlib import reload
from .. import global_data
The provided code snippet includes necessary dependencies for implementing the `check_module` function. Write a Python function `def check_module(package)` to solve the following problem:
Note: Blender mig... | Note: Blender might be installed in a directory that needs admin rights and thus defaulting to a user installation. That path however might not be in sys.path |
20,107 | import site
import sys
import importlib
import subprocess
from importlib import reload
from .. import global_data
def update_pip():
cmd = [global_data.PYPATH, "-m", "pip", "install", "--upgrade", "pip"]
return not subprocess.call(cmd)
def refresh_path():
"""refresh path to packages found after install"""
... | null |
20,108 | import site
import sys
import importlib
import subprocess
from importlib import reload
from .. import global_data
def install_pip():
"""Subprocess call ensurepip module"""
cmd = [global_data.PYPATH, "-m", "ensurepip", "--upgrade"]
return not subprocess.call(cmd)
def ensure_pip():
if subprocess.call([gl... | null |
20,109 | import site
import sys
import importlib
import subprocess
from importlib import reload
from .. import global_data
def show_package_info(package: str):
try:
subprocess.call([global_data.PYPATH, "-m", "pip", "show", package])
except Exception as e:
print(e)
pass | null |
20,110 | import logging
from bpy.props import EnumProperty
from bpy.types import Context
from .. import global_data
from ..utilities.data_handling import entities_3d
logger = logging.getLogger(__name__)
def entities_3d(context: Context) -> Generator[SlvsGenericEntity, None, None]:
for entity in context.scene.sketcher.entit... | null |
20,111 | import logging
from bpy.props import EnumProperty
from bpy.types import Context
from .. import global_data
from ..utilities.data_handling import entities_3d
logger = logging.getLogger(__name__)
def deselect_all(context: Context):
logger.debug("Deselecting all sketcher entities")
global_data.selected.clear() | null |
20,112 | import bpy
from .register import get_name
def get_prefs():
return bpy.context.preferences.addons[get_name()].preferences
import bpy
from bpy.types import Context, Object
def get_scale():
return bpy.context.preferences.system.ui_scale * get_prefs().entity_scale | null |
20,113 | from enum import Enum
from typing import Callable, Tuple
from mathutils.geometry import (
intersect_line_line_2d as intersect_segment_segment_2d,
intersect_line_sphere_2d as intersect_segment_sphere_2d,
intersect_sphere_sphere_2d,
)
from .geometry import intersect_line_line_2d, intersect_line_sphere_2d
from... | null |
20,114 | from enum import Enum
from typing import Callable, Tuple
from mathutils.geometry import (
intersect_line_line_2d as intersect_segment_segment_2d,
intersect_line_sphere_2d as intersect_segment_sphere_2d,
intersect_sphere_sphere_2d,
)
from .geometry import intersect_line_line_2d, intersect_line_sphere_2d
from... | Find all intersections between all combinations of elements, (type, element) |
20,115 |
def index_to_rgb(i: int):
r = (i & int("0x000000FF", 16)) / 255
g = ((i & int("0x0000FF00", 16)) >> 8) / 255
b = ((i & int("0x00FF0000", 16)) >> 16) / 255
return r, g, b | null |
20,116 |
def rgb_to_index(r: int, g: int, b: int) -> int:
i = int(r * 255 + g * 255 * 256 + b * 255 * 256 * 256)
return i | null |
20,117 | import os
import sys
import importlib
from typing import List
from traceback import print_exc
The provided code snippet includes necessary dependencies for implementing the `cleanse_modules` function. Write a Python function `def cleanse_modules(parent_module_name)` to solve the following problem:
search for your plug... | search for your plugin modules in blender python sys.modules and remove them |
20,118 | import os
import sys
import importlib
from typing import List
from traceback import print_exc
def module_register_factory(parent_module_name: str, module_names: List[str]):
modules = [
importlib.import_module(f"{parent_module_name}.{name}") for name in module_names
]
def register():
for m ... | null |
20,119 | import math
from statistics import mean
from typing import Tuple
import mathutils
from mathutils import Vector
def get_face_orientation(mesh, face):
# returns quaternion describing the face orientation in objectspace
normal = mathutils.geometry.normal([mesh.vertices[i].co for i in face.vertices])
return no... | null |
20,120 | import math
from statistics import mean
from typing import Tuple
import mathutils
from mathutils import Vector
The provided code snippet includes necessary dependencies for implementing the `get_face_midpoint` function. Write a Python function `def get_face_midpoint(quat, ob, face)` to solve the following problem:
Ave... | Average distance from origin to face vertices. |
20,121 | import math
from statistics import mean
from typing import Tuple
import mathutils
from mathutils import Vector
def nearest_point_line_line(p1: Vector, d1: Vector, p2: Vector, d2: Vector) -> Vector:
n = d1.cross(d2)
n2 = d2.cross(n)
return p1 + ((p2 - p1).dot(n2) / d1.dot(n2)) * d1 | null |
20,122 | import shutil
import sys
import logging
from os import path
import bpy
from .register import get_path
logger = logging.getLogger(__name__)
import bpy
from bpy.types import Context, Object
def get_path():
def ensure_addon_presets(force_write=False):
scripts_folder = bpy.utils.user_resource("SCRIPTS")
presets... | null |
20,123 |
def set_handles(point):
point.handle_left_type = "FREE"
point.handle_right_type = "FREE" | null |
20,124 | from collections import deque
from typing import Generator, Deque, List, Sequence
from bpy.types import Scene, Context
from ..model.types import SlvsGenericEntity, SlvsSketch, GenericConstraint
def get_flat_deps(entity: SlvsGenericEntity):
"""Return flattened list of entities given entity depends on"""
list = [... | Returns a list of entities along with their dependencies |
20,125 | from collections import deque
from typing import Generator, Deque, List, Sequence
from bpy.types import Scene, Context
from ..model.types import SlvsGenericEntity, SlvsSketch, GenericConstraint
def get_scene_constraints(scene: Scene):
return scene.sketcher.constraints.all | null |
20,126 | from collections import deque
from typing import Generator, Deque, List, Sequence
from bpy.types import Scene, Context
from ..model.types import SlvsGenericEntity, SlvsSketch, GenericConstraint
def _is_referenced_by_constraint(entity, context):
for c in context.scene.sketcher.constraints.all:
if entity in c... | Checks if the entity is referenced from anywhere |
20,127 | from collections import deque
from typing import Generator, Deque, List, Sequence
from bpy.types import Scene, Context
from ..model.types import SlvsGenericEntity, SlvsSketch, GenericConstraint
def get_scene_entities(scene: Scene):
return scene.sketcher.entities.all
def get_sketch_deps_indicies(sketch: SlvsSketch,... | null |
20,128 | from collections import deque
from typing import Generator, Deque, List, Sequence
from bpy.types import Scene, Context
from ..model.types import SlvsGenericEntity, SlvsSketch, GenericConstraint
def get_constraint_local_indices(
entity: SlvsGenericEntity, context: Context
) -> Deque[int]:
constraints = context.... | null |
20,129 | from collections import deque
from typing import Generator, Deque, List, Sequence
from bpy.types import Scene, Context
from ..model.types import SlvsGenericEntity, SlvsSketch, GenericConstraint
The provided code snippet includes necessary dependencies for implementing the `get_scoped_constraints` function. Write a Pyt... | Return a list of constraints that are in the scope of a set of entities |
20,130 | from ..constants import Operators, numeric_events, unit_key_types
from bpy.types import KeyMapItem, Context, Event
from typing import List
def _get_key_hint(kmi: KeyMapItem) -> List[str]:
"""
Returns a string representing the keymap item in the form:
"ctrl + alt + shift + key"
"""
modifiers = {"ctrl... | Returns a list of shortcut hints to operator with given idname. Looks through keymaps in addon keyconfig. |
20,131 | from ..constants import Operators, numeric_events, unit_key_types
from bpy.types import KeyMapItem, Context, Event
from typing import List
def _tool_numeric_invoke_km(operator: str):
km = []
for event in numeric_events:
km.append(
(
operator,
{"type": event, "... | null |
20,132 | from ..constants import Operators, numeric_events, unit_key_types
from bpy.types import KeyMapItem, Context, Event
from typing import List
class Operators(str, Enum):
InvokeTool = "view3d.invoke_tool"
Test = "view3d.stateop_test"
def tool_invoke_kmi(button: str, tool: str, operator: str):
return (
... | null |
20,133 | from ..constants import Operators, numeric_events, unit_key_types
from bpy.types import KeyMapItem, Context, Event
from typing import List
numeric_events = (
"ZERO",
"ONE",
"TWO",
"THREE",
"FOUR",
"FIVE",
"SIX",
"SEVEN",
"EIGHT",
"NINE",
"PERIOD",
"NUMPAD_0",
"NUMPAD... | null |
20,134 | from ..constants import Operators, numeric_events, unit_key_types
from bpy.types import KeyMapItem, Context, Event
from typing import List
unit_key_types = (
"M",
"K",
"D",
"C",
"U",
"A",
"H",
"I",
"L",
"N",
"F",
"T",
"Y",
"U",
"R",
"E",
"G",
)
def i... | null |
20,135 | from ..constants import Operators, numeric_events, unit_key_types
from bpy.types import KeyMapItem, Context, Event
from typing import List
def get_unit_value(event: Event):
type = event.type
return type.lower() | null |
20,136 | from ..constants import Operators, numeric_events, unit_key_types
from bpy.types import KeyMapItem, Context, Event
from typing import List
def get_value_from_event(event: Event):
type = event.type
if type in ("ZERO", "NUMPAD_0"):
return "0"
if type in ("ONE", "NUMPAD_1"):
return "1"
if ... | null |
20,137 | import bpy
import bmesh
from bpy.types import Object
from mathutils.bvhtree import BVHTree
def to_list(val):
if val is None:
return []
if type(val) in (list, tuple):
return list(val)
return [
val,
] | null |
20,138 | import bpy
import bmesh
from bpy.types import Object
from mathutils.bvhtree import BVHTree
def get_pointer_get_set(index: int):
@property
def func(self):
return self.get_state_pointer(index=index)
@func.setter
def setter(self, value):
self.set_state_pointer(value, index=index)
ret... | null |
20,139 | import bpy
import bmesh
from bpy.types import Object
from mathutils.bvhtree import BVHTree
class StatefulOperatorLogic:
"""Base class which implements the behaviour logic"""
state_index: IntProperty(options={"HIDDEN", "SKIP_SAVE"})
wait_for_input: BoolProperty(options={"HIDDEN", "SKIP_SAVE"}, default=True... | Get all classes that inherit from StatefulOperatorLogic |
20,140 | def _format_types(types):
entity_names = ", ".join([e.__name__ for e in types])
return "[" + entity_names + "]"
def state_desc(name, desc, types):
type_desc = ""
if types:
type_desc = "Types: " + _format_types(types)
return " ".join((name + ":", desc, type_desc)) | null |
20,141 |
def stateful_op_desc(base, *state_descs):
states = ""
length = len(state_descs)
for i, state in enumerate(state_descs):
states += " - {}{}".format(state, (" \n" if i < length - 1 else ""))
desc = "{} \n \nStates: \n{}".format(base, states)
return desc | null |
20,142 | from typing import Type, List
from bpy.utils import register_class, unregister_class
from ..logic import StatefulOperatorLogic
def _register_stateop(cls: Type[StatefulOperatorLogic]):
if hasattr(cls, "register_properties"):
cls.register_properties()
register_class(cls)
class StatefulOperatorLogic:
... | null |
20,143 | from bpy.types import Context, Object, RegionView3D
from bpy_extras import view3d_utils
from mathutils import Vector
from bpy_extras.view3d_utils import region_2d_to_location_3d, region_2d_to_vector_3d
from ..utilities.generic import bvhtree_from_object
from typing import Optional
def get_placement_pos(context: Contex... | null |
20,144 | from bpy.types import Context, Object, RegionView3D
from bpy_extras import view3d_utils
from mathutils import Vector
from bpy_extras.view3d_utils import region_2d_to_location_3d, region_2d_to_vector_3d
from ..utilities.generic import bvhtree_from_object
from typing import Optional
def get_scale_from_pos(co: Vector, rv... | null |
20,145 | from bpy.types import Context, Object, RegionView3D
from bpy_extras import view3d_utils
from mathutils import Vector
from bpy_extras.view3d_utils import region_2d_to_location_3d, region_2d_to_vector_3d
from ..utilities.generic import bvhtree_from_object
from typing import Optional
def get_evaluated_obj(context: Context... | null |
20,146 | from collections import namedtuple
OperatorState = namedtuple(
"OperatorState",
(
"name", # The name to display in the interface
"description", # Text to be displayed in statusbar
# Operator property this state acts upon
# Can also be a list of property names or a callback that... | Use so each state can avoid defining all members of the named tuple. |
20,147 | import bpy
from . import assets_manager, global_data
def startup_cb(*args):
bpy.ops.view3d.slvs_register_draw_cb()
assets_manager.load()
return None
def register():
bpy.app.timers.register(startup_cb, first_interval=1, persistent=True) | null |
20,148 | import bpy
from . import assets_manager, global_data
def unregister():
handle = global_data.draw_handle
if handle:
bpy.types.SpaceView3D.draw_handler_remove(handle, "WINDOW") | null |
20,149 | import glob
import bpy
from bpy.types import Operator, Object, Context, MeshEdge, MeshPolygon
from bpy.props import FloatProperty, IntProperty, FloatVectorProperty
from mathutils import Vector
from .base_3d import Operator3d
from ..global_data import LIB_NAME
from ..declarations import Operators
from ..utilities.view i... | Loads an asset of given type from a specified library Returns True if it is loaded or already present in file |
20,150 | import logging
from bpy.types import Operator, Context
from bpy.props import FloatProperty
from ..model.utilities import update_pointers
from ..solver import solve_system
from ..declarations import Operators
from ..stateful_operator.utilities.register import register_stateops_factory
from .base_constraint import Generi... | null |
20,151 | import logging
from bpy.types import Operator, Context
from bpy.props import FloatProperty, BoolProperty
from ..utilities.constants import HALF_TURN
from ..declarations import Operators
from ..stateful_operator.utilities.register import register_stateops_factory
from .base_constraint import GenericConstraintOp
def inv... | null |
20,152 | import logging
from bpy.types import Operator, Context
from bpy.props import FloatProperty, BoolProperty
from ..utilities.constants import HALF_TURN
from ..declarations import Operators
from ..stateful_operator.utilities.register import register_stateops_factory
from .base_constraint import GenericConstraintOp
HALF_TU... | null |
20,153 | import logging
import bpy
from bpy.types import Context, Operator
from mathutils import Matrix
from .. import global_data
from ..declarations import GizmoGroups, WorkSpaceTools
from ..converters import update_convertor_geometry
from ..utilities.preferences import use_experimental, get_prefs
from ..utilities.data_handli... | null |
20,154 | import logging
import bpy
from bpy.types import Context, Operator
from mathutils import Matrix
from .. import global_data
from ..declarations import GizmoGroups, WorkSpaceTools
from ..converters import update_convertor_geometry
from ..utilities.preferences import use_experimental, get_prefs
from ..utilities.data_handli... | null |
20,155 | import logging
import bpy
from bpy.types import Context, Operator
from mathutils import Matrix
from .. import global_data
from ..declarations import GizmoGroups, WorkSpaceTools
from ..converters import update_convertor_geometry
from ..utilities.preferences import use_experimental, get_prefs
from ..utilities.data_handli... | null |
20,156 | import logging
import bpy
from bpy.types import Context, Operator
from mathutils import Matrix
from .. import global_data
from ..declarations import GizmoGroups, WorkSpaceTools
from ..converters import update_convertor_geometry
from ..utilities.preferences import use_experimental, get_prefs
from ..utilities.data_handli... | null |
20,157 | import logging
import bpy
from bpy.types import Context, Operator
from mathutils import Matrix
from .. import global_data
from ..declarations import GizmoGroups, WorkSpaceTools
from ..converters import update_convertor_geometry
from ..utilities.preferences import use_experimental, get_prefs
from ..utilities.data_handli... | null |
20,158 | from bpy.types import Macro
from bpy.utils import register_class, unregister_class
from ..declarations import Macros
class View3D_OT_slvs_duplicate_move(Macro):
"""Duplicate selected entities"""
bl_idname = Macros.DuplicateMove
bl_label = "Duplicate"
bl_options = {"UNDO"}
def register():
register_c... | null |
20,159 | from bpy.types import Macro
from bpy.utils import register_class, unregister_class
from ..declarations import Macros
class View3D_OT_slvs_duplicate_move(Macro):
"""Duplicate selected entities"""
bl_idname = Macros.DuplicateMove
bl_label = "Duplicate"
bl_options = {"UNDO"}
def unregister():
unregist... | null |
20,160 | import bpy, gpu
from bpy.types import Operator, Context, Event
from bpy.utils import register_classes_factory
from mathutils import Vector
from gpu_extras.batch import batch_for_shader
from .. import global_data
from ..declarations import Operators
from ..utilities.index import rgb_to_index
from ..utilities.view import... | null |
20,161 | import bpy, gpu
from bpy.types import Operator, Context, Event
from bpy.utils import register_classes_factory
from mathutils import Vector
from gpu_extras.batch import batch_for_shader
from .. import global_data
from ..declarations import Operators
from ..utilities.index import rgb_to_index
from ..utilities.view import... | null |
20,162 | from copy import deepcopy
from typing import Any, List, Sequence, Tuple
import bpy
from bpy.utils import register_classes_factory
from bpy.types import Operator, Context
from .. import global_data
from ..declarations import Operators
from ..serialize import paste
from ..utilities.select import deselect_all
from ..utili... | Returns filtered list of elements based on whitelist dict_elements must be the dictionary representation of whats stored in data without any modifications |
20,163 | from bpy.types import Operator
from bpy.props import BoolProperty, StringProperty
from bpy.utils import register_class, unregister_class
from ..declarations import Operators
from ..utilities.view import refresh
class View3D_OT_slvs_batch_set(Operator):
"""Batch set a property on all items in a given sequence"""
... | null |
20,164 | from bpy.types import Operator
from bpy.props import BoolProperty, StringProperty
from bpy.utils import register_class, unregister_class
from ..declarations import Operators
from ..utilities.view import refresh
class View3D_OT_slvs_batch_set(Operator):
def execute(self, context):
def unregister():
unregister_... | null |
20,165 | import bpy
import gpu
from bpy.types import Operator, Context
from bpy.utils import register_classes_factory
from .. import global_data
from ..declarations import Operators
def write_selection_buffer_image(image_name: str):
offscreen = global_data.offscreen
width, height = offscreen.width, offscreen.height
... | null |
20,166 | import logging
import math
from bpy.types import Operator, Context
from bpy.props import FloatProperty
from ..model.categories import SEGMENT
from ..model.identifiers import is_line, is_circle
from ..declarations import Operators
from ..stateful_operator.utilities.register import register_stateops_factory
from ..statef... | null |
20,167 | import logging
import math
from bpy.types import Operator, Context
from bpy.props import FloatProperty
from ..model.categories import SEGMENT
from ..model.identifiers import is_line, is_circle
from ..declarations import Operators
from ..stateful_operator.utilities.register import register_stateops_factory
from ..statef... | null |
20,168 | from bpy.types import Operator, Context, Event
from mathutils import Vector
from bpy.props import FloatVectorProperty
from ..declarations import Operators
from .base_2d import Operator2d
from ..stateful_operator.state import state_from_args
from ..stateful_operator.utilities.register import register_stateops_factory
fr... | Return a list of points that are either selected or a dependency of a selected entity |
20,169 | import bpy
from bpy.types import Operator
from .. import global_data
from ..declarations import Operators
from ..utilities.install import check_module
from ..utilities.install import install_package, ensure_pip, show_package_info
class View3D_OT_slvs_install_package(Operator):
"""Install module from local .whl file... | null |
20,170 | import bpy
from bpy.types import Operator
from .. import global_data
from ..declarations import Operators
from ..utilities.install import check_module
from ..utilities.install import install_package, ensure_pip, show_package_info
class View3D_OT_slvs_install_package(Operator):
"""Install module from local .whl file... | null |
20,171 | import bpy
from bpy.props import PointerProperty, FloatVectorProperty, FloatProperty
from bpy.types import PropertyGroup
def update(self, context):
for window in context.window_manager.windows:
for area in window.screen.areas:
if area.type != "VIEW_3D":
continue
area... | null |
20,172 | import bpy
from bpy.props import PointerProperty, FloatVectorProperty, FloatProperty
from bpy.types import PropertyGroup
class ThemeSettingsEntity(PropertyGroup):
default: FloatVectorProperty(
name="Default",
subtype="COLOR",
default=(0, 0, 0, 0.8),
size=4,
min=0.0,
m... | null |
20,173 | import bpy
from bpy.props import PointerProperty, FloatVectorProperty, FloatProperty
from bpy.types import PropertyGroup
class ThemeSettingsEntity(PropertyGroup):
class ThemeSettingsConstraint(PropertyGroup):
class ThemeSettings(PropertyGroup):
def unregister():
bpy.utils.unregister_class(ThemeSettings)
bpy.ut... | null |
20,174 | import sys
from pathlib import Path
import logging
import bpy
from bpy.types import AddonPreferences, Panel, Menu
from bl_ui.utils import PresetPanel
from bpy.props import (
PointerProperty,
BoolProperty,
StringProperty,
EnumProperty,
IntProperty,
FloatProperty,
)
from . import theme
from .. imp... | null |
20,175 | import sys
from pathlib import Path
import logging
import bpy
from bpy.types import AddonPreferences, Panel, Menu
from bl_ui.utils import PresetPanel
from bpy.props import (
PointerProperty,
BoolProperty,
StringProperty,
EnumProperty,
IntProperty,
FloatProperty,
)
from . import theme
from .. imp... | null |
20,176 | import sys
from pathlib import Path
import logging
import bpy
from bpy.types import AddonPreferences, Panel, Menu
from bl_ui.utils import PresetPanel
from bpy.props import (
PointerProperty,
BoolProperty,
StringProperty,
EnumProperty,
IntProperty,
FloatProperty,
)
from . import theme
from .. imp... | null |
20,177 | import sys
from pathlib import Path
import logging
import bpy
from bpy.types import AddonPreferences, Panel, Menu
from bl_ui.utils import PresetPanel
from bpy.props import (
PointerProperty,
BoolProperty,
StringProperty,
EnumProperty,
IntProperty,
FloatProperty,
)
from . import theme
from .. imp... | null |
20,178 | import sys
from pathlib import Path
import logging
import bpy
from bpy.types import AddonPreferences, Panel, Menu
from bl_ui.utils import PresetPanel
from bpy.props import (
PointerProperty,
BoolProperty,
StringProperty,
EnumProperty,
IntProperty,
FloatProperty,
)
from . import theme
from .. imp... | null |
20,179 | import pickle
from typing import Union, Optional
from pathlib import Path
from bpy.types import Scene
from .utilities.index import breakdown_index, assemble_index
def scene_to_dict(scene):
original = scene["sketcher"].to_dict()
elements = {key: original[key] for key in ("entities", "constraints")}
return el... | Saves CAD Sketcher data of scene into file |
20,180 | import pickle
from typing import Union, Optional
from pathlib import Path
from bpy.types import Scene
from .utilities.index import breakdown_index, assemble_index
def scene_from_dict(scene, elements):
original = scene["sketcher"].to_dict()
original.update(elements)
scene["sketcher"].update(original)
The pr... | Overwrites scene with entities and constraints stored in file |
20,181 | import pickle
from typing import Union, Optional
from pathlib import Path
from bpy.types import Scene
from .utilities.index import breakdown_index, assemble_index
def scene_from_dict(scene, elements):
original = scene["sketcher"].to_dict()
original.update(elements)
scene["sketcher"].update(original)
def _ex... | null |
20,182 | from typing import Union, Type
from .group_entities import type_from_index
from .categories import POINT, SEGMENT, LINE, CURVE, ELEMENT_2D
from .types import SlvsSketch, SlvsCircle, SlvsGenericEntity
EntityRef = Union[SlvsGenericEntity, int]
def is_2d(entity: EntityRef) -> bool:
def is_3d(entity: EntityRef) -> bool:
... | null |
20,183 | from typing import Union, Type
from .group_entities import type_from_index
from .categories import POINT, SEGMENT, LINE, CURVE, ELEMENT_2D
from .types import SlvsSketch, SlvsCircle, SlvsGenericEntity
EntityRef = Union[SlvsGenericEntity, int]
def _get_type(value: EntityRef) -> Type[SlvsGenericEntity]:
index = value ... | null |
20,184 | from typing import Union, Type
from .group_entities import type_from_index
from .categories import POINT, SEGMENT, LINE, CURVE, ELEMENT_2D
from .types import SlvsSketch, SlvsCircle, SlvsGenericEntity
EntityRef = Union[SlvsGenericEntity, int]
def _get_type(value: EntityRef) -> Type[SlvsGenericEntity]:
index = value ... | null |
20,185 | from typing import Union, Type
from .group_entities import type_from_index
from .categories import POINT, SEGMENT, LINE, CURVE, ELEMENT_2D
from .types import SlvsSketch, SlvsCircle, SlvsGenericEntity
EntityRef = Union[SlvsGenericEntity, int]
def _get_type(value: EntityRef) -> Type[SlvsGenericEntity]:
index = value ... | null |
20,186 | from typing import Union, Type
from .group_entities import type_from_index
from .categories import POINT, SEGMENT, LINE, CURVE, ELEMENT_2D
from .types import SlvsSketch, SlvsCircle, SlvsGenericEntity
EntityRef = Union[SlvsGenericEntity, int]
def _get_type(value: EntityRef) -> Type[SlvsGenericEntity]:
index = value ... | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.