How to Flatten a vertex path (a list of connected edges) into a straight line while keeping distances?

After long hours, here's an answer to my OWN question, thanks to comments from @Jachym Michal and @batFINGER.
import bpy
import math

def rotatePoint(centerPoint,point,angle):
    """Rotates a point around another centerPoint. Angle is in degrees.
    Rotation is counter-clockwise"""
    temp_point = point[0]-centerPoint[0] , point[1]-centerPoint[1]
    temp_point = ( temp_point[0]*math.cos(angle)-temp_point[1]*math.sin(angle) , temp_point[0]*math.sin(angle)+temp_point[1]*math.cos(angle))
    temp_point = temp_point[0]+centerPoint[0] , temp_point[1]+centerPoint[1]
    return temp_point

def crossProduct(a, b):
    c = [a[1]*b[2] - a[2]*b[1],
         a[2]*b[0] - a[0]*b[2],
         a[0]*b[1] - a[1]*b[0]]

    return c

def dotProduct(a, b):
    c = a[0]*b[0] + a[1]*b[1]+ a[2]*b[2]
    return c

cyl = bpy.context.object
if cyl:
    flt = cyl.copy()
    me = flt.data.copy()
    flt.data = me

assert(len(me.vertices) >= 3)

verts = me.vertices
Nvert = len(me.vertices)
print('Nvert=', Nvert)

nVertRots = 0

for n in range(Nvert - 1, 1, -1):
    print('Vertex:',n)
    v1 = verts[n - 1].co - verts[n - 2].co

    v2 = verts[n].co - verts[n-1].co

    v1mag = math.sqrt(v1.x * v1.x + v1.y * v1.y + v1.z * v1.z)

    v1norm = [v1.x/v1mag , v1.y/v1mag , v1.z/v1mag]

    v2mag = math.sqrt(v2.x * v2.x + v2.y * v2.y + v2.z * v2.z)

    v2norm = [v2.x/v2mag , v2.y/v2mag , v2.z/v2mag]

    res = v1norm[0] * v2norm[0] + v1norm[1] * v2norm[1] + v1norm[2] * v2norm[2]

    angle = math.acos(res)

    cross = crossProduct(v1norm, v2norm)
    sign = dotProduct([0,0,1], cross)
    if sign < 0:
        angle = -angle

    print('Angle(1,2):', angle)

    nVertRots += 1
    for m in range(n, Nvert, +1):
        v2rot = rotatePoint([verts[n - 1].co.x, verts[n - 1].co.y],[verts[m].co.x, verts[m].co.y], -angle)
        verts[m].co = (v2rot[0], v2rot[1], verts[0].co.z)

print('nVertRots:',nVertRots)
if nVertRots > 0:
    bpy.context.collection.objects.link(flt)


After fiddling with it for a little, I figured out your problem.

Your model is duplicated on itself. Test it by moving the model out of the armature and moving the bones around. Alternatively: remove some faces and you'll find faces below them.
You incorrectly assigned your vertex groups by grouping both sides of the mesh that results in the "mirrored movement" effect you're experiencing.
My suggestion to you in the future: better naming conventions to reduce personal confusion (I saw a lot of stuff like [Item_Name].### which can be burdensome to read/tell apart).


texture paint, only part of the mesh is paintable?

In the file you uploaded the image "yfbody.dds" doesn't exist. After creating a new image to replace "yfbody.dds" I am able to paint onto the model.

When exporting UV's you either need to select all the UV's you want included or turn on the All UV's option.


you have unchecked limit selection to visible. To undo that, just click it again.


The slight deviation in color is caused by dithering. If you want to save accurate values for non-color data, then you have to:

Set Dither to zero in Output Properties > Post Processing when you intend to save an 8-bit image

Use one of the following options: Set the View Transform to Raw, disable Save As Render in the file browser or save as OpenEXR to by pass the color management. The latter is the best approach since OpenEXR can store the actual scene linear values.


Vertices behaving like parented bone is rotating when neighbouring bones rotate

Okay so I fixed it, I think. I just dissolved the lower thigh bone and subdivided the upper one and gave the new one the same name as the old lower thigh bone so the weights would sync up.

I still have no idea what the problem was but it's gone now.


You've stacked and collapsed several 3d windows. Press on the tiny "+" on the bottom right of your 3D window to get back the horizontal menu bar


My Blender is crashing after I installed an addon twice by accident. How can I fix it?

When you say that you deleted the /scripts folder, what do you mean exactly? You should never delete the folder that is under the blender installation path, as that will mean Blender cannot start up (some scripts are essential).

When you add an add-on from File -> User Preferences, it will be copied to your local blender user  directory. This is ~/.config/blender/[VERSION].

No matter where it is installed, Blender will be looking in ~/.config/blender/[VERSION] for add-ons, which might explain why they are still present even after you have purged the installation directory and reinstalled.

If you haven't already, try deleting ~/.config/blender/[VERSION] (if my memory serves, it would be sudo rm -r ~/.config/blender/[VERSION]). Then reinstall a fresh copy of Blender via your preferred mechanism (e.g. Steam).

[VERSION] should be 2.78 or whatever you are using.


Baking normal then plugging into the normal channel of a shader results in flat shading

The blue color you're getting should be $RGB(0.5, 0.5, 1.0)$ which corresponds to a normal value of $<0,0,1>$. The normal vector has a range of $<[-1, 1], [-1, 1], [0, 1]>$ In Tangent space, as I understand it, the vector $<0, 0, 1>$ is perpendicular to the the surface. As the first value is changed, the vector tilts left and right. As the second vector is changed, the vector tilts up and down. The third value is adjusted so the length of the vector stays equal to 1. e.g. $z = \sqrt{1 - (x^2 + y^2)}$. Of course we should limit $ x^2 + y^2 \le 1 $.

This is illustrated by the "Check Normal + Y" matcap, which is based on the rendering of the normals of a sphere in Object Space. You can find an EXR version of this image in your Blender install folder under datafiles/studiolights/matcap. You'll see ... not what I expected ... I'm going to submit this now while I play with generating my own exr...
To be continued...


Check that you are really in version 2.78 - the option should be directly under...


Let's start with the water, then we'll talk about mixing in the particles.

Water

It's typical to use the glass shader for water.  This gives you the transparency, reflection, and refraction needed, but has some issues.  First, it renders too dark and too noisy, and second, setting the color ends up looking too uniform (I guess that's how I'd describe it...).

Fast Glass

To fix the first problem, I suggest using a "fast glass" shader.  It's the regular glass shader, but we make it fully transparent to any rays that we don't care about by mixing it with a transparent shader using only a few light paths as our factor.  We only want it to look like the glass shader to shadow, diffuse, and glossy rays.  This will render much faster since the water will now be invisible to any other rays (basically, invisible to most rays).

Admittedly, I don't fully understand this technique, but it has something to do with refraction being time consuming to calculate.

Colored Glass/Water

Now for color.  If you look at water, it's color gets darker as you look at deeper water.  This is because the water is absorbing light as it passes through.  This is what the volume absorption shader was made for.  Plug one into the volume input of your material output and pick a color and a density to see the light get absorbed and colored more in deeper areas than in thinner ones.

There are a few "gotchas" with the cycles volumetrics at the moment.  First, they don't work on AMD GPUs.  I think (but am not certain) that they finally work on Nvidia GPUs, and they should work on all CPUs now.  Also, they're computationally expensive, so they increase render time noticeably.  If you need to speed up renders and can't bear to cut volumetrics, google for tutorials on how to fake them.  There are a couple of good workarounds out there.

Particulate

As for the particles, you can mix your water with your particles' material using a noise texture as the factor.  Running the texture through a greater/less than node allows you to select out just some of the noise.  You'll have more control, however, if you run it through a color ramp node instead.  Basically, sliding the black level up will choose your particle density just like a greater/less than node's factor and sliding the white level closer to the black level will control how fuzzy the particles are which is something you can't do with a greater/less than node.

The only issue with this technique is that I'm not sure if the particles are distributed throughout the water, or if they're just stuck on the surface.

Demo!

Here's a screenshot of all three techniques in action!

UPDATE: Particle System

The factor mixing from above can never cause particles to show up inside a mesh in a render that uses surface rendering.  Blender and Cycles would expect you to do that by adding a particle system to the mesh.  See below for a quick one.


You can find this in the keymap under 3D View > Set Tool By Name. You can search for specific shortcuts by selecting Key Binding in the dropdown in front of the search box.


Is it possible to do a radius constraint in Blender?

I think what you are looking for is the Limit Distance constraint.

From the wiki:

  The Limit Distance constraint forces its owner to stay either further from, nearer to, or exactly at a given distance from its target. In other words, the owner’s location is constrained either outside, inside, or at the surface of a sphere centered on its target.


Having issue with mesh when in smooth mode

The shading is broken along an edge-loop, in those cases i would always check the normals first.

Solution:

Go in edit mode Tab
Select all with A
Follow up with Shift+N Recalculate Outside to correct the normals.

Explanation:
You can always check the normals with a "color indicating overlay" by switching on Face Orientation.

Example:

left looks similar to your shading, right shows the overlay activated

The Entire model should be blue if all normals are ok, if red is visible outside then those areas have bad (facing inwards) normals and you can either manually select the red faces and press Alt+N to open the Normals menu

and Flip the normals of the selected faces, or use the in most cases easier, "select all and recalculate outside" method explained at the beginning. There are cases where the Recalculate Outside function does not manage to fix all, just mentioning. In those cases manual flipping would be needed.

Happy Blending.


OK I found it, I had to reinstall the addon. I didn't realise it comes as part of 2.79 so I downloaded it from the net. When I installed the download I got a duplicate warning, so I removed the folders mentioned in the warning. That really screwed it. So restored folders from waste basket, restart and there it is! the V magic tab below display tab.


How do I change the orientation/anchor point of a group?

In edit mode .. not object mode ... move your mesh relative to the origin for an improvement.

or

in object mode use the menus in the image below.  Object/Transform

Origin to Geometry

For precise control click on part of your mesh to move the 3D Cursor then use the menu option

Origin to 3D Cursor.

Try the similar menu options.

Also I believe you are talking about a Blender Mesh Object and Not a Blender Group.


Display the bone axis.

Driver limited from 0 to 2 moving in Z local direction of bone.
Locally for bones the Y axis goes down the axis of the bone. If you enable the display in armature display properties can turn this on.
The copy location constraint is a bit arbitrary between pose (wrt armature origin) and global.
For the limit location constraint going to use local. The zero of a local transform is its rest position.  Ok can set the minimum to 0.  Looking at bone axis then +Z is forward, have limited it to 2.  An arbitrary choice for this answer and to test against, change to suit.

To change the result to go from 0 to 4 with a generator

which is the equivalent of having a scripted expression for the driver of
0 + 2 * var

which if you remember basic algebra is a linear equation.  As mentioned by @Nathan in other answer, this was and issue because it was set to be result zero, no matter what the value of var was.
1000 seems to me to be an outrageously big result, but for this example would use 500 instead of 2.
See driver results.
Find it handy to use the script from  this answer when fiddling with drivers
https://blender.stackexchange.com/a/199299/15543
can test the value of a number of variables by looking at output in console, rather than via the driver editor UI.


Having a problem with Normal Baking a high poly model into a low poly model. (with file included)

I've tested with a 32 Bit Float image and it works fine:


Adding a texture to follow the shape of the mesh

You can create multiple UV maps (click the add button alongside the list of UV maps in the mesh properties). You can then position your UV for the rust over the rush image without upsetting your ‘base’ UVs.

Your material will then need to be aware of both UV maps and mix between them as appropriate (eg, my using the Alpha of your rust image) although this depends on your choice of render engine (Blender Internal, Cycles).


Getting exactly circular/rounded NURBS corners

I'm not absolutely certain this pertains, but it may not be possible. NURBS cannot be used to represent a circle exactly, but may only be used to create an approximation, however close. You may want to refer to https://en.wikipedia.org/wiki/Non-uniform_rational_B-spline for more information (especially the note in the section titled: Example: a circle).

Of course, this is a good answer if you are attempting to make a full circle. If your goal, however, is to make an exactly circular join between two perpendicular segments, it may or may not be possible.

Then again, as blender is typically used to generate imagery with a finite sample size (i.e. pixels) it may be possible that the rendering of the NURBS approximation of a circle would be sufficiently accurate so as to be indistinguishable from an actual mathematically precise circle.

Hope this helps.


All you need is the Principled Volume shader.

Create a volumetric cube
Give the volume a very light color, and use Density to control it
Use real units for light intensity (lumens). Related answer: Simulating a 40W Light Bulb.

Lights: 10 million lumens (a really strong searchlight), Density: 0.1, Samples: 2000 + Denoiser


Can motion tracking and Video Stabilization constrain to y axis only?

In the compositor the Movie Input nodes has x and y offset values, once you add a tracker to the 2D stabiliser these become active. Just use the correction you need and plug it into the node distort>transform.
In your case just use the y value.


Track object position during an animation using python script

Object.matrix_world.to_translation() gives you a global (visual) location of the object.  The frame change handler makes the panel "hot" and update on every frame change.

import bpy

class MocapPanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "Display Data"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

    @classmethod
    def poll(cls, context):
        return context.object is not None

    def draw(self, context):
        layout = self.layout

        obj = context.object
        pos = obj.matrix_world.to_translation()

        row = layout.row()
        row.label(text="Active object is: " + obj.name)
        row = layout.row()
        row.label(text="object position z is %.2f" % pos.z)

def prop_redraw(scene):
    for area in bpy.context.screen.areas:
        if area.type == 'PROPERTIES':
            if area.spaces.active.context == 'OBJECT':
                area.tag_redraw()

def register():
    #clear handlers for testing
    bpy.app.handlers.frame_change_pre.clear()
    # add a handler to make the area "live" without mouse over
    bpy.app.handlers.frame_change_pre.append(prop_redraw)

    bpy.utils.register_class(MocapPanel)

if __name__ == "__main__":
    register()


You are using "N-Gons" , An N-Gon is a face with more than 4 vertices. You need to convert these to Quads, Or Tris to get a proper Unwrap, You can do this by using the Knife tool, Or by deleting the N-Gon and Applying the faces again.


where to set Image Mapping to Extend mode in Cycles?

In my self compiled Blender from today I have Clip, Extend and Repeat in the image texture node. In 2.75 it's not present yet, though. You can try a development version from Blender buildbot, or for extend you can use the mapping node, as PGmath said, like this:


Why doesn't the draw callback update with mousemove?

Use the event from the modal method.

Will get back to this when I find the link about full event.  The event in invoke doesn't much care about mouse moves, rather a shift click or which button, where as the "full event" is available to the modal.  Try script below, a quick hack to use modal event when setting up handle.

import bpy
import bgl
import blf

def draw_callback_px(self, contex, event):
    font_id = 0
    blf.position(font_id, 15, 30, 0)
    blf.size(font_id, 20, 72)
    blf.draw(font_id, "%s %s" % (event.type, event.value))

class ModalDrawOperator(bpy.types.Operator):
    """Draw a line with the mouse"""
    bl_idname = "view3d.modal_operator"
    bl_label = "Simple Modal View3D Operator"
    _handle = None
    def modal(self, context, event):
        context.area.tag_redraw()

        # Add the region OpenGL drawing callback
        # draw in view space with 'POST_VIEW' and 'PRE_VIEW'
        if not self._handle:
            args = (self, context, event)
            self._handle = bpy.types.SpaceView3D.draw_handler_add(
            draw_callback_px, args, 'WINDOW', 'POST_PIXEL')
        if event.type in {'ESC'}:
            bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
            return {'CANCELLED'}

        return {'PASS_THROUGH'}

    def invoke(self, context, event):

        # the arguments we pass the the callback
        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

def register():
    bpy.utils.register_class(ModalDrawOperator)
def unregister():
    bpy.utils.unregister_class(ModalDrawOperator)

if __name__ == "__main__":
    register()


Blender writes render even when there is no composite node?

As gandalf3 said, I think the best way for now is to delete the files automatically with some python script. Just make sure that the scene output goes to it's own directory, so you don't delete any other files. Run the script and render.

import os
import glob
import bpy

def delete_garbage_files(scene):
    out_path = bpy.path.abspath(scene.render.filepath)
    out_dir, _ = os.path.split(out_path)

    # Remove all files of the currently selected output format.
    ext = scene.render.file_extension
    for f in glob.glob(os.path.join(out_dir, "".join(("*", ext)))):
        os.remove(f)
        print("Deleted: {}".format(f))

    # Also delete the directory.
    try:
        os.rmdir(out_dir)
        print("Deleted: {}".format(out_dir))
    except OSError:
        print("Didn't delete directory {}, probably not empty".format(out_dir))

# Post render handler, to delete the files after every rendered frame.
bpy.app.handlers.render_post.append(delete_garbage_files)

To delete the files after the whole render job finishes, you can use render_complete instead of render_post But if you cancel a render, the files won't be deleted.

# Complete render handler, to delete the files when the whole render job
# is finished.
bpy.app.handlers.render_complete.append(delete_garbage_files)

Probably the best solution is to use a render_cancel and render_complete handler. Then the files will only be deleted when the render is finished or canceled and not after every rendered frame.

# Use both cancel and complete render handlers.
bpy.app.handlers.render_cancel.append(delete_garbage_files)
bpy.app.handlers.render_complete.append(delete_garbage_files)

If you want to automatically delete the 'garbage' files the next time you open the file and render, you should have the name of the script end in '.py' and check the 'register' option:


Blender is comprehensive enough to me. On my PC, I have over 25 FREE open alternatives and AFFORDABLES, none of your overpriced.

Avoid Adobe, if you wish to avoid auto-renewal subscription trap.

If you want softwares to use alongside Blender, see the list below.

MyPaint — free lightweight painting software. Great realistic pencils & gritty charcoals there. You will love MyPaint. Great for planning artworks.

Krita — for digital painting. Has vector and raster formats. Free alternative to Photoshop.

GIMP — free alternative to Photoshop.

Note: you can use universal format ORA for working back and forth in all three softwares above. ORA keeps all your layers intact.

Inkscape — wonderful free alternative to Adobe Illustrator.

Affinity Designer — affordable alternative to Adobe Illustrator. Has AI format, very useful for opening Illrustrator files or for converting SVG to AI and vice reverse.

Artrage — affordable software for digital painting. This has highly realistic oil brushes with textured bristle marks on paint. Makes realistic dirt, smudges, smears, etc.

Rebelle — affordable and unrivalled Software for highly reaslistic watercolour paints that bleed and drip.

Storyboarder — free open source software for storyboarding.

Moreover, you can actually upload Photoshop brushes into Krita, Gimp, and Artrage. You can obstain your PS brushes at DeviantArt and Brusheezy.

Add - I recently created this directory containing thumbnails of scrapbooks, some on open source softwares, if they are of any interest to you.
https://docs.google.com/presentation/d/1TyUpu4zylhDkEAKpepI9P6HkvtmonJG7zEBLsHgWCjI/


What is the sensor width of an iPhone 11? I need it for motion tracking

Found more specifications at https://www.gsmarena.com/apple_iphone_11-9848.php
The focal length for a wide video is 26mm, 1/2.55 sensor width and pixel size 1.4nm.
I have found: https://www.vision-doctor.com/en/camera-calculations/sensor-diagonal-sensor-ratio.html. I simply put in the video's pixel width and height (3840 x 2160) and the pixel size (1.4nm). It gave a more accurate sensor width than the preset in Blender: 5.38mm.
Hopefully, this helps someone.


You do not need hashlib to generate unique hashes of the pixels the hash function is enough for this.
After hashing the images it is only a matter of grouping the images by hash.
import bpy
from pprint import pprint

def duplicates(images):
    hashes = [(hash(i.pixels[:]), i.name) for i in images]
    grouped = {}

    for h, n in hashes:
        grouped.setdefault(h, []).append(n)

    return grouped

pprint(duplicates(bpy.data.images))

The output will look something like this:
{
 -6513983583712379323: ['Image1', 'Image2'],
 -2557438906662028752: ['Image3', 'Image4'],
 5740354900026072187: ['Render Result'],
 -3721407912412733414: ['Viewer Node'],
}

Note: The hash() function can only create meaningful hashes from immutable data structures. As @batFINGER pointed out in the comments image.pixels[:] is alreay a tuple (immutable) so we are good in this case. If however you want to create a hash from a list you have to convert it to a tuple first. E.g. hash(tuple([1,2,3]))


How to do transparent textures on Emission node in Blender Cycles

Are you going for something like this?

If so, then it's as simple as someonewithpc said, just an Emission shader mixed with a Transparent shader using the texture for the Fac.


How do I move vertices from the center without scaling?

Try to use the Alt+S command, then type the desired value.


Lining up vertices/edges horizontally along a slanted object without altering the shape of the object?

The best option here IMO is to use a knife tool. Press K and place the knife icon on the vertex to snap to it. Then press C to make a straight cut. Then select the angled edge and press X-->Dissolve Edges.

To align other edge loops to the newly created horizontal one add an edge loop with Ctrl+R, press E and then F.


How to connect faces without intersection?

You can use Boolean modifier to join them together. If the handle is in the same mesh of the cup body, just simply separate it as a new object by P, then boolean the two object. You will get a final shape without intersection after apply it.

NOTE: When using Boolean modifier, the intersection part has to be closed shape.


How do I access workspace areas in 2.80 with Python

Figured it out thanks to iceythe from blenderartists:
https://blenderartists.org/t/access-to-workspace-areas/1137024

for area in bpy.data.workspaces['my_workspace'].screens[0].areas:
    if area.type == 'VIEW_3D':
      for spaces in area.spaces:
          if spaces.type == 'VIEW_3D':
              area.spaces.active.clip_start = 0.1


{ANIMATIONS v2.8} ~ FBX exporting only the selected action rather than all of them (for Unity)

When working under the Animation tab, select all with A  then when looking at the Action Editor, under Summary, you can see all bones that are being moved and or rotated for the selected action.

Here you need to make sure all names and bones are valid (Ie. nothing with red lines under it when you click the arrow beside the bone name). One this is complete you can open the Modeling tab and will want to select all meshes (using Shift + LMB/RMB) and use Ctrl + A and apply the scale.

Then within the Outliner, you will want to expand the armature, then Animation, then NLA Tracks, then expand each Action Stash. Then expand the Pose tab, and with selecting the bottom-most mesh you want to export, and Shift + LMB  the armature, it will select every mesh and anything within the Armature in the outliner.

Finally, go to File->Export->FBX, under Include go Selected Objects then Shift + LMB Armature, Mesh, and Other.

Under Transform, change Forward to Z Forward. Disable Add Leaf Bones under Armature, and lastly, disable Force Start/End Keying under Bake Animation (which should be checked).

With this, you can move to the desired output folder and click Export FBX.


How to force console window to show up automatically when Blender starts

Append -con to the command line arguments passed to blender.exe.

You can do so by modifying the properties of your favorite Blender shortuct and appending -con in the Target text box.

The console window stays open then.


Absolute lost at words for how to describe this softbody/fluid?

This is a soft body plastic deformation and tearing simulation. Currently, Blender's built-in soft body system does not support tearing, and (to my knowledge) the Mantaflow fluid system is not appropriate for the extremely high viscosities needed to emulate it.
Thankfully, there are a couple of free options you can use:
Molecular Addon
Probably your best bet, the Molecular addon uses a very flexible meshless mass-spring system to approximate a wide range of soft body physics (when combined with CubeSurfer) as well as simulate granular flow. Most relevant to your problem is the feature for breaking bonds. Unfortunately the documentation is offline, so I cannot link it to you now.
FLIP Fluids
FLIP Fluids is a fluid solver for blender that supports high-viscosity liquids. While it appears to be a paid addon, it is possible to use it if you compile from source. For your problem, all you need to do is crank the fluid viscosity up and have a blob of fluid in the initial shape of your body.
In the future, I hope the new soft body sim and particle nodes will be up to the task.


Camera tracking; movie clip does not show up as background footage

After tracking and solving press Setup tracking scene, and then "set as backgroud".

That will set the movieclip to be used as image background for camera view.

If you want to set it manually , then just enable images as background, select your video clip as source and go to camera view on the vieport (numpad zero)

Also, before you ask, the background image is used for reference only, to render the image in the backcground read> Cycles not rendering image or movie clip used as background in the viewport


Is there colour picker in texture paint mode?

You can find the color picker by clicking on left or right Brush Color rectangles.

A faster way will be using S keyboard shortcut to sample color under the cursor location in 3D window or UV/Image Editor.


How to get a smooth curvature map from a normal map?

Python can be used to analyse your normal map and reconstruct the bump map and this can then be used to generate a curvature map.

Here's the code to run - simply paste this into a Text Editor window, load your image into the Image Editor, ensure it has '_nmp' or '.nmp' somewhere in the filename and click 'Run Script'.

import bpy
import os
import math

pixels = None
width = None
height = None

def get_pixel(x, y):

    global pixels, width, height

    base = (y*width+x)*4
    return (pixels[base], pixels[base+1], pixels[base+2], pixels[base+3])

def set_pixel(x, y, rgba):

    global pixels, width, height

    base = (y*width+x)*4
    pixels[base] = rgba[0]
    pixels[base+1] = rgba[1]
    pixels[base+2] = rgba[2]
    pixels[base+3] = rgba[3]

#Adapted from http://blender.stackexchange.com/a/80047/29586
def srgb_to_linear(c):
    a = 0.055
    if c <= 0.04045:
        return c / 12.92
    else:
        return ((c+a) / (1+a) ** 2.4)

# RGBA was previously held as 8-bit. Re-normalize to correct for 8-bit innacurracies
def normalize_normal(rgba):
    dist = math.sqrt(math.pow(rgba[0],2) + math.pow(rgba[1],2) + math.pow(rgba[2],2))
    if (dist > 0):
        return (rgba[0]/dist, rgba[1]/dist, rgba[2]/dist, rgba[3])
    else:
        return (0,0,0,0)

def calc_gradients(normal_x,normal_y):
    adj_x = (normal_x - 0.5)*2
    adj_y = (normal_y - 0.5)*2

    # Filter out the extremes to avoid infinities
    if adj_x < -0.99:
        adj_x = -0.99

    if adj_x > 0.99:
        adj_x = 0.99

    if adj_y < -0.99:
        adj_y = -0.99

    if adj_y > 0.99:
        adj_y = 0.99

    return (math.tan(math.asin(adj_x))/100, math.tan(math.asin(adj_y))/100)

def normalize(arr, width, height):
    #Get range of depth
    max_depth = -99999999999999999999
    min_depth = 9999999999999999999
    for x in range(0,width):
        #print("Normalizing(1)... %i" % x)
        for y in range(0,height):
            depth = arr[y*width+x]
            if depth < min_depth:
                min_depth = depth

            if depth > max_depth:
                max_depth = depth

    print("max = %f, min = %f" % (max_depth, min_depth))
    if max_depth > 1000:
        print("Limited max to 1000")
        max_depth = 1000

    if min_depth < -1000:
        print("Limited min to -1000")
        min_depth = -1000

    if max_depth == min_depth:
        max_depth = min_depth + 1

    #Normalize depth to 0.0 to 1.0 range
    for x in range(0,width):
        #print("Normalizing(2)... %i" % x)
        for y in range(0,height):
            depth = (arr[y*width+x] - min_depth) / (max_depth - min_depth)
            #print(depth)
            arr[y*width+x] = depth

def generate_curviness(heights, width, height, radius):
    #determine curviness at each point and store in RED channel
    curviness = [0.0] * width * height
    print("Calculating Curviness (%i)..." % radius)
    for x in range(1,width-1):
        for y in range(1,height-1):
            for d in range(1,radius+1):

                if (x-d)<0 or (x+d)>=width or (y-d)<0 or (y+d)>=height:
                    pass
                else:

                    h = heights[y*width+x]
                    hv1 = heights[(y-d)*width+x]
                    hv2 = heights[(y+d)*width+x]
                    hh1 = heights[y*width+x-d]
                    hh2 = heights[y*width+x+d]

                    if hv1 < hv2:
                        vcurviness = (h - hv2) - (hv1 - h)
                    else:
                        vcurviness = (h - hv1) - (hv2 - h)

                    if hh1 < hh2:
                        hcurviness = (h - hh2) - (hh1 - h)
                    else:
                        hcurviness = (h - hh1) - (hh2 - h)

                    curviness[y*width+x] += (vcurviness + hcurviness)/(d*d)

    return curviness

def process_image(image_name, new_image_name):

    global pixels, width, height

    image = bpy.data.images[image_name]

    width = image.size[0]
    height = image.size[1]

    # The source image pixels - stream of R,G,B,A for each pixel, width x height
    pixels = list(image.pixels)

    # Gradient from each pixel in each direction - up, left, right, down
    gradient_u = [float] * width * height
    gradient_l = [float] * width * height
    gradient_r = [float] * width * height
    gradient_d = [float] * width * height

    # Determine gradient in each direction for each pixel
    for x in range(0,width):
        print("Capture gradients - Column %i of %i" % (x,width))
        for y in range(0,height):

            this_rgba = normalize_normal(get_pixel(x, y))
            this_rgba_gradient = calc_gradients(this_rgba[0], this_rgba[1])

            if x == 0:
                left_rgba = None
                left_rgba_gradient = (0,0)
            else:
                left_rgba = normalize_normal(get_pixel(x-1, y))
                left_rgba_gradient = calc_gradients(left_rgba[0], left_rgba[1])

            if y == 0:
                bottom_rgba = None
                bottom_rgba_gradient = (0,0)
            else:
                bottom_rgba = normalize_normal(get_pixel(x, y-1))
                bottom_rgba_gradient = calc_gradients(bottom_rgba[0], bottom_rgba[1])

            if x == (width-1):
                right_rgba = None
                right_rgba_gradient = (0,0)
            else:
                right_rgba = normalize_normal(get_pixel(x+1, y))
                right_rgba_gradient = calc_gradients(right_rgba[0], right_rgba[1])

            if y == (height-1):
                top_rgba = None
                top_rgba_gradient = (0,0)
            else:
                top_rgba = normalize_normal(get_pixel(x, y+1))
                top_rgba_gradient = calc_gradients(top_rgba[0], top_rgba[1])

            # Average each directional gradient with this one to give the gradient between the pixels in each direction
            gradient_u[y*width+x] = (this_rgba_gradient[1] + top_rgba_gradient[1])/2
            gradient_d[y*width+x] = -(this_rgba_gradient[1] + bottom_rgba_gradient[1])/2
            gradient_l[y*width+x] = -(this_rgba_gradient[0] + left_rgba_gradient[0])/2
            gradient_r[y*width+x] = (this_rgba_gradient[0] + right_rgba_gradient[0])/2

            # Store it
            ent_u[y*width+x]))
            set_pixel(x, y, (this_rgba[0], this_rgba[1], this_rgba[2], gradient_u[y*width+x]))

    # Now start with 0's and process the whole image pixel by pixel averaging the resulting heights generated by the surrounding pixels
    heights = [0.0] * width * height
    numpasses = int(max(width, height)/2)
    for p in range(0,numpasses):
        print("Pass %i of %i" % (p, numpasses))
        for x in range(0,width):
            for y in range(0,height):
                if y < (height-1):
                    height_top = heights[(y+1)*width+x]
                else:
                    height_top = 0.0

                if y > 0:
                    height_bottom = heights[(y-1)*width+x]
                else:
                    height_bottom = 0.0

                if x < (width-1):
                    height_right = heights[y*width+x+1]
                else:
                    height_right = 0.0

                if x > 0:
                    height_left = heights[y*width+x-1]
                else:
                    height_left = 0.0

                baseindex = y*width+x
                height_this = heights[baseindex]

                #Calculate and store the new height
                heights[y*width+x] = (height_this + (height_top + gradient_u[baseindex]) + (height_bottom + gradient_d[baseindex]) + (height_left + gradient_l[baseindex]) + (height_right + gradient_r[baseindex])) / 5

    normalize(heights, width, height)

    print("Storing Bump...")
    for x in range(0,width):
        for y in range(0,height):
            pixels[(y*width+x)*4+3] = heights[y*width+x]

    # Generate Red with radius 1
    curviness = generate_curviness(heights, width, height, 1)
    normalize(curviness, width, height)
    print("Storing Curviness...")
    for x in range(0,width):
        for y in range(0,height):
            pixels[(y*width+x)*4+0] = curviness[y*width+x]

    # Generate Green with radius 5
    curviness = generate_curviness(heights, width, height, 5)
    normalize(curviness, width, height)
    print("Storing Curviness...")
    for x in range(0,width):
        for y in range(0,height):
            pixels[(y*width+x)*4+1] = curviness[y*width+x]

    # Generate Blue with radius 25
    curviness = generate_curviness(heights, width, height, 25)
    normalize(curviness, width, height)
    print("Storing Curviness...")
    for x in range(0,width):
        for y in range(0,height):
            pixels[(y*width+x)*4+2] = curviness[y*width+x]

    print("Storing image...")
    new_image = bpy.data.images.new(new_image_name, width=width, height=height)
    new_image.pixels = pixels[:]
    new_image.update()
    new_image.pack(as_png=True)
    new_image.use_fake_user = True

    print("Done")

for img in bpy.data.images:
    if "_nmp" in img.name or ".nmp" in img.name:
        new_img_name = img.name
        new_img_name = new_img_name.replace('nmp', 'bump')
        print("%s -> %s" % (img.name, new_img_name))
        process_image(img.name, new_img_name)

The script will look for all images with '_nmp' or '.nmp' in the name and will generate an image of the same name, but with 'nmp' replaced with 'bump'. Each generated image will consist of 4 channels (RGBA). The Alpha channel will be a bump map generated from the normals, while the Red, Green and Blue channels are each a Curvature map - one with a radius of 1 pixels (Red channel), one with a radius of 5 pixels (Green channel) and one with a radius of 25 pixels. The curvature is measured only in the Horizontal and Vertical directions but the result seem reasonable to my eye (I've not got much experience of curvature maps - if there's a problem with these then let me know and I can update the calculations).

Here's the normal map (a section of the map from your question) :

Here's the result :

Bottom-right is the generated bump map, Bottom-left is the red channel (1 pixel radius curvature), top-right is the green channel (5 pixel radius curvature), top-left if the blue channel (25 pixel radius curvature).

The way this works is to first process the normals from the normal map to determine the horizontal and vertical gradients at each point. These are re-normalized to correct for any inaccuracies (such as 8-bit encoding) and extreme values are clipped to avoid problems before being averaged with its neighbours to get a gradient between those pixels. These gradients are then used to determine the difference in height between neighbouring pixels and those height differences built up into the bump map (this is the part that takes the time).

The resulting bump map is stored in the alpha channel and is then sampled to determine the curvature at each point, storing each in the R,G,B channels.

The script produces output of progress to the console - so run Blender from the command line to view the output. Beware large normal maps taking a considerable amount of time to process - on my system the full 2048x2048 map was estimates to take around 10 hours to complete so I used a cut down section for my testing (604x408 pixels) - which only took a few minutes to complete.

EDIT :

Just to clarify, the script takes the original Normal Map...

'rock5_nmp_clipped'

... and extracts the height information into a bump map with the same name but with 'nmp' replaced with 'bump'...

'rock5_bump_clipped'

...along with 3 separate channels, each with the curviness map calculated at different radii :

To analyse curvature using a different radius simply amend the calls to the 'generate_curviness(...)' function and re-run the script to generate a new image :

#Use radius of 25
curviness = generate_curviness(heights, width, height, 25)

e.g., change to :

#Use radius of 40
curviness = generate_curviness(heights, width, height, 40)

Using the Normal Map

The curviness stored in the R,G,B channels of the generated bump map can be used to add wear or additional effects :

Since we now have the actual underlying 'bump' information we can use this to drive other effects - such as the True Displacement - generating a much more realistic surface :

(Above example rendered using a single plane, subdivided to 256x256 faces and displaced with True Displacement (see displacement properties panel at bottom-right of image). All depth, displacement, and wear derived from original normal map, extracted by script.)


How to remove shadows appearing inside material?

Moments after writing up this question, I found an answer. The way to do it is to alter the Roughness value in the Refraction BSDF node of the shader set up.


Can't manage to succesfully UV unwrap house to get aligned brick textured walls

Found that wrapping the UV map around the edge is the easiest way to get the bricks to line up. You just need to concentrate on the sides. Generally a sill covers the bottom layer and on the top - you can cheat more.

The image above shows the normal map which is used later to bump the texture...

...and this shows another building with rounded brick corners.

Some textures I made from baking walls of mesh bricks. Others I drew and composed in Gimp. You can see some of the trials here on the BlenderArtists thread.

Update: First step is to make sure your seams are marked for the unwrap - CTRLE if you haven't done that already. (You can see them marked red and just in the corners.) Then U to unwrap. I use Project from View as I think it's the quickest to get neat UV's, and then just scale ...

Select the recessed edges and scale them on the X axis in the UV editor...

These are the active buttons in the UV editor...


Crate an object that will act as domain and assign it some volume scattering as detailed on this answer

Then use some texture to make the fog less homogeneous, and animate the mapping for it.


When you render images they don't export themselves to a folder, you have to do that manually. Just use the shortcut Shift + F3 (with the mouse hovering over the render in the UV Image Editor) and navigate to the folder you want the image to export to.


CQ means constant quality, it has nothing to do with Blender, everything to do with FFmpeg which blender uses for encoding.

https://trac.ffmpeg.org/wiki/Encode/VP9

Try to use WEBM/VP9 as codec with the WEBM container. (output properties, video panel)

Depending on the platform you are working on, it should normally work right out the box.


Animate using shape keys and drivers.
Example script using z function surface addon.  Default equation 1 - (a * x**2 + y**2) for a = [0..9].  Create a shape for each using bpy.ops.mesh.primitive_z_function_surface(...) (the operator from the addon) passing the substituted a to the operator as the equation property. (eg for a=3 equation="1 - (3 * x**2 + y**2)" .)
The separate objects are joined using bpy.ops.object.join_shapes()
import bpy
context = bpy.context
# 10 shapes over 101 frames

scene = context.scene
vl = context.view_layer
shapes = 10
obs = []

for i in range(shapes):
    bpy.ops.mesh.primitive_z_function_surface(
                    equation="1 - (%d * x**2 + y**2)" % i,
                    div_x=16,
                    div_y=16,
                    size_x=2,
                    size_y=2)

    ob = context.object
    ob.name = "a=%d" % i

    obs.append(ob)

shape = obs.pop(0)
vl.objects.active = shape

for ob in obs:
    ob.select_set(True)

bpy.ops.object.join_shapes()
for ob in obs:
    bpy.data.objects.remove(ob)

# add a discrete driver animation (10 frames of each)
keys = shape.data.shape_keys.key_blocks

for i in range(1, shapes):
    shape = keys.get("a=%d" % i)
    d = shape.driver_add("value")
    d.driver.expression = "frame // 10 == %d" % i

Note the animation uses drivers.  Make sure autorun is enabled
Make sure the Add Mesh : Extra Objects addon is enabled too


If you apply a modifier to an object it becomes a part of the object and therefore vanishes from the modifier menu. The vertices of your object are changed permanently and you cannot reverse this step.

Because of that you will usually not apply modifiers, unless you really have to.


Area of bottom polygons using obj.to_mesh post modifier but without applying it

I guess, you are getting zero because the face.select is not assigned value True, but is being checked for condition True (face.select == True). Also if you are interested only in bottom faces, i.e faces with all vertices having z coordinate value zero, then checking for median z coordinate may not work in all cases. There could be faces with median z at zero but vertices lying on either side of x-y plane.
I can think of the following alternative (I am open to critique and corrections as I am also comparatively new to blender :)

import bpy
import bmesh

bm = bmesh.new()
#bm = bmesh.from_edit_mesh(bpy.context.active_object.data) (without modifier)
bm.from_object(bpy.context.active_object, bpy.context.scene)

#Floats are not always absolute zero, so comparing with a tolerance
total_area = sum(f.calc_area() for f in bm.faces if len([v for v in f.verts if v.co[2] < 0.0001 and v.co[2] > -0.0001]) == len(f.verts))
print('total area:', total_area)

bm.free()


Can you change the render seed for each frame of an animation in cycles?

New Versions of Blender

As of 2.75, this is as simple as checking the little clock icon in the seed input field.

Previous Versions of Blender

You can animate and add drivers to the seed field in the Sampling panel in the render buttons the same way you can with most of the fields in Blender. Simply clicking on the field and writing #frame will create a driver that uses the current frame number as the value for the field. This generates a different noise pattern for each frame.


Help with rigging 3x3 bones and root in blender

Here is a basic solution for this kind of armature:

Extrude a bone from the lower leg, unparent it, it will be the IK target, which will control the lower leg (IK bone). Duplicate the target to make the IK pole target (the bone that will give direction to the knee), parent it to the IK target.

In Pose mode give the lower leg an Ik constraint, assign it the target and pole target, give it a Pole Angle of 180° if necessary and a Chain Length of 3.

To give your bones some custom shapes, in Object mode create an object with the shape you want (example: a circle), then back to the armature, in Pose mode, select the bone you want to shape, in the Properties panel > Bone > Viewport Display > Custom Object > select the circle.


Can honey bee colony simulation be done in Blender?

I expect you can do a good job of that in blender, within the particle physics settings you can find some boids options, these can be used to simulate a flock of birds so it should do bees just as well. I would have some empties moving from place to place that a swarm would follow to specify the timing of the bees moving.

You can use multiple particle systems so you may want one for the bees hanging around the hive; one (or more) for each group(s) that goes off to the flowers; and one (or more) for each group(s) that returns to the hive.

You can also use particles to place the flowers around the scene.


How can to change verts values in the curve model?

In general, you can't directly affect the vertices created by curves without writing those curves to mesh (alt c -> mesh from curve.)

However, you can increase or decrease the number of vertices created by a curve.  Increasing the resolution of the curve in properties/data/shape will create additional vertices along the length of a curve.  If your curve has a bevel, increasing its resolution creates additional vertices along the radius of the bevel.  If your object is using a bevel object, you can change the resolution of the bevel object instead.


Align Object to footage without knowing Camera data

If your footage contains horizontal and vertical features which are known to be parallel in the real-world 3D scene, then the Blam add-on will help you derive a matching camera location/perspective in Blender. You should then be able to make simple bounding-boxes in scene, and align your model to the bounding boxes.


What are these weird clippings on edit mode when my object has subdivision surface on?

Nothing seems wrong here, it's just some z-fighting between your edit mesh and the subsurf mesh.
Z-fighting is when two faces (in this case, the edit mesh face and the subsurf faces) occupy the same space, so they "fight" over which one gets rendered first.


By definition the face normals are perpendicular to the face and can't be adjusted to a specific rotation.

To alter the way the hair is emitted, you want to use something other than the normals to determine the initial direction, you can adjust this in the particle settings.

Enable the advanced option which makes the velocity panel available for hair particles. Set the normal value to 0.0 and change the emitter object values to the direction you want the hair to go.


Blender units equal one meter.

You can set the scene to explicitly use metric units in the scene>unit section of the properties window:

Keeping your scene in real world measurements is a good idea when it comes to dealing with physics simulations and lights, blender is designed to calculate things using real world values.


How to adjust camera clipping for object?

this is a good question.  the shiftX value will shift the camera however many units in the X direction, but the point of origin will stay stationary, if that makes sense.  The camera has a point of origin, like every object. And also like every object, it will rotate around it's point of origin.  In this case, the point of origin is the tip of the camera where all the lines meet (See picture)
The origin can be seen as a small orange dot.  If you wish to change the origin, there are a number of ways to do this.  You can see all the options by going to: Object-Set Origin; and then choose your preferred position.  Hope I answered your questions correctly!


So ,You have not given enough detail to work with but you have given the name Optimize tool so i did some search and found this on Autodesk's site

The ProOptimizer feature is an optimization tool that helps you reduce the number of vertices (and so the number of faces) in an object while preserving the object's appearance.

so that can be done using a modifier in blender which is not an addon and is available by default known as a Decimate modifier that reduce geometry and tries to preserve geometry
Some example
This is a 24 thousand vertices cube

This is the same cube after decimating


How it looks depends on what liquid that is. The 'pixelation' is because of the mesh of the glass shaded flat. You need smooth shading for it. However there are many more problems here. There is only one interface for light traveling from glass to liquid here so there should be only one surface, not two with a gap between them and you need to take IOR into consideration which is different when light goes from glass to liquid than the 'regular' IOR that everyone is used to that is usually between the material and air. You will have to look into physics to make it look right. See: Liquid / glass interface IOR and normals in Cycles


How do I translate a UV set of faces keeping the vertical or horizontal axis fixed?

Press G for the grab command and you can constrain movement by pressing either X or Y afterward.


How do NodeSockets determine if a link between them is possible?

Here's a rough proof-of-concept: https://gist.github.com/Theverat/f6c30469e22e03202dd429fe19b24c83
See my revision for the changes I did: https://gist.github.com/Theverat/f6c30469e22e03202dd429fe19b24c83/revisions

Basically, the node tree offers an update method which does not tell you what exactly happened, only that something happened.

But each node offers an insert_link method, which tells you about a link before it is inserted. So in this method you can not delete the link, or prevent it being inserted, you can only log it in your nodetree as new (or flag it for deletion).

So when the user creates a new link, this is what happens behind the scenes:

insert_link is called on the node the connection is coming from
insert_link is called on the node the connection is going into (Note: the link is the same, so you should prevent a duplicate insertion into the list of new links in the node tree)
update is called on the parent node tree of these nodes


Make an object invisible to a specific camera? (Cycles)

This is possible using Drivers similar to the method described in the answer to How to change world background based on active camera?

You should set the Pass Index for each of the Camera objects so as to identify each camera.

Then add the driver to the visibility of the object being controlled - either the eye icon in the Outliner or the Camera icon - depending on whether you want to control the visibility only in the 3D view or in the final render.

Set the Driver expression to :

bpy.context.scene.camera.pass_index == n

Where 'n' is replaced with the pass_index of the camera from which you want that object to be hidden. Repeat for each object, specifying the relevant 'n' for each driver as appropriate.

Changing the active camera should now hide the object from view. Note that the driver will not necessarily update the visibility but will be updated on the next frame change - so animating the change in active camera on a specific frame will now automatically change the visibility of the objects.

Here I had 4 cameras positioned around the objects - with Pass Index of 1,2,3,4 - with the visibility of the objects (Cone, Cylinder, Torus, Icosphere) driven appropriately  and the active camera changing on each marker :


I ended up figuring it out.
Turns out, you have to individually select every single curve for this to work - not select them altogether, or as a group. Everything's working just fine now.


When moving character vertex stretches (After weighting)

Try moving your character into that second position, where you can see which vertices are being left behind.  Then:

Select the mesh.  Get into Edit Mode.
Select the vertex (make sure Armature deform is enabled to be seen in Viewport)

Hit N in the Viewport, and scroll down to the Vertex Properties and make sure Deform is selected.

From there, look for the bone (probably the name of a Forearm bone) that should be influencing that vertex, but isn't, and set the weight to 1.  Make sure to hit Normalize when your done.


How to make newtonian particles to not go through each other?

If i understood the question you can use the Cast Modifier

Make 2 sphere

Select 1 sphere and add Cast Modifier and Target to other sphere

When you move the 1st sphere it goes inside the other.


When you create a walk cycle in Pose mode, don't move the root, keep it still, this way, when you'll be back in Object mode, you'll be able to move the whole armature and the root won't go back and forth, it will comply to the animation you will give it in Object mode (like typically follow a curve).

You can move the root bone if you don't plan to move your object in Object mode, but in this case it generally won't be a cycle.


The rig needs to be removed from parent therefore select object AlT+P remove parent
https://youtu.be/lVq74a8nD8I


How to create little flanges on the bottom of the bottle

You may do it fast using the inset tool.

Add a circle with 72 vertices- set it in a Tool Shelf (T).

Extrude it inwards (E) and add two edge loops (Ctrl+R). Select the whole face loop with Alt+RMB, then press I twice and set the inset's scale. Finally extrude the inseted faces upwards, add addictional loopcut in the middle and rotate it a bit (R).

Add a subsurf modifier (Ctrl+3 in Object Mode). Lower the middle loopcut a bit. Press Ctrl+Numpad+ to increase the selection area. Press Shift+E to crease it. Finally add a smooth shading and recalculate normals if needed (Ctrl+N).


Cycles - rendered viewport really slow in Blender 2.8

Try to use combined GPU AND CPU for rendering. Using square tiles will increase render speed (any square numbers "X²" for better performance). You can find some sites to help you minimizing the render time.


How best use a texture image to a large/long object

Since you're using an array of planks, you have another option.

Scale your UV map so it's only using a part of the texture (no worries, the rest won't be wasted)
Use the UV Offset in the Array modifier to avoid repeating between planks
Done.

Now you're using the whole texture and also avoid repeating.


How to change animation easing in Blender 2.8?

The Easing can be changed within the Dope Sheet in Blender 2.8 by simply selecting the channel and choosing the Interpolation mode in the Key menu.


Eevee render with blurred textures when not facing the camera

That is cause by low or lack of anisotropic filter. You could try increase the filtering through Blender Preferences located in:
Edit>Preferences
Then in Viewport tab, Under Textures you'll see Anisotropic Filter

Image example above: Anisotropic Filter - Off

Image example above: Anisotropic Filter - 16x


Get an executable list of executed operators in python

Here's a solution I found. It’s not a nice one, but the best I could come up with:

context = bpy.context.area.type
bpy.context.area.type = “INFO”
bpy.ops.info.select_all_toggle()
bpy.ops.info.report_copy()
bpy.ops.info.select_all_toggle()
bpy.context.area.type = context
clipboard = bpy.context.window_manager.clipboard
clipboard = clipboard.splitlines()

So basically I’m changing the active context to the Info Space to then select everything and then copy it. The copied text is then split into lines, so you get a list with operators, that are formatted nicely.


How to color areas corresponding to a bump map?

Use a mix node to choose between the two colours you want, connect the bump image to the Fac input of the mix node.


How can I get a remote computer to automatically render a blender file

Yes, there is. Automatically scheduling it will be a bit of a hassle, though (if you want to do that).

Rendering it

Blender can actually be run from the command line (Terminal on Mac, cmd on Windows). You can render a file like this:

blender -b path/to/file.blend -o whatever-####.png

On Mac, prefix this with /Applications/Blender/Blender.app/Contents/MacOS/ (replace /Applications/Blender with wherever you installed Blender). I don't know what to prefix it with on Windows.

Try this out, and it should spit out a .png image file in the current directory (another name for folder), which should be your home folder.

Rendering it remotely (on Mac)

You can just transfer the file to the remote machine and run the above command. This is for controlling it from the work machine.

Open a terminal on the rendering machine and type hostname. (You only need to do this once.) Then go to your work machine and type ping whatever.local, where whatever.local is the output of the hostname command on the other machine. You should get a continuous stream of output. Hit Ctrl-C to stop it. This step is to make sure that the two computers can see each other.

Now run this command, which does something very interesting:

ssh yourusername@whatever.local

yourusername is your username on the remote machine.

It'll give you a scary "identity could not be verified" warning the first time you connect. Just type "yes" to continue. (It can't tell the difference between a new machine and an impostor.)

Assuming you got your other machine's password correct, you are now controlling the remote machine!

Now copy the file to your render machine, or run this command:

scp yourworkusername@work-machine.local:/Users/.../file.blend ~

This will pull the file to your home folder on the remote machine. (Run hostname in another window to get your work machine's name.)

Now run the blender command above. Repeat scp and blender as necessary. When you're done for the day, type exit to log out of the remote machine.


Scale the model, with automatically scaling UV's

The UV's are independent from the scale of the object so if you scale the object, the texture on it is scaled with it.

If you wanted to have functionality where you scale the object, but the texture remains the same size in relation to it's surroundings, you could use a driver to drive a multiplier for UV coordinates in the shader's nodes to adjust the size of the texture to remain the same size, however if you wish to move vertices around in 3d and UVs to be updated somehow, that functionality does not exist, because you move vertices in 3d space and UVs are in 2d and there is no one right way to define how to translate those transforms from 3d space to 2d space. There could be many ways to do this and it is hard to define the one that would be desired in a UV map. One could keep updating UV unwrap all the time, but that would be very resource intensive task and would not be practical.


As far as I know, Freestyle doesn't stylize shading, only affects geometry lines (correct me if I am wrong). You can combine Freestyle lines in compositor with shading converted to strokes.

Basic plan for shading is to separate simple material to shading layers, and assign "stroke" textures with different density/color/orientation in according with these shading layers.

You can separate shading to layers inside materials using ColorRamp node. (Pic is not mine, taken from tutorial)

Also check .Blend file example on Blender site here (Blue Pencil Shark at the bottom of the page)


Eevee: First animation frame renders black & white until something in the scene updates

Make sure you're looking at the good rendered channel or pass.

If it is not set to "Color and alpha" or "color", you'll see a B&W channel.
What you describe looks like the alpha channel.
It could also be something in the compositing.

Else it's probably a bug.


How to define a colorband in Blender 2.74 using python script

Cycles and Blender Internal render engines have a different Materials ecosystem. They're similar in many ways, but different on important details.

Blender Internal

import bpy

mat = bpy.data.materials.new('experiment')
mat.use_diffuse_ramp = True
elem = mat.diffuse_ramp.elements.new(0.25)
elem.color = (1,0.2,0.3,0.3)

Cycles

Involves adding nodes, or appending a premade material from a different .blend (also easy but a different topic)

import bpy

mat = bpy.data.materials.new('experiment4')
mat.use_nodes = True

ramp_node = mat.node_tree.nodes.new('ShaderNodeValToRGB')
elements = ramp_node.color_ramp.elements

elem = elements.new(0.25)
elem.color = (1,0.2,0.3,0.3)

# the default 'new material' always has a 'Diffuse BSDF' node,
# here we obtain a reference to it
diffuse_node = mat.node_tree.nodes['Diffuse BSDF']

# nodes need to be hooked up!
mat.node_tree.links.new(ramp_node.outputs[0], diffuse_node.inputs[0])

The reason I mention appending an existing material is because it can be a lot more convenient to tailor a complex material once and use many variations of it in subsequent blends by appending the material and adjusting known values. Scripting Cycles materials can be a little verbose :)

If you still have questions then hopefully you'll have some idea what to ask about.


In cycles, do negative lights actually remove light or are they casting "Black" light?

Regardless of what render engine you are using (either Cycles or Blender Internal),If you are using a point lamp. it is actually removing light, because it is impossible for a lamp to cast black light. Set a lamp's emission color to pure black. and set the strength as high as you want, if you have any other lamp in your scene, emitting light of any other color, with the strength any higher than 0.00, your scene will not show any traces of "black light"
If you are using an emission shader, set to pure black, then yes it is emitting "black light"
Lamps can not cast black light, but an emission shader can, and does.

You should also note that there is a difference between setting a lamp to black, and having a positive strength, and setting the lamp to white and having a negative strength.

When using an emission shader,  there is also a difference between emitting black light and having a negative lamp.

In this file, the black cube is emitting black light, the white cube with negative strength is literally removing light. Both appear to be casting a shadow. the white cube with positive strength is emitting light.


I have found the problem to this, u have to go on pose mode find the bone (ctrl) in the properties under display and for some reason the wireframe is off. You have to enable it for every ctrl bone.

Cheers!


I'm a little late because I wanted to say something similar to what moonboots gave as an answer. I'll give you a short example how I would do it:

Let's say the texture should be real life size 75 x 50 cm
Import the textures with "Images as Planes"
In the Image Texture node of the material, set the extrapolation mode to "Repeat" instead of "Clip"
Connect a Mapping node and a Texture Coordinate node to the image
Connect the Mapping node to the "Object" output of Texture Coordinate
In the Mapping node set Scale X to 1 / 0.75 (75 cm) and Y to 1 / 0.5 (50 cm)

Now you can scale the plane to the size you need it for a floor or wall or whatever - the texture will be the correct real life size as long as you apply the objects scale so that it's 1/1/1.
The only problem is that - since the texture is not connected to any UVs or geometry of the new object - it will definitely not work well on curved objects and is only suitable for things like floors or walls or similar flat, even surfaces. To position it as desired you can use "Location" in the Mapping node.
Note: to move the texture for example 20 cm in X direction, you have to divide this by the X dimension of 75 cm: 0.2 / 0.75
The easiest would be to connect the "Location" input to a Vector Math node set to "Multiply" where you already set the same factors as in "Scale".


in my simulation some of the water is stuck on walls blender 2.82

Go to the Liquid menu. Check Fractional Obstacles, and drag that value all the way up to 1.

The reason this is happening is that the fluid simulator is actually based upon lots of 3D "cells". The cup, in a fluid simulation point of view, is basically a lot of obstacle cubes stacked together. The size of these cubes is determined by the fluid resolution. This causes a stair-stepping effect like the one you are seeing, where the liquid stands on a seemingly sloped surface.

By using the Fraction Obstacles feature, it is telling the fluid simulator to make the cell representation of an obstacle more like the original mesh bysmoothing it out.


How to leave identical ammount of space between each CTRL+R Cut? AND why can I only do 1 cut?

When you use Alt R to make a loop cut you get that purple loop of edges - then you click once and there will be an actual cut where the purple guides were. If you move the mouse you'll slide that loop and it will stay where it is once you click again.

If you want several evenly spaced loops you need to hold the mouse still between the two clicks, then change the number where it says Number of Cuts in the tool panel near the bottom.

Edit 2:
Remove edge loops by being in Edit mode, Edges, and right click, while holding down Alt, on an edge that runs in the direction of your edge loop - that will select the loop. Then press Delete and choose Dissolve Edges.

Vertices are points in space with XYZ coordinates - for example, in the middle of the world the vertex would be 0,0,0. There is a vertex at both ends of an Edge-  they define where the edge starts and ends.  There are many things you can accidentally do that will duplicate Edges and Vertices - there are lots of shortcuts that you can accidentally press which do all sorts of things.

To find these double edges or vertices, press A until nothing is selected, then you can use Border select - press B and drag a square around the suspected edge or vertex. Right up the top of the screen it shows details about the geometry including how many edges or vertices are selected - if you only see one, but it says at the top that 2 are selected, you know you have a double one (or triple one).  Reading the manual from the beginning helps get an understanding of all this.

About the last question, if you make one Alt R cut it will make it exactly in the middle between the other loops UNLESS you move the mouse between two clicks, in which case it will slide. If you finish that action and make a new loop it will again be half way between two loops. If you want to evenly divide a face with many cuts, delete the ones that are there and start again - click twice so you don't slide, then immediately enter a number in the Number of Cuts field.


Bmesh Version

Simple test script, run in edit mode. Rather than a particular size, which is a little tricky once scale is involved, for example sake, selects faces 6 x larger than average face area.  ... find the max, and select all faces over a certain percentage of that or.... use the sorted list to select n biggest etc etc.

Note this doesn't take into account mesh deformed by modifiers.

import bpy
import bmesh
context = bpy.context

FACTOR = 6
ob = context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)
avg_face_area = sum(f.calc_area() for f in bm.faces) / len(bm.faces)
print("avge face area: ", avg_face_area)

# biggest is last member of faces sorted
#faces = sorted(bm.faces, key=lambda f: f.calc_area())

for f in bm.faces:
    f.select = f.calc_area() > FACTOR * avg_face_area

bmesh.update_edit_mesh(me)

A run on Suzie


Why does my material panel look different?

This is because you are using the Blender Internal render engine.

Switch the render engine to Cycles at the top of the screen in the Info panel:


I have an idea for this.
It is: the basic shape of a hood is a sphere cut in half  and squashed and stretched into more of an oval shape.  Kind of like an egg cut in half from top to bottom.
You just need to take that primitive mesh shape and add a little detail.
I like to start with an add an extra object add on called Add Mesh:  Extra Objects, I am not sure if it is  there by default but it is definitely free.  This gives you a sphere made out of quads instead of the default sphere.
Then I just take that object, delete the front faces.  Then solidify it, bevel it, and apply those modifiers.  This will make the cloth have a bit of a nice rounded rim.  Then I would add a subdivisions modifier to smooth it out, and maybe sculpt it a bit to add details.
I show all the stages of that in this picture here:


In blender 2.70 just as in 2.60 the Sculpt Tools can be found under Brush once in Sculpt Mode.

In the 3d header switch to sculpt mode, note your active selection needs to be a sculptable mesh

In the Tools tab at the very top you will see the brush section. Exapnd it and you will have access to the sculpt brushes


How to create white volumetric clouds in a dark scene?

First of all clouds can't be seen in total black night. We can see them only when moon shine a bit. So it's pretty accurate result.

But if you need you could just mix your material with emission shader.


Multiple Blender Threads (targetting CPU and GPU )

Blender uses OpenGL for both the 3D viewport and rendering. If you use GPU rendering the render engine occupies the whole GPU and AFAIK there are no settings to influence that in the current builds (even not in development builds).

The only way to get a little more responsiveness while rendering in another instance is to switch from Cycles to Blender internal and then switch the 3D viewport from GLSL to Multitexture. This might at least help with the modeling part.

Other software might continue to work without (or maybe a little) lag, if they don't make use of your GPU in any way. Keep in mind that even more recent versions of MS Office (since 2013) puts load on the GPU to speed up rendering as well as some audio players.


An orange outline indicates object mode selection for the armature. You want the armature in pose mode (blue select outline) before you start weight painting so that you can select and move the bones while you paint.

Select the armature and go into pose mode.
Select the mesh and go into weight paint mode.

When weight painting, the action mouse button setting makes a difference.

 LMB will weight paint

If you are using Select with Right -

 RMB will select a bone

If you are using Select with Left -

⎈ Ctrl LMB will select a bone

While weight painting and the armature is in pose mode, G/S/R works with the active bone, not the object being painted.


you have not connected the Texture Coordinate to the Displacement Texture, would guess that causes the problem. Also switching the Image Texture Node from "sRGB" to "non-color data" give more accurate results


Problems with GPU rendering in Ubuntu on a Macbook Pro Intel Iris 6100

Unfortunately Intel's integrated GPUs don't fulfill the requirements for GPU rendering in Blender 2.8x. You would either need a:

Nvidia graphics card with CUDA compute capability 3.0 or higher
AMD graphics card from GCN second generation or later

  CUDA

  CUDA requires graphics cards with compute capability 3.0 and higher. To make sure your GPU is supported, see the list of Nvidia graphics cards with the compute capabilities and supported graphics cards. CUDA GPU rendering is supported on Windows, macOS, and Linux.

  AMD

  OpenCL is supported for GPU rendering with AMD graphics cards. Blender supports graphics cards with GCN generation 2 and above. To make sure your GPU is supported, see the list of GCN generations with the GCN generation and supported graphics cards.

  AMD OpenCL GPU rendering is supported on Windows and Linux, but not on macOS.


The simplest method to find keyframes in the Graph Editor or Dope Sheet is to disable the "Show Only Selected" filter. With that off keyframes on all non hidden objects will show, not just the selected object(s) which is the default.
The button right next to it (dashed square icon) is the Show Hidden filter. With that off (as shown in the image below) all keyframes will display.


As Mr Zak and Brenticus pointed out in the comments:

Those arrows are always aligned to the global coordinate system and are rendered from the point of view of the viewport camera:


How can i export a cylinder from blender to unity3d to be like a unity3d cylinder?

I can't say for certain from the information you've provided, but I suspect that the first cylinder, with the holes through both sides, was created by doing a knife project through the cylinder in wireframe mode, and cut the hole through both sides of the cylinder. I suspect that the other cylinders you made, you used knife project in a different mode, and that the knife project tool only cut the closest surface. To get the hole in the back side, you could either switch to wireframe shading before you do the knife cut, or do the knife cut twice, one for each side. The reason you can see through the wall on the opposite side of your cylinder is because you're looking through the back side of the far wall.

By default, Blender does not use double sided faces, a consequence of which is that in most circumstances, when you look from the backside of a Blender plane, it will not be visible. There are a number of ways that you can address this issue. One is to create extra geometry, so that your cylinder is "double walled", another is to enable double sided faces, as detailed in the answer to this question on Blender stack exchange.


This can be solved by inserting a Mapping node and setting the Scale values as desired.


Inventor imported object has different reflective properties than blender made one

Okay so I'm dumb, the Inventor glass broke on a thickness function and only the rounded lip was defined, with a correct thickness the glass reflects and refracts as expected! Blender treats a glass plane differently than a glass mesh in terms of reflective properties, hence the issue of differing appearances!


How to get the color of a particle with Python?

As far as I know there is no simple way to get the color of a particle. In the case you have an object with UV's and 1 image texture defining the color you should be able to get the color.

The following example is for BI and assumes you only have 1 UV map, the texture is in slot 1 and there is only 1 particle system and 1 modifier (the modifier for the particle system) on the object.

import bpy
from mathutils import Color

def get_pixel_color(img, x, y):
    # Get the 'index' of the pixel. Pixels are stored as one big list of
    # numbers. The R, G, B and A value for every pixel, one after the other.
    pixel_i = y * img.size[0] * 4 + x * 4
    pixel_col = img.pixels[pixel_i:pixel_i + 4]
    # Return the color as Color object, which doesn't have alpha info.
    return Color((pixel_col[:-1]))

def get_uv_color(img, uv):
    # Get the x and y coordinates of the pixel for the given uv coordinate.
    pixel_x = int(uv.x * img.size[0])
    pixel_y = int(uv.y * img.size[1])
    uv_col = get_pixel_color(img, pixel_x, pixel_y)
    return uv_col

def get_particle_color(p, ps, ps_mod):
    p_uv = ps.uv_on_emitter(ps_mod, p)
    p_mat = bpy.data.materials[ps.settings.material_slot]
    p_mat_tex = p_mat.texture_slots[0].texture
    p_mat_img = p_mat_tex.image
    p_col = get_uv_color(p_mat_img, p_uv)
    return p_col

obj = bpy.context.object       # The object with the particle system
ps = obj.particle_systems[0]   # The particle system you need to query
ps_mod = obj.modifiers[0]      # The modifier for the particle system
p = ps.particles[0]            # The first particle

p_col = get_particle_color(p, ps, ps_mod)

For Cycles (assuming that there is only 1 Image Texture node in the Shading Node Tree) you should change the get_particle_color function. The statement for p_mat_tex should be changed to:

p_mat_tex = p_mat.node_tree.nodes['Image Texture']


Importing camera tracking data from external sources

How about the following function? You would just need to get your ascii data to match the XYZ/RXRYRZ.

import bpy
import bpy.types
import time
from mathutils import *

# positions and rotates an object (globally) and create a keyframe
# at the given frame#
# Change the rotation mode to your liking.
def animate_object( obj, x, y, z, rx, ry, rz, frame_number ):
    obj.location = Vector((x,y,z))
    obj.rotation_mode = 'XYZ'
    obj.rotation_euler = Euler((rx,ry,rz))
    obj.keyframe_insert(data_path="location", frame=frame_number)
    obj.keyframe_insert(data_path="rotation_euler", frame=frame_number)

ex:

cam_positions = (
    ( 1.56,3.13,-1.83, -4.20,-2.58,-3.48 ),
    ( 1.74,3.19,-1.63, -4.40,-1.95,-3.67 ),
    #...
    ( 2.01,3.03,-1.57, -4.32,-1.61,-3.64 )
)

cam = bpy.data.objects["Camera"]

frame_number = 1
for frame_number, cp in enumerate(cam_positions):
    animate_object(cam, *cp, frame_number + 1)


Find a corresponding point on a transformed Mesh

For triangles you can use mathutils.geometry.barycentric_transform:

import mathutils.geometry
pd = mathutils.geometry.barycentric_transform(p, v1, v2, v3, d1, d2, d3)

To test if the point is inside a triangle you can use mathutils.geometry.intersect_point_tri.


I had the same issue on all 3 of my machines.
This is the solution I found; all you have to do is delete the config file located at C:\Users should be called (.sheepit.config). Then it should launch normally.


Just got to the Keymap Tab, that is where the settings are now.


Advice on how to model this piece of a chair?

Maybe you should simply extrude a plane along the shape, in front, left and top view, then extrude inwards, then bevel, etc...


Blender won't open, only flashes command prompt

If you have a second graphics card, try to update that as well as update your firmware. Instead of going to windows and searching for an update there, go to Windows Drivers and manually update everything you can.


Preview rendering the current view from the viewport?

Blender 2.8+
This is now accomplished with the fully interactive Rendered viewport shading mode.
Click the rightmost sphere icon in the top right of the 3D viewport to enter Rendered mode, which displays the scene (more or less) exactly as it will be rendered:

Alternatively, hit Z and select the Rendered mode from the Shading pie menu:

To remove any overlays, outlines, or gizmos covering up parts of the rendered view, turn off Gizmos and Overlays by clicking the icons beside the dropdown arrows left of the shading mode:

Blender 2.69 – 2.79
Use the key combination ShiftZ to switch to Rendered mode. Hit the key combination again to return to Solid mode. Alternatively, switch the Viewport Shading mode between the white sphere (Solid) and pink sphere (Rendered) in the 3D Viewport header/footer bar.

This lacks viewport overlays, however, so it will be difficult to work in fully rendered mode. Nonetheless, it is possible to pivot the view and look around.

Blender 2.68 and Earlier
Switch the Viewport Shading mode between Solid and Rendered as described in the section above. However, the ShiftZ shortcut is not bound by default in earlier versions of the software. But you can bind it yourself:
Open the User Preferences (File > User Preferences...) and switch to the Input tab. From the expandable list, locate 3D View and expand it, then also expand 3D View (Global) immediately below.

Scroll to the bottom of the expanded list and you will find an Add New button.

Click Add New, then expand the new entry entitled "none".

With the new, unbound keymap entry expanded:

Replace none with wm.context_toggle_enum which should lead to three new text fields appearing beneath.
Bind the Z key by clicking the key field (contains the default A) and press Z.
Check the Shift keyboard modifier checkbox.
Fill the new three values, starting with space_data.viewport_shade for Context Attribute.
Next, enter SOLID for Value 1 (beneath Context Attribute).
Finally, enter RENDERED for Value 2 (right of Context Attribute).

To save these changes for future use, click Save User Settings at the footer of the User Preferences window which will update the startup file with the currently open one that now includes the added keymap. Make sure this is a clean startup file.


Why does my mesh enlarge upon applying automatic weights?

There are several issues here.

Unapplied scales

When rigging, every object's scale should be applied. if you select your rig and check its scale, you can see it isn't even nor equal to 1:

To correct that, select the object, hit CtrlA and select Apply Scale.

Wrong Parenting

Rigged models should be parented to your Rig object and the Armature modifiers should target that same Rig object. You have parented you model to a wrong object. And that wrong object also happens to have transforms on it, which influences your model, so we'll have to take care of that too.

Remove the armature modifier of your model.
With your model selected, hit AltP → Clear Parent and Keep Transforms.
Apply your model's scale.
Select your rigged model, then your Rig object, and hit CtrlP → Set parent to Armature Deform with Automatic Weights.

Now everything should be fine. You'll just have to work out those weights.


Inverse Kinematics leg/arm rig bending the wrong way

I am 4 years too late, but still.
You need to create another bone outside the leg and it should not be parented to any other. Now open the bone constraints(where you created the inverse kinematics) and you will see "Pole Target", select your Armature and below will appear "Bone" and select the bone you created.
After that the bones will only bend in the direction of this pole target bone, so you should put it in front of the model.


What units does the cycles SSS scattering radius use?

There is a BlenderArtists thread on this subject. In it it is said:

About Scale: 1 blender unit = 1 meter. (I use metric system) don't know how works with Imperial, never tested.
Scale is actually multiplied by the Radius then, so if you use Scale = 1.0 and Radius = 0.1, 0.1, 0.1 is equal to Scale = 0.1 Radius = 1.0,1.0,1.0
When using colors it's the same but calcs are not that quick, at least for me.
Let's say we want the monkey to sub-surface scatter a bit of red like my example above. Setting Scale = 0.1 And Radius = .5, .05, .05 (RGB!) will give the same output as Scale = 1.0 and Radius = .05, .005, .005 (as you see I divided by 10 the Radius values to compensate the Scale being 10 time bigger)

The radius appears to be derived from both the scale of the object and the radius values. Applying the scale should change results, and is a good way to test this theory.


I was completely black on my computer.But selecting one of the objects and going into local view and then out seems to fix the issue.I think it's a bug.


Try using a displace modifier with a procedural texture:

Add a cube (⇧ ShiftA)
Add a subsurf modifier (⎈ Ctrl5) (where 5 refers to the number of viewport subdivisions.)
Add a displace modifier, and click New texture:

Then click the properties icon on the far right of the button to go to the texture settings for the new texture.
Set the type to Voronoi:

I found that using Distance squared gives more rounded looking puffs, which might be what you want.
Back in the modifiers panel, reduce the strength of the displace modifier to some negative value so that the puffs are convex instead of concave.

Optionally model the cube into a shape approximately how you want the wool to be, and add a second displace modifier for larger displacements (you can use object coordinates and a scaled empty to make the texture larger):

Result:


Have you seen Property Definitions? IntVectorProperty have other parameters to define, among which no "size"!

You can create a Custom property from PropertyGroup:

class CustomProperty(bpy.types.PropertyGroup):
    name: bpy.props.StringProperty(name="Name", default="Some name")
    description: bpy.props.StringProperty(name="Description", default="Frequencies")
    size: bpy.props.IntProperty(name="Size", default=2)

To update any property just assign some value:

bpy.types.Scene.a = 3


How do I detect if a specific keyboard button has been released in BGE python

You check for bge.logic.KX_INPUT_JUST_RELEASED


Detect when auto keying is turned on/off via Python?

You can use a message bus subscription to do that.

The following script will call a function when 'use_keyframe_insert_auto' is changing from the UI.

The principle is:

Obtain a subscription link using path_resolve on the scene
Then use this link to subscribe in order to fire a function when the value changes

Here is the code (look at the console to see the printed results):

import bpy

#The callback when use_keyframe_insert_auto changed
def a_callback(scene):
    print( scene, "use_keyframe_insert_auto changed" )

def subscribe_to_scene(scene):

    #Get a rna subscription link from the scene
    subscribe_to = scene.path_resolve("tool_settings.use_keyframe_insert_auto", False)

    #Effectively subscribe to the rna path from the scene
    bpy.msgbus.subscribe_rna(
        key=subscribe_to,
        owner=scene,
        args=(scene,),
        notify=a_callback,
    )

subscribe_to_scene(bpy.context.scene)


Switch Pivot Point from Individual Origins to Median Point, don't ask me why in that case it made the scale and snap bug though.


how can I get pure white color in blender?

There are three main issues that prevent your stone from getting a brighter color:

Dim lighting: your light sources aren't strong enough to produce white colors, even from white materials. The best example here is the floor, which has a simple 0.8 gray material. If the floor is gray, there's no reason your stone will be white. Increase light intensity to fix this.
The wave texture produces some pretty dark bands, that will darken the entire material in any blending mode where dark colors darken the overall result (including the Overlay mode you're using). I put the wave texture through a color ramp to map the black into mid-light gray to fix this.
Even after moderating the wave texture, it helps to also reduce its influence in the following overlay node by toning down the Factor to 0.25.
And lastly, I added an RGB curves node to lighten the overall color as well.

On a general note, it's worth mentioning that you won't get a "pure white" color with so many bumps and overlayed textures that darken the overall result (Voronoi, Wave). But that's fine, because unless we're talking about a very smooth surface - like our floor here (instead of an ordinary natural stone), a perfectly white color will be unrealistic.


I can't seem to reset the position of the control bone

There's a conflict: the controller controls the foot through several bones parentage, the foot controls the leg through the leg's IK, and the leg controls the controllers through a Limit Distance, so you need to delete the Limit Distance. If it was meant to attach the controller to the leg it is not the right way, I don't know any way to do it but there might be a way though... I personally prefer easier bone setup but I'm not a pro.


I hope I understand what you need.
If you are doing square indentations you will usually need to use a grid topology to not get artefacts with the subdivision modifier. This will keep the edge flow align to the edges instead of creating a circular edge flow. Add at least one extra support edge to get flat surfaces around the indentation.

(You should also use smooth faces so you wont get small facetts.)


Something like this

addon = bpy.context.user_preferences.addons.get(addon_name)
if addon:
    prefs = addon.preferences
    print(prefs['num'])


Smoke trail Effect particles not showing up in image render

After playing around a bit I found that the AutoKeying button will do the job. Simply parent your emitter to your model, then parent your model to an empty, press the AutoKeying button and start draging your model around using your empty. This thechnique may have limitations depending on what you want to do, so any other comments or answers are welcome.


to reverse the hand direction set the sensitivity to -1.0 :

also pay attention to the local/global axis you are using ,the camera was turning in the right direction because you used the local axis while the hand local axis are not in the right orientation


I can't see my background image in the 3D view

#Background images will only be displayed in:

Camera Prespective view (Numpad 0)

Any of the preset Orthographic views:

Front/Back (Numpad 1 or Crl Numpad 1)

Right /Left (Numpad 3 or Crl Numpad 3)

Top/Bottom (Numpad 7 or Crl Numpad 7)

You're in perspective mode instead of orthographic mode  (see the upper left hand corner, it has the abbreviation "persp"). Toggle into orthographic view by pressing numpad 5.
Also, the view information at the top left shows you are in right view, and the background image settings at bottom right show that the image is set to appear only in left view. For that, hit CTRLnumpad 3 to go to left view or change the background image axis to Right to make the background image appear in right view.
The image used must be in a format that Blender supports. For example, a .gif file will not be displayed.


I need help with Path Constraint & Rigging

Make sure your Path object and your Armature have the same orientation before pressing Ctrl + P and selecting Follow Path. Your NurbsPath.001 is rotated by 90° on the Z axis.
In your blend file, select the NurbsPath.001 and press Ctrl + A and select Rotation. It will fix the rotation issue.


Cycles Render Engine on but still no Surface Option

You will find the surface option in the "world" tab.


Cutting out logo shape (using Boolean, or knife on a 2D plane) ruins edges when shaded smooth

After applying smooth you should tick the auto smooth checkbox in the object data panel.

And maybe tinker with the angle if necessary.


Check that the armature modifier is active on your mesh.
check that the armature name is correct, check that there are vertex groups that match your bone names and check that the bones in your rig are set to deform.  Or it may be because your armature in object mode is moved off center and rotated.


Fluid Simulation with Forces Blender 2.9. How do I get useful results?

Probably not.
Blender is for SFX. Stuff that's good enough to fool the human eye, but not precise enough for simulations that give scientific results.

Explosions can be due to obstacles that aren't solid enough. Make them really thick, thick enough to go out through the domain, if you can.

Droplets going through stuff might be fixed by increasing the particle size and/or increasing the time steps (so that the simulation can detect the collision even if the droplet is travelling very fast)

I don't know what to do about the last one, it just happens and you have to compensate for it.
You'll probably just have to forget about precision. For visualization and proof of concept it's probably fine (even if you have to tweak it and cheat here and there), but there's no true precision.


You have probably setup your materials for the Blender Render which are not compatible with Cycles. That means you'll have to (re-)create the materials for Cycles.


Python: vertex normal according to World

I've run into this problem many times, I always have to search for the answer. But I use the tranpose of the inverse of the world_matrix to get the world normal.

https://computergraphics.stackexchange.com/questions/1502/why-is-the-transposed-inverse-of-the-model-view-matrix-used-to-transform-the-nor

mx_inv = C.object.matrix_world.inverted()
mx_norm = mx_inv.transposed().to_3x3()

world_no = mx_norm * C.object.data.vertices[0].normal


Since 2.8 it's named Merge by Distance.

Mesh > Clean Up > Merge by Distance
Shortcut: Alt + M > By Distance


Due to the dynamic nature of that operation you need a Python controller to apply that impulse/force.

I suggest to use a ray sensor. It provides the object hit, the position where it was hit and the direction you measured.
Usage

Place this snippet in a python file force.py

import bge
import mathutils

PROPERTY_STRENGTH = "strength"
DEFAULT_STRENGTH = 1.0

def applyAtHit():
    if not allSensorsPositive():
        return
    sensor = getDetectionSensor()
    affectedObject = sensor.hitObject
    hitPosition = sensor.hitPosition

    strength = getOwner().get(PROPERTY_STRENGTH, DEFAULT_STRENGTH)

    direction = mathutils.Vector(sensor.rayDirection).normalized()
    force = direction * strength

    affectedObject.applyImpulse(hitPosition, force)

def getDetectionSensor():
    return bge.logic.getCurrentController().sensors[0]

def getOwner():
    return bge.logic.getCurrentController().owner

def allSensorsPositive():
    for sensor in bge.logic.getCurrentController().sensors:
        if not sensor.positive:
            return False
    return True

Apply following logic to the measuring object:

Setup a ray sensor (must be the first one) with a distance that covers the range you want to have, [True Level Triggering] is not needed as you want a single impulse
Setup a Python controller in module mode with Module: force.applyAtHit
Ensure detected objects are physics objects (dynamic, rigid body, softbody)

How does it work?

When all sensors are positive and any of the sensors triggers the controller the function applyFromHere() will be executed. Each run will apply exactly one force or no force at all.
That is the reason for [True Level Triggering] disabled. This prevents subsequent execution unless you "activate" again. Means you need all sensors positive and at least one to trigger.

The ray sensor checks for an hit. The Python controller calculates the

the affected object
the direction towards the affected object
the strength of the force

With that the Python controller applies the individual force to the affected object. Here we use applyImpulse(). This does not just affects the linear motion, it results in change of the torque too.

I hope it helps


How to duplicate an object and rename the original to have the "_high" suffix and the duplicate the "_low" suffix

For question code above put act_obj = context.active_object after the duplicate operator call.  Then it will be the duplicate of obj. if only one object is selected and active.
However also at play is the duplicate operator duplicates all selected objects. Try running with more than a single object selected.
You are only renaming the original obj if and when it is act_obj
However possibly much easier to use API calls and keep a ref to the newly created object and rename both based on original base name.
import bpy

context = bpy.context

for ob in context.selected_objects:
    name = ob.name
    copy = ob.copy()
    copy.data = copy.data.copy() # linked = False
    ob.name = f"{name}_high"
    copy.name = f"{name}_low"
    ob.location.x += 5
    context.collection.objects.link(copy)