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, sin, cos | |
| from mathutils import Vector | |
| num_points = 10 | |
| center = (0.0, 0.0, 0.0) | |
| def get_frame(frames, frame_num): | |
| '''Checks for the existence of a given frame''' | |
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, sin, cos | |
| from mathutils import Vector | |
| num_points = 10 | |
| center = (0.0, 0.0, 0.0) | |
| def get_frame(frames, frame_num): | |
| '''Checks for the existence of a given frame''' | |
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
| # Generates grease pencil line to which various formulas can be applied | |
| # to test different value gradients | |
| import bpy | |
| import random | |
| from math import tau, sin, cos, tan | |
| def line(gp_frame, start_pos, end_pos, num_pts): | |
| gp_stroke = gp_frame.strokes.new() | |
| gp_stroke.line_width = 30 |
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 tau, pi, sin, cos, ceil | |
| import random | |
| import time | |
| t = time.perf_counter() | |
| num_points = 48 | |
| center = (0.0, 0.0, 0.0) |
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 | |
| sel_obj = None | |
| sel_objs = bpy.context.selected_objects | |
| if sel_objs: | |
| sel_obj = sel_objs[0] | |
| if sel_obj and sel_obj.type=='GPENCIL': | |
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 mathutils import Vector | |
| min_dist = 10.0 | |
| max_dist = 120.0 | |
| fog_color = (1.0, 0.9, 0.7, 1.0) | |
| fog_mult = 1.0 | |
| final_fog = (fog_color[0]*fog_mult, fog_color[1]*fog_mult, fog_color[2]*fog_mult) | |
| falloff = 3.0 |
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 mathutils import Color | |
| palette_name = bpy.context.tool_settings.gpencil_paint.palette.name | |
| def create_palette_materials(gp, palette_name): | |
| palette = bpy.data.palettes.get(palette_name) | |
| if palette: | |
| i = 0 | |
| while i < len(palette.colors): |
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 | |
| IMAGE = None | |
| TEXTURE_PATH = 'D:\\images\\textures\\hatch_1.jpg' | |
| for i in bpy.data.images: | |
| if i.filepath == TEXTURE_PATH: | |
| IMAGE = i | |
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 | |
| IMAGE = None | |
| TEXTURE_PATH = 'D:\\images\\textures\\hatch_1.jpg' | |
| for i in bpy.data.images: | |
| if i.filepath == TEXTURE_PATH: | |
| IMAGE = i | |
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 mathutils import Vector | |
| def duplicate(obj, data=True, actions=True, collection=None): | |
| obj_copy = obj.copy() | |
| if data: | |
| obj_copy.data = obj_copy.data.copy() | |
| if actions and obj_copy.animation_data.action: | |
| obj_copy.animation_data.action = obj_copy.animation_data.action.copy() |