Access hair child strands (animation nodes)

Problem Definition

Animation Nodes provides a set of nodes that returns some information about particle systems, however, non of which provides any information regarding hair children, and this is a known limitation in blender.

To get around this, we shall replicate the children system in blender's particle system using Animation Nodes.

Inputs

Our input is a list of poly splines that represents the hair returned by the Hair Data Node :

Each of the following section will concern with on particular aspect about children, any section can be ignored if it has no need for you. We shall attempt to replicate all children options.

Children Generation

Given a single spline that represents a single hair, the simplest of things we can do to generate some children would be as following. We can make copies of that spline, move them around in random directions and return them. Animation Node have a particular node that does exactly that, the Replicate Spline Node:

Notice that the used transformations acts as offsets to the original spline locations, this is due to the fact that splines are described in global space, something we have defined in the Hair Data Node. So it is sufficient to use the output of the random vector node directly.

Tangent Based Offsets

The previouse simple method imposes certain effect that you might consider faulty, since the hair can move freely in any direction, it might move away from the surface and be considered detached from the mesh. A solution is to restrict the motion to the two axis that are perpendicular to the tangent. There are many ways which we can do this, the simplest of which would be to project the random vectors on the plane with normal equal to the tangent at the start of the splines:

Notice that the magnitude of the random vector may change based on the angle they make with the normal of the plane, so you might want to renormalize the random vectors accordingly. A more efficient method to do that same thing would be to compute two perpendicular vector that are perpendicular to the tangent, Animation Nodes already gives us one of those vectors, the Normal vector (Though it can still be computed by taking the cross product between the tangent and some arbitrary unit vector), if we take the cross product between the tangent and the normal, we will get a cotangent that is perpendicular to both vectors, if we define the random vectors as a linear combination between the normal and the cotangent, we will get similar results to the projection method:

Remember that a linear combination between two vectors is the sum of the vectors multiplied by some scalar, in this case, random scalars. This works because both vectors are linearly independent from the tangent, this guarantee there won't be an offset along the tangent direction.

Surface Normal Based Offsets

Using the tangent of the first bit of the hair spline may not achieve the result we are looking for, this is due to the fact that if the angle between the tangent and the surface normal at that point is high enough, the offset will still be away from the surface and subsequently it will look detached ! So a possible fix is to use the surface normal at that point instead, to get the surface normal at the tip of the hair, we can use the BVH Find Nearest Surface Point Node:

This, I think, is the method blender uses because it gives very similar if not identical results to the children hairs. It should be noted that this method is more expensive than other methods because it required BVH operations which are costly for large data sets.

Advanced Point To Point Offsets

To really get fine control over the output spline, we will take it a step deeper and edit the individual points of of the spline. We will first evaluate some points on the spline, get their locations, normals and cotangents, to get the cotangent, we use the cross product as we learned before. Then we create a loop that has two iterators which are some random values that we will use as scalars in the linear combination just as before, inside the loop, we perform the linear combination and create a poly spline from the result and return them:

Now that we have a good base children hair, we can go ahead and add some effects to it.

Clump Effect

A clump effect is making the hair closer to each other at the tip or the root of the hair, since we are actually offsetting the children's points, all we have to do is to scale down the offset factor based on the location along the hair, for instance, if we were to clump the hair at its root, will will multiply the scalars of the linear combination by some small value for points near the root and leave the scalars of the points at the tip as this, in other words, we will multiply all the scalars by values ranging from zero to one where zero is at the root and one is at the tip:

The added nodes are highlighted in blue. If I want the clumping to happen at the tip, I simply have to invert the values of the interval:

Let us take it a step further and control the clump factor using an interpolation curve, all we have to do is to evaluate the interpolation at the values we used before:

Which gives the effect:

Randomize Hair Points

Adding noise to the hair is as easy as adding the random vectors on the hair points, so I will leave this one to you.

Hair Trimming

We can trim hair using the Trim Spline Node:

We can also input random values from the trim node:

Which results:

Hair Noise

We can use Animation Node's noise functions to offset hair points and making it look a bit noisy:

Noise can be evaluated three times to construct a vector noise which can be add on the final point locations instead of the offset factor.

Curl Kink

Curl king is shaping the hair as a helix. This can be done by adding a vector defined by the parametric equation of the circle ($x = cos(t), y = \sin(t)$) where the parameter $t$ is a scalar multiple of the index of the point along each hair, this is exactly the equation of the helix except we are using the normal and contangent as the fundamental vectors of the space where is the normal helix equation is defined in terms of the $x$ and $y$ fundamental vectors:

Which results:

Notice that we can optimize the node tree by putting the interpolation and kink computations outside the loop since it is constant for all hair strands:

Radial Kink

Radial kink is making the hair oscillate as a sine wave radially around the base hair, so it is as simple as adding a sine wave by the factor we generated from the interpolation:

I have shown most of the effects achievable through hair children system in blender, there are millions of other ways to control the children, I think I have showed the workflow and you will be able to do whatever you want yourself. Finally, here is a sample blend file for a combination of effects to play with and explore:


Keeping access to Vertices after deleting some other

Mesh data layers

Instead of storing in an array could use an int data layer on the vertices.

Setting it up, object mode script.

import bpy
import bmesh

context = bpy.context
obj = context.object
me = obj.data

bm = bmesh.new()
bm.from_mesh(me)
int_layer = bm.verts.layers.int

# custom int property on vert
selectionlayer = (int_layer.get("Selection")
        or int_layer.new("Selection"))

# assign verts indices to layer
for v in bm.verts:
    v[selectionlayer] = v.index

bm.to_mesh(me)
me.update()

Ok now each vertex has an integer in the layer that matches the index it once had.

To test..

Here is an edit mode script to test, remove some verts and run script

import bpy
import bmesh

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

bm = bmesh.from_edit_mesh(me)

int_layer = bm.verts.layers.int

selectionlayer = int_layer.get("Selection")

if selectionlayer:

    print([(v.index, v[selectionlayer]) for v in bm.verts])

After removing vert from default cube and running test script, I get [(0, 0), (1, 1), (2, 2), (3, 3), (4, 5), (5, 6), (6, 7)] so it would appear I have deleted vertex previously known as "4"


Material that can catch shadows but wont cast itself

Maybe you want to use the Input > Light Path node like so:

If the cycles ray is a shadow ray, use the transparent BSDF, otherwise use the Diffuse node (or whatever material nodes you want).

The grey cube casts a shadow on the plane and the blue cube, but the blue cube casts no shadow.


how to combine blender internal and cycles?

You'll have to render every image two times: one in Internal and one in Cycles, and then combine them in the compositor, using transparency instead of sky for the overlay images (and series of PNG's as format).


Why does my computer freeze up when updating the preview window in cycles with gpu compute?

Go to the User preference and check for 2 things.

Is the correct Graphics card listed in the Compute Device section?
Is CUDA enabled or if your GPU actually support CUDA?

UPDATED ANSWER
Yes there is a limitation on the support for AMD GPU unfortunately, at the
moment it's pro nvidia. Feb 2016.


Make photo fade out to black in the middle of a circle

In the compositor add an image node and create an ellipse mask.

By animating the size of the mask (with and height) over time down to zero you can create an iris effect.

Animating the X and Y coordinates of the mask you can change where the center of the vignette ends:


How can I create a staggered, repeating procedural pattern?

Here are the nodes for creating staggered texture mapping for procedural textures.

First the Y axis gets multiplied by the number of lines you want to have in the pattern (the Lines value node).  After adding .5 that gets rounded creating stripes (along the X axis in this example).

If you were to look at the output from that node at this point it would look all white, that is because the values start at 1 and increase by 1 with each stripe.

The next three nodes take the stripes, multiplies it by the reciprocal of the input value (lines), then by 0.5 to lower the values. Then the X axis is added in.

At this point there are only stripes, next the Modulo math node causes the texture coordinates to repeat.
All that was for the X axis.

The Y axis is simple, it is just the Modulo of the reciprocal of the lines.

With the nodes pictured at the top you can get a pattern like this.

After adding the Subtract and Absolute nodes from Jerryno's answer,  every other tile will be mirrored and you can get a pattern like this.

This blend has the nodes packed in to a node group, which can easily be added to any project.

Blend File

As you can see, manipulating the texture coordinates of generated textures is quite powerful.


The ratio on the decimate modifier doesn't refer to level detail, it refers to the number of faces. From the wiki:

  Ratio: The ratio of faces to keep after decimation, from 0.0 (0%, all faces have been completely removed) to 1.0 (100%, mesh is completely
  intact, except quads have been triangulated).
      As the percentage drops from 1.0 to 0.0, the mesh becomes more and more decimated until it no longer visually looks like the original
  mesh.


Help with determining camera specs? Blender Motion Tracking

If it helps, there are some presets in Blender for certain cameras. In Properties area.

Make sure you are in Object Mode and the Camera is selected. I found this info recently, myself.


Threading does not go well with context. Instead use modal timer operator.

def delete_info():
    for window in bpy.context.window_manager.windows:
        screen = window.screen
        for area in screen.areas:
            if area.type == 'INFO':
                info = area

    context = bpy.context
    c = context.copy()
    c["area"] = info

    # # test call
    bpy.ops.info.select_all_toggle(c)
    bpy.ops.info.report_delete(c)

class LoggingTimer(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "myops.logging_timer"
    bl_label = "OPERATOR_LABEL"

    _timer = None

    def modal(self, context, event):

        if event.type == 'TIMER':
            delete_info()

        return {'PASS_THROUGH'}

    def execute(self, context):
        wm = context.window_manager
        self._timer = wm.event_timer_add(300, context.window)
        wm.modal_handler_add(self)
        return {'RUNNING_MODAL'}

    def cancel(self, context):
        wm = context.window_manager
        wm.event_timer_remove(self._timer)

def register():
    bpy.utils.register_class(LoggingTimer)

def unregister():
    bpy.utils.unregister_class(LoggingTimer)

if __name__ == "__main__":
    register()


Is there a way to use grid fill with the mirror modifier?

It is possible only with some preparation.

GridFill uses closed loop to work on and adjacent number of vertices. You can't use it if you have opened loop (ready to be mirrored). The Mirror modifier won't change anything as the geometry it creates doesn't exist unless the modifier is applied. So you are left with 2 general ways:

Applying modifier temporarily

Apply modifier, make necessary changes.
Remove half of the mesh. It is ready to be mirrored again.
Add modifier back.

Create geometry necessary for GridFill manually.

Select 2 vertices which are located on the mirror plane (those connected only to one edge).
Create an edge (with F).
Subdivide it. The number of subdivisions depends on number of the vertices of the rest of the mesh. In case of circle from 32 vertices, subdivide 7 times (so to create 7 additional vertices).
Select all and use Ctrl+F > GridFill (probably modifiy its settings a bit).

The half of the mesh will be filled with the quad topology reflected in the mirrored part.


Interlaced footage in the motion tracker?

You can use AviSynth to deinterlace your footage before using it in Blender on the fly. You can mount your avs Scripts with avfs and Pismo File Mount to have virtual avi files that you can import into Blender.

I use it all the time and it works well, even though it's a bit tricky to set up... Depending on your footage you might need a proper VideoSource Plugin for AviSynth like L-Smash and if you don't want to use the included Bob Deinterlace Filter, maybe use QtGMC.


Have you checked the boundaries of the Smoke Domain?

The Smoke Domain is a cube that determines the limits of the simulation of the smoke. It cannot escape it. The cube can be resized and it's shape changed, of course.

Here's the relevant page from the Blender Manual for 2.79.


Script to add a number of Objects, Cameras to a scene but cannot rename data objects?

After running a primitive_add operator the context object will be the newly created object.

import bpy
from math import pi
context = bpy.context

bpy.ops.mesh.primitive_circle_add(radius=6,
                                  fill_type='TRIFAN',
                                  location=[0, 0, 0])
plane = context.object
bpy.ops.mesh.primitive_cube_add(radius=1,
                                location=[0, 0, 5])
cube = context.object
bpy.ops.object.camera_add(view_align=False,
                          location=[0, 10, 20],
                          rotation=[0.436, 0, pi])
camera = context.object
plane.name = 'Plane1'
cube.name = 'Object1'
camera.name = 'Object2'

If you want to rename the data part of above objects

plane.data.name = "blah" #  rename plane mesh
camera.data.name = "blah"

Using indexes from the collections is IMO not the way to go.  Running

[o.name for o in bpy.data.objects]

in the py console, indicates the objects in this collection are internally sorted by name.  A "better" approach may be

[o.name for o in bpy.context.scene.objects]

but still wouldn't recommend this approach.


Export Distortion Node for Nuke or Natron?

The undistort formula is starting at line 66, both polynomial and divison, in blender-2.78c\intern\libmv\libmv\simple_pipeline\distortion_models.h Seems pretty straight forward formula, can be implied to Nuke using Blink script, or to Natron using Shadertoy.


UVUnwrap splitting other edges besides seams

If an edge isn't marked with a seam it will be kept together when using the standard 'Unwrap' tool as long as the geometry is connected. From your screenshot it looks like you have some extra faces between the two blue faces you have selected (the black dots are 'face-dots'), which could mean the faces aren't actually connected; outlined in red here:

Select all the faces in the mesh with A (press A again if it deselects everything) and choose Mesh> Vertices> Remove Doubles:

This will remove any vertices that are extremely close to each other and should remove those extra faces, meaning your geometry is properly connected.


How to make an object transparent to the freestyle pass?

The source of the problem is that Freestyle view map has (can see) the smoke domain geometry. This is a typical problem. Transparent mesh like glasses can be solved with the same method.

Put torus, cone and sphere on a new render layer (mesh on layer 1). This render layer will be rendered with freestyle.
Isolate the smoke domain cube to another render layer (ie: mesh on layer 2). Turn off freestyle on this render layer or don't render this layer at all.

That should solve the smoke domain cube from being rendered.


Automatic AOV shader pass setup for geometry buffer

You can override all materials in the scene as in the figure below. This is what I did in our paper "Fast Synthetic LiDAR Rendering via Spherical UV Unwrapping of Equirectangular Z-Buffer Images". It is worth looking into material management addons.


I modeled a dragon character. when i import it to unity its mesh is inverted.Can any one tell me why?

As lemon suggest:

Rotations not applied in Blender before exporting? Or Z forward -Y up options not set when exporting

Explanation:

Unity uses a left-handed coordinate system. Blender, right-handed. But why?

It's just tradition. Neither system is objectively better than the other, so you just have to get used to using both and switching between them from time to time!

Right-handed coordinates are traditional for modelling where one imagines the XY-plane to be horizontal, and the Z-axis to be vertical.

Left-handed coordinates are traditional for cameras where one imagines the XY-plane to be vertical (corresponding to screen coordinates if the camera is upright), and the Z-axis is into the screen (corresponding to the Z in the Z-buffer).

So modelling applications like Blender often use right-handed coordinates and game development toolkits like Unity often use left-handed coordinates. But some systems go the other way: RenderMan is left-handed, and OpenGL is right-handed (or at least early versions were, it's fairly agnostic now).

Another reason why handedness can differ is because of different conventions about the direction of the Y axis in two dimensions. Back in those far-off days when computer displays used cathode ray tubes, the display was scanned from top to bottom and left to right by the electron beam. So it was convenient to have the Y axis running down the screen, with the coordinate origin in the top left. On the other hand, it's conventional in mathematics for the Y axis to point upwards, with the coordinate origin in the bottom left. When you add a Z axis, these conventions give rise to three-dimensional coordinate systems of different handedness.
Source: left-hand-and-right-hand-coordinate-systems


Selecting a new material slot to selected vertices

One way to do this:

import bpy

mat = bpy.data.materials.new("PinkMaterial")
mat.diffuse_color=((0.8,0.2,0.8))
bpy.context.object.data.materials.append(mat)

for p in bpy.context.object.data.polygons:
    if p.select:
        p.material_index = len(bpy.context.object.material_slots)-1

This would add a pink material to the active object and then go through it's faces to see which ones are selected and then change their material index to the last one.

There might be more efficient ways to do this as well.


How can I see the mesh when I have vertices hidden in edit mode?

It seems this functionality differs in 2.8 and 2.7 versions. Geometry modified with modifiers inherits the state of being hidden from the original mesh in 2.80:

There does not seem to be a way to achieve exactly what is shown in the video in 2.80 at least at the moment.


Can blender use the Alpha channel of an image as transparency on a plane?

Yes, Blender can use the transparency of an images (and not only for photoshop files).
When you use the Import images as planes you can change the settings to  make use of the alpha channel as transparency for a texture  (The image, of course, has to be saved as RGBA on a format that supports alpha channels: Tiff, png, openEXR and some psd files will work fine for example, jpeg images do not have alpha channel).
The settings are different depending on the render engine used:

For Cycles Render enable Use Alpha,
and then choose between diffuse and emission:

For Older Versions the settings are:

Note that on the 3D viewport the transparency will only show when shading is set to Material or Rendered.

For Blender Render use this settings:

On the 3D viewport the transparency will only show when shading is set to Texture, Material or Rendered.

A final note: When importing photoshop's .psd the transparency will work fine, but keep in mind that support for this type of format is still limited and not all features of the file might work in blender. read: Importing textured psd into blender not showing correct colors in blender


How to wiggle multiple keyframed objects with Animation Nodes

You will have to put these nodes into a loop to use the effect on multiple objects. To get different motions for every object you have to link the Index output of the Loop Input node with the Seed input of the Wiggle Vector node.

Make sure that you disable "Use Current Transforms" in the Object Transforms Input node. Otherwise the objects will move away when you stop the playback. You find the setting in the advanced node settings panel on the right.

The basic idea here is that you evaluate the fCurve to get the location the cube would normally have (the Transforms Input node does that). Then you create an additional vector that wiggles around the origin with a maximum amplitude (0.5 in the image above).

By adding both vectors together you get an offset on top of the original keyframed position.
The last node sets the new location on the object and overwrites the keyframed position.


How can I make a custom gizmos to set the origin

I propose to do it with a modal operator, not a gizmo:

The principles:
Run the operator (search it using its name F3 and type set origin on boundings). Then the operator creates a sphere to display it as green point as shown above. And it register a draw handler in the 3D view, in order to display the boundings and the small green spheres.
The operator is a modal so it will continue until 'FINISHED' or  if 'CANCELED' is returned. In this case, it returns 'CANCELED' when the ESC key is hit. Now for each modal call, it does the following:

Get the view location
Get the mouse cursor location
Get the active object

And from that the bounds of the object are going to be calculated in order to display a black subdivided mesh (some kind of lattice) as well as figuring out which point to highlight in green.
Here we can use the dot product the view location/mouse location with view location/bouding point location and keep the best one. When all that done, validating the point where to set the object origin:
If you left-click (LMB) then the previously identified bounding point will be used to change the origin. It seems to work fine independently of the mode (object, edit, etc.) but I've not tested them all.
You can stop the operator using ESC. Here is the code (some comments, just ask for more information if necessary):
import bpy
import bmesh
import gpu
from gpu_extras.batch import batch_for_shader
from mathutils import Vector
from bpy_extras.view3d_utils import region_2d_to_location_3d

# indices to make cube edges from boundings
bounding_indices = (
    (0, 1), (1, 2), (2, 3), (3, 4),
    (4, 5), (5, 6), (6, 7), (7, 0),
    (8, 1), (8, 3), (8, 5), (8, 7),
    (9, 10), (10, 11), (11, 12), (12, 13),
    (13, 14), (14, 15), (15, 16), (16, 9),
    (17, 10), (17, 12), (17, 14), (17, 16),
    (18, 19), (19, 20), (20, 21), (21, 22),
    (22, 23), (23, 24), (24, 25), (25, 18),
    (26, 19), (26, 21), (26, 23), (26, 25),
    (27, 28), (28, 29), (29, 30), (30, 31),
    (31, 32), (32, 33), (33, 34), (34, 27),
    (35, 28), (35, 30), (35, 32), (35, 34),
    (36, 37), (37, 38), (38, 39), (39, 40),
    (40, 41), (41, 42), (42, 43), (43, 36),
    (44, 37), (44, 39), (44, 41), (44, 43),
    (45, 46), (46, 47), (47, 48), (48, 49),
    (49, 50), (50, 51), (51, 52), (52, 45),
    (53, 46), (53, 48), (53, 50), (53, 52))

# Cut a bounding face in half
def bounding_cuts(b_box, result, indices):
    p0 = Vector(b_box[indices[0]])
    p1 = Vector(b_box[indices[1]])
    p2 = Vector(b_box[indices[2]])
    p3 = Vector(b_box[indices[3]])
    result.append(p0)
    result.append((p0 + p1) / 2.0)
    result.append(p1)
    result.append((p1 + p2) / 2.0)
    result.append(p2)
    result.append((p2 + p3) / 2.0)
    result.append(p3)
    result.append((p3 + p0) / 2.0)
    result.append((p0 + p1 + p2 + p3) / 4.0)

# Get half parts of bounding box
def bounding_points(obj):
    b_box = obj.bound_box[:]
    result = []
    bounding_cuts(b_box, result, [0, 1, 2, 3])
    bounding_cuts(b_box, result, [4, 5, 1, 0])
    bounding_cuts(b_box, result, [7, 6, 5, 4])
    bounding_cuts(b_box, result, [3, 2, 6, 7])
    bounding_cuts(b_box, result, [5, 6, 2, 1])
    bounding_cuts(b_box, result, [3, 0, 4, 7])
    return result

def draw_callback(self, context):
    obj = context.active_object
    if obj and obj.type == 'MESH':
        # translate bounding in world co
        mat = obj.matrix_world
        obj_coords = [mat @ Vector(c) for c in bounding_points(obj)]

        # draw boudings
        shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
        shader.bind()
        batch = batch_for_shader(shader, 'LINES', {"pos": obj_coords}, indices=bounding_indices)
        shader.uniform_float("color", (0, 0, 0, 0.5))
        batch.draw(shader)

        # if close enough to a corner
        if self.highlight != -1:
            # draw a small sphere on it
            scale = self.highlight_distance / 100.0
            base_coord = obj_coords[self.highlight]
            h_coords = [base_coord + (Vector(c) * scale) for c in self.highlight_coords]
            batch = batch_for_shader(shader, 'TRIS', {"pos": h_coords})
            shader.uniform_float("color", (0, 1, 0, 0.5))
            batch.draw(shader)

class ModalOperator(bpy.types.Operator):
    """Set origin with the mouse"""
    bl_idname = "object.set_origin_on_boundings"
    bl_label = "Set origin on boundings"

    # Create highlight (corner) geometry
    def create_highlight(self):
        # it is based on UV sphere triangulated for the GPU rendering
        bm = bmesh.new()
        bmesh.ops.create_uvsphere(bm, u_segments= 6, v_segments=4, diameter=1)
        bmesh.ops.triangulate(bm, faces=bm.faces)
        self.highlight_coords = [v.co.to_tuple() for f in bm.faces for v in f.verts]

    # Update object information
    def update_object(self, context, obj, view_loc, mouse_loc):
        prev_highlight = self.highlight
        self.highlight = -1
        if obj and obj.type == 'MESH':
            self.target = obj.name

            # Find the closest corner using a dot product from the view
            mat = obj.matrix_world
            obj_coords = [mat @ Vector(c) for c in bounding_points(obj)]

            axis = (mouse_loc - view_loc).normalized()
            angles = [axis.dot((c - view_loc).normalized()) for c in obj_coords]
            min_angle = max(angles)

            # and keep it if close enough
            if min_angle > 0.999:
                self.highlight = angles.index(min_angle)
                self.highlight_distance = (view_loc - obj_coords[self.highlight]).length
            else:
                self.highlight = -1

            if self.highlight != prev_highlight:
                self.redraw(context)

    # Mouse location in 3D
    def mouse_location(self, context, event):
        x, y = event.mouse_region_x, event.mouse_region_y
        loc = region_2d_to_location_3d(context.region, context.space_data.region_3d, (x, y), (0, 0, 0))
        return loc

    # View location in 3D
    def view_location(self, context):
        camera_info = context.space_data.region_3d.view_matrix.inverted()
        return camera_info.translation

    # Move the object origin to the wanted corner
    def set_origin(self, context, obj, index):
        mat = obj.matrix_world
        loc = mat @ Vector(bounding_points(obj)[index])

        cursor_location = context.scene.cursor.location.copy()

        mode = obj.mode
        if mode != 'OBJECT':
            bpy.ops.object.mode_set( mode = 'OBJECT' )

        bpy.context.scene.cursor.location = loc
        bpy.ops.object.origin_set(type='ORIGIN_CURSOR')

        if mode != 'OBJECT':
            bpy.ops.object.mode_set( mode = mode )

        context.scene.cursor.location = cursor_location

    # Force the 3D view to redraw when needed
    def redraw(self, context):
        bpy.ops.wm.redraw_timer(type='DRAW_SWAP', iterations=1)

    def modal(self, context, event):

        mouse_loc = self.mouse_location(context, event)
        view_loc = self.view_location(context)
        obj = context.active_object

        self.update_object(context, obj, view_loc, mouse_loc)

        # when left click, set the origin if a highlight point is known
        if event.type in {'LEFTMOUSE'}:
            if self.highlight != -1:
                self.set_origin(context, obj, self.highlight)
                return {'RUNNING_MODAL'} #We don't want the click to be taken into account further

        # esc is used to quit and remove the draw handler
        elif event.type in {'ESC'}:
            bpy.types.SpaceView3D.draw_handler_remove(self.handle, 'WINDOW')
            self.redraw(context)
            return {'CANCELLED'}

        return {'PASS_THROUGH'}

    def invoke(self, context, event):
        self.highlight = -1
        if context.area.type == 'VIEW_3D':
            self.create_highlight()
            args = (self, context)
            self.handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback, args, 'WINDOW', 'POST_VIEW')
            context.window_manager.modal_handler_add(self)
            self.redraw(context)
            return {'RUNNING_MODAL'}
        return {'FINISHED'}

keymaps = []

def register():
    bpy.utils.register_class(ModalOperator)

    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name="3D View", space_type="VIEW_3D")

    # Ctrl+Shif+B as shortcut
    kmi = km.keymap_items.new(ModalOperator.bl_idname, 'B', 'PRESS', ctrl=True, shift=True)

    keymaps.append((km, kmi))

def unregister():
    for km, kmi in keymaps:
        km.keymap_items.remove(kmi)
    keymaps.clear()

    bpy.utils.unregister_class(ModalOperator)

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.object.set_origin_on_boundings('INVOKE_DEFAULT')

Run the script and use ctrlshiftB to activate the operator and esc to stop it.
Note: I'm still using right click select, so I've set the trigger that position the origin on the left click. You may want to change that.


Shadows settings not showing on my light

You're using Cycles Render Engine.
Switch to Eevee and all the options will be there.

Render Tab > Render Engine > Eevee


How can I tell what a particular key combination will do in Blender 2.92

'Is key Free' really does work.  I was just too green to find it once activated.  To find it:

Use the 'Editor Type' dropdown on any window's title bar to select 'Text Editor'.  (Look at the float-over text first to see it's current type to simplify restoration of old content when done.)
In the text editor window, pull down the View menu and insure "Sidebar" is checked
On the right side of the window, click the 'Dev' sidebar tab
'Is key Free' should be on the now active sidebar.

Being a programmer rather than an artist I hacked the code up to give more(useful) info.  The version below, by default, works identical to the original but has 2 extra buttons.  They turn on 'internal values' in 'List all Shortcuts' output.  So, for instance, you can see the difference between the two Render hotkeys.
Default output example:
Render --------------------------- Ctrl F12
Render -------------------------------- F12

With the [Params] toggle on:
render.render(animation=1,use_viewport=1) ---- Ctrl F12
render.render(use_viewport=1) --------------------- F12

As for mapping hotkeys from versions less than 2.8 to those of 2.8 and above, it seems the only way is to look something up in the old version and use output from this to find it in the newer version.
It's not perfect.  It doesn't translate enums to text.  But these updates should make telling one otherwise identical call from another easier to map.
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####

# PEP8 compliant (https://www.python.org/dev/peps/pep-0008)

bl_info = {
    "name": "Is key Free",
    "author": "Antonio Vazquez (antonioya) + Rick Bielawski",
    "version": (1, 2, 0),
    "blender": (2, 80, 0),
    "location": "Text Editor > Sidebar > Dev Tab",
    "description": "Find free shortcuts, inform about used and print a key list",
    "doc_url": "{BLENDER_MANUAL_URL}/addons/development/is_key_free.html",
    "category": "Development",
}

import bpy
from bpy.props import (
    BoolProperty,
    EnumProperty,
    StringProperty,
    PointerProperty,
)
from bpy.types import (
    Operator,
    Panel,
    PropertyGroup,
)

# ------------------------------------------------------
# Class to find keymaps
# ------------------------------------------------------

class MyChecker():
    lastfind = None
    lastkey = None
    mylist = []

    # Init
    def __init__(self):
        self.var = 5

    # Verify if the key is used
    @classmethod
    def check(cls, findkey, ctrl, alt, shift, oskey):
        if len(findkey) > 0:
            cmd = ""
            if ctrl is True:
                cmd += "Ctrl+"
            if alt is True:
                cmd += "Alt+"
            if shift is True:
                cmd += "Shift+"
            if oskey is True:
                cmd += "OsKey+"
            cls.lastfind = cmd + findkey.upper()
            cls.lastkey = findkey.upper()
        else:
            cls.lastfind = None
            cls.lastkey = None

        wm = bpy.context.window_manager
        mykeys = []

        for context, keyboardmap in wm.keyconfigs.user.keymaps.items():
            for myitem in keyboardmap.keymap_items:
                if myitem.active is True and myitem.type == findkey:
                    if ctrl is True and myitem.ctrl is not True:
                        continue
                    if alt is True and myitem.alt is not True:
                        continue
                    if shift is True and myitem.shift is not True:
                        continue
                    if oskey is True and myitem.oskey is not True:
                        continue
                    t = (context,
                         myitem.type,
                         "Ctrl" if myitem.ctrl is True else "",
                         "Alt" if myitem.alt is True else "",
                         "Shift" if myitem.shift is True else "",
                         "OsKey" if myitem.oskey is True else "",
                         myitem.name)

                    mykeys.append(t)

        sortkeys = sorted(mykeys, key=lambda key: (key[0], key[1], key[2], key[3], key[4], key[5]))

        cls.mylist.clear()
        for e in sortkeys:
            cmd = ""
            if e[2] != "":
                cmd += e[2] + "+"
            if e[3] != "":
                cmd += e[3] + "+"
            if e[4] != "":
                cmd += e[4] + "+"
            if e[5] != "":
                cmd += e[5] + "+"

            cmd += e[1]

            if e[6] != "":
                cmd += "  " + e[6]
            cls.mylist.append([e[0], cmd])

    # return context
    @classmethod
    def getcontext(cls):
        return str(bpy.context.screen.name)

    # return last search
    @classmethod
    def getlast(cls):
        return cls.lastfind

    # return last key
    @classmethod
    def getlastkey(cls):
        return cls.lastkey

    # return result of last search
    @classmethod
    def getlist(cls):
        return cls.mylist

    # verify if key is valid
    @classmethod
    def isvalidkey(cls, txt):
        allkeys = [
            "LEFTMOUSE", "MIDDLEMOUSE", "RIGHTMOUSE", "BUTTON4MOUSE", "BUTTON5MOUSE", "BUTTON6MOUSE",
            "BUTTON7MOUSE",
            "MOUSEMOVE", "INBETWEEN_MOUSEMOVE", "TRACKPADPAN", "TRACKPADZOOM",
            "MOUSEROTATE", "WHEELUPMOUSE", "WHEELDOWNMOUSE", "WHEELINMOUSE", "WHEELOUTMOUSE", "EVT_TWEAK_L",
            "EVT_TWEAK_M", "EVT_TWEAK_R", "A", "B", "C", "D", "E", "F", "G", "H",
            "I", "J",
            "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "ZERO", "ONE", "TWO",
            "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "LEFT_CTRL", "LEFT_ALT", "LEFT_SHIFT",
            "RIGHT_ALT",
            "RIGHT_CTRL", "RIGHT_SHIFT", "OSKEY", "GRLESS", "ESC", "TAB", "RET", "SPACE", "LINE_FEED",
            "BACK_SPACE",
            "DEL", "SEMI_COLON", "PERIOD", "COMMA", "QUOTE", "ACCENT_GRAVE", "MINUS", "SLASH", "BACK_SLASH",
            "EQUAL",
            "LEFT_BRACKET", "RIGHT_BRACKET", "LEFT_ARROW", "DOWN_ARROW", "RIGHT_ARROW", "UP_ARROW", "NUMPAD_2",
            "NUMPAD_4", "NUMPAD_6", "NUMPAD_8", "NUMPAD_1", "NUMPAD_3", "NUMPAD_5", "NUMPAD_7", "NUMPAD_9",
            "NUMPAD_PERIOD", "NUMPAD_SLASH", "NUMPAD_ASTERIX", "NUMPAD_0", "NUMPAD_MINUS", "NUMPAD_ENTER",
            "NUMPAD_PLUS",
            "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15",
            "F16", "F17",
            "F18", "F19", "PAUSE", "INSERT", "HOME", "PAGE_UP", "PAGE_DOWN", "END", "MEDIA_PLAY", "MEDIA_STOP",
            "MEDIA_FIRST", "MEDIA_LAST", "TEXTINPUT", "WINDOW_DEACTIVATE", "TIMER", "TIMER0", "TIMER1", "TIMER2",
            "TIMER_JOBS", "TIMER_AUTOSAVE", "TIMER_REPORT", "TIMERREGION", "NDOF_MOTION", "NDOF_BUTTON_MENU",
            "NDOF_BUTTON_FIT", "NDOF_BUTTON_TOP", "NDOF_BUTTON_BOTTOM", "NDOF_BUTTON_LEFT", "NDOF_BUTTON_RIGHT",
            "NDOF_BUTTON_FRONT", "NDOF_BUTTON_BACK", "NDOF_BUTTON_ISO1", "NDOF_BUTTON_ISO2",
            "NDOF_BUTTON_ROLL_CW",
            "NDOF_BUTTON_ROLL_CCW", "NDOF_BUTTON_SPIN_CW", "NDOF_BUTTON_SPIN_CCW", "NDOF_BUTTON_TILT_CW",
            "NDOF_BUTTON_TILT_CCW", "NDOF_BUTTON_ROTATE", "NDOF_BUTTON_PANZOOM", "NDOF_BUTTON_DOMINANT",
            "NDOF_BUTTON_PLUS", "NDOF_BUTTON_MINUS", "NDOF_BUTTON_ESC", "NDOF_BUTTON_ALT", "NDOF_BUTTON_SHIFT",
            "NDOF_BUTTON_CTRL", "NDOF_BUTTON_1", "NDOF_BUTTON_2", "NDOF_BUTTON_3", "NDOF_BUTTON_4",
            "NDOF_BUTTON_5",
            "NDOF_BUTTON_6", "NDOF_BUTTON_7", "NDOF_BUTTON_8", "NDOF_BUTTON_9", "NDOF_BUTTON_10",
            "NDOF_BUTTON_A",
            "NDOF_BUTTON_B", "NDOF_BUTTON_C"
            ]
        try:
            allkeys.index(txt)
            return True
        except ValueError:
            return False

mychecker = MyChecker()  # Global class handler

# ------------------------------------------------------
# Button: Class for search button
# ------------------------------------------------------
class RunActionCheck(Operator):
    bl_idname = "iskeyfree.action_check"
    bl_label = ""
    bl_description = "Verify if the selected shortcut is free"

    # noinspection PyUnusedLocal
    def execute(self, context):
        scene = context.scene.is_keyfree
        txt = scene.data.upper()
        global mychecker
        mychecker.check(txt, scene.use_crtl, scene.use_alt, scene.use_shift,
                        scene.use_oskey)

        return {'FINISHED'}

# ------------------------------------------------------
# Defines UI panel
# ------------------------------------------------------
class UIControlPanel(Panel):
    bl_idname = "DEVISKEYFREE_PT_ui"
    bl_space_type = "TEXT_EDITOR"
    bl_region_type = "UI"
    bl_label = "Is Key Free"
    bl_category = 'Dev'
    bl_options = {'DEFAULT_CLOSED'}

    # noinspection PyUnusedLocal
    def draw(self, context):
        layout = self.layout
        scene = context.scene.is_keyfree

        row = layout.row(align=True)
        row.prop(scene, "data")
        row.operator("iskeyfree.action_check", icon="VIEWZOOM")

        row = layout.row(align=True)
        row.prop(scene, "use_crtl", toggle=True)
        row.prop(scene, "use_alt", toggle=True)
        row.prop(scene, "use_shift", toggle=True)
        row.prop(scene, "use_oskey", toggle=True)

        row = layout.row()
        row.prop(scene, "numpad")

        layout.operator("iskeyfree.run_export_keys", icon="FILE_TEXT")

        row = layout.row(align=True)
        row.prop(scene, "report_params", toggle=True)
        row.prop(scene, "report_keyname", toggle=True)

        global mychecker
        mylist = mychecker.getlist()
        oldcontext = None

        box = None
        if len(mylist) > 0:
            cmd = mychecker.getlast()
            if cmd is not None:
                row = layout.row()
                row.label(text="Current uses of " + str(cmd), icon="PARTICLE_DATA")
            for e in mylist:
                if oldcontext != e[0]:
                    box = layout.box()
                    box.label(text=e[0], icon="UNPINNED")
                    oldcontext = e[0]

                row = box.row(align=True)
                row.label(text=e[1])
        else:
            cmd = mychecker.getlast()
            if cmd is not None:
                box = layout.box()
                if mychecker.isvalidkey(mychecker.getlastkey()) is False:
                    box.label(text=str(mychecker.getlastkey()) + " looks not valid key", icon="ERROR")
                else:
                    box.label(text=str(cmd) + " is free", icon="FILE_TICK")

# ------------------------------------------------------
# Update key (special values) event handler
# ------------------------------------------------------
# noinspection PyUnusedLocal
def update_data(self, context):
    scene = context.scene.is_keyfree
    if scene.numpad != "NONE":
        scene.data = scene.numpad

class IskeyFreeProperties(PropertyGroup):
    data: StringProperty(
        name="Key", maxlen=32,
        description="Shortcut to verify"
    )
    use_crtl: BoolProperty(
        name="Ctrl",
        description="Ctrl key used in shortcut",
        default=False
    )
    use_alt: BoolProperty(
        name="Alt",
        description="Alt key used in shortcut",
        default=False
    )
    use_shift: BoolProperty(
        name="Shift",
        description="Shift key used in shortcut",
        default=False
    )
    use_oskey: BoolProperty(
        name="OsKey",
        description="Operating system key used in shortcut",
        default=False
    )
    report_params: BoolProperty(
        name="Params",
        description="Report invoked function and params",
        default=False
    )
    report_keyname: BoolProperty(
        name="KeyName",
        description="Report internal key name vs interpreted name",
        default=False
    )
    numpad: EnumProperty(
        items=(
            ('NONE', "Select key", ""),
            ("LEFTMOUSE", "LEFTMOUSE", ""),
            ("MIDDLEMOUSE", "MIDDLEMOUSE", ""),
            ("RIGHTMOUSE", "RIGHTMOUSE", ""),
            ("BUTTON4MOUSE", "BUTTON4MOUSE", ""),
            ("BUTTON5MOUSE", "BUTTON5MOUSE", ""),
            ("BUTTON6MOUSE", "BUTTON6MOUSE", ""),
            ("BUTTON7MOUSE", "BUTTON7MOUSE", ""),
            ("MOUSEMOVE", "MOUSEMOVE", ""),
            ("INBETWEEN_MOUSEMOVE", "INBETWEEN_MOUSEMOVE", ""),
            ("TRACKPADPAN", "TRACKPADPAN", ""),
            ("TRACKPADZOOM", "TRACKPADZOOM", ""),
            ("MOUSEROTATE", "MOUSEROTATE", ""),
            ("WHEELUPMOUSE", "WHEELUPMOUSE", ""),
            ("WHEELDOWNMOUSE", "WHEELDOWNMOUSE", ""),
            ("WHEELINMOUSE", "WHEELINMOUSE", ""),
            ("WHEELOUTMOUSE", "WHEELOUTMOUSE", ""),
            ("EVT_TWEAK_L", "EVT_TWEAK_L", ""),
            ("EVT_TWEAK_M", "EVT_TWEAK_M", ""),
            ("EVT_TWEAK_R", "EVT_TWEAK_R", ""),
            ("A", "A", ""),
            ("B", "B", ""),
            ("C", "C", ""),
            ("D", "D", ""),
            ("E", "E", ""),
            ("F", "F", ""),
            ("G", "G", ""),
            ("H", "H", ""),
            ("I", "I", ""),
            ("J", "J", ""),
            ("K", "K", ""),
            ("L", "L", ""),
            ("M", "M", ""),
            ("N", "N", ""),
            ("O", "O", ""),
            ("P", "P", ""),
            ("Q", "Q", ""),
            ("R", "R", ""),
            ("S", "S", ""),
            ("T", "T", ""),
            ("U", "U", ""),
            ("V", "V", ""),
            ("W", "W", ""),
            ("X", "X", ""),
            ("Y", "Y", ""),
            ("Z", "Z", ""),
            ("ZERO", "ZERO", ""),
            ("ONE", "ONE", ""),
            ("TWO", "TWO", ""),
            ("THREE", "THREE", ""),
            ("FOUR", "FOUR", ""),
            ("FIVE", "FIVE", ""),
            ("SIX", "SIX", ""),
            ("SEVEN", "SEVEN", ""),
            ("EIGHT", "EIGHT", ""),
            ("NINE", "NINE", ""),
            ("LEFT_CTRL", "LEFT_CTRL", ""),
            ("LEFT_ALT", "LEFT_ALT", ""),
            ("LEFT_SHIFT", "LEFT_SHIFT", ""),
            ("RIGHT_ALT", "RIGHT_ALT", ""),
            ("RIGHT_CTRL", "RIGHT_CTRL", ""),
            ("RIGHT_SHIFT", "RIGHT_SHIFT", ""),
            ("OSKEY", "OSKEY", ""),
            ("GRLESS", "GRLESS", ""),
            ("ESC", "ESC", ""),
            ("TAB", "TAB", ""),
            ("RET", "RET", ""),
            ("SPACE", "SPACE", ""),
            ("LINE_FEED", "LINE_FEED", ""),
            ("BACK_SPACE", "BACK_SPACE", ""),
            ("DEL", "DEL", ""),
            ("SEMI_COLON", "SEMI_COLON", ""),
            ("PERIOD", "PERIOD", ""),
            ("COMMA", "COMMA", ""),
            ("QUOTE", "QUOTE", ""),
            ("ACCENT_GRAVE", "ACCENT_GRAVE", ""),
            ("MINUS", "MINUS", ""),
            ("SLASH", "SLASH", ""),
            ("BACK_SLASH", "BACK_SLASH", ""),
            ("EQUAL", "EQUAL", ""),
            ("LEFT_BRACKET", "LEFT_BRACKET", ""),
            ("RIGHT_BRACKET", "RIGHT_BRACKET", ""),
            ("LEFT_ARROW", "LEFT_ARROW", ""),
            ("DOWN_ARROW", "DOWN_ARROW", ""),
            ("RIGHT_ARROW", "RIGHT_ARROW", ""),
            ("UP_ARROW", "UP_ARROW", ""),
            ("NUMPAD_1", "NUMPAD_1", ""),
            ("NUMPAD_2", "NUMPAD_2", ""),
            ("NUMPAD_3", "NUMPAD_3", ""),
            ("NUMPAD_4", "NUMPAD_4", ""),
            ("NUMPAD_5", "NUMPAD_5", ""),
            ("NUMPAD_6", "NUMPAD_6", ""),
            ("NUMPAD_7", "NUMPAD_7", ""),
            ("NUMPAD_8", "NUMPAD_8", ""),
            ("NUMPAD_9", "NUMPAD_9", ""),
            ("NUMPAD_0", "NUMPAD_0", ""),
            ("NUMPAD_PERIOD", "NUMPAD_PERIOD", ""),
            ("NUMPAD_SLASH", "NUMPAD_SLASH", ""),
            ("NUMPAD_ASTERIX", "NUMPAD_ASTERIX", ""),
            ("NUMPAD_MINUS", "NUMPAD_MINUS", ""),
            ("NUMPAD_ENTER", "NUMPAD_ENTER", ""),
            ("NUMPAD_PLUS", "NUMPAD_PLUS", ""),
            ("F1", "F1", ""),
            ("F2", "F2", ""),
            ("F3", "F3", ""),
            ("F4", "F4", ""),
            ("F5", "F5", ""),
            ("F6", "F6", ""),
            ("F7", "F7", ""),
            ("F8", "F8", ""),
            ("F9", "F9", ""),
            ("F10", "F10", ""),
            ("F11", "F11", ""),
            ("F12", "F12", ""),
            ("F13", "F13", ""),
            ("F14", "F14", ""),
            ("F15", "F15", ""),
            ("F16", "F16", ""),
            ("F17", "F17", ""),
            ("F18", "F18", ""),
            ("F19", "F19", ""),
            ("PAUSE", "PAUSE", ""),
            ("INSERT", "INSERT", ""),
            ("HOME", "HOME", ""),
            ("PAGE_UP", "PAGE_UP", ""),
            ("PAGE_DOWN", "PAGE_DOWN", ""),
            ("END", "END", ""),
            ("MEDIA_PLAY", "MEDIA_PLAY", ""),
            ("MEDIA_STOP", "MEDIA_STOP", ""),
            ("MEDIA_FIRST", "MEDIA_FIRST", ""),
            ("MEDIA_LAST", "MEDIA_LAST", ""),
            ("TEXTINPUT", "TEXTINPUT", ""),
            ("WINDOW_DEACTIVATE", "WINDOW_DEACTIVATE", ""),
            ("TIMER", "TIMER", ""),
            ("TIMER0", "TIMER0", ""),
            ("TIMER1", "TIMER1", ""),
            ("TIMER2", "TIMER2", ""),
            ("TIMER_JOBS", "TIMER_JOBS", ""),
            ("TIMER_AUTOSAVE", "TIMER_AUTOSAVE", ""),
            ("TIMER_REPORT", "TIMER_REPORT", ""),
            ("TIMERREGION", "TIMERREGION", ""),
            ("NDOF_MOTION", "NDOF_MOTION", ""),
            ("NDOF_BUTTON_MENU", "NDOF_BUTTON_MENU", ""),
            ("NDOF_BUTTON_FIT", "NDOF_BUTTON_FIT", ""),
            ("NDOF_BUTTON_TOP", "NDOF_BUTTON_TOP", ""),
            ("NDOF_BUTTON_BOTTOM", "NDOF_BUTTON_BOTTOM", ""),
            ("NDOF_BUTTON_LEFT", "NDOF_BUTTON_LEFT", ""),
            ("NDOF_BUTTON_RIGHT", "NDOF_BUTTON_RIGHT", ""),
            ("NDOF_BUTTON_FRONT", "NDOF_BUTTON_FRONT", ""),
            ("NDOF_BUTTON_BACK", "NDOF_BUTTON_BACK", ""),
            ("NDOF_BUTTON_ISO1", "NDOF_BUTTON_ISO1", ""),
            ("NDOF_BUTTON_ISO2", "NDOF_BUTTON_ISO2", ""),
            ("NDOF_BUTTON_ROLL_CW", "NDOF_BUTTON_ROLL_CW", ""),
            ("NDOF_BUTTON_ROLL_CCW", "NDOF_BUTTON_ROLL_CCW", ""),
            ("NDOF_BUTTON_SPIN_CW", "NDOF_BUTTON_SPIN_CW", ""),
            ("NDOF_BUTTON_SPIN_CCW", "NDOF_BUTTON_SPIN_CCW", ""),
            ("NDOF_BUTTON_TILT_CW", "NDOF_BUTTON_TILT_CW", ""),
            ("NDOF_BUTTON_TILT_CCW", "NDOF_BUTTON_TILT_CCW", ""),
            ("NDOF_BUTTON_ROTATE", "NDOF_BUTTON_ROTATE", ""),
            ("NDOF_BUTTON_PANZOOM", "NDOF_BUTTON_PANZOOM", ""),
            ("NDOF_BUTTON_DOMINANT", "NDOF_BUTTON_DOMINANT", ""),
            ("NDOF_BUTTON_PLUS", "NDOF_BUTTON_PLUS", ""),
            ("NDOF_BUTTON_MINUS", "NDOF_BUTTON_MINUS", ""),
            ("NDOF_BUTTON_ESC", "NDOF_BUTTON_ESC", ""),
            ("NDOF_BUTTON_ALT", "NDOF_BUTTON_ALT", ""),
            ("NDOF_BUTTON_SHIFT", "NDOF_BUTTON_SHIFT", ""),
            ("NDOF_BUTTON_CTRL", "NDOF_BUTTON_CTRL", ""),
            ("NDOF_BUTTON_1", "NDOF_BUTTON_1", ""),
            ("NDOF_BUTTON_2", "NDOF_BUTTON_2", ""),
            ("NDOF_BUTTON_3", "NDOF_BUTTON_3", ""),
            ("NDOF_BUTTON_4", "NDOF_BUTTON_4", ""),
            ("NDOF_BUTTON_5", "NDOF_BUTTON_5", ""),
            ("NDOF_BUTTON_6", "NDOF_BUTTON_6", ""),
            ("NDOF_BUTTON_7", "NDOF_BUTTON_7", ""),
            ("NDOF_BUTTON_8", "NDOF_BUTTON_8", ""),
            ("NDOF_BUTTON_9", "NDOF_BUTTON_9", ""),
            ("NDOF_BUTTON_10", "NDOF_BUTTON_10", ""),
            ("NDOF_BUTTON_A", "NDOF_BUTTON_A", ""),
            ("NDOF_BUTTON_B", "NDOF_BUTTON_B", ""),
            ("NDOF_BUTTON_C", "NDOF_BUTTON_C", "")
        ),
        name="Quick Type",
        description="Enter key code in find text",
        update=update_data
    )

class IsKeyFreeRunExportKeys(Operator):
    bl_idname = "iskeyfree.run_export_keys"
    bl_label = "List all Shortcuts"
    bl_description = ("List all shortcuts with their function in a text block\n"
                      "The newly generated list will be made active in the Text Editor\n"
                      "To access the previous ones, select them from the Header dropdown")

    def all_shortcuts_name(self, context):
        new_name, def_name, ext = "", "All_Shortcuts", ".txt"
        suffix = 1
        try:
            # first slap a simple linear count + 1 for numeric suffix, if it fails
            # harvest for the rightmost numbers and append the max value
            list_txt = []
            data_txt = bpy.data.texts
            list_txt = [txt.name for txt in data_txt if txt.name.startswith("All_Shortcuts")]
            new_name = "{}_{}{}".format(def_name, len(list_txt) + 1, ext)

            if new_name in list_txt:
                from re import findall
                test_num = [findall("\d+", words) for words in list_txt]
                suffix += max([int(l[-1]) for l in test_num])
                new_name = "{}_{}{}".format(def_name, suffix, ext)
            return new_name
        except:
            return None

    def execute(self, context):
        wm = bpy.context.window_manager
        scene = context.scene.is_keyfree
        from collections import defaultdict
        mykeys = defaultdict(list)
        file_name = self.all_shortcuts_name(context) or "All_Shortcut.txt"
        start_note = "# Note: Some of the shortcuts entries don't have a name. Mostly Modal stuff\n"
        col_width, col_shortcuts = 2, 2

        for ctx_type, keyboardmap in wm.keyconfigs.user.keymaps.items():
            for myitem in keyboardmap.keymap_items:

                if scene.report_params:
                    desc = myitem.idname if myitem.idname else "Not Available"
                    description = "{}(".format(desc)
                    if myitem.properties:
                        if len(myitem.properties.items()):
                            for prop in myitem.properties.items():
                                description += "{}={},".format(prop[0],prop[1])
                            description = description[:-1]
                    description += ")"
                else:
                    desc = myitem.name if myitem.name else "No Name"
                    description = "{}".format(desc)

                padding = len(description)
                col_width = padding + 2 if padding > col_width else col_width

                short_type = myitem.type if myitem.type else "UNKNOWN"
                is_ctrl = " Ctrl" if myitem.ctrl is True else ""
                is_alt = " Alt" if myitem.alt is True else ""
                is_shift = " Shift" if myitem.shift is True else ""
                is_oskey = " OsKey" if myitem.oskey is True else ""
                if scene.report_keyname:
                    short_cuts = "{}".format(myitem.to_string())
                else:
                    short_cuts = "{}{}{}{}{}".format(short_type, is_ctrl, is_alt, is_shift, is_oskey)

                t = (
                    description,
                    short_cuts,
                )
                mykeys[ctx_type].append(t)
                padding_s = len(short_cuts) + 2
                col_shortcuts = padding_s if padding_s > col_shortcuts else col_shortcuts

        max_line = col_shortcuts + col_width + 4
        textblock = bpy.data.texts.new(file_name)
        total = sum([len(mykeys[ctxs]) for ctxs in mykeys])
        textblock.write('# %d Total Shortcuts\n\n' % total)
        textblock.write(start_note)

        for ctx in mykeys:
            textblock.write("\n[%s]\nEntries: %s\n\n" % (ctx, len(mykeys[ctx])))
            line_k = sorted(mykeys[ctx])
            for keys in line_k:
                add_ticks = "-" * (max_line - (len(keys[0]) + len(keys[1])))
                entries = "{ticks} {entry}".format(ticks=add_ticks, entry=keys[1])
                textblock.write("{name} {entry}\n".format(name=keys[0], entry=entries))

            textblock.write("\n\n")

        # try to set the created text block to active
        if context.area.type in {"TEXT_EDITOR"}:
            bpy.context.space_data.text = bpy.data.texts[file_name]

        self.report({'INFO'}, "See %s textblock" % file_name)

        return {"FINISHED"}

# -----------------------------------------------------
# Registration
# ------------------------------------------------------
classes = (
    IskeyFreeProperties,
    RunActionCheck,
    UIControlPanel,
    IsKeyFreeRunExportKeys,
)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.Scene.is_keyfree = PointerProperty(type=IskeyFreeProperties)

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)
    del bpy.types.Scene.is_keyfree


If you mean maintain a more-or-less even mesh density (and appropriate mesh density), this is something you need to pay attention to throughout the modeling process and adjust for as you go. It's not like you just push a button and make it even.

If you notice at some point that an area is too dense, dissolving edge loops, sliding edges, and smoothing geometry are some common operations that can help you maintain consistency.


in the rigid body section, change the collision shape from convex hull to Mesh.


A simple shader node should work in Cycles render. It's using the new Principled BSDF shader with the roughness set to 1. Alternatively you could use a Diffuse BSDF shader with the roughness set to 1 and get the same result.

I have a main sun light source  with Ambient Occlusion under World->Ambient Occlusion and set the value to .1. If you increase the value for the Ambient Occlusion, you'll see less shadows.


Moving armature using as pivot a bone from other armature

This is very much possible and quite easy.
Just add a Copy Location or Copy Rotation or Copy Scale or Copy Transform constraint (depends on how you want the bone to move) on the bone you want to be moved, you must be in pose mode for this. Go into the bone constraints tab or press shift+alt+c with the bone selected and choose the constraint afterwards.
In the Constraint settings choose the armature of the moving bone and the moving bone as target. Depending on where you want the moved bone to be, you should set the head/tail value of the constraint.
Now you can move the moving bone and the moved bone will follow.

Btw this might be a little bit misleading because I called the armatures bone. :)


Since normal UV mapping creates distortions (from the vertex linear interpolation) the Generated UV coordinates usually gives better result.

Give the texture node the Generated UV coordinates and set the method to project to Sphere.

Here is a full tutorial: https://www.blenderguru.com/tutorials/earth-cycles


Orbit in Blender by holding SHIFT + Middle buttom

Yes, this is quite simple to change.
Navigate to Preferences > Keymap and select Pan for "Middle Mouse Action"


How do I remove the overlap from merged meshes?

You could do it with the TinyCAD addon or with some extrudes.

If you want to start with your 3 parallelepipeds you could use the TinyCAD addon:

Download and istall the addon.
Join your parallelepipeds with a ctrlJ, and go in Edit mode.
Select all and press W > TinyCAD > XALL.
Keep everything selected and press W > Remove Doubles.
Delete the inner vertices so that you won't have any inner edges in the final object.
Fill all the faces.

If you want to do it with some extrudes, you could:

Start with a plane, create an edge loop on its middle and tilt it with GG.
Bevel the middle edge loop with ctrlB and create 2 new edge loops.
Extrude the plane.
Select a face and press ctrlaltspacebar to create a new custom Transformation Orientation (named "Face.001" by default).
Keep this new orientation selected.
Select one of the faces you need to extrude, press E and Enter right away.
Move this new face along the Face.001 Y axis.
Same thing for the other face.


Big problem is that you have a node material with these textures set up in Blender Render, and trying to bake. Baking in Blender Render doesn't work with nodal materials as far as I have experienced, but that is not a hard thing to fix here. I have a file for you to test baking just color to the diffuse in Cycles, and the bake target is a non-connected image node representing the blank image in the 2d editor window. Press bake and you should see it clear and then return a result like you expect.A screen shot for you to see what I did.


How to point a sun lamp using a vector in Python?

There is indeed a straightforward python method using mathutils.

from mathutils import Vector
direction = Vector(your_tuple)
your_object.rotation_mode = 'QUATERNION'
your_object.rotation_quaternion = direction.to_track_quat('Z','Y')

You can see the doc here for more details.

Edit: As the sun direction is negative on the z axis, you may have to change 'Z' to '-Z'


BGE Video Textures not showing up in exported .app

The VideoTexture module expects external files. It does not work with internal data blocks unless explicitly provided by Python call.

Therefore "Pack External Files" will not solve your issue. It increases the size of your distribution as you need to distribute the external files (as separate files) anyway.

I suggest following:

Perform "Make Paths Relative" before distributing
Ensure to distribute your VideoTexture source files where they are (relative to the start blend file).


Why are my Eevee renders much slower to output than they are in a viewport?

Aha. Well it's not QUITE as fast as the viewport, but it's fast enough! From Will it soon be possible to render an Eevee animation in realtime (2.8 Beta)? : View -> Viewport Render Animation

Hope that helps someone :-)


How can i add a texture to billboard particles?

As answered in the bug report by Brecht, billboards is a feature that is not supported by cycles and isn't planned to be added any time soon.

To get billboards working you need to be using the blender internal render engine. By default the material used for particles is the same material used on the object emitting the particles, you can change the material used for the billboards in the particle settings in the render panel.


Where Can I Download Import Image As Plane Add-On For v2.7?

The Addons project links to the Addons Catalog(archive) which gives a list of all the 2.6 scripts where you can get the details for Image as Planes which then links to the SVN repository containing the actual Python script.

And hopefully that is in a usable state.


How to use the Blender ID in a third-party add-on?

The readme file in the blender cloud add-on gives more direction. This page discusses the simple way to use the Blender ID with your own add-on.

  Using the addon from another addon The following functions can be used
  from other addons to use the Blender ID functionality:

  blender_id.get_active_profile() returns the BlenderIdProfile that
  represents the currently logged in user, or None when the user isn't
  logged in:

class BlenderIdProfile:
    user_id = '41234'
    username = 'username@example.com'
    token = '41344124-auth-token-434134'

  blender_id.get_active_user_id() returns the user ID of the logged in
  user, or '' when the user isn't logged in.

  blender_id.is_logged_in() returns True if the user is logged in,
  and False otherwise.

As is mentioned there, you have access to the user's username (email) and whether or not they are logged in.

This is simply a module that you can import:

import blender_id

# returns True or False
print(blender_id.is_logged_in())

# user's email username
print(blender_id.get_active_profile().username)

Here is a mini demo in Blender's console:


Is it possible to invert the SSS shader effect?

Following on from what Yvain commented: "negative SSS" is basically an opaque material. If the surface is opaque, you can't see through any face to see if the volume gets lighter. If what you're after isn't a surface texture, it's probably a volume texture. And if you want something lighter in the middle of a volume than the volume's outer walls, you either need an Emission or Volume Scatter node in the Volume of your material Output, or a rough Glass surface shader with a light in the volume.


Can F-Curves be used to define interpolation between keyframes?

Maybe using the Breakdown Tool could help you to find the right curve / pose quicker? It is one of the In-Between functions Blender has, see the section In_betweens here: https://www.blender.org/manual/de/rigging/posing/editing.html.  The workflow would be like this:

Set start and end keyframe of your pose. So the moment when the punch starts and the moment after the hit. Then scrub to a frame in between the two. With the very sophisticated example here it looks like this:

If I take my example, the X F-Curve should have a keyframe value lower than what it currently has. Or in other words, the pose should be closer to the starting pose, than to the ending one. The breakdown tool allows you to do just that: In the 3D Viewport, hit Shift + E, and then move the mouse left and right. The extent of your 3D Viewport acts as a slider, so if you move the mouse to the very left, you're at the starting pose, on the right at the ending pose. Your model will now deform either towards the starting pose, or towards the ending one. In your case, you wanna go closer to the starting one. After clicking, you can add a keyframe for this pose (or if you use Auto-Keying, that keyframe has been created already):

It's your choice now if you want to set the end value to vector (can be done in Dope Sheet or F-Curve Editor:

If you're not happy with the pose, go to the same keyframe and use the breakdown tool again.


Animate Soft Body Along Curve (Holding Form)

When using a [Curve Modifier] the curve can have 2 portions. That is a starting portion and a final portion.

The starting portion could be a wound up visual of the shoe lace or other artistic vision
the final portion can be the cursive words.

This may or may not suit your artistic needs.


Midi in/out for game engine via animation nodes

The idea of implementing midi into animation nodes is relatively old:
https://github.com/JacquesLucke/animation_nodes/issues/332

It might be possible that we have a node for that later but then there is also the problem with the game engine. AN doesn't work with the game engine.

So unfortunally I have to say that this is just impossible.


Any way to get a specified magnification effect?

I would recommend not trying to actually model the lenses to magnify the image, but rather place a camera in front of the scope with a higher Focal Length.

Then in the compositer you can add the scope's camera view to the final image.


Pose mode- can't change transform location of root bone?

Looking at your file this problem is because the root bone Bone.27 is set to Connected. You need to unset this. To do this follow the below steps:

Switch to Edit Mode
Select the root bone Bone.27
Go to the Bone tab in the properties window
Uncheck the Connectedcheck box in the relations panel

This will fix the problem and you will be able to grab the root bone and move the character using it as shown below:

Updated .blend file can be found here:


How to hide the reflection of an object in blender

Are you using Cycles or the Internal Engine to render?

I am familiar with Cycles, so I can only help you on that, assuming you're using it.

You can tell Cycles that you don't want the sphere to appear in any reflections at all, by going into the object properties, in Cycles Settings and unchecking Glossy.


Particle system with combined meshes and lights

Unfortunately ctrl+J will work only with meshes so your solution cannot work, and also unfortunately Blender doesn't allow group hierarchies (like group of groups).

So, if you don't want to create mesh light emitters, that can be easily ctrl+J'd (but from your screenshot I see that you want to use spot lights, so mesh emitters won't help), I'd suggest to

Create a different particle system for each one of the "complex" buildings

Remove all the buildings with "lamp" lights from your original particle  system's dupligroup ("Object" menu > "Groups" > uncheck the existing group)
For each building that has lamps, hoping they are just a little fraction of your 37:

create a new particle system on the emitter plane (by duplicating the original one, making it "single user", and reducing the number of particles on both by ~ 1/37 and 36/37 respectively)
use Render>Group and check the "Whole Group" option
create a group containing only the building and its lamps
assign this group to the "Dupli Group" of the new particle system
change the Seed of the emitter until you remove overlaps with already existing buildings

Edit:

an illustrated version of the above

Say you have a situation like this, where a Group of buildings is being used by a Particle System to create the city by duplication:

Select the building on which you would like to add the lights, go to its "Object" properties, and remove it from the group:

Go back to the particle system and reduce the number of buildings for the "main" group, that now has only the buildings with no lights:

Now create the spotlights, select the lights and then the building, and do ctrl+G to create a new group:

Then go back to the emitter plane, and {1} create a new particle system, {2} apply the settings of the already existing particle system, then {3} click on the "2" to make it single-user (i.e. an independent particle system created from a copy of the original)

Finally, on the new particle system, reduce the number to a small value (as many buildings with light you want); select the newly created group (probably Group.001) as your DupliGroup; set "Whole Group" as dupli option:

If you have created the group in the correct way, the building should be correctly placed in the vertical direction. They will be, however, a little bit displaced horizontally from the emitter plane (especially if the spot lights are not exactly vertical). To fix this, play around with the "Offset" settings of the light's "Object">"Group">Group.001 properties until all the buildings lay on the city's floor.


I don’t think there is a hole - it looks to be refraction showing the inside of the cup. Try reducing the IOR of your shader and see if the problem goes away - that will show whether there actually is a hole. Also, check your normals as that is critical with refractive surfaces since flipped normals will also flip the refraction properties. Also check that you have a realistic IOR for the material being modelled (eg, typically in the range 1.0 for air to around 1.33).


How to change the default views of quad view in blender 2.8?

Go to the 3D View header menu, under View > Area > Toggle Quad View.
Once in quad view, in the sidebar area under the View tab a new panel will appear with the Quad View options.


Blender 2.8 compositor isn't saving me any time?

No adaptive sampling in Cycles in Blender versions prior to 2.83
Cycles used lack adaptive sampling functionality in versions lower than 2.83 so no matter what, the pixels being rendered used to get sampled as many times as there were samples defined in the render settings.
Mask with Holdout shader
You could make a plane, parent it to the camera(Ctlr+p) using Without Inverse option so it snaps to the camera and is oriented to it's local space, move the plane and cut a hole in it so it's sort of a mask. If you assign Holdout shader to it it will get rendered as transparency (transparent film enabled) and it will still get sampled, however those samples are going to be as easy to calculate as possible, so it will speed up the process greatly. You can make any shape of the mask just by modelling the hole the way you need it to be, however if it covers anything that you need in the render(like shadows for example) that will become invisible, so you need to be careful about what you mask.

You can see the masked areas outside the center of the image render a lot faster:

Adaptive sampling is added since Blender 2.83
From version 2.83 adaptive sampling is finally added and if enabled will render transparent areas a lot faster.


How to see RGB and XYZ image info in Blender 2.8?

In the Image editor, If you Right click on the image, you can sample the pixels of the image. A small window appears at the bottom of the screen where you can read the pixel information.
(for previous versions of blender: left click on the UV/Image editor window)

From Left to right you see:
$X$ (horizontal) and $Y$ (vertical) pixel position ($0$,$0$ is at the bottom left of the screen)
Z depth, in blender units.
Red, Green, Blue, Alpha information before the color management transforms (Scene Referred, Linear values).
Red, Green, Blue after the Color Management transforms (Display Referred, values)
Hue
Saturation
Value
Luminance


How to register scripts in the startup/scripts folder if they are inside a Sub-folder?

You need to register the script path in the file paths section of user preferences.


What is causing sharp creases on subdivided model?

The sharp crease there is caused by a set of duplicate vertices. To fix it you just need to select all the vertices (A) and Remove Doubles (CtrlV, Remove Doubles).
Those sharp edges are occurring because of your edge split modifier. Remove it to get a smoother look. I also recommend adding in another support loop on the right side of the gap in order to get better smoothing, like so.

To solve this you need to add more loops towards the bottom (CtrlR), and move all of the loops at the bottom up a little bit. I recommend putting loops next to the points on the main phone where it transitions from the curves of the corner to the straightaway. After you've added the loops, select them one at a time and move them up along the Z axis so that the limit surface of the subdivision surface modifier just touches the bottom of the phone. You can use the Shift key during the grab to move the points more slowly and position them more precisely. Here's the result I get from doing that:

In addition you should probably set the screen part of the phone to be shaded smooth before you put together the final render. In Edit mode, select everything and then use CtrlF, Shade Smooth to get the smooth shading you probably want to have for the final render.


How could I prevent repeating textures on an object like floor tiles?

Since Blender 2.8, you've been able to set a U and V offset per element in an array. Well,OK, that's an offset. But it gives you access to more.

The elements' UVs change at the same rate as the Generated UVs of the whole array.  So if you have set any  UV offsets in your Array modifiers, and then take the difference between the element UV and the array's Generated UV, you get a per-element UV: a pair of numbers which is constant per element, but different for each, which you can use for anything you like. (Shown as color in the array on the left, below.)

In this example, the per-tile UV has been used to look up a color from a Noise texture. The  R and G found in the noise at that coordinate have been used to displace the Y location and Z rotation of an image texture, per tile.


Rotate Edge to Be Perpendicular to the Ground

This is how I usually do it...

Go to navigation panel > Mesh Display turn on display edge length.
Select the vertex point you want to rotate the line on ... (but we DO NOT rotate)
Instead, Hit E then Z for the axis you want the point to extrude in and key in the edge length revealed in step 1.
Select the diagonal edge and hit delete

Now you have the new edge perpendicular to the ground.

Hope that helps.


Because hairs usually stand upright, the particle system is doing what it is supposed to do.

In the 3D Viewport of the image below you can see a similar setup to yours. Some of the planes in my collection are rotated though, but I did not Apply the rotation.

In the second Viewport I did apply the rotation.
Object > Apply > rotation.
Note how the upright planes in my collection (blue) are flat as particles, and the flat planes in my collection (orange) stand upright as particles.

You can rotate the leafs in your collection so they will stand upright, and then apply the rotation, so the leaf particles will be flat. Like the blue planes in the bottom picture.

If you want the leafs to be higher from the ground (because they might still clip through the ground plane) then you can move the individual meshes of the leafs away from their origins in Edit Mode, as seen in this (3rd) image below.

EDIT:
It wasn't apparent to me when I first answered this question (i think someone may have hinted to it in a comment but not clearly enough I'm afraid), but there is another, if not a better way to do this. It is a bit hidden though.

In Particle Properties check the box Advanced, and then the box Rotation. Under Rotation you can change the particle Orientation Axis.


You can get the Fcurves from the source object, and evaluate them with some frame offset fro some object. You can get the fcurves using the FCurves From Object Node, to identify what fcurve belong to what property, FCurve Info Node can be used where, for instance, the data path will be location for objects' location fcurve and the Array Index will be 0, 1, 2 for x, y, z respectively. Having identified the fcurves for the properties you want, for instance, locations. We can go ahead and evaluate them while setting some offset:

By viewing the results, we see that the object Cube.001 lags behind the source object Cube by 5 frames (The offset we set):

We can put that inside a loop to perform it for multiple object, where the offset will be a multiple of the index of the iteration:

Which results in:


I was looking for the same thing and decided to make a TPU material myself. I did it using a brick texture with the row height set really high, brick width set low, and mortar thickness very low to create tightly spaced long thin vertical line and feeding that into the Normal socket. You could experiment with mixing the Brick Texture with a Noise Texture to give it some more randomness, or by feeding the brick texture into the Color socket, varying the brick colors and changing the Brick Texture Bias setting to give it more color variance between the lines.


The material you provided is just a Base Color texture, so it is worth quickly noting that a lot of the character of the floor in the photo is created by surface imperfections.  You'll get these from the Roughness, Normal Map, and Height textures in the PBR workflow.  Still, your question is about wear and tear, which is not exactly the same thing.
I have three pretty basic methods for this.  The first is simply the Hue/Saturation node.

Apply this to the Base Color and you can desaturate an object as though it sat in the sun too long, or darken an object as a whole with the Value setting.
The second is to make use of the Ambient Occlusion map.  Ambient Occlusion is normally used to tell us where objects in the scene are close to each other, and thus would most likely be in shadow.  You can, however, use the output for whatever you like.  So we could say if two objects are close to each other it's also kind of a place where detritus will build.
There are lots of ways to control the output, but in this example I used a Color Ramp to find a suitable map to use as a Factor input on a Hue/Saturation node.  It's used to put grime in the mortar between these pieces in a stone floor.

On the left base color only, on the right this node group.

My third method would be to use a surface imperfection image texture.  You can probably find them the same place you get your other image textures.  Here are some examples.


Where do I have to put the Bump on my nodes?

Add > Vector > Bump. Connect like this:

You can also feed the texture directly into the displacement input of Material Output node and use Multiply Math node to adjust the strength.


Animation sequence Render Layers + OpenExr

I am answering myself, the thing is that you have to

- untick "OVERWRITE"

All your renderlayers and all passes will be stored in a single EXR file per frame.

superuseful!


Blender is rendering my short animation too slow!

Welcome to the hard reality of 3d Rendering: rendering takes time, a lot of it.
The more detailed and complex the scene, the more resources are needed to render.
You have three options:

Use more powerful hardware, more processors, faster processors, more GPUs and lots and lots of RAM.

Use a render farm, that will render all the frames using many computers, freeing your own. If every frame takes 4 hours to render  and you use 120 computers simultaneously, then you can render 120 frames in 4 hours!
Or use cloud computing to have access to higher specs hardware. Do a search for Amazon elastic compute clud, or other similar solutions.

Adjust your expectations to the hardware available to you. Create and optimize your scenes in a way that you can render them within your means, and in a reasonable time.


Is it true that there's no escaping a little bit messy geometry in the part you connect last?

I've tried your mouse, it's not exactly the G600 shape but I think the method is good. Unfortunately I lost all the screenshots I made, but here are the basic steps. For this kind of object you should begin by modeling the whole shape, then duplicate it and use a Shrinkwrap modifier to continue to stick to this shape:

Use the pictures you find as backgrounds for Front (or Back), Top and Left (or Right) views.
Use all these views to model the general shape of the object.
Keep the model simple (picture 1), give it a Subdivision Surface modifier to smooth it. Let's call this object A.
Duplicate this object to create a copy called object B. Don't move this copy so that it keeps the same position as object A, but put it on another layer to make invisible.
Give the object A a Shrinkwrap modifier that you put above the Subdivision Surface modifier, choose object B as the Target of the Shrinkwrap.
Select all the vertex of your object A, assign them to a
vertex group, select this group in the Shrinkwrap modifier, so that they will be the ones that will be affected by the Shrinkwrap.
Add some edge loops on your object A, begin to draw all the additional shapes with a knife. Make sure that the new vertices are part of the vertex group. As the object has a Shrinkwrap modifier, the new topology you create stick to the right shape.
Begin to extrude where you need to dig some holes. This time, make sure that the extruded vertices are not part of the vertex group, otherwise they would stick to the surface.
The tricky part is all around the square cuts, you can use the kind of topology I've used (picture 3), fortunately the Shrinkwrap make it easier to keep a correct shape.
Note that you can choose sometimes to apply the Shrinkwrap so that the vertices of object A always stick as much as possible to the shape of object B. Then recreate the exact same Shrinkwrap as before.


How to export a 3D model of just a particular frame?

Go to the frame you want and apply your modifiers. Including your cloth modifier. If you have Interface: Modifier Tools Add-on enabled you can press Apply All. If not then you can press the little down arrow and Apply. Or select a modifier and press Ctrl+a. Remember to start from the top.

Now your cloth is frozen and can be used as any 3D-object and exported from File and Export.


How can I display only one camera view option in a custom pie menu?

pie.operator("VIEW3D_OT_viewnumpad").type='CAMERA' - this is right


making angle label - spin vertices with python script

The api doc specifies the argument geom as

  geom (list of (bmesh.types.BMVert, bmesh.types.BMEdge, bmesh.types.BMFace))

so

import bpy
import bmesh
from math import radians
from mathutils import Vector, Quaternion

mesh = bpy.data.meshes .new("Pie")
obj  = bpy.data.objects.new("Pie", mesh)

scene = bpy.context.scene
scene.objects.link(obj)

bm = bmesh.new()

A = bm.verts.new(Vector((0.0, 0.0, 0.0)))
B = bm.verts.new(Vector((1.0, 0.0, 0.0)))
base_line = bm.edges.new((A, B))

result = bmesh.ops.spin(
    bm,
    geom  = [B],
    cent  = A.co,
    axis  = Vector((0.0, 0.0, 1.0)),
    dvec  = Vector((0.0, 0.0, 0.0)),
    angle = radians(60.0),
    steps = 12,
    use_duplicate = 0
    )

C = result['geom_last'][0]
bm.edges.new((C, A))

bm.to_mesh(mesh)
bm.free()

works for me. You could also implement this yourself:

def create_arc(bm, start, center, axis, angle, steps):
    angle = angle / steps
    q = Quaternion(axis, angle)

    prev = start
    vec  = start.co - center

    for i in range(steps):
        vec.rotate(q)
        current = bm.verts.new(center + vec)
        bm.edges.new((prev, current))
        prev = current

    return current


Video texture is out of sync in blender, but fine in other programs

I would export out of vegas as a jpg sequence. then blender will use each file as an exact frame. you can then render out of blender and import into vegas matching the same frames per second.


It seems as of version 2.79, displacement node, Adaptive subdivision (experimental mode) cannot be combined with normal map node. Workaround for now is either using only bump map or switching off the adaptive option inside of subdivision modifier.

This bug is not noticeable when using simple plane: (probably here tangent space is same as object space)

In case of a sphere, shading artefacts appear when combining Normal Map and Adaptive Displacement

Unfortunately I now have the file in version 2.8 only
http://gofile.me/2mjhf/tn9buuTmU

Node setup in 2.8:

Correct me if I am wrong, but it seems like developers were aware of this bug and changed it in the upcoming version 2.8. Since that is around the corner I can live with the 2 above mentioned workaround in 2.79 until then.

Thanks


import bpy

for area in bpy.context.screen.areas:
    if area.type == "VIEW_3D":
        break

for region in area.regions:
    if region.type == "WINDOW":
        break

space = area.spaces[0]

context = bpy.context.copy()
context['area'] = area
context['region'] = region
context['space_data'] = space

bpy.ops.view3d.viewnumpad(context, 'EXEC_DEFAULT', type='TOP')
bpy.ops.view3d.view_persportho(context, 'EXEC_DEFAULT')

or without operators:

from mathutils import Quaternion

r3d = space.region_3d
r3d.view_perspective = "ORTHO"
#default - look down z-axis
r3d.view_rotation = Quaternion((1.0, 0.0, 0.0, 0.0))


Like Jerryno said as comment, it is a texture space visualization. that can be hiden in object tag -> Display


The last few weeks I developed all sort of spline evaluation stuff for my Animation Nodes addon. For that I created a small library that deals with curves. (Bezier and Poly splines for now only)

When you want to use this package for your addon, you should make a multifile addon. To explain how that works isn't the topic here. You may want to google it, look at other multifile addons or ask another question here on stackexchange.

Then create a new folder in your addon directory called 'splines' or whatever.
And copy the content of this folder inside:
https://github.com/JacquesLucke/animation_nodes/tree/curve-sockets/data_structures/splines
(I hope this link will still be available after I removed the branch, otherwise tell me in the comments)

Here is how to use this library:

from . spline import from_blender

# the object can be any blender object, but should be of type CURVE obviously
# it returns a list of splines, because one curve object can contain multiple splines
user_splines = from_blender.createSplinesFromBlenderObject(object)

# choose the spline you want to use
active_spline = user_splines[0]

# only needed when you want the spline in world space
active_spline.transform(object.matrix_world)

# this internally creates the individual segments (at least for Poly and Bezier Splines)
# and prepares everything for evaluation
active_spline.update()

# get 50 points distributes over the spline
samples = active_spline.getSamples(50)

# getting samples with equal distances is a bit more complicated
active_spline.ensureUniformConverter(resolution = 100)
uniformSamples = active_spline.getUniformSamples(50)

# To evaluate individual parameters (what you called apex):
location = active_spline.evaluate(0.5)

# The same applies for evaluating the tangents/derivatives of the spline
tangents = active_spline.getTangentSamples(50)
uniformTangents = active_spline.getUniformTangentSamples(50)
tangent = active_spline.evaluateTangent(0.5)

For more details you may want to take a look at the code


How to project plane with image to another model

Use the DataTransfer modifier to transfer the UVs of the plane to your meshes.


Scale the bones as desired, select the mesh, in the modifier stack apply the armature modifier, then select the armature in pose mode, select all the bones and choose Ctrl+A "Apply pose as rest pose".

Then select the mesh and add an armature modifier to the mesh and select your armature in the "object" field.

Done.


How can i change the color of a material created with the PBR addon

The thing with PBR is: it tries to be physically accurate. That's why you don't have a RGB input in this setup but a blackbody converter node.

Blackbody converts color temperature (measured in kelvin) to RGB values.
You can look at the Wikipedia page to see which color corresponds to which kelvin value.

if you don't need to be physically accurate, you can just unconnected the blackbody node and set the color directly in the emission shader.


The curve must be manually closed in edit mode (selecting the first and last vertex and pressing F to connect) and seen from top view (it should lie on a X/Y plane) to be properly filled.

If you want to animate it, check the AnimAll Addon, which can animate single points of a curve.


How do i fit those eyes into my character mesh?

Both your eye globe and your eye hole have irregular shape, so if you want to solve your problem you need to make them both as regular as possible.
Another way to create your eye would be not to move the eye itself, but to move the texture on the surface of the eye, using an empty as Texture Coordinate Object, like this:

Here is the material setup:

You could get a similar result with the UV Warp modifier as suggested by Lemon.


game engine hides cursor (windows 8.1/parallels) Also a OS X 10.12.5 issue.

To see the mouse cursor when bge is running active Mouse cursor checkbox in render tab of property panel.

Or use a script to show the mouse cursor.

You can use logic or render to show the mouse cursor while BGE is running.

Using bge.logic.mouse

 from bge import logic
 logic.mouse.visible = True # 1 or True are acepted, to disable 0 or Flase

Using bge.render.showMouse()

from bge import render
render.showMouse(1) # 1 or True are acepted, to disable 0 or False

NOTE: When BGE is running you are unable to make change to configurations, property, objects, scripts, etc.


How to create a Tetrix/Sierpinski Tetrahedron fractal radiating from 0,0,0 ? Python or nodes

Updated answer with animation technique (sort'a cheating)

So to generate an animation of the tetrix levels increasing I kind'a cheated.
Since my previous answer already used a dictionary to store all the levels, I simply wrote that data structure into a json file, then used an app handler function to read it prior to every frame change and load the current level matching the frame number.

So this has solution has two steps:

Generate data file

import numpy as np
from time import time
import bpy, bmesh, json
from mathutils import Vector

def generate_quad( original, quads, level, max_level ):
    ''' Recursive function generating 4 tetrahedra off of the the input tetrahedron '''

    # The 1st new tetrahedron is simply half the scale of the original starting from the original tet's bottom left corner
    origin = original.min(axis=0) / 2
    half  = original / 2
    half += origin

    # Calculate the dimensions of the new tetrahedra
    newdims = Vector( half.max(axis=0) - half.min(axis=0) )

    # The 2nd moves by the new tet's x dimension to the right
    right = half.copy()
    right[:,0] += newdims.x

    # The 3rd moves by half the x dim and all the y dim
    forward = half.copy()
    forward[:,0] += newdims.x / 2
    forward[:,1] += newdims.y

    # The 4th moves by half the x, a third of the y and all the z
    up = half.copy()
    up[:,0] += newdims.x / 2
    up[:,1] += newdims.y / 3
    up[:,2] += newdims.z

    quad = [ half, right, forward, up ]
    quads[ level ].extend( quad )

    if level < max_level:
        for q in quad:
            quads = generate_quad( q, quads, level + 1, max_level )

    return quads

## Main Code
start = time()
n     = 5  # Number of steps of the fractal
scale = 10 # Scale of the original tetrahedron

# Generate regular tetrahedron at the desired scale
orig = np.array([
    [0,   0, 0],
    [1,   0, 0],
    [0.5, 3**0.5/2, 0],
    [0.5, 1/3*3**0.5/2, ((3**0.5/2)**2 - (1/3*3**0.5/2)**2)**0.5]
]) * scale

# Initialize data structure for all tetrahedra in all steps
quads = { i : [] for i in range( n+1 ) }

# Generate tetrix via recursive function
quads = generate_quad( orig, quads, 0, n )

# From numpy to simple lists to prepare to save as json
quads = { i : np.array(quads[i]).tolist() for i in quads }

quad_cache_file_path = r'C:\Users\username\Documents\tetrix.json'
with open( quad_cache_file_path, 'w' ) as fh:
    quads = json.dump( quads, fh )

print( f'Generated {n} tetrix levels in {round(time() - start,1)} seconds' )

Add frame_change_pre app handler function to link between the frame number and the tetrix's level

import itertools
import numpy as np
import bpy, bmesh, json
from mathutils import Vector

def update_tetrix( scene ):
    C = bpy.context
    D = bpy.data
    S = C.scene

    regular_tet_faces = np.array([[3, 0, 1], [1, 0, 2], [0, 3, 2], [3, 1, 2]])

    quad_cache_file_path = r'C:\Users\username\Documents\tetrix.json'
    with open( quad_cache_file_path ) as fh:
        quads = json.load( fh )

    # Select level to display at current frame (match
    n = S.frame_current - 1
    n = n if str(n) in quads else max( quads.keys() )

    # Generate mesh data
    verts = []
    faces = regular_tet_faces.tolist()
    for q in quads[str(n)]:
        # Find last vert index and add new verts
        last_vert_index = max([ len( verts ) - 1, 0 ])
        verts.extend( q )

        # Use base face arrangement of original regular tetrahedron and offset indices
        faces_indices = regular_tet_faces + last_vert_index + 1
        faces.extend( faces_indices.tolist() )

    # Remove duplicates
    faces = sorted([ sorted(f) for f in faces])
    faces = list(f for f,_ in itertools.groupby(faces))

    if 'tetrix' in D.objects:
        print( f"Updating mesh with level {n}" )
        o = D.objects['tetrix']
        m = o.data

        bm = bmesh.new()

        bmverts = [ bm.verts.new(co) for co in verts ]
        bmfaces = [ bm.faces.new([ bmverts[i] for i in f]) for f in faces ]

        bm.to_mesh( m )
        m.update()

    else:
        # Generate mesh data and initialize vertex and face arrays
        m = D.meshes.new('tetrix')

        # Generate mesh object and add to scene
        m.from_pydata( verts, [], faces )
        print({ k : len( quads[k] ) for k in quads })
        o = D.objects.new('tetrix',m)
        S.collection.objects.link( o )

bpy.app.handlers.frame_change_pre.append(update_tetrix)

Caveats

This solution doesn't enable animating a transition between levels, simply a harsh switch. You also don't get a lot of control over how long the pauses are between switches (though this could be done in post in any video editing software by multiplying or delaying frames).
Currently the entire data file is read prior to every frame change. This can be pretty slow if you've generate a big file with many levels (above 7), depending on your computer's specs. It could probably be improved by loading the file once to memory as a global scene object then reading directly from that prior to every frame change, rather than reading the file from disk every time.

Original Answer

This script can generate a n-level tetrix. It will work only in Blender 2.8 and utilizes some Numpy tricks for more efficient numerical manipulation.

import bpy, bmesh
import numpy as np
from mathutils import Vector

def generate_quad( original, quads, level, max_level ):
    ''' Recursive function generating 4 tetrahedra off of the the input tetrahedron '''

    # The 1st new tetrahedron is simply half the scale of the original starting from the original tet's bottom left corner
    origin = original.min(axis=0) / 2
    half  = original / 2
    half += origin

    # Calculate the dimensions of the new tetrahedra
    newdims = Vector( half.max(axis=0) - half.min(axis=0) )

    # The 2nd moves by the new tet's x dimension to the right
    right = half.copy()
    right[:,0] += newdims.x

    # The 3rd moves by half the x dim and all the y dim
    forward = half.copy()
    forward[:,0] += newdims.x / 2
    forward[:,1] += newdims.y

    # The 4th moves by half the x, a third of the y and all the z
    up = half.copy()
    up[:,0] += newdims.x / 2
    up[:,1] += newdims.y / 3
    up[:,2] += newdims.z

    quad = [ half, right, forward, up ]
    quads[ level ].extend( quad )

    if level < max_level:
        for q in quad:
            quads = generate_quad( q, quads, level + 1, max_level )

    return quads

## Main Code
C = bpy.context
D = bpy.data
S = C.scene

n     = 2  # Number of steps of the fractal
scale = 10 # Scale of the original tetrahedron

# Generate regular tetrahedron at the desired scale
orig = np.array([
    [0,   0, 0],
    [1,   0, 0],
    [0.5, 3**0.5/2, 0],
    [0.5, 1/3*3**0.5/2, ((3**0.5/2)**2 - (1/3*3**0.5/2)**2)**0.5]
]) * scale

regular_tet_faces = np.array([[3, 0, 1], [1, 0, 2], [0, 3, 2], [3, 1, 2]])

# Initialize data structure for all tetrahedra in all steps
quads = { i : [] for i in range( n+1 ) }

# Generate tetrix via recursive function
quads = generate_quad( orig, quads, 0, n )

# Generate mesh data and initialize vertex and face arrays
m     = D.meshes.new('tetrix')
verts = []
faces = regular_tet_faces.tolist()

# Generate mesh data
for q in quads[n]:
    # Find last vert index and add new verts
    last_vert_index = max([ len( verts ) - 1, 0 ])
    verts.extend( q.tolist() )

    # Use base face arrangement of original regular tetrahedron and offset indices
    faces_indices = regular_tet_faces + last_vert_index + 1
    faces.extend( faces_indices.tolist() )

# Generate mesh object and add to scene
m.from_pydata( verts, [], faces )
print({ k : len( quads[k] ) for k in quads })
o = D.objects.new('base',m)
S.collection.objects.link( o )

Here's a higher level tetrix from all orthographic angles and a free one (quad view):


How can you access/open principled BSDF editor?

Split your screen and make one window into a Node Editor. Then use Shift + A to bring a menu from the pointer and go to Shader -> Principled BDSF. You can also click on 'Search' once you've called the many via Shift+A and type 'principled' and it will be displayed on the results.