Different frames make rigid bodies act differently So I am writing a small script to set initial speeds for objects in the Rigid Body system. It is really bare bones right now, but it essentially sets a keyframe for the selected object on the frame number of a variable called start_frame.

The goal of the script is so I can choose a start frame and a speed, and the object will have all of the correct keyframes set so it can just launch off with an initial speed. The problem is that depending on what frame I set start_frame to be, the cube reacts differently.

Here is what I mean:

If start_frame equals 1, the object is launched and then falls off the plane.

If start_frame equals any number greater than 1, the object doesn't travel as far.

From what I understand, there shouldn't be any difference because the distance between the start and end keyframes is always the same.

I looked at the graph editor but the only change I am seeing between the two conditions is being shifted, just like it should be.

I am so confused why changing the frame from 1 to anything above 1 would give such a different result.

So is there anything special about frame 1?
And if so, how can I avoid this problem in my script?

The problem is the animation starts at frame_start and ends at frame_end and since end_frame = start_frame + speed the duration is always the same but shifted.
To achieve the desired effect the animation duration should get longer when frame_start gets larger, one way to do it is to set the first keyframe at 0.
so the first key frame shouldn't be the start_frame :

    # First keyframe
    scene.frame_current = 0
    bpy.ops.anim.keyframe_insert(type='Location')
    print(start_location)

if you want to start at frame_start and end at frame_end and get different results you have to change the frame_end expression :

frame_end = speed + 2*frame_start

this way the delay the start the longer the duration is , giving the cube lower speed ( less momentum )  and it will travel shorter


I can't append node groups For some reason the node groups i try to append do not show up. what am i doing wrong? I linked a short clip of the group im trying to append and my problem.
https://www.youtube.com/watch?v=WRgEJPOx2Ec&feature=youtu.be

You have appended the node group to the .blend file, however you are in the compositing editor, whereas your group is a material node group.

To switch to the Material Editor simply select an object in the scene, click this icon at the bottom of the window (see below), try adding it again and you should see your node group in the expected place (you might need to select the Use nodes checkbox again).


How to make anime/toon like procedural wind texture, blender 2.9 eevee How to make procedural wind texture in an anime/toon style. Which can be put mainly on planes.
Like these, but the creators didn't say how they did it.

You can create a curve, give it extrusion in the Properties panel > Object Data > Geometry > Extrude, then give it a material that is a mix between a Transparent and an Emission node with a Texture > Musgrave Texture as factor (in Eevee don't forget to choose Alpha Blend in the material settings). In the Mapping node, stretch the texture on one axis:

You can blur the borders with a second ColorRamp:

Then use the Location values to move the streaks:

As for the ring around the ball, create it with a Geomtery > Bevel > Object instead of an Extrude, and choose a oval or a rectangle as Object. And for the material, from what I see in your animation, enable both the Show Backface and the Backface Culling options in the material settings to get the right transparency:


Particle Hair Not Assuming Emitter Color I'm experimenting with hair particles to simulate feathers on a bird. I have painted a texture to designate the color of the individual strands. The texture has a simple node setup with UV texture coordinates, vector mapping, an image texture and diffuse shader. The texture is indicated in the render tab of the particle system. However, the hair particles are not taking on this color. The head and chest should have a green and purple color, but instead the body is a uniform grey. Am I missing something?

Having other maps such as normal map will cause all hair to show as black, I duplicate the material and disconnect every texture input other than base color, then assign it as the active material in the particle system to fix this.
I had a similar issue pop up which is unrelated. The hairs had desynchronized from the source mesh and were projecting the UV map in a really bad way. It was using the texture area for the characters mouth and tongue along a good stretch of the back, freaky!
If this happens, Click 'Disconnect Hair' near the top of the particle system setting panel, then after it has changed to 'Connect Hair' click the button again.
Another issue I've had is displaced or outright exploding hair caused by changes to the source mesh, this includes many modifiers and subdivision. Checking 'Use Modifier Stack' did not work for me here, strangely.


Can I bake glass BSDF? I'm learning how to use Blender. I'd like to make models for game engines and also for sharing with other people.

Context: I want to make a bottle with a glass material, and a label on the bottle (and the label is a bit round).

I found the best glass effect is the glass BSDF in cycles, but to be able to export my model as .obj or .fbx I have to bake everything on a texture (from what I know so far).

Problem: When I bake the glass, export my model and then reimport to other software, the baked glass is not transparent. Of course I can set the transparency in that other 3D software for that "glass area", but that'll effect all other objects on that baked image. For example, I dont want the "round label" to be transparent.

Question: Is it possible to bake the glass area of the bottle with transparency? I've found the only way to export a model of a bottle with a rounded label would be through cycles, though I don't want to adjust the faces to fit the label that is rounded. So is this possible? Is there a better way to do what I want to do?

Refraction and reflection effects can't really be baked into an object, at least no dynamically like you seem to want. Actually they can be baked, but is that what you really want?

Baking is generally used to simulate effects like shadows, lighting, small details like bumps or roughness through displacement maps, bump maps, normal maps, etc., the kind of thing that is either too complex or too expensive, or somehow unwanted or not needed to calculate in real time.

Baking means it will be pre-calculated and become static, so it wont react when you change the viewpoint. So if you bake things like transparency or refraction or reflections they will become static, and seem to be "printed" or "painted" onto the surface of the object and that is generally not desired.

See here What does "Baking" mean?

If you want to provide your model for other people to use should not worry too much about materials, and only deliver the correct geometry and textures needed so that they can create the materials themselves suited for whatever rendering engine or game engine they will be using.

For your bottle and label just provide the correct label texture and a geometry with correct UV coordinates to use them. The transparency should then be created by the user in their destination software


How can I make better UVs for my photogrammetry models? Smart UV project is making some pretty terrible UVs for my photogrammetry scans:

Lots and lots of tiny islands.

I already tried changing the smart UV project settings.  I need margin at .1 so I can edit sections in Photoshop later.  Changing area weight doesn't do anything.

Flat sections of mesh translate to UV great.

But anything slightly complicated and BAM, tiny UV islands everywhere.

Surely there is a better way to do this.  Any ideas?  Thank you very much for your help.

If you have issues editing your UV layout in an external program, you might keep a small margin and increase the exported UV layout's resolution instead:

Also, if your output render engine supports multiple UV sets for one object, you might just make several UV unwraps which each gives more pixels to different areas. You could have one UV Map for the house for example, and one for the other parts.

For rendering in Cycles, you will just have to use the Input → UV Map in order to specify which UV Map to use in your shader. You can have one node for each UV Map you need:

Or play it the "Divide and Rule" way:
Just split your mesh into different smaller objects and give them what they need in UVs and textures.
In order to split: go in edit mode, select the mesh you want to split, then hit P → Separate Selection. What you selected will be sent into a new object. Repeat as much as you need.


How to mix Vertex Colours with character's Diffuse Texture? (Blender Internal) I'm currently on my wit's end trying to find an answer to this that works for me, but every question and answer are referring to something different from my situation, and with most being Cycles-only across a variety of forums. I've a model here (extracted from a videogame) which already contains default vertex colours in its data.

^ Viewport view

The problem is, even with enabling Vertex Colour Paint in the Material tab, the colours don't mix with her diffuse textures, most notably her hair colour. Observe:

And here is her hair in the texture, which was already grey-scale since the vertex colours do the job in their game.

Finally a screenshot of how the woman originally looks like.

Here's my nodes I have already set up on the model. (Edit: My setup has nothing to do with the vertex colouring issue at hand, it's just a lighting setup)

Note that I've tried enabling Vertex Colour Paint on this character even in a new .blend with no nodes or anything else, but she remains the same. I also am not looking to accomplish this on Cycles; only Internal, like the title says.

This question in particular came close to the situation I'm in, but when they get to the actual answer, it's a dead end. How can I "bake" the vertex colours into the diffuse texture? I actually tried to search up on this as well, but everything is either cycles-related or just does not answer what I meant. I also don't intend on using a game engine, my main goal is to render this model with its default vertex colours applied onto the diffuse textures and save the render as an image.

If you have any questions on the steps let me know


Automatically Scale and Export All Files in Directory? Is there a way to go through every .blend file in a directory and do the following with each:

Open the file.
Move the cursor to 0,0,0
Enter edit mode (there is only 1 object in each file)
Select all vertices
Apply a scale by a constant across all 3 axis
Exit edit mode
Save the file
Export to .fbx

If someone can point me to the recursing/opening/saving and exporting portions of this I can likely get the rest - just not sure how to go about it because I've only made very small hacks to the spacebar hotkey plugin (like adding arc intersection calculators/snap-tos) and am not really familiar with Blender scripting beyond inserting the occasional menu item into a preexisting plugin.

Hoping for something quick and dirty.

Using only Python and Blender
For clarity and security, I don't overwrite the original files.
This script will check for the scene files (which contain the object). Then, for each file separately, it will append all objects, scale them and save itself as the scaled file version. After that export the .fbx and finally on completion save itself as the original conversion script file.
With the script saved in the file convert.blend. My folder structure looks like this at the start.

Opening the file convert.blend and pressing Run Script the scaled scene files and fbx files will be created.
import bpy, os
import bmesh
import math
import mathutils

def clear_objects():
    for obj in bpy.data.objects:
        bpy.context.scene.objects.unlink(obj)
        obj.user_clear()
        bpy.data.objects.remove(obj)
    for me in bpy.data.meshes:
        me.user_clear()
        bpy.data.meshes.remove(me)

def save_scaled_objects(dir_source, dir_target, dir_fbx, scale = 1):
    dir_root = bpy.path.abspath("//")
    path_origin = bpy.data.filepath

    dir_source = os.path.join(dir_root, dir_source)
    dir_target = os.path.join(dir_root, dir_target)
    dir_fbx = os.path.join(dir_root, dir_fbx)

    files = os.listdir(dir_source)

    scn = bpy.context.scene

    for f in files:
        input_filepath = os.path.join(dir_source, f)
        output_filepath = os.path.join(dir_target, f)
        output_fbx = os.path.join(dir_fbx, os.path.splitext(f)[0] + ".fbx")

        print("DIR",output_fbx)
        # append object data block
        with bpy.data.libraries.load(input_filepath, link=False) as (data_from, data_to):
            data_to.objects = data_from.objects
        #link all objects to current scene
        for obj in data_to.objects:
            if obj is not None:
                scn.objects.link(obj)
                #scale the objects data
                scale = 0.1
                for v in obj.data.vertices:
                    v.co *= scale
        print(output_filepath)
        # saves the file
        bpy.ops.wm.save_mainfile(filepath=output_filepath)
        #export to fbx
        bpy.ops.export_scene.fbx(filepath = output_fbx)

        clear_objects()
    # on completion of all saves, restore the original path of this file
    bpy.ops.wm.save_mainfile(filepath=path_origin)

dir_source = "scn_files"
dir_target = "scn_files_scaled"
dir_fbx = "fbx_export"
save_scaled_objects(dir_source, dir_target, dir_fbx, scale = 0.1)

Linking and Appending
Remove Objects
Base Path, Path Joining, Splitext


Wrapping a 2D image on a 3D sphere I have a simple code that creates a sphere.

bpy.ops.mesh.primitive_ico_sphere_add(location=(0.0, 0.0, 0.0))

and I would like to add an image of the Sun and 'wrapped' around the sphere made. Is this possible?

Yeah, Unwrap the uv sphere(it's already done but just in case), add the texture of the sun in the image editor(just drag it in), plug colour to an emission shader, mix it with the bsdf as well, increase value at what ever size you like, turn on bloom if you are on eevee.


How to get face normal from a mesh loop? I'm iterating through the loops of my mesh and would like to get the face it is attached to (so I can get the face's normal).  I'm looking specifically for the face normal, not the vertex or loop normals.  The docs provide information for finding the associated vertex, but I can't find anything to get the face index.  Is there a way to do this?
    for obj in ctx.selected_objects:
        if obj.type == 'MESH':
            mesh = obj.data
            for l in mesh.loops:
                v = mesh.vertices[l.vertex_index]
                #looking for face here

Loop the faces
Suggest this is easier to loop the faces and get the loop indices.
for f in mesh.polygons:
    print(f.index, f.loop_indices)

default cube
0 range(0, 4)
1 range(4, 8)
2 range(8, 12)
3 range(12, 16)
4 range(16, 20)
5 range(20, 24)


Real time color changing of an object I want to develop a human model where the segments of human body lets say human lower arm changes its color.
I am new to blender any kind of help would be much appreciated.

you just need to assign a separate material to that body part, then animate that material color over time, with keyframes

Here is an example of how to do this: the monkey head has a ase blue color, but I assigned a different (grey) material to one ear.

Then at frame 1 I inserted a key frame for the color (press I over the diffuse grey slot), and at frame 80 I changed the color to red, and inserted another keyframe.

That's it.


How can I create 360° Videos? First I don't want make an animation. I just want to understand how I can make a Scene and wander around in it with 360°.

I mean this as an example.

In blender cycles, change your camera settings to these

Then render and use KolorEyes to run your 360 video: http://www.kolor.com/kolor-eyes/

Hope this helped.


2D Line Strokes Turn Thin; Don't Know how to Change Them Back While trying to make a 2D animation in blender 2.8, I have come across an issue that I'm not sure how to change. I am very new to the program, so I don't know how it can be fixed.

I had been using the default "Draw Ink" tool to make my lines. One time I opened the project and every single stroke I made turned thin- along with the lines on every previous frame.

This is what the lines are supposed to look like.

This is how they actually appear; only the onion layers have what I drew.

I haven't been using any modifiers and all blender settings have been reset to the factory settings. Nothing seems off about the original brush as well. Is there any way to change the lines back to the way they were before?

In the grease pencils properties, you have two properties that affect the stroke thickness.

These are applied to the selected layer, to have each stroke shown a different size at the same time, means each stroke is on a different layer.


How do I animate an image in the Video Sequence Editor to match the underlying video? I'm new to the program. In the video editor, is there an easy way to move an added image smoothly in one direction that it will be synchronous with the base video?

I tried splitting the image into many little pieces but it should be easier than that.

EDIT: So I want the picture follow the original movement and stay like a mask.

What you want to do is quite easy to do in blender with motion tracking.
Open a new project as VFX File > New > VFX
In the Clip Editor (not the Video Sequence Editor) open the video you want to use.

Add a tracker on the face or whatever feature you want to track.
Track the element.

In the solve tab of the tools window, in the geometry section use "Link empty to track".
And in the scene setup select "Set as Background" so that you can see the image as background on the camera view.
Import the image as plane, set it where you need.
You can then use that empty as parent to any object on the 3d workspace.

To render, composite the rendered image on top of the movie clip (the image used in the 3D viewport is for reference only).

Or you can opt to create 4 trackers and creata a "Plane Track" that can be used to deform an image as if follows the placement of the trackers.
Read:
How would I attach text to a tracked point on video clip
Is it possible to take a mask clip and 'connect' it to a specific point on a moving object?
Overlaying an image to cover a face in a video?


Proper deformation of body mesh? i've model a body rigg it and weight paint it and now that i want to make poses with it i realize that i have a few problems, but the real problem is that when two part of the body clash together one goes on the top of the other and don't stretch like a real body and i was wondering if there is anything i can do to improve that? What should i be looking for? colliders? Because so far it's imposible to do poses

Standard skinning approaches (e.g. the armature modifier) do not support collision behavior.

Self collision handling can be a bit tricky and certainly computationally intensive.

In blender you have two real options:

using physics simulations (cloth or softbody) which are difficult to
get right and slow to run (using a corrective smooth modifier after
the simulation can help a bit with looks though). They also don't
handle volume properly.
Manually creating corrective shapes for the intersecting poses (and potentially adding appropriate drivers if you are animating). This can be quite time consuming if you have a lot of poses you care about and want to drive everything for animation.


Material doesnt come up in texture list for UV I'm using nodes to texture my pistol a bit, however, I've colored each material seperatly so I can assign specific parts to the pistol, however, none of them show up in the list of materials, I'm worried because I'm doing this for a game, and I'm scared that they will not show up.

You can't use the uv editor for assigning materials.  All you need to do is go into edit mode, select what you want to color, click the material you want to assign it, and click assign.


Offset curve bevel extrusion Learning Blender. Can anyone tell me is there a way how to offset this piece.

What I have here is path which is set on bevel extrusion with start and end values changed with circle curve as a sweep object. Now I would like to know how to offset this piece along the path. Analog to this would be probably After Effects Trim Path.

When you hover over the Bevel Start and End Properties you can press I to create a keyframe on them. The keyframes can be offset (move G) and duplicated in the graph editor.

You could continuously Duplicate and Move the keyframes for both of the start and end values, or animate them independently.


How do I parent an object to a vertex which is modified by a curve? I'm currently modelling a watch. The strap is curved by a curve modifier. I want to parent the buckle of the strap to the end of the strap so I can change the Bezier curve of the strap and have the buckle move and rotate with it.

the strap (left) with the curve modifier applied:

the strap in edit mode:

I tried parenting the buckle to a vertex of the strap but it doesn't seem to take the curve modifier into account.

I hope someone can help me with this issue.

MVMT_chrono.blend download link

Modifiers do affect Vertex parents. (Its in my answer on parenting). So what you are trying to do is completely possible.

Let me start with the setup. I have a curve object (black curved line top left in the image below). The selected object is the one that will be deformed by the curve, lets call it the "bendy bit." The object on the right is the thing I will vertex parent to the bendy bit.

With that out of the way, select the "thing" in your case the buckle, then select the strap (or in my case the bendy bit) that way the bendy bit is the active object. Now Tab into edit mode.

This is how it will look when in edit mode, with another object selected.

Now select three vertices. But not just any three, they have to be near the end with the thing (duh), but they also can not be in a straight line.
See if you select three vertices in a line, that line does not hold enough information to properly convey the orientation to the child object.

So with three vertices selected, like in the image above, press CtrlP > Make Vertex Parent.

Now when you turn on the display of the curve modifier you will see the thing on the end follows properly.  You edit the curve, and everything will update live.

Here is a gif of the whole process, just because people live videos:


Find out if Mesh Operator (bpy.ops.mesh...) was cancelled or not via python I am using bpy.ops.mesh.extrude_region_move to extrude a selected region along their averaged normal. I don't set the value-component of TRANSFORM_OT_translate, so the operator is modal. The return-value of the operator is not {'CANCELLED'} or {'FINISHED'} it's {'RUNNING_MODAL'}.
The user can accept the extrusion with enter or cancel it via esc (normal behaviour of that operator).

My blender-addon needs to know if the user has accepted a extrusion or if it was cancelled (The addon stores the face-ids of a selected region. If the user now extrudes the face ids are recreated. Therefore I need to update the stored face-ids. But I need to know 'when').

Any ideas how I can find out if the extrude_region_move was cancelled/not cancelled?

Thanks!

This looks at the TRANSFORM_OT_translate.value Vector as shown in the 'INFO' reports.  If the operator was cancelled it returns (0, 0, 0) else has a length.

import bpy

wm = bpy.context.window_manager

print("TESTing Extrude Op")
for op in wm.operators:
    if op.bl_idname == 'MESH_OT_extrude_region_move':  #name == 'Extrude Region and Move'
        print(op.name, "Found")
        v = op.macros['TRANSFORM_OT_translate'].properties.value
        if v.length:
            print("operator used")
        else:
            print("operator canceled")


Environment mapping controls missing in Texture context tab - Blender 2.8 It seems Environment mapping controls are missing in the Texture context tab in Blender 2.8. Any reason for this?

Thanks
JK

The environment map can be set in the World tab or alternatively by using nodes in the Shader Editor.

To setup the environment map as depicted below, perform the following steps in the World tab on the default world configuration which only consists of a Background node connected to the World Output.

Click on the circular button for Color and select Environment Texture from the dropdown
Click on Vector and select Mapping
Click on the circular button behind Vector in Mapping and select Generated


How to create text on a semi-transparent overlay with Cycles? I have Blender 2.73a and I am working on a movie project. I want to make HUD-like text since there are no voiceovers. I want the text to be like it is in The Legend of Zelda where it displays the text since that has no voiceovers also. It will be something like this
(source: deviantart.net)  .

You can create a text object and a plane that is translucent/transparent.

Add a copy rotation constraint using the camera as target (so that both objects are parallel to the camera).

Material for the plane:

Material for the text:

If you have a lot of titles you might need to create the titles as a separate scene and render each one as a PNG file to composite later.


Cast 2d image shadow on to my 3d object Is it even posible? Hello everyone! I have placed a background image to my project and also a plane with an image as its material.

As you may see in the picture I attached (it is not in camera view), that the tree that you see next to a path I modeled has a the shadow I need to project (somehow) to my object.

Thank you so much for your time.

A footpath (pink) plane is laid over the background image to hide and replace the original path at the left side of the water.

Two shadow-shaped masks are then laid over that which cut through it to reveal the background image's shadows once more.

The masks are not fully transparent so they can be tinted pink.  The shadows then appear to be on the added pathway when in fact, they're on grey concrete.

Because the masks are to be selective, in that they cut through the added path-plane but don't affect the background image-plane, we render in OpenGL.  (See footnote)

If the masks do cut through the background, parent both to the background plane, then unparent them immediately. (use "keep transform" option in both cases)

See here - for more about this form of masking

-=============-

Footnotes -

An alternative would be to texture the masks with the background image and use the UV editor to scale and align the respective shadows.

-==============-

Another, is to use Blender's internal masking which will cut a hole through everything and require post processing.

Render the holed image (or lossless video) in .png format with an alpha layer. (the RGBA button at extreme right in the rendering properties' output tab)

Note that the output still includes the background image-plane.

Save the project and exit. Fire up Blender again and use the 'Video Sequence Editor' this time.

Lay the holed image/video over a COPY of the background image which is tinted pink to match the overlaid path.

The holed image will only allow the tinted shadows through.

-===========-

The post processing could also be performed using the Compositor.

All up, the easiest by far was to render in OpenGL and use it's masking, do it all in one go.

enter code here


Is it possible to repeat a geometry pattern along the lenght of a curve? i was adding some deformation to a curve i made on Blender with Zbrush, but the curve is too long, so i wanted to know if its possible to export (just the part) of the curve that i deformed, and then somehow repeat that geometry like a pattern (with geomety, not texture) alongside the Blender curve. (i can export the .obj of the already deformed part of the curve, then import it into blender)

You need to use and array, then curve modifier. You start by adding the array, making it the length you wan't. Then add the curve modifier, and select the curve as the object


How to smooth the appearance of a specified subset of faces without topology changes with a script? This is a magnetic pole piece for an electric motor (there will be 12 in a circle). The bottom face is a hyperbola, the the top is a circle, and the sides are straight.

I would like the top and bottom curved surfaces to appear smooth when rendering in Cycles, but not create any visible rounding of the corners, or affect the large flat faces, so that even when illuminated sideways the top and bottom surfaces would appear smoothly curving.

I'll be doing a lot more to them algorithmically, so I need something that doesn't modify the topology of the mesh by adding/deleting edges, faces, vertices, etc.

edit: Since I'm generating the mesh algorithmically, I will know the indices of the faces that need to be smoothed. If I can target them for smoothing specifically, this would be the best way for me.

Below is a simplified script that shows how I generate them (I've skipped the math, happy to include it if it helps).

xpts_sharp = [ 7.196,  5.606,  4.009,  2.407, 0.803, -0.803, -2.407,
              -4.009, -5.606, -7.196, -5.08, -4.298, -3.517, -2.735,
              -1.954, -1.172, -0.391,  0.391, 1.172,  1.954,  2.735,
               3.517,  4.298,  5.08 ]

ypts_sharp = [ 45.434, 45.657, 45.825, 45.937, 45.993, 45.993, 45.937,
               45.825, 45.657, 45.434, 32.072, 31.832, 31.605, 31.398,
               31.219, 31.084, 31.01,  31.01,  31.084, 31.219, 31.398,
               31.605, 31.832, 32.072 ]

import bpy
import numpy as np

xpts = np.array(xpts_sharp)
ypts = np.array(ypts_sharp)
zpts = np.array([-50.0, 50.0])
scale = 0.1

xptss, yptss, zptss = scale*xpts, scale*ypts, scale*zpts
nxy, nz = len(xptss), len(zptss)

verts = []
for zpt in zptss:
    zapt  = zpt + np.zeros_like(xptss)
    vertz = list(zip(xptss, zapt, yptss))
    verts += vertz
nverts = len(verts)

faces = []
for iz in range(nz-1):
    for ixy in range(nxy):
        v1 = (iz+0)*nxy + (ixy+0)%nxy
        v2 = (iz+0)*nxy + (ixy+1)%nxy
        v3 = (iz+1)*nxy + (ixy+1)%nxy
        v4 = (iz+1)*nxy + (ixy+0)%nxy
        faces.append((v1, v2, v3, v4)[::-1])
face = list(range(nxy))
faces.append(face)
face = list(range(nverts-nxy, nverts))[::-1]
faces.append(face)

if 1 == 1:
    name = "pole_piece"

    me = bpy.data.meshes.new(name)
    ob = bpy.data.objects.new(name, me)

    bpy.context.scene.objects.link(ob)

    me.from_pydata(verts, [], faces)

    bpy.data.objects[name].select = False
    bpy.data.objects[name].select = True

Set your object to smooth shading.

Add an edge split modifier. Apply it if you wish.

Depending on the angle setting in the edge split modifier, surfaces will appear smooth shaded preserving sharp edges.

Internally, the modifier splits edges based on the angle of the adjacent faces.

This will add the edge split modifier and "apply" it. The topology will change.

if 1 == 1:
    name = "pole_piece"

    me = bpy.data.meshes.new(name)
    ob = bpy.data.objects.new(name, me)

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

    me.from_pydata(verts, [], faces)

    bpy.data.objects[name].select = False
    bpy.data.objects[name].select = True

    for p in ob.data.polygons:
        p.use_smooth = True
    mod = ob.modifiers.new("edge", type='EDGE_SPLIT')
    ob.data = ob.to_mesh(scene, True, 'PREVIEW')
    ob.modifiers.remove(mod)


How to Combine two Normal Maps? I made a high poly model and then baked its textures onto a low poly model.
Now I want to give another normal map's details to the model. How can this be done?

I adapted the UDN Blending method from this article, for cycles nodes.

The simple formula is:
"Normal map 1" (nm1) the large distortion, "Normal map 2" (nm2) the small details.
nm1.x + nm2.x = X, nm1.y + nm2.y = Y, nm1.z = Z

Split the normal maps in the their three separate channels with a Separate XYZ node.
Add the X channel of both normal maps together with a Math node set to Add
Add the Y channel of both normal maps together with a Math node set to Add
Make the new vector with a Combine XYZ node. Plug the component X into the X input of the Combine XYZ node, and the component Y into the Y. Take the Z from the first normal map.
Add a Vector Math node set to Normalize. Take the output from the Combine XYZ node and plug it into the first slot of the Normalize node.
Add a Normal Map node. Take the output from the Normalize node and plug it into the color slot of the Normal Map node.

Another option is to use Multiply instead of Add for combining the X and Y channels. The bonus with this is, I have found no need for the Normalize node. The resulting normal map will look different from the method above.


How to render the whole of image? How can I fix my problem?

my blend file: https://drive.google.com/file/d/0ByScwSCTIaUGUVBzUTAzejdleDg/edit?usp=sharing

I would not do this in the compositor at all. You are giving yourself a lot of extra work.

The easiest solution is to place the camera at the correct place, giving you exactly the layout you want.

Like this:

The border around the render region turns red.

Open the options panel to the right (N). Use the normal view control keyboard commands to rotate and pan the camera until you are satisfied.


Can normal map smooth hard edges? For example i have 2 models. One low poly and second high poly. Low poly has hard edges. High poly after subdivision mod will have smooth edges at same position where lowpoly has hard edges. After baking "high on low" in Substance painter can normal map (from high poly) smooth those hard edges on lowpoly ? Or u need to smooth those hard edges on low poly manually with bevel, smooth shading etc. Can normal map do fake smoothing ? Or normal map can only add fake bump ?

Yes, a normal map can do "fake smoothing". A normal map changes how light interacts with the surface, specifically the angle at which it reflect. So a normal map can make light reflect off a hard edge as if it was a rounded edge.

The limit is that it will not change the silhouette of your object. So, if you look at a hard edge from the side, you can still tell it's a hard edge with a normal map. However, if you can model and texture well, these problems can often be mostly dealt with.

Just in case you don't know as well, Blender can 'bake' normals from high poly to low poly objects as well, in case that would help you.


Documentation on Materials and Textures Simple question... Why is there no documentation on how to properly use materials and textures? The only documentation I can find is for loading texture images in the UV editor. The Blender search engine doesn't come up with anything useful at all when you search for "materials" or "textures". This is something that should have its own section in the docs.

First, I think the answer to your question is "Why no documentation?" is simple. It is free open source software and the developers didn't yet have to time to do it in more details. However, if you have some knowledge in the subject you can contribute:

https://www.blender.org/manual/about/contribute/index.html

If everyone will do so, the documentation soon will be very extensive.

Second, it is true, that the documentation on this topics is not detailed enough. I also didn't necessarily have problems with particular materials, but wanted first to know what materials I can create, how I should do it and what different parameters mean. I found many answers in the article below. It has good explanations and many pictures. Hope it will be useful for you too.

http://www.blenderguru.com/articles/cycles-shader-encyclopedia/


How to exclude hair particles from freestyle render? Is there a way to prevent freestyle from rendering lines on hair particles?

I still want to render lines on the mesh which has the particle system.

Use compositing. Enable strand render for the hair. Create one render layer with Freestyle enabled and Strand disabled. A second layer with Solid and Freestyle disabled and Strand enabled. That will give you one layer with freestyle lines around the object and another with just hair.

Composite together with an alpha over.


How to update/overwrite an existing rig with Rigify I have rigged a character with Rigify. I would like to adjust some bone positions (edit the armature). The documentation states I can adjust the metarig and then again press Generate Rig. The default action should overwrite the existing rig. I have also tried enabling 'Advanced Options' and selecting the current rig (https://en.blender.org/index.php/Extensions:2.6/Py/Scripts/Rigging/Rigify#Advanced_Rig_Generation)

However, 'Generate Rig' gives the following error:

Incorrect armature for type 'utils'
Can't add new bone 'root' outside of edit mode.

I only found 1 answer, stating to rename the existing 'rig'. But this will generate a new rig, unparented to the mesh and with no weight painting.

How can I adjust/overwrite an existing rig?

Thanks in advance!

Looks like I've found my own answer right after posting this question :)

I had moved my metarig to another layer and when pressing 'Generate Rig' the layer with the rig itself was not active. So make sure to have both the metarig and the rig active when pressing 'Generate Rig'.

'Generate rig' now correctly overwrites my existing rig, keeping the parenting and skinning intact. Only my pose position gets reset, but that's not a problem.


How to disable this weird see through I am doing retopology, messing up with settings, but now when I try to edit legs or ear, and I can't see where the mesh is so it become confusing. Backface culling is on, object viewport is set to In front

I think what you are saying is that while you edit the "green" lower density mesh, you want to see the vertices or more detail of the higher detail (horse) mesh?   So you want to control how individual objects are displayed, instead of everything the the viewport (selected and unselected)
You can select the higher detail mesh, an use the Viewport display options to show different details of that mesh before selecting the lower detail mesh and Edit Mode.  "Display As" select: "Wire" may be what you want.  Or you can change Vewport Display options on your lower detail mesh to see through it at times.
Here I have selected that higher detail (sphere) and added "WireFrame":


Textures Showing Up In Rendered View But Not Texture View I was following Blender Guru's tutorial on UV unwrapping.
However, I have a problem: my textures will show in render view mode but not texture view. (Right at the bottom next to the select menu that says Object Mode). In texture view, it looks just like solid view. Also can anyone find a way to keep the whole object lit and visible?

With the object selected :

From the Properties panel open the Object tab and then from the Display menu change the Max Draw Type from Solid to Textured.

Now you should be able to see your texture when the viewport shading is set to Texture.


Volumetric error when rendering mantaflow fire simulation so I've been working on honing my fire-simulation skills in the Cycles renderer using Mantaflow as I'm set to be using it soon for a project; but while working on looks and so on, I noticed a render error that I've not come across before.
If you look at the fire itself, the edges have these "blocky" outlines, its most noticeable along the leftmost border of the fire, here is appears as dark blocky borders to the fire, but its also visible at the back end of the fire, where the block is brighter than the backdrop

The error like stated above, is very obvious and basically ruins the whole thing: it might be worth mentioning that the fire simulation is emitted via a particle system and not mesh.
Is anyone able to tell me how I would go about removing these blocky almost "bounding-box"-like artifacts.

"I can see your problem there., Are there any actual cuboids there that might be set to a volumetric material, and are appearing in the render?" - ZargulTheWizard
Yes, thats it! It seems my volumetric node for the fire wasnt set to an absolute black, making the actual cuboids themselves only semi-transparent.


Difference between push/pull and shrink/fatten? What's the difference between the push/pull and shrink/fatten tools in the transform menu in edit mode?

I noticed that they both do the same thing, so what's the point of making separate options?

They don't actually do the same things.

Shrink/Fatten scales the selected elements along their normals.

I've enabled face normals display in the above gif so that you can see that each face is moving along it's normal (blue lines).
Push/Pull moves the selected elements farther/closer to the pivot point.

Here you can see that the faces are not moving along their normals, but instead are moving away from/closer to the pivot point. In this case, the pivot is the median location of the selected elements, which happens to be the world center in this particular example.


How to create a object/mesh that can change colour during an animation The required effects is that of a changing color light bulb. It would preferably be an emission mesh.

You can do this by giving your object a material, and in that material, using a Value Node with #frame as a value, connected to the hue modulation of a Hue/Saturation/Value Node.
When you enter #frame into the value node, it will change color and change to 1.0 - this is normal, it will change along with your frame when you animate. I find the default rate of change too fast, so I usually multiply it by some low value to slow it down. When you connect it to the HSV Node, you must also input SOME color (default white will not work). I used an RGB Input node so I can easily change the "base color". Connect this to an emission shader, and then to the material output. When you press "play" the color will change with the frame number.


having problems using Texture Paint and Clone Stencil I'm having problems with texture painting on the latest version (2.90.1).
I add a cube mesh, open an image and pack it, link the image to the cube in materials tab by selecting "Image Texture" as "Base Color", then I go to Texture Paint tab and start painting. You can see what happens in the pictures.

Picture 1: A simple cube with a texture.

Picture 2: Painting on the image viewer. Nothing shows up on the 3D
view.

Picture 3: With same settings, painting on the 3D view. It appears
correctly on the image viewer but strangely on the 3D view.

Also I can't make the stencil in stamp tool work.
I click the "Clone" tool, then I go to "Texture Properties" tab and click "New", in the same tab under Image>Settings I choose an image. Then from the header of "Clone" tool, I click "Texture" and select the texture that I just created. And set the "Mapping" to "Stencil". This makes the stencil appear on both 3D and image view and it is scalable and rotatable the way it's supposed to be; but left-clicking on it doesn't paint anything in either places.

Saving the image once solves the painting problem. Also, using the stencil in brush tool instead of clone tool seems to serve the same purpose so I'll be using that instead.


Method to align object local axis with global plane when rotating on local axis? For the cube shown I want to do a rotation on the cubes local z axis so that the cubes local x axis lies on the global xz plane.

Select the cube, Shift S > Cursor to Selected, choose 3D Cursor as current pivot point, or simply press . (the period key).
Press Numpad 1, add a plane object, press F6 then toggle Align to View, in order to make it parallel to global XZ plane.
Select the cube, then View > Align View > Align View to Active > Top (or simply press Shift Numpad 7), then add another plane object, toggle Align to View in F6 panel, as well.
Keep current View unchanged, add an empty object, toggle Align to View in F6 panel, as well. G X X to move a certain distance along its local X axis.
Add a Boolean modifier to either one of the plane, set Boolean mode to Intersect, choose another plane as the target object, in order to generate the intersection line from two planes.
Enable Snap icon on 3D View header, choose Edge as snap element, and Active as snap target, first select the cube, then select the empty by holding Shift to make it active, R Z Z, move mouse over the intersection line generated in Step 3, until it is snapped, LMB or Enter to confirm. Finally, delete these extra objects.


Render depth map to image with python script I'm trying to render an object from different views using blender. While I worked out how this can be achieved by the means of a python script, I'm stuck on my next task: I also want to dump the depthmap for every rendered image. What I've found so far is this link, so I assume that I need to somehow disable render passes to get my desired result? How would I do that through the python interface? Or is there an easier way?

Edit: I found another reference how to do this in the GUI: http://www.cs.tut.fi/kurssit/SGN-5406/vrlab2012/blender-manual.pdf. How could I automate this with a python script?

From various sources I found out how to assemble a render graph to put out the depth map (scaled to the range [0, 255]):

# Set up rendering of depth map:
bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree
links = tree.links

# clear default nodes
for n in tree.nodes:
    tree.nodes.remove(n)

# create input render layer node
rl = tree.nodes.new('CompositorNodeRLayers')

map = tree.nodes.new(type="CompositorNodeMapValue")
# Size is chosen kind of arbitrarily, try out until you're satisfied with resulting depth map.
map.size = [0.08]
map.use_min = True
map.min = [0]
map.use_max = True
map.max = [255]
links.new(rl.outputs[2], map.inputs[0])

invert = tree.nodes.new(type="CompositorNodeInvert")
links.new(map.outputs[0], invert.inputs[1])

# The viewer can come in handy for inspecting the results in the GUI
depthViewer = tree.nodes.new(type="CompositorNodeViewer")
links.new(invert.outputs[0], depthViewer.inputs[0])
# Use alpha from input.
links.new(rl.outputs[1], depthViewer.inputs[1])

The output can then be saved to a file using a File Output node:

# create a file output node and set the path
fileOutput = tree.nodes.new(type="CompositorNodeOutputFile")
fileOutput.base_path = "/my_path/"
links.new(invert.outputs[0], fileOutput.inputs[0])

Whenever a render is triggered, the depth map will be dumped into the base_path specified.


functioning of the geometry node- what does it do with the vector math mathematically cosθ|a||b| is the dot product of two vectors, but in blender what does the vector math node do both technically and intuitively?
. If possible could you also please explain the normalize, cross product and subtract operations, and how do these follow with the geometry node?

The source used for the vector math node can be found here.

For each Operation -

Add, the output Vector is the two input vectors added together. The Value output is the average of the output vector components (x+y+z)/3.
Subtract, the output Vector is input vector one(upper) minus input vector two(lower). The Value output is the average of the output vector components (x+y+z)/3.
Average, the output vector is the normalised result of the sum of both inputs. That is the vector divided by the length of the vector. The length is calculated as the square root of the dot product.
Normalize, The result vector is the normalised vector of input vector one. The result value is the length of the vector.
Dot Product, the output value is the dot product of the input vectors, that is vector one times vector two and all components added together v1.x*v2.x + v1.y*v2.y + v1.z*v2.z. The Vector output is 0,0,0.
Cross Product, the output vector is the cross product of both inputs. The Value output is the length of the result, calculated as the square root of the dot product of the output vector. The cross product is calculated as

result[0] = v1.y * v2.z - v1.z * v2.y
result[1] = v1.z * v2.x - v1.x * v2.z
result[2] = v1.x * v2.y - v1.y * v2.x


Linux, Save As Game Engine Runtime not working When I export / Save As Game Engine Runtime, I do not get an exe file. I made a file on my desktop, named it 'runtime001'. These are the only exe files and they don't do anything.

Which exporter addon did you use? If you used the 'save game as runtime' it creates an executable for the platform you are on. This is found in the File->Export->Save Game as Runtime

If you use the 'Game Engine Publishing', you also need to download blender for the different OS's, and point the addon at the filepath for blender. This is a fair bit more complex, and the options are found in the Render Panel.

I'm going to assume you're using the 'save game as runtime'
If you are running windows, it will create an exe, if you are on linux it will create a linux executable - which does not have a file extension.
In a quick test I did, exporting it from my system worked find, although it took several seconds.

One thing to check is that there is a located blenderplayer file. When you chose 'save game as runtime,' you see this on the left:

Check that there is a file at the location in the circled box.

Also check what folder you're exporting it too. Neither of the folders shown in the question have the exported executable.


Retopology - move vertex + snap to model I am attempting to retopo a face using bsurface, this is working ok for now but i would like to know if it is possible to ajust the position of the vertecies while it is snaped to the face the shrinkwrap modifier seems to be working only for bsurface and for now i can only move vertecies freely which is not good, i would like them to stick to the head no matter where i move them.

Any ideas ?

I suppose you don't see your vertex sticking to the surface because of the modifier setting: you should activate Display Modifier in Viewport and Display Modifier in Edit Mode so that you can see the original mesh and its modified version, and put a bit of Offset if you want to see it out of its Target surface.

Also, I'm not sure about the Snap option, as you already use the Shrinkwrap modifier. I guess you should either use the Snap or the Shrinkwrap method. If you use the Snap option, select Face as Snap Element and activate the other Snap options.


Set origin to vertex in edit mode? I want to make the origin in edit mode at a vertex, but it keeps setting it to the last clicked-on face :( So now in edit mode the pivot is on the last clicked-on face ;(

In Edit mode, make sure you enable vertex selection.

Click the vertex to which you want to set the origin.

While still in Edit Mode, Mesh > Snap > Cursor to Selected
If all you want to do is change the pivot point, set it to 3D cursor.

If you actually want to change the origin.

Tab to Object mode, then Object > Transform > Origin to 3D Cursor.

Since Blender 2.8 it's Object > Set Origin > Origin to 3D Cursor.


How to emit particles evenly within single particle setting How to emit particles evenly from verts / faces within single particle setting?

For example, for the default cube, I want to emit 80 particles in 10 frames, in other words, each vertex should emit 1 particle together per frame. (Note that this is a simple case to show what I'm talking about, not a specific one)

Blender Internal Render with Particle Info Node for Material Nodes

Image below. 16 Layers of Particles Systems modified with a Python Script.
Vertices of a Cube.

Image Below.  An image meant to be more readable with the particles placed in a plane.  Pulsed and Batch alternating.  Spiral motion is a typical consequence of the Particle System and very little effort of the Python Script.

Image Below.  Particles with Turbulence.  One Force example.

Image Below.

Technique

In the image above are 4 particle systems.  You may use 10.  Each Emitter particle system is copied via the Keystroke Shift+D. User preferences allows particle system to be duplicated with fresh unique copies.  See user preferences Editing/Duplicate Data and enable Particle System Duplication.  Of course an object can have multiple particles systems.  The script assumes 1 per object for no particularly sound reason.

If you can copy a mesh easily you can copy a mesh with a particle system easily.
The N particles system has the [Start] and [End Value] set to different numeric value M. M >= 0 and  M < N in the simplest case.  See Script below.
Copying Emitters and Manual modification of the values takes (log N + N ) steps.
Example is Verts emission.  Faces emission is an easy switch.
Clearly if you wanted ((vertex or face) * large number) particles then a script could modify the particle system [Start] and [End] values. (frame_start, frame_end)
The Emitters are in a group for selection convenience.

Script

Use at your own risk. Standard Disclaimer. Please test and improve.
Select the group of Particle System emitters before running the script.

...

import bpy
import datetime
import math

def delay_particles():
    print("Delay Particles")
    print(datetime.datetime.today())
    print(datetime.datetime.now())

    so = bpy.context.selected_objects
    limit = (len(so))
    n = 0
    for x in range(0,limit):
        so[x].particle_systems[0].settings.frame_start = n
        so[x].particle_systems[0].settings.frame_end = n
        n = n + 1

delay_particles()


2.8 Viewport and Render Preview My Viewport in Eevee looks nice and how I want it (LookDev shading).
However, the render preview looks nothing like what I have done and I don't know how to change it to look the same as lookdev.
Devlook is that thing at the top right of the 3d space with 4 buttons.

LookDev

Render preview

It is because LookDev don't care about lighting, materials,etc. It just gives the quick view of how render will look.
So first of all add a lamp to viewport by Shift+A and click Lamp>Sun, Grab it by pressing G and take it on top of your object.
Edit:
I missed out to look the rendering engine you have selected, It should be Cycles. Change it to Cycles by going to render settings and click on Rendering engine dropdown and select Cycles.

  EEVEE is not capable to show reflections and stuffs.


Weird light emitting from part of mesh So part of my wall seems to be emitting light and has an odd whitish color. I've went through and made sure I din't have an extra light or anything. I'm just not really sure what else I need to check out to solve this. Any help would be appreciated. Here are some photos of the front and the back of this.

Go to edit mode and then Press "Shift + N" It will Recalculate your Normals of the Mesh
Just Try If it Helps


Export UV Layout in proportion to object size, not UV map When I unwrap an object, the UV Map automatically expands to fit the layout size, 1024 x 1024. Is there a way to unwrap it in proportion to the object size, and not the UV layout size? I need both of the maps to be the same height in pixels when working with them in Photoshop.

This one expands horizontally:

This one expands vertically:

Which is throwing off the texture proportions in PhotoShop. I don't want to resize the image.

Edit: Here's the UV Layout with all three panels joined and unwrapped per answer.

Unwrap both meshes together. (If they are 2 separate Objects then Join them temporarily.)

When both are unwrapped to the same UV space then you will have to do a little editing to get them both aligned.


HSV system (numeric values) broken? I'm new to Blender and currently digging into the nodes system, trying to figure out what all of those nodes actually do (aside from the information one is given in various YT-tutorials).

I came across a very strange behaviour of HSV values when it comes to Separating/Adding/Combining.

It's all about Pink:

RGB: 1 0 0.212
HSV: 0.917 1 1

I ) I can set up this pink just in a diffuse shader inputting RGB and/or HSV values.

II) I also get to this pink by mixing blue and red using "Add Shader" or using "Mix RGB - Add)

Blue:

RGB: 0.000 0.000 0.214
HSV: 0.667 1.000 0.500

Red:

RGB: 1.000 0.000 0.000
HSV: 0.000 1.000 1.000

(Results are 100% conform with same Photoshop blending mode)

III) I also get to this pink by manually adding values in the RGB system:

RGB color values

R: 0 + 1 = 1
G: 0 + 0 = 0
B: 0.214 - 0.002 = 0.212

IV) BUT: Manual adding of values does not work within the HSV-System!

HSV color values

H: 0.667 + 0.250 = 0.917
S: 1 + 0 = 1
V: 0.5 + 0.5 = 1

The outcome should be the same Pink but IT IS NOT!
It's almost the same but a little darker.

Any ideas?

No! There is not a single reason, why this should work. Manually adding HSV-System values will not necessary result in the same color as different other mixing methods.

Counterexample:
Mix the turquoise colors [H=0.49,S=1,V=1] and [H=0.51,S=1,V=1] and a similar turquoise color will be the result. But if you add the values the result is red [H=1,S=1,V=1]

The reason for this behavior is purely based on the mathematics of color mixing and is not a question concerning blender.


Changing location of a walk cycle keyframe I'm facing a simple problem:
When I copy-pasted my walk cycle, the locations of the keyframe don't change so it looks like a reset.
How can I add (3.2m on the Y axes) to all the copy pasted key frame ?
I guess it's with the Graph editor but I never used it before.
Any pieces of advice would be very welcome !
Thank you,
V

So I guess you must have keyframed the armature's location itself. What you need to do is open the Graph Editor, unfold the Object Transforms tracks, select the track that you need to change (probably X or Y Location), press ShiftH to hide all the other tracks (AltH to bring them back later) and move the curve on the Graph Editor X or Y axis. It will only work if the duplicated action is a simple copy and not a linked duplication, in that case you need to click on New Action in the Dope Sheet.


Realistic metal textures So guys i'm not the greatest when it comes to metallic textures, any other textures i can do. I can easily create a silver(Natural) metallic texture, But i cannot create a Green(Painted) Metallic texture. I am currently working on this Renault and I just cant seem to find the right way to create a good texture for it. What texture should I use to create the Metallic body of the Tank and how do i achieve this or apply it to the tank, do I create my own diffuse and glossy shader with a normal map or do I use a texture and give it a normal map and a glossy map. And how would I set this all up in the Nodes correctly with glossy shaders and Bump maps.
Thanks Guys.

Metal materials are pure gloss and if you want it painted then

1-It's metal that have been painted (like it's been sprayed with paint)
which is gloss shader mixed with a paint material using a mix shader and the Factor is an image texture made to tell blender where is gloss and where is paint

2-It's like metal that is factory painted
which is gloss with an image texture

note that metal has a colored rim light

for the best realistic result look up PBR materials

I recommend blender guru's tutorial ..2 videos that explain PBR materials the second one is about accurate metal materials but you need to see the first one


.mp4 can be accessed normally outside blender but I can't make the sound work on blender vse preview or even render a video with audio Pretty much self explanatory. As you can see in the screenshot, I am using a configuration that used to work really well in the past. But now it does not work anymore with this .mp4 file that I got from Shadowplay recording. When I access the file outside of Blender, it works well, but if I insert it on Blender, it does not work the audio on VSE preview... If I render it under the setting displayed, it also will not have any audio on it.

Anyone can help me?

You will find folks giving you advice and make you jump through hoops and walk through fire just to get your video to play in blender, but the bottom line is that Blenders VSE is a very inefficient and antiquated program. Why put yourself through a poor experience when there are better, friendlier and responsive programs out there? Transcoding shouldn't be necessary in today's software and hardware. Try shutcut, DaVinci resolve free, openshot, media composer first, premiere, etc etc. A search in your favorite search engine for free or cheap video editing sotware will give you plenty of choices. Be happy, stay creative. Don't be bogged down by the tools. Make the tools work for you, not the other way around. Blenders is great for creating 3d, but not a great video editor.


iteratively key shape keys only on active object I need to keyframe shape keys and have a script that's nicely working -
import bpy

frames = bpy.context.scene.frame_end + 1

for frame in range(frames):
    for shapekey in bpy.data.shape_keys:
        for i, keyblock in enumerate(shapekey.key_blocks):
            if keyblock.name != 'Basis':
               curr = i - 1
               if curr != frame:
                   keyblock.value = 0
                   keyblock.keyframe_insert("value", frame=frame)
               else:
                   keyblock.value = 1
                   keyblock.keyframe_insert("value", frame=frame)

The issue is, I need it to work only on the active object, not every object in the scene.
Anyone any pointers?

Will this do?
import bpy

frames = bpy.context.scene.frame_end + 1

# For the active object...
ob = bpy.context.active_object
me = ob.data

# Remove ['Basis'] from a shallow copy of *ob's* shape-keys list.
kblocks = dict(me.shape_keys.key_blocks)
del kblocks['Basis']

# Keyframe shapekeys' values to 1 for the frame corresponding
# to their position in remaining list, 0 for other frames
for f in range(frames):
    for i, kb in enumerate(kblocks):
        kblocks[kb].value = (f == i)
        kblocks[kb].keyframe_insert("value", frame=f)

This may get burned down by a proper Pythonista.. :)


How to enlarge dynamic paint cache size (Blender 2.8)? I try to create 900-frame animation using dynamic paint in Blender 2.8.

When I try to play animation or bake all dynamics calculations are made until frame #250 and that's all.

Does anyone know where the cache size settings for dynamic paint are (if there are any)?

Or maybe there is some workaround to calculate and bake all the animation?

In the Dynamic paint controls you have Frame Start and End.


Proportional editing excluding certain faces I'm trying to scale part of a mesh using proportional editing, but certain faces aren't being affected despite them being well within the radius of the proportional editing circle.

Has anyone else encountered this? Am I forgetting something or doing something silly here?

For brevity, here's the .blend

In this case one can either edit the left or right side of the objects location. This is because X Mirror is active.

Disable it by pressing T to open the tools panel. Go to the options tab and uncheck X-Mirror.

For further reference, also make sure you're the "Apply shape in edit mode" option of shapekeys as that could change edit mode behaviour as well and you have chosen the correct proportional editing mode.


when I move an object it permanently moving in 1.0000 increments when I move an object it's snapping every 1.0000 increments without me holding anything just move it.
unlike when you move it smooth.
unlike normal when you open the software

can you please tell me how to fix it

sorry for any spelling mistakes

Welcome to Blender stack Exchange!

That's because of an option called 'Snap During Transform'. It's a little magnet icon in the toolbar at the bottom of the 3D view (in Blender 2.79b and earlier) or at the top center of the 3D view (Blender 2.80 and later). The keyboard shortcut is Shift+_Tab. I find those keys very easy to accidentally bump because of the other shortcuts Blender uses. Disable it and you should be good to go.


Keeping emitted particles with emitter animation I am trying to animate a beer glass moving across a table. I am using a particle emitter for the bubbles. My problem is that the emitted particles don't move with the beer but just continue to rise where they were emitted from thereby moving outside of the glass. Is there a way to have the generated particles move with the emitter and keep the same xy position of the emitter but still moving upward in z?

Thanks for the answers, but you may have misunderstood my question. You can't use hair because hair doesn't continually emit and what I needed was for particles to emit while moving with their emitter. Like when you pick up your beer glass, the bubbles stay in the beer instead of in the place where they formed.

I did figure out how to make it work and the answer is using keyed particles. with Keyed particles, you can create chains of emitters whose particles flow from emitter to emitter. With this you can create some really cool effects too.
https://www.blender.org/manual/physics/particles/physics/keyed.html

To use,first set up your primary emitter. This will be the emitter whose particles are visible. Then duplicate that emitter and move it to where you want your particles to travel to. Then back on the first emitter, change the physics to "Keyed". then under that is a list where you can set keys. Click the button twice to add two keys. Select the second key and then select the second emitter on the object target below the keys.

Now set your second emitter to "Keyed" and particles to not render and run the simulation. Your particles now travel from emitter to emitter regardless of gravity. Parent the second emitter to the first and now they travel together. I found the answer on this youtube video https://www.youtube.com/watch?v=6tRKFUEhEgw


How can I make drops of fluid hang from a surface? The images below display the kind of effect that I'm looking for. A combination of surface tension and intermolecular forces make drops of water hang on things (though they may occasionally fall off depending on the amount of fluid in the drop). I can't seem to figure out how to do this with the fluid simulator though--every time I try, the fluid just beads off like the object is made of a hydrophobic material; as soon as it reaches the side of the obstacle, it falls, rather than curving to the surface like my diagram.

I've already tried using various combinations of No Slip, Partial Slip, and Free Slip on both the obstacle and the domain but I can't find the right combination.

Apply a strength 5 force field to both the fluid and obstacle. The fluid should probably have a low partial slip, and free flip on the object. I would be more precise if I had more time, but here's my result (see below pic). You can see particles starting to stick, then fall off near the very bottom.

How it works: Water molecules have a charge of attraction to each other (and solid objects) causing surface tension, which holds a drop together. applying the force field tries to imitate that effect.


how to apply a boolean modifier to a collection how to apply a boolean modifier to a collection instead an objects?

I think the best way to achieve something like what you are trying to do, is using the Bool Tool add-on.
Activate the Bool Tool add-on (ships with Belender) by checking its box in the Preferences window.
In the 3D Viewport press N, click the Edit tab and click on Bool Tool to extend the menu, if it isn't already.
Then right click the collection in the Outliner window and choose Select Objects.
In the 3D Viewport Shift select the target object (so the collection objects and the target object are selected), and click on the desired boolean operation in the Bool Tool menu. For instance: Brush Boolen Difference.


.hdr versus .jpg environment maps I use cgskies HDRI.
It comes  with .jpg and .hdr.

.hdr has better lighting quality than .jpg but I my GPU does not support .hdr rendering.

I used math multiply node for strength of world map in .jpg HDRI but it doesn't have the same effect as real .hdr has.

How can I modify .jpg HDRI so that resembles the real .hdr ?

You can't.

To understand why, it would require dissecting a typical JPEG transfer curve.

The TL;DR is that a typical display referred photograph encoded to sRGB can only encode approximately two and a bit stops over middle grey, where middle grey is mapped to 0.18. 0.18+0.18 is one stop to 0.36, 0.36+0.36 is two stops to 0.72, and 0.72+0.72 is 1.44 for three stops, which the display linear linearization maxes out at 1.0.

Any particular photograph represents well over this dynamic range of course. As a result, the method the camera or software uses to encode the additional stops back into the scene is using a unique and custom transfer curve. Once in the display referred encoded domain however, that original transfer characteristic is lost and unrecoverable.

You can guess, estimate, etc., but it will never be even remotely accurate due to the number of stops compressed into the image and the limited dynamic range of an sRGB transfer curve.

Scene referred imagery is vastly different than display referred, and as such, it is very much a one-way street in terms of data flows.

In addition to this, .HDR is a less reliable storage format for scene referred imagery as compared to .EXR. Avoid it when possible.


My camera won't zoom after it reach certain distance of zoom My camera will not let me zoom in anymore after I zoom in on a huge obj. I know it is probably designed that way so we can zoom in anymore after certain amount,but I want to know if I can break that. I really need to zoom in more.

Try hitting "5" on you numeric keypad. It will switch to orthographic view mode. If that is not what you want try reading the thread iKlsR mentioned.


Changing user preferences via console? The machine that I'm currently using is an extremely slow netbook. Whenever I go to change user preferences in Blender, it stalls out. What I need to do is activate the "emulate 3 button mouse" checkbox. Is there a way to do this via console/script?

Got it.

bpy.context.user_preferences.inputs.use_mouse_emulate_3_button = True

It also says on the wiki that The Blender API can modify user preferences, keymaps and themes


How to control reflection of environment color on materials In a scene I have an asphalt material made using a Principled BSDF node whose color, roughness and normal values are generated using noise and voronoi textures. World uses an environment texture with a HDR photo of an exterior scene. The problem is that the asphalt material reflects the color of the HDR image, making it blue. Is it possible to make the material reflect only illumination values of the world, without the color values, so there would be no coloring of the asphalt?

The problem could be dealt with by assigning a material or object index to the object causing problems and adjusting colors in compositing, but I'm making quick renderings without compositing.

In the World material, use the Light Path node to give 2 different colors to the direct light and the reflected light

In this example I use a purple tint from an RGB node, but you can replace it with your texture


How to apply normal-, gloss-, occlusion-, specularity- and displacement map on one cycles material? I try to apply all these textures to one material in cycles.
These are all my textures:

My attempt (no idea at all how occlusion map works)

It can't be said exactly as it depends on the setup/program they were baked out of in the first place. But in general:

Color: Diffuse Node Color

Normal: Diffuse and Gloss Normal input. Put into Normal node first if you want control of it.

Displace: Bump node, then Diffuse and Gloss Normal input. When you also have a normal map, plug the normal map into the Bump node's normal input. It can also go in the material output Displacement socket. This is necessary if trying to use True Displacement. But generally not needed.

Gloss: This is either the Glossy Node's color or Roughness. If it is the roughness, the color should be pure white.

Spec: This is the mix fac between Diffuse and Gloss. It can be combined with Fresnel for added realism (the details for how to do this vary.) Note that in some cases, Gloss and Spec are reversed.

Occlusion: This can mean several things, so it also varies. It could be Roughness, or it could be multiplied over Diffuse and Gloss color, or it could be a mix fac between Diffuse and black AO node, or a color for AO with an unknown mix fac with Diffuse. Or it could not be needed at all due to Cycles having global illumination. AO is generally for faking some aspects of ambient light in game engines that don't actually have real indirect lighting.

If you can give more info on where the maps came from, or share the whole file, then we can narrow it down more for this specific case.


Change Orientation of Bones Hello Blender Community,

I have rigged a robot-arm and now I want to import the Rotations for the Animation with a python script.
However The Normals of the Bones aren't convenient for the Animation and I can't correct them with "roll". Is there any way to exchange the y-Axis with the x-Axis/z-Axis of the Normals of the Bone?

You can see the Axes in the Picture:

While in the edit mode, select the bones and press "W" on your keyboard, you will get options


Make objects invisible when they go through shadow catcher? I have a plane as the ground, and I am animating a character to walk across the plane. The plane is a shadow catcher, because I'm doing VFX and I want to add shadows to the ground in the video, to make it more realistic. When the characters food slightly goes through the shadow catcher, it makes a dark spot where the foot goes through the plane. I'd like everything that goes through the shadow catcher to be invisible, so when the bottoms of the feet slightly go through the plane, there won't be any shadow issues. (See Attached Photos) If anyone can help, I'd appreciate it!

If it is a plane...you can use this very simple basic setup: (thanks to vklidu for the modified version with more charm)

result:
https://youtu.be/TEEF467A4E0


plane/3d object depth of field problem I have a 3d frog and a plane with an image of a foot.

but despite both being equidistant to the camera, foot is out of focus except for where it is in front of froggy.
If you look at the image, you can see what I mean, especially near his right eye.
Changing the focus distance doesn't help, I dont want to change the depth of field.
It seems to me that there is something untoward happenign, because the foot is obviously 'in focus' but only when there is frog behind it.
further clarification: its not specifically where it intersects with frog, as his right shoulder is further back than the eye. the plane is in front of the shoulder, not touching

If you want deeper focus you need a higher number for the f-stop.
Or you can render the foreground image and deal with the background and it's sharpness through compositing.
How to blur background image.?
How to Blur a Video Background in blender?
An alternative would be to work at a larger scale, so that the model won't be as close to the camera, and the focus won't be as critical.
Depth of Field F-stop not doing anything?
A different solution also is to work with a much smaller sensor, so that you work with even smaller lens size to achieve the same Field of View, and gain a bit of depth of field.
How do I set focus range?


Rotating, Moving or Placing Procedural Texture on an Object I have modelled an object with procedural material.
I wish that the texture could either be rotated, moved or placed anywhere in the x-y-z axis or, the surface of it.

This is how far I've gone with the model.

I've made some nodes for the texture. And, have 2 Musgrave texture nodes for the object.
I would like to fill the empty or plain surface with the same texture. By either rotating it along the z axis, move it along x or y axis. Or, place it anywhere on the surface along either axis.
What kind of nodes should I do to be able to have control over the texture placement on the surface?

Thanks in advance.

Here I have Sphere with two textures, one red and one blue.

The Blue texture coordinates are defined by the the Sphere default generated vector input. The Red coordinates are defined by Object. The object is an Empty.

Now when I rotate the Empty you can see the Red texture following the rotation exactly.

I hope that helps.


Opening a Sphere Mesh I'm planning an animation, and one of the creatures is going to basically have a mouth. It'll be roughly spherical, but... unlike most of the ones you are thinking of, I want the opening to 'bend open' the sphere.

Okay, I'm not sure that's how I'd describe it, but... think Pac-man, then think THIS:

That 'thing/eldritch horror' is known as Chuxtoepose. It's from this game and I want to make that magnificent jaw by cutting into a UV Sphere. Is this doable, and how?

Thanks, Nefer

Create a sphere, move the pivot point to the point where you want the mouth to open.

Duplicate. On one sphere delete the top half. On the other delete the lower half.

Animate both objects by rotating them in opposite directions.

Optionally create a cycle by extrapolating the keyframes in the curve editor (Channel->Extrapolate->Make cyclic).

Add an empty and parent both hemispheres to it.

To move the object just move the empty.


Align text on the inside of a circle I'm trying to create a round object similar to a coin, where there are two text strings, one above the head - referred to here as the top text - and the other below the head - referred to as the bottom text (take an American quarter for example). Both the top text and the bottom text are right side up when the head is positioned properly, so they are both easy to read without rotating the coin.

Assuming that both text objects are aligned along a circle (follow a circle in Blender parlance), the top text must have the bottom of its characters toward the center of the circle, while the bottom text must have the top of its characters toward the center of the circle.

I can create and center easily the top text, by telling the text object to follow the circle and then rotating around the z axis depending on the length of the text. But I can't figure out how to create the bottom text. Without any other processing, round text rotated to the bottom will be upside down. I tried to turn the original text either upside down or right-to-left before rotating around the z axis, but after the final rotation I obtain the same result - the text is upside down and right-to-left.

I can't figure out a way to create this text that is right side up and has the top of its characters pointing to the center of the guiding circle. Has anyone done something like this? Is there maybe another way to do it?
(Note: the title line is slightly misleading but I used it for brevity - I don't necessarily care to have the bottom text inside the guiding circle, it can be on the outside as long as it is right side up and can be read naturally, just like the bottom text on an American quarter.)

This has probably been solved a long time ago. But I just encountered this problem now and stumbled on the answer somehow.
If you want text to appear on the inside of the circle, you have to enter Edit mode and transform the bezier curve 180 deg along the x axis.


Changing primitive properties retrospectively - options not visible below the tool panel When adding a circle I can see the 'Add circle' panel below the tool bar, but once I do something else it disappears. How do I get this back? How can I change the number vertices on an existing circle for instance? It appears that you have to do this immediately after adding the primitive, otherwise you're scuppered?

Creation is special.  Some options you are see are valid at creation time only.  That is standard Blender behavior. The options panel will disappear as you move on to the next mode or task.  If you created a with sphere 32 rings and then in [edit mode] removed many faces ... it is difficult to understand what it would mean to change the rings to 7.

It is difficult to get a creation panel behavior that is acceptable to a large consensus after some object has been potentially modified.


Bending objects along a curve I do not know English, so I will use a translator.
how can you curve the mesh at angles?
That is, there is a curve, and there is a cube, you need to bend it along the curve but that it is bent along this curve.

yandex translate

You can use the curve modifier, just make sure that your model has sufficient geometry.  If you select your model, go to the modifiers tab, and select the curve and deformations axis, then it will deform your model on the curve that you selected.


Smoke won't generate in 3d View. Or at all I've been working on my ink drop tutorial and i've noticed the 3D view won't produce any smoke effects after baking. i'm in cycles render as instructed. Animation is on internal. I'm running on Mac OSX 10.9. Blender version 2.77

Where the smoke is supposed to be is just the outlining box both in 3d view and in render.

What am I missing? Is it my video card (Nvidia)? My mac book laptop supports 64-bit. It's OSX 10.9. I'm really out of ideas here.

So I figured out the answer. Apparently there's an add-on check point for generating smoke that needs to be turned on. Once I did that now I see smoke in my renders.


Cutting out logo shape (using Boolean, or knife on a 2D plane) ruins edges when shaded smooth Hy, sorry if there is simmilar question as mine, I tried to find answer but couldn't.

This is a model of a redbull can and the detail you see is the can opener that has that little bull cutted out.

I tried to cut out the logo from the can opener and just dont know how to do it right so the edges stay smooth when shade smooth is activated.
  First I cutted out the shape using boolean tool, either on a 2d plane(and then solidify it) or on a already 3D shape. No good result.
  Then I have drawn a shape with knife tool in a mesh, same result. Dont know what else to do.

On the first image you can see shade smooth activated.
  On the second, shade flat.
  On third, its in edit mode so you can see the mesh.

Can someone give me a hint how to do job properly? It would mean a lot to me. Im new at blender still.

Thanks a lot!!

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

And maybe tinker with the angle if necessary.


Draw string value text modal so I was trying to draw a text and a string value, more specifically, the value of the width of the bevel modifier. I achieved it but the string value seems to long, I want it to be shorter let's say I want only 0.0310 to display in the text without the extra numerals. How do i do it ?

hi you must use the round function...

in line 14 add something like this:

bevelWV = round(bevelWV, 4)


add clothing physics to a PART of mesh? I'm trying to figure out how to add clothing physics to a portion of the mesh and keep it attached to the object. In the picture, I want to add physics to the highlighted faces and leave the rest of the box solid. How do?

You have to create a vertex group.

There is a video tutorial on making a flag by BornCG ( https://www.youtube.com/watch?v=sOtRsHYCzEE&list=PL006307E237BB7FF6&index=21 ) that shows you pretty well how to do this.

Essentially, you add the physics to the entire mesh, then select a vertex group to ignore the physics and remain stationary.

My knowledge in blender is only a few months old so please excuse if this does not solve your problem.


How can I make a rounded indentation on a cylinder? I'm trying to do a cosmetic bottle in blender but i don't how to do this thing in the image. How to do this round edge on the cap. Can anyone help me?

Though you may do it using Boolean Modifier (or BoolTool add on) the good solution here may be using an Inset tool since it'll allow you to make a clean topology mesh.

Add a cylinder with 16 subdivisions. Add edge loops Ctrl+R to define the indentation position. Select the faces representing the indentation and press I,B (to enable Boundary mode). Repeat it twice (to create the extra edge loops for subsurf creasing). Extrude it inwards (E), then inset again as before.

Add the additional edge loops to the indent, then form its shape transforming some vertices. Finally fill the top part of the cylinder with mesh (example topology pictured in the first .jpeg).


BPy set keyframe by active object only? i have a tiny problem to set a keyframe by active object only in python console.

my problem is now i have in "Object Mode" any objects select, and i try to set a keyframe by a active object (Cube) only.

my attempts have become all selected objects a keyframe :(

it's doable to do this in python ?

i apologize for my english skills :/

best regards
-DevilSam

Use the API method rather than an operator.

Making the assumption that if all selected objects are being keyframed, you are using an operator to set keyframes.

Much easier to use keyframe_insert(data_path, index=-1, frame=bpy.context.scene.frame)

Index default is -1 for all components (eg x, y and z of a location) or 0, 1, 2, 3, (location.x ==> location[0])

The method returns True if the keyframe has been successfully added.

An example of adding all location keyframe to the active object. Set the location, then insert the keyframe(s).

import bpy
ob = bpy.context.object
ob.location = (1, 2, 4)
# add this as keyframe at frame 10
ob.keyframe_insert("location", frame=10)

Take z up to 19 at frame 100

ob.location.z = 19
ob.keyframe_insert('location', index=2, frame=100)


Light object evenly and have a transparent or solid background I am trying to generate a 2d image dataset form a 3d model rendered in Blender. I want to randomize the orientation of the object, the lightning and a background image.

My idea to randomize the lighting is to have a light aiming at the object at a fixed distance (radius) but otherwise positioned randomly around the object. By doing that I foresee a problem: there will be very strong shadows. The scene contains only the object, so there is nothing to reflect and spread the light.

How could I solve that? Would it work to have some "general" lighting and then have this other moving light in a way that all faces of the are never in absolute darkness? Is there a method (best practice) to lid and object quite evenly? Is there a certain type of light that spreads more than another?

Another important point is that the background of the rendered image should be either a solid color or transparent in order to replace it with a background image. Shadows on the background would be a problem.

And last thing to mention: I am just getting started with blender. So please tell me if you think I am trying to do something stupid or in a very wrong way. For example I am not sure if it makes to have a scene with only one object or it would be better to try to recreate a room scenario were the light is reflected in the walls more naturally.

My model

This is my model from 3DXtras and below is a render of it. This image shows  pretty much the kind of lightning I want to achieve but with an solid colored background if possible.

In General

The ultimate purpose of every 3D render engine is to create 2D images of 3D objects in a way that they are recognizable as 3D objects. A main aspect of this is light - and therefore also shadows.

Depending on how realistic the source images are and how exact your image recognition software should work, keep that in mind.

Transparent Background

Guessing from your rendered image, I assume you are using cycles. To get a transparent background, just get rid of the object that generates the white plane(s), then go to "Properties Window - Render - Film" and mark the Checkbox for transparent background.

Light Setup

If you use Cycles instead of Blender internal you can avoid hard shadows to a point where there are nearly no shadows at all. Because it handles light "more naturally", it's really simple to recreate a diffuse light setup similar to what you would use in a photo studio setup.

Instead of a common light source, you can use planes, assign a light-emitting material to them and turn off their ray visibility. This method gives you more "visible" control over your light sources.

Depending on the plane's size and the strength of the light your shadows will get stronger. If you add more than one plane you can get to a point where there is nearly no shadowing at all.

Here's the result with one light-emiting plane:

The same scene with six light-emiting planes, that are placed in even distances around the object:

Remember to turn off the camera ray visibility for your light planes.

Here's the .blend that contains the setup.


How do I render animations in a workspace-like manner? (Blender 2.8) I'm starting to learn how to animate, and something that I have noticed in blender is that it is faster to use a screen recorder (such as OBS) and play back the animation in blender (in Eevee Viewport Rendered mode) in full screen than it is to render the animation itself in (specifically in the engine "Eevee", not "Workspace"). The strange thing is that modifying render, encoding, and render output speed and quality options doesn't seem to have any impact on the rendering speed; it only changes the output filesize and quality. This problem occurs no matter how large my workspace is. Are there any rendering options that will speed up the rendering process to be quick like the workspace?

Speeding up the render

By default, the samples are higher for the Render than for the Viewport (so the render is slower). You can set them in Render properties, under Render.

Also, the render is done at full the resolution, but the viewport is rendered, well, at viewport resolution, which is usually lower. The larger the resolution is, the slower the render is.  You can set the Render resolution in Output properties, under Dimensions / Resolution X and Y.

Rendering the viewport without external tool

Do you know Blender allows you to export the viewport cleanly, without the need of OBS or whatever ?

In the View menu, select 'Viewport Render Animation'. It will render exactly what you see in the Viewport, and export it as a video file. You can set the Path and the File Format in Output properties, under Output.


How can I bind viewport display display as wireframe (wire) to a hotkey? I'm trying to hotkey Blender's function of a mesh object in the viewport to be displayed as a wireframe (the one that can be found in the Object --> Viewport Display tab --> Display as wire). I need it so that I don't have to quit the fullscreen mode while I'm modelling.
Now, I am aware that there are free and paid add-ons available that automatically do that when you use an object for a boolean operation (like Jaynam's Fast carve or Hardops), but I try to keep my workflow add-on free as much as possible, as those add-ons have their own problems and disadvantages (slow updates causing problems with latest builds of 2.8, for example, Jaynam's fast carve creates hidden geometry rubbish in latest versions and etc, and this is why I don't want to rely on those workflows, especially when I can bind everything on hotkeys and do it quite fast straight out of the box and have zero problems migrating to future builds).
I've tried creating a hotkey bind in input preferences on a command Object.display_type, but nothing happens (It's obvious that I'm not using it correctly). I'm not acquainted with Blender python API, neither am I a good python coder. Can someone, pretty please, direct me in the correct destination?

You would have to code it as an add-on. First make an operator than make it into an addon for it to be available every time you start Blender. Something like this:

bl_info = {
    "name": "Toggle Wireframe",
    "author": "Martynas Žiemys",
    "version": (1, 0),
    "blender": (2, 80, 0),
    "location": "View3D - ctrl + alt + shift + z",
    "description": "Toggles display mode of selected objects between Wire and Textured",
    "warning": "",
    "wiki_url": "",
    "category": "View 3D",
}

import bpy

class OBJECT_OT_wire_toggle(bpy.types.Operator):
    """Toggles display mode of selected objects between Wire and Textured"""
    bl_idname = "object.wire_toggle"
    bl_label = "Display as Wire Toggle"

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

    def execute(self, context):
        if context.object.display_type == 'WIRE':
            display_type = 'TEXTURED'
        else:
            display_type = 'WIRE'
        for obj in context.selected_objects:
            obj.display_type = display_type
        return {'FINISHED'}

addon_keymaps = []
def registerKeymaps():
    wm = bpy.context.window_manager
    if wm.keyconfigs.addon:
        km = wm.keyconfigs.addon.keymaps.new(name='3D View Generic', space_type='VIEW_3D')
        kmi = km.keymap_items.new('object.wire_toggle', 'Z', 'PRESS', shift=True, alt=True,ctrl=True)
        addon_keymaps.append((km, kmi))

def unregisterKeymaps():
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

classes = (
    OBJECT_OT_wire_toggle,
)

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

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

if __name__ == "__main__":
    register()

You can change it to your liking, save it as .py and install it as an add-on.

There is no reason to try to keep your workflow 'add-on free'. A big part of using Blender is using its many addons. The software cannot and should not come with all possible functionality - it would be massive and inefficient. Add-ons help you have the functionality you need.


Mesh causing abnormal results with subsurf modifier Probably an obvious answer, but I can't figure out why my mesh is causing such a weird crumpled up look with the subsurf modifier.  I've gone through to make sure there are no doubles or overlapping vertices, but it still looks weird when I apply the subsurf.  Any idea what I might be doing wrong?

Here is the .blend

Short answer:

Bad topology.

Longer answer:

You have here some non-manifold geometry as internal edges, badly made faces (one face across 3 prepared quads), ngons and for some parts you will need support geometry (to eliminate shading issues and hardening edges). Subdivision Sufrace modifier don't play along with those. You will need to have quad based topology with proper edge flow.

As for this particular question there is too much to cover on how to repair every broken part, I would encourage you to have a moment to redo the whole mesh having in mind quad based topology. Also, use Mirror modifier so you will not need to make changes on both sides (there are some differences now).

Look for example at this topology:

Also you can learn something from here: http://topologyguides.com/


How to slow down animation playback without messing with fps setting so that i can animate in realtime with auto-keyframe on and also sync audio? Im looking for is some sort of "time multiplier" slider, end goal is NOT to create bullet time animation but to animate subtle movements with audio in realtime with auto-keyframe on so that the flow the movement can be easily animated with pressing, for example, R key while animation is playing and then i rotate in realtime while animation plays.
If that makes sense.
TLDR, you know then you accidentally leave auto-keyframe on and then grab or rotate anything and now you have wierd animation keyframes, it can be useful if we have control over playback speed and then do it intentionally and not accidentally.

Without coding, I think the simplest way is to temporarily set to half (or a quarter) the Frame rate, and set to 0.5 (or 0.25) the "Pitch" property of the sound.
With the pitch sound property trick, you can also scale the timing of your animation, to mantain the frame rate unaltered and so mantain the "time resolution" of the animation.


Problem importing .stl files, it has a lot of faces and vertices I'm new to blender, but I just want to ask how to dissolve the faces in a quicker way, because importing stl and viewing it to edit mode shows a lot of unnecessary faces. I select faces and dissolve it, but I don't want that, I want a quicker way. If you don't get what I'm saying, here's an example:

With dissolved faces:

I hope you understand what I'm saying. :)

Remove doubles first, W > R
If helpful, use the planar decimation modifier. It will create ngons though.

⎇ AltJ is the shortcut for the tris to quad operation.


Blender 2.83.5 will not run if archive extracted with xarchive If you extract the archive file blender-2.83.5-linux64.tar.xz with xarchiver
you may get all of the files extracted into one directory. This obviously
won't work, blender fails to start, generating several missing file errors,
since the directory structure that it expects is missing

Yikes! Forgot to answer how I fixed this. Extract with
tar --xz -xfv
Sorry!