Cleaning unwanted overlapping duplicate meshes

Following a BIG CLUE given by @rob I've slapped together a script.

Give each mesh object in selection a key faces_edges_verts, for instance the default cube would have a key "6_12_8", 6 faces, 12 edges, 8 verts.  Then check whether the coordinates of global bounding box, of any other objects that have same counts, match.

If they do select those objects to mark them as possible dupes.

To run suggest: Select all in scene, run script from text editor, and see if those objects that remain selected are dupes.... or close enough to... and then if all good hit x

import bpy
from mathutils import Vector
context = bpy.context

scene = context.scene
TOL = 1.0e-4 # reduced tolerance.

# routine to text matches on bound box.
def test(ob1, ob2):
    # test if ob1 and ob2 which have same face/edge/vert count are same
    bbox1 = [ob1.matrix_world * Vector(b) for b in ob1.bound_box]
    bbox2 = [ob2.matrix_world * Vector(b) for b in ob2.bound_box]

    diffs = [v2 - v1 for  v1, v2 in zip(bbox1, bbox2)]
    return all(d.length < TOL for d in diffs)
    #return sum(diffs, Vector()).length < TOL

obs = {}
keys = []
for ob in context.selected_objects:
    ob.select = False
    if ob.type != 'MESH':
        continue
    # make a key from faces, edges, verts
    mesh = ob.data
    key = "%d_%d_%d" % (len(mesh.polygons), len(mesh.edges), len(mesh.vertices))
    obs[ob.name] = key
    keys.append(key)

possible_dupes = set([x for x in keys if keys.count(x) > 1])
print("-" * 40)
while possible_dupes:
    p = possible_dupes.pop()
    dupes = sorted(name for name, value in obs.items() if value == p)
    while dupes:
        original = dupes.pop(0)
        original_ob = scene.objects.get(original)

        for dupe in dupes:

            dupe_ob = scene.objects.get(dupe)
            if dupe_ob.select:
                continue

            if test(original_ob, dupe_ob):
                dupe_ob.select = True
                scene.objects.active = dupe_ob
                print("possible dupe: ", dupe, " of original: ", original)

Result on your file.  Dupe objects moved to layer 3 on left.  Reduced file size from 91 to 47 meg on removal of dupes.

Updated for version 2.8

Some minor changes for the new API, notably ob.select_set() and ob.select_get() for setting and getting selection, and `@' for matrix / vector multiplication

import bpy
from mathutils import Vector
context = bpy.context

scene = context.scene
view_layer = context.view_layer
TOL = 1.0e-3 # reduced tolerance.

# routine to text matches on bound box.
def test(ob1, ob2):
    # test if ob1 and ob2 which have same face/edge/vert count are same
    bbox1 = [ob1.matrix_world @ Vector(b) for b in ob1.bound_box]
    bbox2 = [ob2.matrix_world @ Vector(b) for b in ob2.bound_box]

    diffs = [v1 - v2 for  v1, v2 in zip(bbox1, bbox2)]
    return all(d.length < TOL for d in diffs)
    #return sum(diffs, Vector()).length < TOL

obs = {}
keys = []
for ob in context.selected_objects:
    ob.select_set(False)
    if ob.type != 'MESH':
        continue
    # make a key from faces, edges, verts
    mesh = ob.data
    key = "%d_%d_%d" % (len(mesh.polygons), len(mesh.edges), len(mesh.vertices))
    obs[ob.name] = key
    keys.append(key)

possible_dupes = set([x for x in keys if keys.count(x) > 1])
print("-" * 50)
while possible_dupes:
    p = possible_dupes.pop()
    dupes = sorted(name for name, value in obs.items() if value == p)
    while dupes:
        original_ob = scene.objects.get(dupes.pop(0))
        for dupe in dupes:

            dupe_ob = scene.objects.get(dupe)
            if dupe_ob.select_get():
                continue

            if test(original_ob, dupe_ob):
                dupe_ob.select_set(True)
                view_layer.objects.active = dupe_ob
                print("possible dupe: ", dupe, " of original: ", original_ob.name)


Program resolution is too small on the screen

Open File > User Preferences, under Interface adjust Display Scale


joining two objects distorts procedural texture

Right of the bat, I must say that your use of 'Texture coordinate' node as a texture/color input is not in line with its intended purpose. Anyway, the problem here is, all the texture input nodes (noise and voronoi ) don't have their 'vector' inputs connected. So by default, they take 'generated' as the texture coordinates input. And generated texture coordinates work based on the bounding box of the object.This is a problem in our case because when we join the objects, the objects bounding box (black lined box) increases as shown here..
Inorder to have similar marble effect even after joining, we have to scale the texture proportionately. This could be done using texture 'mapping' node under (Vector>Mapping). Here are the steps.

Before joining the parts, note down the marble globe bounding box dimensions.You can find these in properties panel (Hot key 'N') under dimensions section, while the marble globe is selected (as shown below).
Join the two objects.Now note down the dimensions of the new object.It will be as shown.
Now in the node editor for the marble material add the 'texture mapping' node as shown here (remember we need to scale the texture).
Now if you are wondering what the scale values in the red box are, they are basically the ratio of bounding box dimensions. For X & Y: 1.66573/1.11312 = 1.49645 and for Z :3.16439/0.680168 = 4.65237

This will fix the scale and get a result very close to your initial texture. You can fiddle with the 'location' values in the texture mapping node to get a result you like. Feel free to check the attached blend file below with the implementation.


How do you rotate your alpha brush in sculpting mode?

In case you're referring to the stencil image in the 3D view, Then you can achieve that by pressing Ctrl + Right click.
Additionally, you can move the stencil image using Right click, you can scale it using Shift + Right click.


Why do my lamps require an insane "strength" value of 1 million?

Your area lamp is not 1m across, it is 100m in size, hence the strength required.

Your Blend file seems to have pretty messed up scaling factors, for starters your viewport has a clipping distance of 50µm which is causing all sorts of display precision issues and Z-Fighting.

Your whole scene is huge in reality, most objects are several meters high, have very high scaling factors, and your room is more than one kilometer long.

Most problems probably stem from the fact that your whole scene has a Units Scale factor of 0.01, which is giving you a false sense of scale, and falsely reported units value

Go to the Properties Window > Scene > Units > Units Scale and set the value to 1


Add a texture coordinates node and a mapping node.
Depending on what you mean by "flip" can change the scale to negative one for whatever axis, or rotate the coordinates 180 degrees on a particular axis.


If you're just talking about ordinary planes being used for walls, or even 3D walls with thickness, select them each in turn, goto Edit mode, select the upper vertices ONLY and press X to delete them.

You might find it easier to switch the view to 'Wireframe' beforehand.

The floor from which they were extruded in the first place will remain.

If you're going to need to replace them again, just drag the vertices down to near 0.  Their texture (if any) should return when you raise them back up again.


I couldn't figure out how to square the UV mesh in blender 2.8 so I copied the object into 2.79 and used the UV squares addon and copied it straight back into 2.8


You should unclick the Bone Envelopes option of the Armature modifier of the mesh, then select the armature, shift select the mesh, ctrl tab to switch to Weight Paint mode, then select each bone and paint the mesh accordingly to the influence you want this bone to have on the mesh.

Or even delete the Armature modifier and reparent the mesh to the armature With Automatic Weight and then bring some corrections in Weight Paint mode...


How can I make an object appear or disappear smoothly?

You can use the node editor to animate the mix shader slider.
this shouldn't matter what render engine your are in.

Here are two examples posted:

 <-- Blender Render (Blender Internal)

 <-- Blender Cycles

Here are the file links for you to see how it is done:

<-- Blender Render

<-- Blender Cycles

Hope it helps - Kind Regards,

RRiggs

Added in response to the comments below:

To make this a little more expressive without having to download files, here is the summary of what I would do:

The 1st question was - how to make an object gradually appear/go away.

The second one is how to do this with a texture.

The quick answer is (IMHO), add two materials to each of the objects, one of those materials needs to be completely transparent, and the other material needs to be the desired visible one.

For the second part of the question:

Two textures will be needed for each of the objects that require the texture differences.

In either case the 'mix' sliders within the node editor can be key-framed in the timeline by hovering your mouse over them and hitting the I key.

Your control over the timeline and keyframes allow you to have the control over how gradual you want the effect to be.


How can I add UV coords to a mesh from script?

Below you find a very well-performaning solution to set mesh UVs from a source in a per-vertex format to Blender's per-loop (face corner).

This assumes you have a sequence of float pairs (UV coord),
e.g. ((0.2, 0.1), (0.8, 0.9), (0.2,0.1), ...).

import bpy
from random import random

me = bpy.context.object.data

# Sample data
vert_uvs = [(random(), random()) for i in range(len(me.vertices))]

me.uv_textures.new("test")
me.uv_layers[-1].data.foreach_set("uv", [uv for pair in [vert_uvs[l.vertex_index] for l in me.loops] for uv in pair])

Original thread: Importing UV coordinates


I managed to solve this problem by joining the pendant and the two closest links then connecting that object with the adjacent links.


Create effect where light takes time to reach camera

I don't have a Blender related answer but if you are comfortable coding you can have a look at the OpenRelativity opensource toolkit created at MIT.  There is a demo program available their gamelab website called A Slower Speed of Light.

Here's the current link.  If the link goes down in the future you are all free to edit this answer.  http://gamelab.mit.edu/games/a-slower-speed-of-light/


Orbiter Import/Export .MSH Files Addon

The current version of the add-on works only with Blender 2.63 or later with Bmesh (new powerful mesh system with Ngons).

The addon exports and imports geometry, UVs, materials and textures from/into Blender scene.

Installation:

Download the latest Blender build from Graphicall.org
Download the archive from links below

http://gitorious.org/blender-orbiter-io/blender-orbiter-io/archive-tarball/master (.tar.gz),
https://github.com/vlad32768/blender-orbiter-io/zipball/master (.zip)

or you can download Git repository from

git://gitorious.org/blender-orbiter-io/blender-orbiter-io.git
git://github.com/vlad32768/blender-orbiter-io.git

Place io_orbiter_msh.py into Blender's addons directory
Enable module in File->User Preferences->Add-Ons dialog

Notes on .msh import:

You should import meshes from Orbiter installation. The module will autodedect Orbiter directory and load textures from Orbiter installation.
The script doesn't import vertex normals. It seems that Blender often recalculates vertex normals, so it's useless to import them.
If there is one material with different textures in .msh file, the script will create a copy of this material for every texture.
There are no ambient and emissive colors in Blender, so the script doesn't import ambient colors, but calculates emit component
Some models (for example DGIV and DG-XR) have got materials with shiny specular and zero hardness. That doesn't look good in blender.
You can use "Raise small hardness" parameter in file import dialog to set minimal hardness manually

Notes on .msh export

The script exports selected objects. To export the whole scene, select all objects by pressing "a".

1a. Blender has to be in object mode before exporting ( to avoid some Python API issues and, of course, to select mesh objects for export). If not, object mode will be set automatically during export.
Coordinate system: The script does conversion to left handed coordinate system, so there is the proper way to place your model in Blender when you start modeling:

Y axis is the direction of the main thruster's exhaust; -Y is the main thrust direction;
Z axis points UP;
X axis points LEFT.

Materials:

You should use Blender Internal renderer; don't use Cycles if you want to export your model to Blender;
The script exports only the first material of a mesh object;
The script makes Ambient color equal to Diffuse;
Emissive color is equal to Diffuse*emit

Textures

The script exports only the first texture of a material; this texture's type must be "IMAGE".
If you export your model to "file.msh", textures will be saved in "filetex" directory near the .msh file.
"file.msh" should be copied to Orbiter's "Meshes" directory, "filetex" directory
to "Textures" (see TEXTURES section of .msh file)
Blender does not support writing .DDS files. In most cases the script will save .png files (check it).

So you have to convert textures to .dds manually. However, the script writes names with .dds extension in .msh TEXTURES section

(Source: http://www.orbiter-forum.com/showthread.php?t=18661 )


The dot displays the origin of your object. This also defines the axis the object will rotate on. It won't show up in your render though.


How to rebuild mesh in optimized way? Example inside

There isn't one.  Because you created individual blocks, even when they're joined they're still independent meshes. Tools like dissolve faces only work on completely connected meshes.


how to recreate microscopic diatom glass material

A Fresnel node can be used as factor for a Mix Shader between a Transparent BSDF and Emission Shader, in order to achieve the glow at grazing angles. The Facing socket from the Layer Weight node allows to add a slight glow for the angles in between. Finally the Is Camera Ray output from the Light Path node is used to only show the emissive material to the camera, meaning the object itself and objects near by won't be affected by the emitted light.


display a grease pencil object ontop of a 3d model(despite location)

If you mean to make the GP object always be in front of everything, then there is a setting for it. Check out this tutorial video to find out where (because I can't specifically remember where....):

https://youtu.be/1HRYC4Q1ajI

it's somewhere near the end, like past halfway. it had to do with depth order... may have moved from 2.8 to 2.82.

Hope that helps...


Method for creating a bulge in a fuselage

Hard to do it without a complete blueprint, but I guess you can do it this way:

Create the right view profile, which is basically an extruded cylinder.
Draw the wing cut with the knife.
Extrude the wing, use all the views to make it correctly.


How to read scene(s) data without loading content

Note this is a very low level of access, not intended for general use.

So you could read this answer "no", unless you're willing to get into Blender's format internals.

This is possible but not trivial, especially for cycles settings which are stored in a generic IDProperty structure.

Blender comes with blendfile.py
This module can be used to load blend files and extract content without having to open them from Blender.
While we don't have docs for this, there is some example use.
It shouldn't take long to extract resolution, engine for e.g.
Cycles settings will be more work, if you have gotten this far you should be able to do it though.

This will work with files from both 2.7x and 2.8x

Edit: see this answer for a start on how to use blendfile.py.


Delay in showing menus, tooltips, 3D cursor: Actually, delay in showing everything

This sounds like a graphical issue, either from your GPU or graphics drivers; for this sort of problem you should always post what your graphics card is so it helps solving your problem.

You mention having no dedicated graphics processing unit, only an Intel integrated one, which are largely regarded as low end and known to often cause problems with blender, so that is most likely the origin of your problem.

Not exactly sure how to solve your graphical glitch, try upgrading your drivers to the latest version.

After that you could open blender, go to the User Preferences > System Tab > Window Drawing Method and play around with the options in the dropdown menu, see if any other besides the default one work better for your particular machine. Make sure you save settings and restart Blender in between changes.

Also try turning off any multi sample if it s turned on, in the menu right after the previous one.


In the Materials section, under "Settings", check and see in in "Blend Mode" if Alpha Blend is on. You can either choose to disable Alpha Blend or you can Disable "Show Backface". See picture.


You can change the FPS for screencasting in Blender from the System panel of the User Preferences.

Go to File > User Preferences
Switch to the System panel.
Adjust the FPS and Wait Timer under the Screencast section.


What are the differences between lamps in Cycles and Blender Internal?

Cycles uses a physically correct light falloff by default, Blender Internal uses a smoothed falloff with a Distance parameter. Cycles can give a similar falloff by using the Light Falloff node with Smooth parameter.

Cycles lamp strength for point, spot and area lamps is specified in Watts, while Blender Internal has no clear physical unit that I know of. For Cycles this means you typically need higher values, as you couldn't use a 1W lamp to light a room, you need something stronger like a 100W lamp. For Blender Internal the default Distance of 30 means you can use lower strength values.

Sun lamps in Cycles are specified in $\frac{\text{Watts}}{\text{m}^2}$, which requires much smaller values like 1 $\frac{\text{Watt}}{\text{m}^2}$. This can be confusing, but specifying strength in Watts wouldn't have been convenient, the real sun for example has strength 384600000000000000000000000W. Emission shaders on meshes are also in $\frac{\text{Watts}}{\text{m}^2}$.


How can I change an objects settings to render correctly when using the blender renderer

Cycles Materials aren't compatible with Blender internal renderer engine, so you'll have to create new materials.


What format, codec, and color settings should be used for youtube?

That sure looks like a broken encode. If using FFMPEG, you need to set the range to broadcast and the encoding weights to 709.

If you hunt through the other tidbits here, I explain how broken ranges or double ups will give you exactly what you are seeing.


Maya to blender,Change view selected component

The Problem is, that there is another Shortcut bound to F in that context, with a higher priority. In Blender there are context-bound shortcuts. You have changed the shortcut for the Object context. However, if you select a mesh and go into edit mode, you are in Mesh context.

In the Preferences, sort the shortcuts by Key-Binding and locate the Mesh section. Then remove or change the shortcut, which is currently bound to F, it will probably be Make Edge/Face. However, you will have to change the other shortcuts which are bound to F for each context individually.


Blender 2.8: Why cannot I colour on the same plane?

I've had the same issue.
There is the ability to select your drawing pane, and lock strokes/fills to that pane. Depending on which build of 2.8 you have, this has moved, so check the image below.

For my selection, to lock it to the same pane as the Ink Strokes, I needed to select Side (Y-Z). In your screencap I can see you have it set to view, so that if you rotate around your scene you'll move the drawing pane.
Selecting one from the drawing pane dropdown will lock it down for you.


image texture node - Image sequence control by slider

I founded the solution, its alittle bit tricky and not fully suported at this time, but.

A) Set a driver to offset in Image texture node set to image sequence:

B) Create an object or custom property, but object responce was better for me, and write #frame to any slider (Z scale in my situation) and tap enter > it create a driver.

C) In offset driver find the scale value from object you set in and the value where is set your image number it must be integer so I rounded it. And voila.

Pros: It can be done.

Cons: In viewport - refresh image is not fully working after change the slider - you can see right result only in render view.
In blender 2.80 it is not working at all. But I hope it will be. I am looking forward to make sume flat puppets and re-drawing the phases of hands and faces trough grease pencil it will be awesome.


Mesh deform (and other modifiers, like boolean) uses two objects.

For mesh deform :

The first one is the one to be deformed : the modifier is defined on this object
The second one is the deforming object : it has to be set in the 'object' field of the modifier

An example :

Here two objects : the cylinder will be the object to be deformed and the cube is the deforming object. The cube must surround the parts of the cylinder we want to be deformed. So it is easier to hide the cube faces to see the cylinder inside :

Now select the cylinder, add the modifier and set the cube as deforming object :

This modifier has a particularity : Blender needs to do some calculations before the modifier can be used. As these calculations can be a bit long, it is needed to click on the "bind" button to make it work (above the calculation time, bind/unbind is also a way to change the initial configuration if needed, clicking on the 'unbind' button available once the binding is done).

Once bound, you can edit the cube mesh to deform the cylinder :

But you can also use other modifiers on the cube to deform it and the cylinder will follow. Here an example with an armature modifier set to the cube. So the armature influences the cube and the mesh deform modifier influences the cylinder as the cube is transformed :

Concerning the warning you indicate in your question : this is because the object field is not defined in the modifier panel.

The "apply" button (for all modifiers) is used to freeze/transform the object at the position (or geometry, etc.) it is when you apply. And once applied the concerned object is really modified and the modifier disappears from the panel.


Weird View in Blender Render view, black object in Object while moving, transparent render, Eevee

This is a problem with the new AMD drivers. You can either degrade them, but i recommend something else. Go to render setting, then find Performance --> High Quality Normals. Enable it and the problems should be gone.


Adding Jitter to Animation During High Velocity

There's possibly a script-level way of achieving this, but I strongly suggest trying the NLA(Non-Linear Animation) editor first.  It allows you to set F-Curve modifiers on-top of entire actions (so all the channels if need be).  Fairly quickly too.  Learning to use the NLA isn't too hard, and the payoff can be big, especially for the long animation you have.  Check out some basics of the NLA here: https://www.blender.org/manual/editors/nla.html

To get the jitter on certain parts of the animation, try adding a 'noise' modifier to the strip.  You could also try adding another animation layer 'on top' of your current one, and keyframe the noise on that strip instead, and then ease into it's influence using the Blend in/out fields.


The version of geometry_nodes as of commit edbdbc8fea539 does a small check that isn't actually really used yet. This looks to be part of a work-in-progress that is as of yet uncompleted. To get these nodes running you'll have to modify modifiers.py and comment out or remove lines 46 and 47:

#if not isinstance(datatype, TypeSpec):
#    raise TypeError("Expected TypeSpec datatype")

After this (re-)start blender, enable the addon and play with the geometry nodes :)

Note that as of this writing the above mentioned commit is the latest and the only one in 24 days. Looks very much like current development is on hold.

A small screenshot of geometry nodes in the node editor:


Add a Subdivision Surface modifier and you can select(paint) things you wish with C and then press Shift+E to make it smooth or edgy.


How can I randomize Wave Texture's Wave Width?

Try using a Wave Texture as the scale factor for a Noise Texture:

You can change the detail or distortion levels of the Wave Texture or the Noise Texture (or both) for interesting effects:


Changing the "Pan View" Keybind works in Object Mode, Not Sculpt Mode

Yes,it can be done. But probably what prevents you to do so is: there's already another "shortcut" using the same combination in Sculpt, by default.

if you search for "sculpt" in preferences, you'll see that there are three different mouse/keyboard combinations to do the "sculpt" action, including this:

you can remove it by clicking on the "x" icon right of it, getting this:

then, if you set you desired "pan" shortcut in the "sculpt" editor section from the default:

to:

you should be able to "pan" the sculpt view with your preferred combination, like I was able to do here:

By the way, remember to save your preferences to keep this configuration or it would reset at next start. You can also reset to factory settings in the same menu.


I had this problem and I redownloaded Blender 2.83. I opened my file, and all the keyframing works the way it's supposed to. Proabably a bug.


How to import fbx image to an existing project

This is two questions, but I will answer both.
First, your description sounded like you are thinking of the tire as a 2D rendering of a 3D object, being moved about in a 2D space. It is in a 3D space. If you already understood that, I am sorry. But anyway, to fake it and make the tire render in front of everything all the time even if it is positionally behind it, you can use the render engine specific solution, or a permanent one that works with all engines. I will describe the latter.

Place the tire in its own collection, and place everything else except the lights and camera in their own collection together.
Create a new View Layer.
In that new layer, uncheck the collection without the tire.
If you do not want the tire to cast shadows on anything, uncheck its collection from the first view layer.
In Properties editor -> Rendering tab -> Film panel, enable Transparent.
In the Compositing screen, enable Use Nodes, then add both view layers, and use Alpha Over to put the tire over the other view layer.

About the rotation transform question, look at the top of the 3D view for a magnet icon. Check that the setting next to it is “Increment” and not something like “Vertex,” and enable Rotation and Scale (Location is enabled by default). Then, click the magnet to turn on snapping. Rotation will now snap to 5 degree increments.


According to the documentation Blend4web uses WebGL and supports:
Full Support

Yandex Browser
Chrome
Firefox
Opera

Experimental Support

Internet Explorer 11
Safari 8

Mobile Platforms

Android (on the majority of modern devices)
BlackBerry
Firefox OS
iOS 8
Tizen
Ubuntu Touch
WebOS

It looks promising, I would check whether it covers all requirements and give it a try.


This is an old tread, but I just stumbled by..
A fast way to do this, is to use the Matcap preview in the 3D view, and select the "normal sphere" in the matcap images/balls.
Then simply screengrap!

If this is not good enough, it would be easy to make a material that would do it.


how to create node group inside another node group using Python script

Here is some Python functions to manipulate groups and group instances.

Principally, there is two aspects:

Groups are stored in Blender's data in bpy.data.node_groups
Inside a material or another group, a group needs to be instantiated so that it is link to this material or other group

The code is commented below:

import bpy

def create_material( name, use_nodes = True, clear = True ):
    """
    Create a material of the given name.

    Parameters:
    name (string): the name of the material to create
    use_nodes (bool, default True): if True the material is ready to have nodes
    clear (bool, default True): if True clear default nodes

    Returns:
    material: The created material
    """
    material = bpy.data.materials.new( name )
    material.use_nodes = use_nodes
    # Materials are created with two default nodes, so we may want to clear them
    if clear:
        clear_material( material )
    return material

def clear_material( material ):
    """
    Remove all node of the given material

    Parameters:
    material (material): the material to clear
    """
    if material.node_tree:
        material.node_tree.links.clear()
        material.node_tree.nodes.clear()

def create_group( name ):
    """
    Create a group in Blender's data

    Parameters:
    name (string): the name of the material

    Returns:
    group (group): the created group
    """
    group = bpy.data.node_groups.new( name, 'ShaderNodeTree' )
    return group

def instanciate_group( nodes, group ):
    """
    Instanciate a group inside a node tree

    Parameters
    nodes: the nodes of the node tree in which the group is to instantiate
    group: the group to instanciate

    Returns:
    instance: the created group instance
    """
    instance = nodes.new( type = 'ShaderNodeGroup' )
    instance.node_tree = group
    return instance

# Example:

# Create a material
material = create_material( "mat" )
# Create group0
group0 = create_group( "group0" )
# Create group1
group1 = create_group( "group1" )

# Instantiate the group0 into the material
group0_instance = instanciate_group( material.node_tree.nodes, group0 )
# Instantiate the group1 into group0
group1_instance = instanciate_group( group0.nodes, group1 )


Blender doesn't ask 'Do you really want to quit', when I press file -> new

Unfortunately, you can't do this. Notice that Blender uses an operating system specific dialogue box instead of the normal Blender UI. This appears to be more of an operating system thing than a Blender, but it obviously doesn't work with the Blender controls.

You can see that if you do File > Quit, Blender will open a dialogue box that asks if you want to quit (it is the same whether the file is saved or not).

This is not a "smart" dialogue. The same applies to the "new file" button. Blender opens a dialogue box, but it is not an OS level "smart" dialogue box.


It would be easier to help you if you had provided a blender scene or some screenshots.
If you want to bake multiple objects together, the way to go is the following (from what I understand you are doing some steps correctly, but might miss out on a few things to consider):

create a separate uv channel for all objects and set it active
note: every material must have a unconnected texture node with the texture you would like to bake to (this node has to be active)
unwrap your objects: you can either select all objects and unwrap them together. (this will distribute the uv-coordinates for all objects on one uv-layout) Or you can manually unwrap the objects. but you need to make sure that they will not overlap with the uv coordinates from other objects you also want to bake)
Make a copy of all objects and merge them
hide the original objects
bake (watch out that the island margin is not too big -> play around with it)

Edit: if you keep the original objects hidden, you can later apply the baked texture to all those objects and you still have them separate. Or you can apply the texture on the joined object, whatever you prefer


How to apply transformations to an object using the world matrix?

You need to apply the matrices in reverse order.

The code is given below. You can comment the last call (and the createObjs call if the objects are already created) and uncomment the commented applyMatToVerts calls one by one to see the effect of each matrix transformation (see gif above).
The last applyMatToVerts call is equivalent of all the commented calls. It creates a single matrix and applies it to all the coordinates of the object. I am not using matrix world since the objects are at the origin. If they are not, the matrices need to be multiplied with obj.matrix_world.

import bpy
import bmesh
from math import radians, sqrt
from mathutils import Matrix

def getMat(name, color):
    oldMat = bpy.data.materials.get(name)
    if(oldMat != None):
        bpy.data.materials.remove(oldMat)
    mat = bpy.data.materials.new(name)
    mat.diffuse_color = color
    return mat

def createObjFromCo(meshName, objName, coList, matName, matColor):
    bm = bmesh.new()
    verts = []
    for co in coList:
        verts.append(bm.verts.new(co))
    bm.faces.new(verts)
    mesh = bpy.data.meshes.new(meshName)
    obj = bpy.data.objects.new(objName, mesh)
    bpy.context.scene.objects.link(obj)
    bm.to_mesh(mesh)
    mat = getMat(matName, matColor)
    obj.data.materials.append(mat)
    return obj

def applyMatToVerts(obj, mat):
    for vert in obj.data.vertices:
        vert.co = mat * vert.co

origObjName = 'origObj'
origCopyName = 'origCopyObj'
toMapObjName = 'toMapObj'

def createObjs():
    t = [(-1, -1, -1), (1, 1, -1), (-1, 1, 1), (1, -1, 1)]
    u = [(2, 2, -1), (2, 2, 3), (0, 0, 1), (4, 0, 1)]
    orange = (0.8, 0.2, 0.1)
    green = (0.2, 0.8, 0.2)
    blue = (0.2, 0.2, 0.8)
    origObj = createObjFromCo(origObjName+'_data', origObjName, t, '__obj1Mat__', orange)
    origCopy = createObjFromCo(origCopyName+'_data', origCopyName, t, '__objCopyMat__', blue)
    toMapObj = createObjFromCo(toMapObjName+'_data', toMapObjName, u, '__obj2Mat__',green)

createObjs()

origObj = bpy.data.objects['origObj']
origCopy = bpy.data.objects['origCopyObj']
toMapObj = bpy.data.objects['toMapObj']

rot_mat1 = Matrix.Rotation(radians(45), 4, 'Z')
scale_mat1 = Matrix.Scale(sqrt(2), 4, (1,0,0))
scale_mat2 = Matrix.Scale(sqrt(2), 4, (0,1,0))
trans_mat = Matrix.Translation((2, 1, -1))
rot_mat2 = Matrix.Rotation(radians(90), 4, 'X')

# ~ applyMatToVerts(origCopy, rot_mat1)
# ~ applyMatToVerts(origCopy, scale_mat1)
# ~ applyMatToVerts(origCopy, scale_mat2)
# ~ applyMatToVerts(origCopy, trans_mat)
# ~ applyMatToVerts(origCopy, rot_mat2)

applyMatToVerts(origCopy, rot_mat2 * trans_mat * scale_mat1 * scale_mat2 * rot_mat1)


Import FBX Camera animation - rotation issue?

If I'm coming from After Effects I can use this plugin to properly import a 3D camera to Blender: https://blendermarket.com/products/ae2blend


Saving GIMP's Alpha Color values in Blender

PNG is an unassociated alpha image format, while Blender, as any other 3D renderer produce associated (often called premultiplied) alpha images.
To produce an unassociated alpha image using the compositor, you have to "pre-divide" the alpha channel and connect the unassociated RGB to the composite output and the alpha socket of the same node.
You can unassociate the alpha channel using an Alpha convert node (using the "premul to straight" mode) or just divide the rendered image by its alpha with a mix node (divide mode).

That's the correct way to save unassociated from Blender if it has to be predivided manually for any reason, otherwise Blender does the predivision automatically when PNG is selected as output (and in that case it's not necessary to manually connect alpha to the output).

PNG will always save the RGB information of transparent pixels because it is an unassociated alpha format.
However, producing an unassociated alpha image from an associated image is a destructive process, because it has to be divided (and alpha zero pixels are discarded).
Saving an associated image as PNG is not allowed by the format, so it's important to keep in mind that any hack used to produce a PNG as described by the OP will produce an invalid image that is likely to produce edge artifacts when composited.

It is strongly advised to respect the alpha association dictated by the format and avoid this kind of hacks if PNG has to be used.


Attempting to Extrude Imported SVG Curve

Your object is very very small and has a very large scale.

Select all your imported curves and apply scale with Ctrl + A > Scale
Join them all together with Ctrl + J (select them all and then make sure you click-select at least one last curve to make it the active object, so it will act as receiving curve other curves will be appended to)
Now enter edit mode in the new curve
Select all vertex and press Space Bar
Search for Set Curve Radius
Enter a value of 1.0and press enter

You should now be able to extrude successfully
You can now separate all curves again into their original parts by entering edit mode, selecting each spline individually and pressing P Separate

Just a side note, when using curves always prefer the builtin extrusion method over solidify, it is more reliable and has better features like allowing non destructive beveling


First of all, thanks for giving all the right info in your illustration. There's no object scaling, and you've shown us your texture space.
You're using the Object texture space, which is measured from the object's origin, along its own XYZ, before any object transforms,in Blender units. It's 3D. If you use a 3D texture, like the provided 'Checker' texture node, you will see no stretching: the pattern on the surface will be the one produced where the surface intersects a 3D grid of black and white cubes.
In the picture, on the other hand, you are using an Image texture, which is 2D. It only has X and Y coordinates, there's no Z to take into account, so, in Object space, it's projected straight down the object's Z, like a (UK) stick of rock. All points on the surface with the same Object XY get the same color from the image, where the surface intersects columns projected from black and white squares.
If you use a 2D image texture, you usually need a UV map to cut it up and plaster it over the surface in the desired way, and use the UV output of the Texture coordinate node.


When you choose automatic weights does it have settings?

For more control you could use the Envelope Weights instead. For this, select your armature and set its Display properties to 'Envelope'. The bones will now show in 'Edit mode' surrounded with a halo indicating the extent of the envelope and this can be varied for each bone via the properties panel ('N') via the Envelope attribute. The reach of influence of that bone is also affected by the Head and Tail radius. When the armature is parented to a mesh via the 'With Envelope Weights' option, the reach of the envelope will affect the influence of each bone.


Face color from distance to object, regardless of origin?

Yes. This made me realize the setup from my answer is not optimal. You want to simply get the length of the vector from your empty to the pixel on your mesh :


How to make several objects free fall at different keyframes?

Use the bpy.data.objects[“Obj Name”].rigid_body.dynamic or …rigid_body.enabled property


Is it possible to find the nodes connected to a node in python?

The python path to the links between each node is

bpy.data.materials[].node_tree.nodes[].inputs[].links[].from_node

So for each material we want to start at the Material Output node then loop through each array of inputs[] and links[] to move through the connections. Going this way (using from_node) there should only be one link for each input, but if you want to reverse the order (by using to_node) you can have multiple links for each output.

import bpy

def followLinks(node_in):
    for n_inputs in node_in.inputs:
        for node_links in n_inputs.links:
            print("going to " + node_links.from_node.name)
            followLinks(node_links.from_node)

for mat in bpy.data.materials:
    print("Traversing " + mat.name)
    for mat_node in mat.node_tree.nodes:
        if mat_node.type == 'OUTPUT_MATERIAL':
            # we start at the material output node
            print("Starting at " + mat_node.name)
            followLinks(mat_node)


It's a bit hard to visualize without having the actual mesh, but I think you just have an extra loop in there.  If you just merge the points on the yellow edge here to the points to their right, you'll be pretty close to correct.

OK, then add this edge in green, delete the edge in red, and move the top endpoint of the green edge over to the right:

That should give you this edge in your reference model:

Then I think the last problem edge is the one that curves over the top of the bicep.


Assuming that it is the rotation of the 3D view that always pivots around the center of the screen and you would like it to pivot around the selected objects origin instead, you need to activate the "Rotate Around Selection" setting.

File menu > User Preferences > Interface


When I press space instead of search I'm getting playback started

In 2.8x Search is F3. For this and other shortcuts see https://www.ablenderuser.in/2019/01/blender-key-map.html?m=1


Is their a way to move multiple vertices gradually at a time?

You can get the movement you want all at once with proportional editing.

Select the top vertex
Press O to enable proportional editing
Change the Falloff type to be either linear or Smooth.
Press G to move the vertices
While still moving the vertices, use the mouse wheel to change the size of the influence until it covers all the vertices you want to move.


How To Get A Quaternion Camera Rotation That Is Independent Of View Orientation

I've never experienced myself the specific problem that you are talking about, so I don't actually know if this fixes it, but you are able to change the rotation mode for the camera from XYZ to Quaternion.

The image below shows the setting being changed in the properties panel.

I hope this helps! (but it might not, idk)


Rigging shft+ctrl+v does not flip animation properly

As I said it's a bone axis problem, so follow these steps to fix it:


The "Dynamic Context Menu" is the new name, probably with added functionality, of the "Dynamic Spacebar Menu".


Make a plane with the dimensions you need to cut.

In object mode select the cutting object first then while pressing Shift select the object to be cut.

Set your view to orhtogonal, go into edit mode, press the Spacebar and type Knife Project

Th Knife Project tool will make a hole using the shape of the selected object.


Animating for interchangeable model parts?

My first instinct is to use a single armature, and have different meshes with an armature modifier pointing to the same armature.  In simple cases you could instead parent the mesh to one bone in the armature.  In more complicated cases you can use the armature modifier and vertex groups with weights to have the mesh modified by the appropriate subset of bones.

How exactly that translates to Unity, I am not sure.


Is speed control effect for a time range or just one specific strip?

Try extracting audio and video from your clip to get two separate files. Next, in VSE, change only the extracted video strip speed.


character movement does not work in blender game engine

Unfortunately you can't use the Mirror Modifier with the BGE this way. When you apply the character's Mirror Modifier everything will work as expected. I only added this as an answer because Blender game character is not responding to game logic has no accepted answer.


Do you know how to set up material nodes?
(Assuming your in cycles)
You need to use an texture node in your material setup:


How can i make two objects move together?

Linking the objects by making one of the two objects the parent. If you select both objects you can Ctrl+P and make the last selected object the Parent.


If a known mesh can use the index

If the mesh is created from a grid via the operator or a bmesh we know the order of the vertex indices, and how many rows and columns.

In the example in question it appears to be a 22 x 22 vertex grid.

For a default grid, as viewed from top, the bottom left hand corner is index 0, up to 21 along bottom row, 22 to 43 the next row up and so on.

Hence we can use these indices to select using div and mod.

Test script for 22 x 22 vert grid, selecting every fifth row, every third column, starting from row 2 column 4

import bpy
import bmesh

context = bpy.context
me = context.edit_object.data

bm = bmesh.from_edit_mesh(me)

#example in question has 22 x 22 vert grid
rows = 22
cols = 22

# choose every 5 rows, 3 columns
r = 5
c = 3
# offset (eg make (2, 4) == (0, 0)
ro = 2
co = 4

for v in bm.verts:
    i = v.index
    row, col = i // cols + ro, i % rows + co
    v.select = not row % r and not col % c

bmesh.update_edit_mesh(me)

Note the order can be changed using sort.

For example to sort along x

bm.verts.sort(key=lamda v: v.co.x)

for a default aligned xy grid will order up the columns.


rotating linked torri with arrow mapping

That can be something like this (if I understand the question...):

The idea is to hook a grid (1x2 proportions) then simple deform bend twice to make a torus and finally weld to remove doubles.
Then if we move the hook object (only in X/Y axis), that will rotate around the simple deform with bend option.

In short:

Hook will move all vertices (in the animation, just move the hook empty in X/Y so that the arrow will move around the torus)
Simple deform / bend 360 makes a tube
Simple deform / bend 360 makes a torus
Weld merges doubles


Is there any way to clean a triangulated mesh?

I wouldn't recommend retopo for a relatively simple mesh, just create it from scratch scale a cube and add a bevel modifier (apply it when your're happy with the result):

Than add two loop cuts like in the next image this will help to avoid crazy meshes when using Knife project


How do I add custom property to object in bpy?

The answer is:

bpy.types.Material.gltf_double_sided = bpy.props.BoolProperty()
bpy.context.object.active_material.gltf_double_sided = True

And it works.


Projecting Texture onto surface from point

You can project an image from a point onto a surface using Vector Maths.

Start with two reference points - one for the source of the projection (L) and another for the centre of the plane (O).

The reference points can be defined in the material using a couple of Combine XYZ nodes to generate each as a Vector (representing the position in relating to the world origin). In addition, a third Combine XYZ node can be used to indicate the orientation of the image used in the projection. You can use Drivers to automatically set each of the XYZ elements of the vectors based on the location of an Empty positioned within the scene. In this way you can easily change the reference points simply by re-positioning those reference Emptys rather than having to manually adjust the vectors.

For each sample point on the surface we need to determine the vector of the ray from the projection source, through the image plane and to the surface. This can be achieved by subtracting the vector representing the source of the projection from the point on the surface. However, in order to calculate the vector of the ray we need to ensure that each of the points are in the same 'space'. The two reference points are in world space whereas the sample point Object output from the Texture Coordinate node) is in Object space. The Vector Transform node can be used to translate from Object space to World space and we can then simply Subtracting the vectors to calculate the vector of the ray.

Note : You must use the Vector Math Subtract node - not the Math Subtract node - for this.

To determine the point in the image texture that would be projected onto any particular point on the surface we need to be able to measure how far the ray travels in specific directions - in the Y direction of the image plane, in the X direction of the image plane, and also the distance travelled perpendicular to the image plane.

The vector between the two reference points (LO) can be used as the 'centreline' of the projection and this will be perpendicular to the image place. It can be calculated simply by subtracting one vector from the other.

The X and Y vectors need to both be perpendicular to the 'centreline' and to each other - to ensure they are independent (ie, at 90 degrees to each other, in the same way as for the the usual X,Y,Z axes in World or Object space). These can be generated by using the Cross Product Vector Math node; the Cross Product takes two vectors and generates a vector that is perpendicular to both of the input vectors. Passing the 'centreline' vector and the Orientation vector into a Cross Product will generate the X vector. Passing the generated X vector and the 'centreline' vector into another Cross Product wiil generate the Y vector.

Passing the X and Y vectors through a Vector Math Normalize node ensures they are of unit length (important to ensure the projection is not distorted).

To measure each ray we use the Dot Product to determine how far the ray travels in the direction of each of the 3 reference vectors (X,Y,centreline). ie, To measure the distance to the plane where the ray intersects the mesh we can combine the ray with the 'centreline' vector; in the X direction we combine with the X reference vector; in the Y direction we combine with the Y reference vector.

All that remains is to scale the measured distances based on the relative distances between the source, the projection plane, and the plane at the intersection of the mesh. ie, if the distance between the source and the plane (L->O) is 1/3 the distance from the source to the plane at the mesh (L->Q) then the vector in the texture plane (O->t) will be 1/3 the length of the equivalent vector (Q->P) at the mesh.

This can be achieved using maths nodes to calculate the ratio (the Dot Product and first Divide) and applying the ratio to the measured coordinates (the other Divide nodes). The results are combined into a Vector.

The resultant coordinates will be centred around 0,0 but the texture space is from 0.0 to 1.0 - so an additional MixRGB node set to Add is used to add 0.5,0.5,0.5 to the vector to adjust. The result can be used in a Texture node to apply the actual image to the projection.

The final material should look something like this :

In the attached Blend file, move the empties to move the reference points of the projection.

The material can be used to drive the surface for a surface projection as shown above, but can also be used to drive Volumetrics which can show the path of the projected rays.


In the World tab you can add a volume to the entire scene. This allows you to create fog which scatters light from your laser and thus makes it visible. You will likely need to adjust the Scattering Scale to the size of your scene, larger values result in stronger scattering.


Screenshot 1 To see the UV maps do the following...

select the object in the outliner. You can select more than one object if you want to unwrap them on the same UV map
switch to Edit Mode
make sure you have selected the correct UV map
select the faces you want to see. Press A to select them all and it should reveal the whole UV map. You can unwrap the object(s) with U. The Unwrap operation requires seams (the red lines). Smart UV Project does not need seams.
in the UV editor you can see the UV islands now. If you select only a few faces in the viewport then only those are shown here. You can drag them around and they will become separated islands. This way you don't need a seam.
if you're looking for a specific face you can activate the UV Sync Selection mode. In this mode, any face you select in the UV editor will be selected in the viewport and vice versa. Tip: Use Face Selection mode (3). In this mode, vertices of connected islands are automatically selected. Turn sync off, if you want to move a UV island.

Screenshot 2

here in the section Object Data Properties > UV Maps, you can select the UV map that you want to edit. The camera icon specifies the map that is used for the render. In this list, you can also add more UV maps and delete unnecessary ones.

In the Image Editor on the left, you can select an image that is displayed for the UV map.


Make a keyframe last longer than one frame

As Puck suggested, you can duplicate keyframes to achieve this effect.

To do this, open one of the keyframe editors. I'd use the Dope Sheet view for this task since you need adjust the keyframes in the timeline, but don't necessarily need to change their location/rotation data.

Make sure to deselect all keyframes by hitting A. The keyframes will be white when deselected. Now select the keyframes you want to duplicate by hitting B and using your mouse to drag a box around them. The selected keyframes will turn orange.

Hit ShiftD to duplicate them and move the mouse. The keyrames will follow, so you can position them in the timeline. There will be an orange line signaling duplicated keyframes and the length of the pause the animation.

If you want to move the keyframes again, hit G to grab and re position them again.


quoting from the manual:

  order to merge two window frames, they must be the same dimension in the direction you wish to merge. For example, if you want to combine two window frames that are side-by-side, they must be the same height. If the one on the left is not the same as the one on the right, you will not be able to combine them horizontally. This is so that the combined window space results in a rectangle. The same rule holds for joining two window frames that are stacked on top of one another; they must both have the same width. If the one above is split vertically, you must first merge those two, and then join the bottom one up to the upper one.

read:
https://www.blender.org/manual/getting_started/basics/interface/window_system/arranging_frames.html?highlight=join%20window


How to access mesh data of an object in a script?

I'm not sure what you're asking, but you can retrieve the mesh datablock associated with an object like

ob = bpy.context.object # get the active object for example
mesh = ob.data

The reverse is not directly possible. A mesh can be used by many objects, and the mesh doesn't know/store who its "owners" are. You can build a reverse index however:

mesh_owners = {}
for ob in bpy.data.objects:
    if ob.type == 'MESH':
        mesh_owners.setdefault(ob.data, []).append(ob)

print(mesh_owners[mesh])
# Example output - mesh is used by a one object:
#[bpy.data.objects['Cube.003']]


What is the best way to animate the camera path?

Create a single path for all of the trajectory. On the camera use a Follow Path Constraint. select the Target path, check the Follow Curve box so the camera starys aligned with the path and animate the Offset value.

On frame 1 create a Keyframe at 0. Go to to frame 500, change the offset value so that the camera reaches point B and insert another keyframe. Move to frame 550 and don't alter the offset value and insert another keyframe.

Keep doing the same procedure until your camera reaches point D.

The graph for the camera movement in the Graph Editor shows how the camera starts at 0, picks up speed, decelerates to a stop and accelerates again... all of that because as default Blender uses Bezier interpolation.


internally the value is stored as an 8-bit value (char C type, range 0..255). This means to get from the 0..1 range to the actual stored value, multiply by 255:

0.65 * 255 = 165.75 ~ 166 (rounded to integer)
0.1  * 255 = 25.5   ~ 26  (rounded to integer)

When 166 is in turn displayed in 0..1 range again, it gets divided by 255:

166 / 255 = 0.650980392... ~ 0.651 (rounded to 3 digits)
26  / 255 = 0.101960784... ~ 0.102 (rounded to 3 digits)

So the double rounding when entering and then displaying the value causes this slight error. If you read the same value and set it back again these errors will mount up, but otherwise it's not a big problem.

In addition to cases like this where a color value is actually an 32-bit integer (8 per component) internally, there is also the usual issue of floating point representable numbers. But in this case the integer rounding overshadows it.


How to render with alpha-channel defined by object form?

The holdout node can be used to cut an object from the scene.

  The Holdout shader node is used to create a “hole” in the image with zero alpha transparency, which is useful for compositing

Note that the holdout only cuts through objects in the scene, you need to render with transparency and composite the scene onto the environment pass if you want the background.

You can also set the object pass index and use the ID Mask Node to mask it out in the compositor. The material index is the same thing applied to the material instead of the whole object.


How to render the shadow of an invisible object?

If you are using cycles you just have to disable camera visibility.

Alternatively you can make a shader that uses the camera ray as a mix factor for your figure's shader and a transparent one. The camera will not see the object but it will still cast a shadow.


Missing elements while rendering an image in Blender

Check and see if you have this option checked in your missing object.


Why isn't the Image Editor showing the denoising image like in the Compositor?

You have to switch on top row of Image Editor from your 0001.png to Viewer Node :)


Making ventilation holes in a hockey mask style model

If your mesh is clean and subdivided enough you can make as many holes as you need with the following method. If it has not enough edge loops you can add some with W > Subdivide Smooth or add and apply a Subdivision Surface modifier.

Select four faces, press i to inset, and scale down the inset.
Press W > LoopTools > Circle
Delete the inner faces of your circle
Now you have a hole
Add a Solidify modifier to give thickness to your shape
Add an edge loop around your circle if you want a sharper edge

If you want a low-poly mesh you can create a low-poly version of your mask, bake your high-poly version, and, in the low-poly material, recreate fake holes with Normal or Bump maps.


Primitive shapes whose parameters are dependent on their relative postiton

Here is one workflow that might get you where you want to go:
Set the 3D cursor to world origin Shift+s, 1
Create a "unit cone" with radius 1 and depth 1:

Notice Location Z is set to -0.5. This places the vertex of the cone on the origin.
Use the object menu to set the object origin to 3D cursor. Now the cone's origin is at the vertex. All scaling and rotating we will do is reference to the vertex.
Add in a UV Sphere, leave the radius at 1 for simplicity, then move it away from the cone. While you've still got the Sphere selected, add a "Limit Distance" object constraint, set the Target to the Cone, Distance to 1.1 (a little more than the Sphere radius) and "Clamp Region" to outside. This prevents the Sphere from moving too close to the Cone's Vertex. Its hard to calculate the tangent of a point inside the Sphere!

Now we need to point the Cone at the Sphere, to do that select the Cone, and press r, y, -90 to rotate it 90 degrees on the y axis. Then apply rotation. The add a "Track to" object constraint to the Cone. Set the Target to the Sphere, and Axis to x. The Cone's base should now point to the Sphere as you move the Sphere around the scene, and you should not be able to move the Sphere too close to the Cone.

Now we need to add some Drivers to the Cone: Open the Cone's Transform panel, right click on Scale X and choose "Add Driver", on the Driven Property panel, set the "Expression" to var, and under Input Variable set the type to "Distance" and the Targets to Sphere and Cone. This should make the Cone stretch to always intersect the origin of the Sphere. You can experiment with the expression to get the effect you want.

Finally, add drivers to the Cone's Scale:Y and Scale:Z properties.
The expression is
tan(asin(1/dist)) * var

Where dist is a distance variable as setup previously, and var is height of the cone, taken from "Scale:X"


How do I replace the player with a rigid body object? BGE

when you press space. use python to add a invisible ball.

parent the snails physics object to the ball no collision.

the snail,should be

Cube (physics,bound)

armature parented to cube

skin parented to armature

and the ball should be a rigid body,

invisible, sphere physics, bound

your going to want to use python and a timer to do it

let me know if you need more help.


Processing edges twice.

The logic is wrong.  If an edge is a boundary of two selected faces it gets subdivided twice (for each face).  These are the edges to have seam set to false

To get all the edges of smooth faces. First will select smooth faces. Set the material on these faces.  From these faces get the edges.

faces = [f for f in bm.faces if f.smooth]
edges = set(e for f in faces for e in f.edges)

by making edges a set it has only one of each unique member. Pass list(edges) to an operator.

Can use this narrowed down selection to do the seam setting.

Object mode test script.  With object selected and active in OBJECT mode run the script below.

Set use_grid_fill=True in the bmesh subdivide operator if you wish to subdivide faces too.

import bpy
import bmesh

context = bpy.context
ob = context.object
me = ob.data

# object mode bmesh

bm = bmesh.new()
bm.from_mesh(me)

faces = [f for f in bm.faces if f.smooth]

for f in faces:
    f.material_index = 1

edges = set(e for f in faces for e in f.edges)

for e in edges:
    if all(f.smooth for f in e.link_faces):
        e.seam = False

bmesh.ops.subdivide_edges(bm,
        edges=list(edges),
        cuts=1,
        use_grid_fill=True,
        )
bm.to_mesh(me)
me.update()

Recommend when using bmesh choosing which mode you wish script to run in. The toggle mode operator is not required in your question script.

If you wish to see live results as you are editing would go with an edit mode bmesh as below.

Here is a test file to run in EDIT mode.  Can run this script against a "live" selection of edges.

import bpy
import bmesh

context = bpy.context
ob = context.object
me = ob.data

# edit mode bmesh

bm = bmesh.from_edit_mesh(me)

edges = [e for e in bm.edges if e.select]

bmesh.ops.subdivide_edges(bm,
        edges=edges,
        cuts=1,
        use_grid_fill=True,
        )
bmesh.update_edit_mesh(me)
me.update()


Quickly use a screw modifier for the basic shape.

You could use a curve to make the second step easier - the extra objects addon will let you add a screwed curve.

Then just create the tail parts. I applied the screw modifier then I extruded but if you had used a path it would probably be easier

I copied and flipped the whole thing, using snapping to add it to the top of itself, thus making the top tail.

Then put the whole thing on a curve using a curve modifier.


is there a way to select just the outer surface but not the inner?

You probably have got the nonmanifold elements there. Select the whole mesh in Edit Mode (A), go to Select-->NonMannifold, then delete the edges.

You may also use a MeshLint add on to do it. Activate it in User Preferences (Ctrl+Alt+U). Go to the MeshLint panel of the Data header, check the NonManifold Elements checkbox and click Select Lint button.


You have pivot point set to Active Element and the first vertex you select when selecting a loop is the active element. To scale to the center you would need to set transform pivot to Median Point or to Bounding Box Center. You can switch the type of pivot point for transform operations like rotate, move or scale at the header of any 3D View window:


You can try to set size of the crosshairs to 0:

To do this for multiple objects set the active one and copy to all the selected with right-click on property-field and Copy_To_Selected option.

This will only scale them and not eliminate them.

You can also set the viewport properties panel > Display > Only Render property:


How to use video preview as video output?

This may not be exactly what you're asking but have you tried rendering
from the Drop down menu at the top left of the 3D window.  It's called "render" strangely enough and gives you access to the "OPenGL Render."

I use this almost always and find it outputs (usually) what I see in the 3D window, or through the camera.  On the few occasions it doesn't, the problem is always a setting or two, (or three, to almost infinity)

A large factor in it's favour is it's rendering speed.


(Physics) Animated Model with Armature interacts with cloth, but not other objects

Just figured it out, apparently this had something to do with it...


How to model/apply a rhomboid pattern on a cylinder? (Sword hilt modeling)

Subdivide your cylinder vertically the number of desired times with a Loopcut.

Select all faces and use the Poke operator to turn them into rhombus.

Using the Select Similar operator (Shift+G by default) select all horizontal edges and erase them with the Dissolve option, making sure you keep the ones defining the cylinder top and bottom edges.

Repeat the process for the vertical edges by Select Similar then Dissolve.
Done!


Wow Blender/Python is really like an onion ( a rather large on at that ) and my eyes have been watering like made getting through the layers :)

Ok I finally ran grep in the scripts directory as I should have when pink vertex first sugessted it. Duh.
Line 340 in bl_extract_messages.py gives it up (code below). So it looks to me that if it doesn't have a bl_rna.description (or bl_description) then it uses the __doc__ part.
In the process I realised that the bulk of what I need is directly in the keymaps them selves as .name attribute of the individual keymap. This is derived from the bl_label that is in the op that is called by the new keymap definition line.

So I went round in circles when it was right under my nose.
Thanks again everyone.

    if bl_rna.description:
        process_msg(msgs, default_context, bl_rna.description, msgsrc, reports, check_ctxt_rna_tip, settings)
    elif cls.__doc__:  # XXX Some classes (like KeyingSetInfo subclasses) have void description... :(
        process_msg(msgs, default_context, cls.__doc__, msgsrc, reports, check_ctxt_rna_tip, settings)


Playing and stopping sound on in Blender game engine

It's simple: use properties.

When you click, you set the property "sound" to then respective number of sound. Then, you check the property value with "Property" sensors and play sound 1 if property = 1, play sound 2 if property = 2 and so on.

Here's a working example file:


As Sanbaldo says, use trick to keep good topology, meaning quads as much as possible, see this site for example: https://topologyguides.com/
Here are examples of edge loops reductions:

For your hand you could try the following method, first delete vertices:

Then draw this topology:


You can achieve a similar result with the Subdivide operator

Just select the desired edges, press W > Subdivide. In the operator panel options choose the number of cuts.

Have in mind that this is most likely to create lots of NGons at the ends which are largely considered a bad modelling practice, and prone to problems with topology, animation, and texturing.


How can I easily check if an object is linked to an other object?

I just found the answer for my question myself:

In the properties panel I have to go to the object data section. If a number is displayed beside the mesh-icon it means that the mesh of the selected object is linked to at least one other object:


Import Toon Shaded Character to an outside program?

I cannot say for certain if it can or can't be done, but I would advise against it regardless. Unity comes with a few toon shaders that are fine for most cases and are guaranteed to work with the engine.

What you do instead is that you export the mesh object by itself and build the material you want for it inside Unity. You also assign the texture for it in Unity if your object has one.

If you feel you need more control over the toon shader, there are some solutions over at the Unity Marketplace you could try.


Found the solution, in this tutorial:

https://www.youtube.com/watch?v=jtX_zBVwBgI&t=973s


You use Emitter particles for your static particle crystals ("sprinkles"). For static particles that don't change their position like grass, trees, sprinkles, sesame seeds on a burger, ... it's better to use Hair particles. They are static and always dead.
Emitter particles are used for animation mainly. For birds, fishes, moths, dust, and fluid. They have a lifetime and die.
Looks like you knew that and have made the settings accordingly: Only 1 frame animation and set Frame Start and End to 1, lifetime 1. Unfortunately, it does not work because in frame 1 the particles are still unborn and not rendered by default. The nasty thing is that you see them in the viewport.
Possible fixes:

use particle type Hair. You need to apply the scale of the instance object and scale it up a bit. For some reason, the particles are smaller when rendered as Hair.
or set Frame Start and End to 0
or tick the checkbox Render > Extras > Unborn in particle settings
or render frame 2 and tick the checkbox Render > Extras > Dead in particle settings
or use particle type Hair ;-)


The problem has been solved. It turns out my GPU needed a driver, but it had to be downloaded manually instead of just clicking "update driver".


Create an interface which is similar to the material list box

The example given is called UIList. The following code is based on the Modifier UIList of this answer. Once registered, scene objects can be added, removed, printed or selected via UI Elements.

custom_uilist.py

import bpy

from bpy.props import (IntProperty,
                       BoolProperty,
                       StringProperty,
                       CollectionProperty)

from bpy.types import (Operator,
                       Panel,
                       PropertyGroup,
                       UIList)

# -------------------------------------------------------------------
#   Operators
# -------------------------------------------------------------------

class CUSTOM_OT_actions(Operator):
    """Move items up and down, add and remove"""
    bl_idname = "custom.list_action"
    bl_label = "List Actions"
    bl_description = "Move items up and down, add and remove"
    bl_options = {'REGISTER'}

    action = bpy.props.EnumProperty(
        items=(
            ('UP', "Up", ""),
            ('DOWN', "Down", ""),
            ('REMOVE', "Remove", ""),
            ('ADD', "Add", "")))

    def invoke(self, context, event):
        scn = context.scene
        idx = scn.custom_index

        try:
            item = scn.custom[idx]
        except IndexError:
            pass
        else:
            if self.action == 'DOWN' and idx < len(scn.custom) - 1:
                item_next = scn.custom[idx+1].name
                scn.custom.move(idx, idx+1)
                scn.custom_index += 1
                info = 'Item "%s" moved to position %d' % (item.name, scn.custom_index + 1)
                self.report({'INFO'}, info)

            elif self.action == 'UP' and idx >= 1:
                item_prev = scn.custom[idx-1].name
                scn.custom.move(idx, idx-1)
                scn.custom_index -= 1
                info = 'Item "%s" moved to position %d' % (item.name, scn.custom_index + 1)
                self.report({'INFO'}, info)

            elif self.action == 'REMOVE':
                info = 'Item "%s" removed from list' % (scn.custom[idx].name)
                scn.custom_index -= 1
                scn.custom.remove(idx)
                self.report({'INFO'}, info)

        if self.action == 'ADD':
            if context.object:
                item = scn.custom.add()
                item.name = context.object.name
                item.obj_type = context.object.type
                item.obj_id = len(scn.custom)
                scn.custom_index = len(scn.custom)-1
                info = '"%s" added to list' % (item.name)
                self.report({'INFO'}, info)
            else:
                self.report({'INFO'}, "Nothing selected in the Viewport")
        return {"FINISHED"}

class CUSTOM_OT_printItems(Operator):
    """Print all items and their properties to the console"""
    bl_idname = "custom.print_items"
    bl_label = "Print Items to Console"
    bl_description = "Print all items and their properties to the console"
    bl_options = {'REGISTER', 'UNDO'}

    reverse_order = BoolProperty(
        default=False,
        name="Reverse Order")

    @classmethod
    def poll(cls, context):
        return bool(context.scene.custom)

    def execute(self, context):
        scn = context.scene
        if self.reverse_order:
            for i in range(scn.custom_index, -1, -1):
                item = scn.custom[i]
                print ("Name:", item.name,"-",item.obj_type,item.obj_id)
        else:
            for item in scn.custom:
                print ("Name:", item.name,"-",item.obj_type,item.obj_id)
        return{'FINISHED'}

class CUSTOM_OT_clearList(Operator):
    """Clear all items of the list"""
    bl_idname = "custom.clear_list"
    bl_label = "Clear List"
    bl_description = "Clear all items of the list"
    bl_options = {'INTERNAL'}

    @classmethod
    def poll(cls, context):
        return bool(context.scene.custom)

    def invoke(self, context, event):
        return context.window_manager.invoke_confirm(self, event)

    def execute(self, context):
        if bool(context.scene.custom):
            context.scene.custom.clear()
            self.report({'INFO'}, "All items removed")
        else:
            self.report({'INFO'}, "Nothing to remove")
        return{'FINISHED'}

class CUSTOM_OT_removeDuplicates(Operator):
    """Remove all duplicates"""
    bl_idname = "custom.remove_duplicates"
    bl_label = "Remove Duplicates"
    bl_description = "Remove all duplicates"
    bl_options = {'INTERNAL'}

    def find_duplicates(self, context):
        """find all duplicates by name"""
        name_lookup = {}
        for c, i in enumerate(context.scene.custom):
            name_lookup.setdefault(i.name, []).append(c)
        duplicates = set()
        for name, indices in name_lookup.items():
            for i in indices[1:]:
                duplicates.add(i)
        return sorted(list(duplicates))

    @classmethod
    def poll(cls, context):
        return bool(context.scene.custom)

    def execute(self, context):
        scn = context.scene
        removed_items = []
        # Reverse the list before removing the items
        for i in self.find_duplicates(context)[::-1]:
            scn.custom.remove(i)
            removed_items.append(i)
        if removed_items:
            scn.custom_index = len(scn.custom)-1
            info = ', '.join(map(str, removed_items))
            self.report({'INFO'}, "Removed indices: %s" % (info))
        else:
            self.report({'INFO'}, "No duplicates")
        return{'FINISHED'}

    def invoke(self, context, event):
        return context.window_manager.invoke_confirm(self, event)

class CUSTOM_OT_selectItems(Operator):
    """Select Items in the Viewport"""
    bl_idname = "custom.select_items"
    bl_label = "Select Item(s) in Viewport"
    bl_description = "Select Items in the Viewport"
    bl_options = {'REGISTER', 'UNDO'}

    select_all = BoolProperty(
        default=False,
        name="Select all Items of List",
        options={'SKIP_SAVE'})

    @classmethod
    def poll(cls, context):
        return bool(context.scene.custom)

    def execute(self, context):
        scn = context.scene
        idx = scn.custom_index

        try:
            item = scn.custom[idx]
        except IndexError:
            self.report({'INFO'}, "Nothing selected in the list")
            return{'CANCELLED'}

        obj_error = False
        bpy.ops.object.select_all(action='DESELECT')
        if not self.select_all:
            obj = scn.objects.get(scn.custom[idx].name, None)
            if not obj:
                obj_error = True
            else:
                obj.select = True
                info = '"%s" selected in Viewport' % (obj.name)
        else:
            selected_items = []
            unique_objs = set([i.name for i in scn.custom])
            for i in unique_objs:
                obj = scn.objects.get(i, None)
                if obj:
                    obj.select = True
                    selected_items.append(obj.name)

            if not selected_items:
                obj_error = True
            else:
                missing_items = unique_objs.difference(selected_items)
                if not missing_items:
                    info = '"%s" selected in Viewport' \
                        % (', '.join(map(str, selected_items)))
                else:
                    info = 'Missing items: "%s"' \
                        % (', '.join(map(str, missing_items)))
        if obj_error:
            info = "Nothing to select, object removed from scene"
        self.report({'INFO'}, info)
        return{'FINISHED'}

# -------------------------------------------------------------------
#   Drawing
# -------------------------------------------------------------------

class CUSTOM_UL_items(UIList):
    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
        split = layout.split(0.3)
        split.label("Index: %d" % (index))
        custom_icon = "OUTLINER_OB_%s" % item.obj_type
        #split.prop(item, "name", text="", emboss=False, translate=False, icon=custom_icon)
        split.label(item.name, icon=custom_icon) # avoids renaming the item by accident

    def invoke(self, context, event):
        pass

class CUSTOM_PT_objectList(Panel):
    """Adds a custom panel to the TEXT_EDITOR"""
    bl_idname = 'TEXT_PT_my_panel'
    bl_space_type = "TEXT_EDITOR"
    bl_region_type = "UI"
    bl_label = "Custom Object List Demo"

    def draw(self, context):
        layout = self.layout
        scn = bpy.context.scene

        rows = 2
        row = layout.row()
        row.template_list("CUSTOM_UL_items", "", scn, "custom", scn, "custom_index", rows=rows)

        col = row.column(align=True)
        col.operator("custom.list_action", icon='ZOOMIN', text="").action = 'ADD'
        col.operator("custom.list_action", icon='ZOOMOUT', text="").action = 'REMOVE'
        col.separator()
        col.operator("custom.list_action", icon='TRIA_UP', text="").action = 'UP'
        col.operator("custom.list_action", icon='TRIA_DOWN', text="").action = 'DOWN'

        row = layout.row()
        col = row.column(align=True)
        row = col.row(align=True)
        row.operator("custom.print_items", icon="LINENUMBERS_ON") #LINENUMBERS_OFF, ANIM
        row = col.row(align=True)
        row.operator("custom.select_items", icon="VIEW3D", text="Select Item")
        row.operator("custom.select_items", icon="GROUP", text="Select all Items").select_all = True
        row = col.row(align=True)
        row.operator("custom.clear_list", icon="X")
        row.operator("custom.remove_duplicates", icon="GHOST")

# -------------------------------------------------------------------
#   Collection
# -------------------------------------------------------------------

class CUSTOM_objectCollection(PropertyGroup):
    #name = StringProperty() -> Instantiated by default
    obj_type = StringProperty()
    obj_id = IntProperty()

# -------------------------------------------------------------------
#   Register & Unregister
# -------------------------------------------------------------------

classes = (
    CUSTOM_OT_actions,
    CUSTOM_OT_printItems,
    CUSTOM_OT_clearList,
    CUSTOM_OT_removeDuplicates,
    CUSTOM_OT_selectItems,
    CUSTOM_UL_items,
    CUSTOM_PT_objectList,
    CUSTOM_objectCollection,
)

def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    # Custom scene properties
    bpy.types.Scene.custom = CollectionProperty(type=CUSTOM_objectCollection)
    bpy.types.Scene.custom_index = IntProperty()

def unregister():
    from bpy.utils import unregister_class
    for cls in reversed(classes):
        unregister_class(cls)

    del bpy.types.Scene.custom
    del bpy.types.Scene.custom_index

if __name__ == "__main__":
    register()

Updated for Blender 2.8x: https://gist.github.com/p2or/d6dfd47366b2f14816f57d2067dcb6a9

As of 2.79 we can have real references to objects per ID by using a PointerProperty, which basically allows to display the actual data, access and edit the attributes on the fly.

Following funky example is a simple demo on how to create a custom UIList of materials. You can create new materials, display and edit their properties (name, color etc.) directly within the list.

material_uilist.py

import bpy

from bpy.props import (IntProperty,
                       BoolProperty,
                       StringProperty,
                       CollectionProperty,
                       PointerProperty)

from bpy.types import (Operator,
                       Panel,
                       PropertyGroup,
                       UIList)

def random_color():
    from mathutils import Color
    from random import random
    return Color((random(), random(), random()))

# -------------------------------------------------------------------
#   Operators
# -------------------------------------------------------------------

class CUSTOM_OT_actions(Operator):
    """Move items up and down, add and remove"""
    bl_idname = "custom.list_action"
    bl_label = "List Actions"
    bl_description = "Move items up and down, add and remove"
    bl_options = {'REGISTER'}

    action = bpy.props.EnumProperty(
        items=(
            ('UP', "Up", ""),
            ('DOWN', "Down", ""),
            ('REMOVE', "Remove", ""),
            ('ADD', "Add", "")))

    def invoke(self, context, event):
        scn = context.scene
        idx = scn.custom_index

        try:
            item = scn.custom[idx]
        except IndexError:
            pass
        else:
            if self.action == 'DOWN' and idx < len(scn.custom) - 1:
                item_next = scn.custom[idx+1].name
                scn.custom.move(idx, idx+1)
                scn.custom_index += 1
                info = 'Item "%s" moved to position %d' % (item.name, scn.custom_index + 1)
                self.report({'INFO'}, info)

            elif self.action == 'UP' and idx >= 1:
                item_prev = scn.custom[idx-1].name
                scn.custom.move(idx, idx-1)
                scn.custom_index -= 1
                info = 'Item "%s" moved to position %d' % (item.name, scn.custom_index + 1)
                self.report({'INFO'}, info)

            elif self.action == 'REMOVE':
                item = scn.custom[scn.custom_index]
                item_name = item.material.name
                mat = item.material
                mat_obj = bpy.data.materials.get(mat.name, None)
                if mat_obj:
                    bpy.data.materials.remove(mat_obj, True)
                info = 'Item %s removed from scene' % (item_name)
                scn.custom.remove(idx)
                scn.custom_index -= 1
                self.report({'INFO'}, info)

        if self.action == 'ADD':
            item = scn.custom.add()
            item.id = len(scn.custom)
            item.material = bpy.data.materials.new(name="Material")
            item.name = item.material.name
            item.material.diffuse_color = random_color()
            scn.custom_index = (len(scn.custom)-1)
            info = '%s added to list' % (item.name)
            self.report({'INFO'}, info)
        return {"FINISHED"}

class CUSTOM_OT_printItems(Operator):
    """Print all items and their properties to the console"""
    bl_idname = "custom.print_items"
    bl_label = "Print Items to Console"
    bl_description = "Print all items and their properties to the console"
    bl_options = {'REGISTER', 'UNDO'}

    reverse_order = BoolProperty(
        default=False,
        name="Reverse Order")

    @classmethod
    def poll(cls, context):
        return bool(context.scene.custom)

    def execute(self, context):
        scn = context.scene
        if self.reverse_order:
            for i in range(scn.custom_index, -1, -1):
                mat = scn.custom[i].material
                print ("Material:", mat,"-",mat.name, mat.diffuse_color)
        else:
            for item in scn.custom:
                mat = item.material
                print ("Material:", mat,"-",mat.name, mat.diffuse_color)
        return{'FINISHED'}

class CUSTOM_OT_clearList(Operator):
    """Clear all items of the list and remove from scene"""
    bl_idname = "custom.clear_list"
    bl_label = "Clear List and Remove Materials"
    bl_description = "Clear all items of the list and remove from scene"
    bl_options = {'INTERNAL'}

    @classmethod
    def poll(cls, context):
        return bool(context.scene.custom)

    def invoke(self, context, event):
        return context.window_manager.invoke_confirm(self, event)

    def execute(self, context):

        if bool(context.scene.custom):
            # Remove materials from scene
            for i in context.scene.custom:
                name = i.material.name
                mat_obj = bpy.data.materials.get(name, None)
                if mat_obj:
                    bpy.data.materials.remove(mat_obj, True)
                info = 'Item %s removed from scene' % (name)

            # Clear the list
            context.scene.custom.clear()
            self.report({'INFO'}, "All materials removed from scene")
        else:
            self.report({'INFO'}, "Nothing to remove")
        return{'FINISHED'}

# -------------------------------------------------------------------
#   Drawing
# -------------------------------------------------------------------

class CUSTOM_UL_items(UIList):
    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
        mat = item.material
        if self.layout_type in {'DEFAULT', 'COMPACT'}:
            split = layout.split(0.3)
            split.label("Index: %d" % (index))
            # static method UILayout.icon returns the integer value of the icon ID
            # "computed" for the given RNA object.
            split.prop(mat, "name", text="", emboss=False, icon_value=layout.icon(mat))

        elif self.layout_type in {'GRID'}:
            layout.alignment = 'CENTER'
            layout.label(text="", icon_value=layout.icon(mat))

    def invoke(self, context, event):
        pass

class CUSTOM_PT_objectList(Panel):
    """Adds a custom panel to the TEXT_EDITOR"""
    bl_idname = 'TEXT_PT_my_panel'
    bl_space_type = "TEXT_EDITOR"
    bl_region_type = "UI"
    bl_label = "Custom Material List Demo"

    def draw(self, context):
        layout = self.layout
        scn = bpy.context.scene

        rows = 2
        row = layout.row()
        row.template_list("CUSTOM_UL_items", "custom_def_list", scn, "custom",
            scn, "custom_index", rows=rows)

        col = row.column(align=True)
        col.operator("custom.list_action", icon='ZOOMIN', text="").action = 'ADD'
        col.operator("custom.list_action", icon='ZOOMOUT', text="").action = 'REMOVE'
        col.separator()
        col.operator("custom.list_action", icon='TRIA_UP', text="").action = 'UP'
        col.operator("custom.list_action", icon='TRIA_DOWN', text="").action = 'DOWN'

        row = layout.row()
        row.template_list("CUSTOM_UL_items", "custom_grid_list", scn, "custom",
            scn, "custom_index", rows=2, type='GRID')

        row = layout.row()
        col = row.column(align=True)
        row = col.row(align=True)
        row.operator("custom.print_items", icon="LINENUMBERS_ON")
        row = col.row(align=True)
        row.operator("custom.clear_list", icon="X")

# -------------------------------------------------------------------
#   Collection
# -------------------------------------------------------------------

class CUSTOM_objectCollection(PropertyGroup):
    #name = StringProperty() -> Instantiated by default
    material = PointerProperty(
        name="Material",
        type=bpy.types.Material)

# -------------------------------------------------------------------
#   Register & Unregister
# -------------------------------------------------------------------

classes = (
    CUSTOM_OT_actions,
    CUSTOM_OT_printItems,
    CUSTOM_OT_clearList,
    CUSTOM_UL_items,
    CUSTOM_PT_objectList,
    CUSTOM_objectCollection,
)

def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    # Custom scene properties
    bpy.types.Scene.custom = CollectionProperty(type=CUSTOM_objectCollection)
    bpy.types.Scene.custom_index = IntProperty()

def unregister():
    from bpy.utils import unregister_class
    for cls in reversed(classes):
        unregister_class(cls)

    del bpy.types.Scene.custom
    del bpy.types.Scene.custom_index

if __name__ == "__main__":
    register()

Updated for Blender 2.8x: https://gist.github.com/p2or/30b8b30c89871b8ae5c97803107fd494

Same principle applies to all other types. Using the PointerProperty for e.g. objects in the scene, makes it pretty comfortable to edit, add and remove them safely without any additional checks.


Get an object scanned for use in blender

There are many different programs available for 3D Scanning. I think these are probably the best (give highest quality results) and are the easiest to use.

RealityCapture, great for huge environments taken from drones but it's very expensive.
Agisoft Photoscan, probably the best value imo but still a tad expensive
Meshroom, free on github, I've had pretty good results with this
123D Catch, rubbish results but free and very easy to use. I have a feeling it's been discontinued tho.

All of these can export the mesh as .OBJ I think, blender can import this. Be prepared for a slow experience though, 3D scans can have millions of poly's.

You'll need a decent camera to take photographs of your object, a modern phone camera will probably work ok but a DSLR will be preferable. When you take photos make sure there is plenty of overlap between images.

To get the best results either make use of lighting equipment indoors to create an even lighting environment, or wait until an overcast day comes and go outside. Never 3D scan on a bright sunny day as you'll have very harsh shadows which will be 3D scanned and then you'll have a permanent shadow in blender.

It should be noted that you cannot 3D scan (with photogrammetry anyway) transparent or reflective surfaces as the software cannot determine which is the object and which is a reflection, you'll get nasty artifacts.

Once you've imported into blender you'll probably want to use the decimate modifier set to between 0.05 and 0.5 depending on how detailed you want the final mesh to be. In my experience I can set it to as low as  0.1 and not even lose any detail while reducing the number of verts by 90%.

If you want to get fancy, then you could retopologize the mesh and bake the normals from the high density mesh to the retopologized mesh.

CG Geek has a good tutorial on using meshroom. Gleb also has a few tutorials on 3d Scanning: Photoscan, 123D Catch, Visual SFM and Meshlab.


Nodes and vector colours of a 2D picture in Blender

You can run your image into a separate RGB node and use only the red channel.  This is in the material editor, but there are similar compositor nodes.


I dont think there is an option for that.
Action is per object. So to have them in a single action you will need to parent them to Armature (each object to a single bone) and animate.
Select Object > Select Armature > Switch to Pose mode Ctrl+Tab > Parent to Bone Ctrl+P

In a current situation the only one thing that can help you a bit is increase Repeat option in NLA Properties > Strip tab > Action Clip panel for selected strip.

Note - In a case you will have more tracks for one object you can search for Bake Action to merge them by step 10 here.


How can I independently pose Group Instances?

On Linux (have not tested on Mac) I recently used the following method to create layout for a shot that required 3 instances of a procedural rock creation rig. Then i created a proxy of the armature from each of the group instances and posed them accordingly.

Starting with two folders: one containing an asset file and the other where my shot file exists. In the asset file the Rig/Geometry is grouped.

blend:~/demoProceduralRocks>> ls
asset/ shot1/

Since I want to create create a scene that should have 3 identical instances of the asset, I create hard links to the file in the shot's import folder

blend:~/demoProceduralRocks>> cd shot1/import/

blend:~/demoProceduralRocks/shot1/import>> ln -v ../../asset/Rock.blend Rock.instance.1.blend

blend:~/demoProceduralRocks/shot1/import>> ln -v ../../asset/Rock.blend Rock.instance.2.blend

blend:~/demoProceduralRocks/shot1/import>> ln -v ../../asset/Rock.blend Rock.instance.3.blend

This is how it looks after creating hard links

blend:~/demoProceduralRocks> ls -lirt asset/ shot1/import/
asset/:
total 172
22217836 -rw-rw-r-- 4 blend home 169297 2013-05-27 15:22 Rock.blend

shot1/import/:
total 516
22217836 -rw-rw-r-- 4 blend home 169297 2013-05-27 15:22 Rock.instance.3.blend
22217836 -rw-rw-r-- 4 blend home 169297 2013-05-27 15:22 Rock.instance.2.blend
22217836 -rw-rw-r-- 4 blend home 169297 2013-05-27 15:22 Rock.instance.1.blend

Then I layout the shot file by linking the groups from the hard linked files created above. Then I make a proxy of the Armature and Pose each proxy separately. (A demo of this in action)

blend:~/demoProceduralRocks> tree ./
./
|-- asset
|   `-- Rock.blend
`-- shot1
    |-- Layout.shot1.blend
    `-- import
        |-- Rock.instance.1.blend
        |-- Rock.instance.2.blend
        `-- Rock.instance.3.blend


Run modal operator while tool is selected

This is a hack--but for now (in 2.80/2.81) you can find out when a custom tool is activated and deactivated with a custom gizmo group:

class MYADDONNAME_TOOL_mytool(bpy.types.WorkSpaceTool):
    bl_idname = "myaddonname.mytool"
    bl_space_type='VIEW_3D'
    bl_context_mode='OBJECT'
    bl_label = "My tool"
    bl_icon = "ops.transform.vertex_random"
    bl_widget = "MYADDONNAME_GGT_mytool_activated"

class MYADDONNAME_GGT_mytool_activated(bpy.types.GizmoGroup):
    bl_label = "(internal)"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'WINDOW'
    bl_options = {'3D'}

    @classmethod
    def poll(cls, context):
        return True

    def setup(self, context):
        print("My tool activated!")

    def __del__(self):
        print("My tool deactivated!")

bpy.utils.register_class(MYADDONNAME_GGT_mytool_activated)
bpy.utils.register_tool(MYADDONNAME_TOOL_mytool, separator=True)

This isn't enough to invoke a modal operator as you're asking for, because the setup() method gets called in a drawing/rendering context, not one where you can just call bpy.ops.whatever('INVOKE_DEFAULT'). But this might be a useful starting point.


How to model the wavy wrapper of a cupcake?

Well, here's how I would model "the thing that cupcakes are in":

Start with a cylinder with an even number of vertices (like 40) and NGon cap fill:

Give the cylinder the shape of a cupcake

Select the top face and make it larger by scaling it (S). Then, delete the face (X):

Select half of the side edges

Switch to edge selecting mode
Select one edge at the top and one at the bottom circles
Multi select loops (Press Space and search for this function)
Select inverse (ControlI)
Checker deselect (again, search for this)

Create the waves

Make this selection larger by scaling it:

If you don't like the spikes, scale down in the z-direction (S to scale, and Z to use the z axis.

Fix the bottom

Go back to face selection mode and select the bottom face. Scale down over the z-axis to make the face flat. Then, poke it (AltP). This will split the face into triangles, which is better for rendering.

Make it look nicer

Exit edit mode (Tab). Add the Solidify modifier. Adjust the thickness as desired. Add the Bevel modifier, with a very small width (like 0.02). Add the Subdivision surface modifier, to smooth it out. You can play with the settings a bit, and you should get something like this:


How do you assign multiple shrinkwrap modifiers to rig muscles?

What I do for muscles rig is that I have 2 Armatures and 2 Meshes:

All muscles as 1 mesh with rig
Character mesh with rig

That means no muscle groups and no clutter in scene and character and only 1 shring-wrap modifier.

The muscle rig bones are parented to character rig with Child Of constraints. This also allows for muscle layering.
The individual muscle jiggle is controlled with 1 vertex group for soft-body goal.
Each muscle has its own shape-key controlled with muscle-rig bones.
Character mesh has only 1 shrink-wrap with vertex-group only for muscle-bulging strength.


If you want to stop the cup when it hits the plate try the "deactivation" under the Dynamics tab (lower-right corner on your first pic).
Otherwise setting are here:

And it also helps if you increase the object's scales.


Spinning wheel has pauses after each rotation?

Most likely, your keyframes are moving in bezier curves. This causes them to slow down at the beginning and end. You could try going into the Curve editor, selecting all of the keyframes on the curve that corresponds to the rotation of your wheel, key "T" and select linear on the left side of the pop-up menu. This will solve your problem.

Now, instead of continuing to add keyframes until the end of your animation, you can key "Shift+E" choose linear extrapolation, and the rotation will continue forever.

Hope this helps! Happy blending.


How to remove connected intersecting geometry?

You could box select only the visible vertices, duplicate them, separate them (or invert the selection and delete) and then remesh it to fill the holes.