This file contains 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 | |
import collections | |
import json | |
def select_current_selset(self, context): | |
"""Selection""" | |
if len(context.scene.sj_sel_set_items) is 0: | |
return None |
This file contains 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 | |
import bmesh | |
# source: https://blender.stackexchange.com/questions/177559/select-vertices-within-a-given-object/241467#241467 | |
# must create an object with many interior points (apply a array modifer on a cube 3 times) | |
# create another object (here named "Sphere") to be the hull | |
# go into edit mode for the first object | |
def is_inside(p, max_dist, obj): | |
result, point, normal, face = obj.closest_point_on_mesh(p, distance=max_dist) # you weren't using max_dist in yours, is that intentional? |
This file contains 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
def test_variables_declared_deleted(): | |
import re | |
declaration_re = r"\s*(\w+\.?)+\s+=\s+[\w\d\.]+Property\(" | |
deletion_re = r"\s*del\s+(\w+\.?)+" | |
init_file = open(path_to_addon_init, 'r') | |
deletion_vars = [] | |
declaration_vars = [] | |
while True: | |
line = init_file.readline() |
This file contains 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
$coverageFilePath = "coverage.xml" | |
$matchPackagePattern = "nViewAddon" | |
$ignoreClassPatternList = @("__init__", "panel") | |
$ignoreClassPattern = $ignoreClassPatternList -join "|" | |
if (-not (Test-Path $coverageFilePath)) { | |
Write-Error "Cannot find coverage report: $coverageFilePath" | |
return | |
} |
This file contains 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 numpy as np | |
from mathutils import Vector | |
import bpy | |
def occlusion_test(scene, depsgraph, camera, resolution_x, resolution_y): | |
# get vectors which define view frustum of camera | |
top_right, _, bottom_left, top_left = camera.data.view_frame(scene=scene) | |
camera_quaternion = camera.matrix_world.to_quaternion() |
NewerOlder