3

Use bmesh Strongly recommend using bmesh instead of bpy.ops.mesh whenever you can. Here is my understanding of the script needed. Extrudes the individual selected vertices randomly a number of repeats. The operators return dictionary has the newly created vertices and edges. import bpy import bmesh from mathutils import Vector from random import uniform ...


3

In order to check if a mesh is watertight, we can test that the mesh is 2-manifold and no boundary edges exist [1]. The following definitions are loosely based on the quoted sources, some terminology and explanations were adjusted. This may not be up to standard for a scientific publication. Definition: 2-manifold [1] [2]: Each edge is incident to one or ...


2

You can use a single line python expression as a driver, like an if-else statement. 1 if (bpy.context.scene.frame_current == 1) else 0 The reason this fails, would be if python scripts have been disabled. You get this dialog after entering a python expression when python scripts are disabled. Click on "Allow Execution". If you dismissed the dialog, ...


1

In Blender, the way selection works is a bit different. You can't really have something "selected" when it's hidden in the viewport. You can hide an object with H, but to unhide, you generally either undo or alt-H to unhide all hidden objects. To have the same shortcut key do both an action and its opposite is pretty uncommon in Blender. The only thing I ...


1

Object.to_mesh In 2.79 can use the to mesh method. >>> me = C.object.to_mesh( to_mesh() Object.to_mesh(scene, apply_modifiers, settings, calc_tessface=True, calc_undeformed=False) Create a Mesh data-block with modifiers applied >>> me = C.object.to_mesh() To create a mesh with the modifiers applied, instead of using modifier apply ...


1

Loop the materials collection Loop over the material collection. Need only do this once per material, rather than for each object that uses the material. Search for links from tex node to bsdf and from color to alpha socket, if found unlink old, make a new link, and print the image name. import bpy for m in bpy.data.materials: if not m.use_nodes: ...


1

Some blender basics The console is a great place to figure stuff out where C = bpy.context and D = bpy.data for our convenience. >>> C.object bpy.data.objects['Cube'] >>> C.object.dimensions Vector((2.0000009536743164, 2.0000009536743164, 2.0)) >>> C.object.dimensions.y 2.0000009536743164 >>> The height of an ...


1

Look in NodeTree.animation_data Python console code. Loop thru materials that use nodes and have animation data, if so loop the drivers collection. In simple example below find the couple of simple drivers including a driver on a value node with expression "frame" (the current frame) The drivers datapath gives the node name and the index of the socket. ...


1

Thanks to all for the input. I am answering my own question. I wanted to have in my AddOn a way to choose a folder containing some input files. It turns out that it was very easy using bpy.props StringProperty as panel property: import_path: StringProperty( name = "Path", description = "Path to the folder containing the files to import", ...


1

In Blender 2.8 / 2.81 Line 17 above o.select = False needs to be changed to: o.select_set(False)


Only top voted, non community-wiki answers of a minimum length are eligible