Setting the right context in a python script? For a project involving 3D printing of some labels with varying text, I want to use a small script. I checked all commands interactively and piled them up. However the script fails while the interactive session doing this with mouse and keyboard succeeds (repeatedly).

I tried to minimize the problem, removed everything not strictly needed, to pinpoint the place where I stumbled, but I cannot put my finger on the right spot. It fails when converting the text object into a regular mesh, complaining on the context not being right.

What am I doing wrong?

The script contains:

### (re-)start Blender, I used version 2.77a
### - open the scripting window in the top menu bar
### - load this file into the text window
### - run it with the "Run Script" button
import bpy
status = bpy.ops.object.text_add(radius = 1.0)
print("status after object creation is: ", status)
myobject = bpy.context.active_object
print("myobject is: ", myobject)
myobject.data.body = "Hello World !"
status = bpy.ops.object.select_all(action='DESELECT')
print("status after deselect all is: ", status)
status = bpy.context.scene.update()                     # forces update
print("status after update is: ", status)
bpy.context.scene.objects.active = myobject
status = bpy.context.object.type
print(" bpy.context.object.type is: ", status)
status = bpy.ops.object.convert(target='MESH')          # fatal error
print("status after converting to a mesh is: ", status) # never reached

The console shows:

Read new prefs: /Users/wim/Library/Application Support/Blender/2.77/config/userpref.blend
found bundled python: /Applications/Utilities-3rd-party/blender.app/Contents/MacOS/../Resources/2.77/python
measureit: added to phytonpath
measureit: Imported multifiles
status after object creation is:  {'FINISHED'}
myobject is:  <bpy_struct, Object("Text")>
status after deselect all is:  {'FINISHED'}
status after update is:  None
 bpy.context.object.type is:  FONT
Traceback (most recent call last):
  File "/test-convert-mesh.py", line 18, in <module>
  File "/Applications/Utilities-3rd-party/blender.app/Contents/MacOS/../Resources/2.77/scripts/modules/bpy/ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.convert.poll() failed, context is incorrect
Error: Python script fail, look in the console for now...

As well as making the text object the context object you need to reselect it. (You did call deselect after all). An object can be context.active_object while not context.active_object.select  Some operators that work on all objects selected may only go thru the context.selected_objects list.

bpy.context.scene.objects.active = myobject
myobject.select = True
status = bpy.context.object.type
print(" bpy.context.object.type is: ", status)
status = bpy.ops.object.convert(target='MESH')          # fatal error

print("status after converting to a mesh is: ", status)


What's the name of the keystroke that the streamer uses? it supports 2.90.1 version. it's not screencast key.
thank you for helping.

Is ScreenCastKeys (from github you can get it, but there is other versions, but that's the name "ScreenCastKeys" there is a compatible version for 2.9, but I don't know if its ready for 2.91)


Black areas in glossy surface I have three curved objects which I would like to render with a glossy surface. Unfortunately I can't figure out why my cycles render gives me these black areas. If I render the objects individually the black areas disappear so I assume its some kind of reflective interaction.

Would anyone mind explaining where I'm going wrong with this please? Any help would be very much appreciated. I'll try to link the .blend file if that would help.

OK I looked at your blend, and it was nothing more then the reflection of the shadow from the other objects.

First off I whent into edit mode, selected everything with A A, then on the tool shelf under the Shading/UV tab pressed the Recalculate button. Half of the normals were backwards.

The main thing I did was add a Diffuse node to your material, connected to a Mix Shader. The diffuse node gives the material a base color, regardless of reflections. Then mixed with the glossy node will add some reflections back to the material.

You really need something for the glossy shader to reflect off of, if you are going to get any reflections. A HDR is commonly used.

Modified blend


Shading effects not showing in layout I've edited an eyeball in the shading editor however I am unable to see the shading effects in 'layout' it just shows the mesh. However I can see shading effects under 'shading' tab

This is the eyeball in shading

This is the mesh in layout where it doesnt show the colours


Cannot see imported models Whenever I import this model into blender, I cannot see it, regardless of what format I convert it to. The vert count immediately jumps to 30,000 or so, so it's there somewhere. Its origins are all at 0/0/0, and I have tried the following:
- Making sure the rendering engine renders it as solid
- Pressing . to zoom in on it, which only put my user camera in an inescapable hell
- Scaling it up and down by absurd amounts
- Manually zooming in
- Converting it to many different formats then importing again
I have no idea what else to do; any help would be much appreciated! I'm likely missing something very obvious...

I might try adjusting your object's scale, position, and origin.

The transform properties panel is your friend. If you don't have it active toggle it on by pressing T. At the top, you can view and change the position, rotation, scale, and bounding dimensions of your object. Using the Dimensions section of the panel, you can tell if your object is really big or really small. By setting one of the dimensions (let's say the X dimension) to 1.0 to 8
.0 or so, the object should be able to fit into your scene well. Then you can copy the X scale value into the Y scale and Z scale boxes to proportionally resize your object.

Quick Fix:
First try resetting position with Alt+G. If you still don't see your object, but you see its origin, it may be really small (in which case you can play with the scale) or the origin may not be the center of your object. To reposition the origin of your object, in object mode, choose Object > Transform > Origin to Geometry, then reset the position again.

Once you are satisfied with the size of your object, press Alt+S to apply your scale changes.

Another approach is to work in edit mode, selecting all your vertices by toggling A (you can see how many verticies you have selected at the top of the viewport) and pressing Alt+S > Selection to Cursor to move all your geometry to the 3D cursor position, then scale appropriately.


How to convert HSV to RGB using shader nodes? I am trying to implement the following function that converts HSV to RGB:
HSVtoRGB= function(color) {
    var i;
    var h,s,v,r,g,b;
    h= color[0];
    s= color[1];
    v= color[2];
    if(s === 0 ) {
        // achromatic (grey)
        r = g = b = v;
        return [r,g,b];
    }
    h /= 60;            // sector 0 to 5
    i = Math.floor( h );
    f = h - i;          // factorial part of h
    p = v * ( 1 - s );
    q = v * ( 1 - s * f );
    t = v * ( 1 - s * ( 1 - f ) );
    switch( i ) {
        case 0:
            r = v;
            g = t;
            b = p;
            break;
        case 1:
            r = q;
            g = v;
            b = p;
            break;
        case 2:
            r = p;
            g = v;
            b = t;
            break;
        case 3:
            r = p;
            g = q;
            b = v;
            break;
        case 4:
            r = t;
            g = p;
            b = v;
            break;
        default:        // case 5:
            r = v;
            g = p;
            b = q;
            break;
    }
    return [r,g,b];
}

I'm completely fine up until the large switch/case structure. I have no idea how to implement this without creating a huge mess. It would be fine if each case was changing the same value, but each case has different variable assignments than others.
Here's my current nodegroup:

If someone could guide me to a working solution here, it would very much appreciated!

Is this an exercise,  or ....

... will this do?...
EDIT: No, it won't. If you want to do logic like this by hand..
One way to approach the case statement would be use the implicit cast of True and False to 1 and 0, and multiply the truth-value of the case-condition with the color that would result if it were true.

.. so the above cluster says (v,t,p) * (i == 0) + (q,v,p) * (i == 1) +....
If the i == 0 condition is true, then the (v,t,p) contributes to the sum of colors. If the condition is false, it contributes (0,0,0).  Only one case will be true, and contribute more than 0 to the sum.
You then accumulate a sum of all the colors:

But this stuff can be tedious to debug.. @Rich Sedman's kit can be a fantastic time-saver.


driver expression dot.product function I´m coming from 3ds max and I would like to rebuild a scene in blender.
It has a controller that outputs the angle between a bone and
the world z-axis via the dot product function. That´s pretty simple in 3ds Max with e.g

> myvec=$.transform.row1 globalz=[0,0,1] theAngle = acos(dot (normalize
> myvec) (normalize globalz))

The script controller calculates the angle between the bones X-axis(roll axis) and the world z-axis. This works for realtime tranformations and animations as well.

How could I make this with a blender driver?

So far I have written a script which is running in the console line by line(sorry for the noobish syntax)

import bpy
import mathutils
import math

from mathutils import Matrix, Vector

myvec=bpy.data.objects['Armature'].pose.bones['Bone'].matrix.col[1]
gloma= Matrix()
ori=gloma.col[2]
ori=ori.dot(myvec)
ori=math.acos(ori)
ori=math.degrees(ori)
print (ori)

After I had created a driver function with bpy.app.driver_namespace that driver didn´t got evaluated. Any help would be very appreciated.

Script:

import bpy
import math

def test_fn2(pose_bone):
    rig = pose_bone.id_data
    mat = rig.matrix_world @ pose_bone.matrix
    vec = mat.col[1].normalized()
    angle = math.degrees(math.acos(vec[2]))
    return angle

bpy.app.driver_namespace["test_fn2"] = test_fn2

Settings:

Turn on register in Text Editor. And Auto Run Python Scripts in User Preferences if you need.

Expression: test_fn2(bones["Bone"])/45

Additions:
Original script has two mistakes.
1. Transformation matrix for converting to world space is

object.matrix_world @ pose_bone.matrix

2. Vector myvec needs to be normalized.


Save and load object position in bge I am using version 2.79.
How can I save and load an objects position in the BGE?

To save, you only need to:

Get the object's attributes
Store them in a dictionary
Convert this dictionary to string
Write the resulting data to disk

To load this data, you only need to:

Read this saved data
Convert the loaded string to dictionary
Set the object's attributes

Here's a working script (below) and a example blend file. Press 1 to load and 2 to save on the example blend file.

import bge
from ast import literal_eval

def save(cont):

    # Objects
    own = cont.owner

    # Sensors
    sensor = cont.sensors[0]

    # Properties
    path = bge.logic.expandPath('//')
    savedata = {
        'position' : list(own.worldPosition),
        'rotation' : list(own.localOrientation.to_euler())
    }

    ### PROCESS ###
    if sensor.positive:

        # Creates/overwrites savedata file
        with open(path + 'savedata.sav', 'w') as openedfile:

            # Write savedata dict as str
            openedfile.write(str(savedata))
            print('Data saved to ' + openedfile.name)

def load(cont):

    # Objects
    own = cont.owner

    # Sensors
    sensor = cont.sensors[0]

    # Properties
    path = bge.logic.expandPath('//')
    savedata = None

    ### PROCESS ###
    if sensor.positive:

        try:
            # Try to open savedata file
            with open(path + 'savedata.sav', 'r') as openedfile:

                # Reads savedata and evaluates it from str to dict
                savedata = literal_eval(openedfile.read())
                print('Loaded data from ' + openedfile.name)

            # Set object attributes from loaded data
            own.worldPosition = savedata['position']
            own.localOrientation = savedata['rotation']

        except FileNotFoundError:
            print('Save data not found')


How to recalculate normals? in version of Blender 2.72, where is the option recalculate?.

Like in this video https://www.youtube.com/watch?v=IZPqxADetWE&feature=player_detailpage#t=108

Here is a screenshot:

'Toolbar tabs' were implemented in 2.70. You can recalculate the normals from the 'Shading/UVs' tab of the tool shelf (revealed with T), or you can do it by a short cut by Ctrl+N


Add extra control to rigify? I am using rigify and it works great, but I also want to add an empty sphere, that will allow me move part of the clothe, for example on this photo:

But I also want when I create the extra bone from rigify, to apply it to the clothe as control without breaking the already applied skin weight. Can someone guide me on how to do this? I need this controller so I can move the area of the clothe that is behind the middle area of the legs to push the clothe closer towards the legs, as the character sits on a chair for example, so the clothe won't go through the chair.

Found the solution, in this tutorial:

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


Can I create a noise texture with a "darker end"? I made a logo in photoshop a while ago and I am now trying to make it in Blender.
I'm really new to nodes and I somehow managed to create something that looks quite like the real deal. The only thing left to do with the texture is to make it have a "gradient limit" or something that'll make it turn darker after a while.
I'm not a certified explainer so I attached two images.
NOTE: the "PTV" is from the reference image so I haven't gotten that fixed
What I'm getting

What I'm trying to get

You can add multiple materials to an object in Blender. In Edit Mode just select the faces of the outer part and assign them to a new material. In the example I've done this for the outer, middle (white line), and the inner part.
The "darker end" can be created with a ColorRamp and a MixRGB node in the node setup. Set the mode of the MixRGB node to Multiply and factor to 1.0. To move the "darker end" of the outer part to the bottom right I had to add a Mapping node and rotate the position a bit.

The shading for the inner area looks similar. Just swapped the grey values of the  ColorRamp to darken the top right part of this area a bit.

If the colors appear too dark you might need more light in your scene. The logo on the screenshot is 3m tall (to get the shading right) and there is a 3000W point light, 3m radius (affects the shadow softness).
With a Solidify modifier you can add some depth/3D to your logo and it gets some nice light reflections. Add a plane as background to see the drop shadow if you want.
I removed the Alpha channel since it's always 1 and it had no use(?). If you activate the Node Wranger addon that ships with Blender you can press CTRL + SHIFT + LMB to get a preview of the selected node. This can help a lot to see what's going on.


How can I mark the seams to UV unwrap a torus? So, uh... I've been using blender for a couple months, and I'm still lost on how the heck texturing works. I would like unwrap this torus, the problem is, it has way too many vertices to for me to even try and mark seams.

I want to unwrap it properly, to where it doesn't appear like... this:

Texturing is the most difficult part for me.. I just recently learned (somewhat) proper rigging. I still have not been able to figure out textures though... I am only able to add them on simple things like that clock on the cylinder.

Thanks in advance. :)

There are many ways to unwrap a torus (or any mesh). A lot of it depends on your needs and the kind of projection you are after.

One way is to mark one seam that splits the torus horizontally and one that does it vertically:

Then select one of the faces where the seams meet

and press A to deselect and A again to select all faces. That way you will have all of the faces selected but will also have an active face.

Press U to unwrap and select follow active quads

The result should look like this:

Form there on you can scale, assign a texture, etc.


Principled Shader inputs I am looking for documentation on the titled item. Of course, I first went to the Blender 2.79 API documentation to find out about the node inputs and their acceptable values, but couldn't sort out how to determine default values for a given input from that page. I've searched on here for the titled item and got 16 answers, none of which addressed my problem. Please allow me to illustrate using a code snippet from a class that creates a shader in a material zone of a figure.

  def buildShaderset(self, image):
    if self.selSdr == "PrinSSS":
      self.matOut = self.treeNodes.nodes.new("ShaderNodeOutputMaterial")
      self.matOut.location = (100, 450)
      self.nodes["Output"] = self.matOut

      if (self.Region[0:4] == 'Skin' or self.Region == 'Mouth'):
        self.shPrin = self.treeNodes.nodes.new("ShaderNodeBsdfPrincipled")
        self.shPrin.location = (100, 250)
        self.nodes["Principled"] = self.shPrin
        self.treeNodes.links.new(self.shPrin.outputs[0], self.matOut.inputs[0])
        # Specular values
        self.shPrin.inputs[5].default_value = .015
        self.shPrin.inputs[11].default_value = .2
        self.shPrin.inputs[14].default_value = 1.8

    # Skin and Eyes mat slot names have _suffixes
    if self.Region[0:4] == 'Skin':
      self.makeSkin()

...etc

I sort-of guessed the input[] locations for spec values, which appear to reflect on the created node. I was wondering if there was documentation on those inputs for Python developers (of which I am least).

Thank you for considering my little conundrum.

Just ignore the input list index values. Treat the input list as a dictionary.

shPrin.inputs['Specular'].default_value = 0.015
shPrin.inputs['Sheen Tint'].default_value = 0.2
shPrin.inputs['IOR'].default_value = 1.8

If you know an index and want to know the name -

>>> shPrin.inputs[11].name
'Sheen Tint'

And to list all the available names -

for i in shPrin.inputs:
    print(i.name)


How can you sync Blender configs between multiple machines? I run Blender on several machines, it is a hassle to copy configs around, in order that you don't have to configure everything from scratch every time.
Is there a sync functionality that does this?

Yes, this is in fact possible:

This is part of the Blender Cloud functionality is called Blender Sync.
And guess what: it is completely free!

This will sync your Blender Startup and User Preferences to the Blender Cloud and you can then retrieve it from any new install. It works even cross plattform (I use it on Linux and Windows)

First, create a blender ID here:
https://www.blender.org/id/

Then download the blender Cloud addon and install it:
https://cloud.blender.org/services

Then log in via the addon and bingo, your settings will be synced up to the cloud.

See here for all the details:
https://cloud.blender.org/blog/introducing-blender-sync

I have noticed that some people have heard of this before, but assumed that it was only part of the paid Blender Cloud. But it is in fact free. I hope this will boost your productivity and make sure you can save time only having to configure Blender once.


How to Twist a Procedural Material? I'm trying to figure out how to twist a procedural material applied to a mesh.

I have a hollow cylinder like a tube (the two end cap faces are deleted) with a noise texture applied to it.

My nodes are:

Texture Coordinate - Generated output to a Mapping Node, Vector input.
Mapping Node - Vector output to Noise Texture, Vector input.

On the mapping node, I can see that the Rotation ordinates will rotate the texture on the surface of the cylinder. The length of my cylinder runs down the Y axis, so as I rotate the texture on the Y axis it rotates around the barrel of the cylinder. So far so good, but the problem is that it equally rotates the texture around the cylinder barrel all along its entire length.

What I want to do is to fix the material's rotation on one end of the cylinder, but rotate it around other end so that it twists or spirals down the length of the cylinder like the rifling in a gun barrel.

Is there a way to tell Blender "on that end of the cylinder the material's rotation is 0, and on this end it is 360 degrees (or 720, or -180, or whatever)?

This seems as if it'd be a piece of cake, but I'm just not seeing it.

While @DuateFarrajotaRamos's answer will seem to work for small angles of rotation, it only approximates rotation and will not achieve 360 degree rotation mentioned in the question. Instead, you can apply a rotation matrix to the actual vectors concerned.

A solution is mentioned as part of this answer https://blender.stackexchange.com/a/77638/29586 - where the X/Z coordinates are rotated based on the Y coordinate using the following nodes :

This works by splitting the Vector into separate X,Y,Z coordinates and applying a rotation using matrix multiplication as :

X = x.cos(angle) + z.sin(angle)
Z = -x.sin(angle) + z.cos(angle)

Varying the Twistiness input will vary the rotation. The Twistiness is measured in Radians rather than degrees so 2*pi radians is a full rotation (360 degrees) - just type '2*pi' into the value node and Blender will automatically calculate.

Note also the Subtract color mix node at the start. This is set to mid-grey (0.5,0.5,0.5) to convert the Generated coordinates ranging from 0.0 to 1.0 into the range -0.5 to 0.5 so that the origin - and centre of rotation - is in the centre of the mesh.

For clarity, here's the complete node setup :

Note that I've removed the 'green' element from the first Subtract MixRGB node. This is to leave the origin of the Y channel at the edge of the mesh so that one end is not affected by the twist (otherwise it twists from the middle). The Subtract and Divide nodes at the end (after the Noise texture) are there simply to increase the contrast of the Noise texture and isn't related to the twisting.

And here's the result :

Blend file attached


Text in front of text transparency When text is displayed in front of other text, the background text does not display correctly through the transparent parts of the letter. It looks like there is a surrounding box around each individual character of the text where no other text is displayed. See the b example in the screenshot, where I marked the surrounding box.

However, this behavior seems to apply to text/text relationships only. Where I have text in front of cubes, the cube color shines through correctly.

All objects are real text objects, no images, not textures. The text objects themselves are not transparent, they are opaque. But I expect them to be, well, transparent in the holes of the letters (sorry, I'm a non-native English speaker, if you understand what I mean, you can edit this sentence).

Is this a bug which should be reported or can I influence this behavior somewhere?

Version info: Blender 2.70, downloaded
Render Engine: Blender Game
Download SSCCE .blend file

Open the SSCCE in Blender 2.70. Hover your mouse over the 3D viewport. Press P to start game engine. Move your mouse so that the two text objects overlap.

If only I could get more details as to what exactly you expect from the software, I might be able to answer your question right.

However, from you explanation, I replicated that, and I'm not seeing any problem.

What version of blender are you using? You built from source or downloaded from blender.org?

I just set my transparency to the desired value in the materials tab in the properties panel and all seem to go well.

By the way, I used the bge too.


Using freestyle and normal textures in one scene How to combine Freestyle with normal textures?
I have a townscape scene In bender 2.79. All objects have a simple freestyle outline. I want to have the bottom most object (a landscape) to be a normal texture, (not freestyle) so can add an image to it, does any one know how I can do this? Thank you.

You can set freestyle visibility per-collection. Add your landscape in another collection and set it to EXCLUSIVE in the bottom of the line set properties :


Discontinuous large values in depth map For my project, I save rgb frames (PNG format) and the depth maps (EXR format) for different camera views. The compositor setup I use is shown here  and I use Cycles.
When I read the raw depth values, for plane surfaces like paintings or glass surface the depth map has sporadic, or clusters of, very large values like 10^10 among a region of foreground pixels with low depth values.
Why does blender render these certain pixels as background, when they actually belong to a foreground object? This renders the depth map inaccurate.
Is there a better, accurate way to obtain depth maps from blender?
Edit: The link to a blend file where I saw this.

It's hard to say for sure without seeing the file.
But I believe you're probably seeing places where the reflections shoot off into infinity.
Let's think about glass, which is one place where you mentioned problems.  A ray either goes through the glass or reflects from the glass.  You can get vastly differing depths depending on which it does.  The depth needs to take into account the reflection for purposes of misting, DoF, etc (think a mirror).  But there's no sense in mixing depths-- you're not going to get something more right by averaging the depth through and the depth reflected, you're just going to get something completely wrong.  Blender has to pick between reflected depth and refracted depth, and where it changes its pick, you have a discontinuity.
What's the solution?  I've asked around and not heard any suggestions.  If you want your depth to a surface, you can render an Eevee depth map, which won't have this behavior.  You could also consider using multiple render layers, perhaps with material AOV outputs that would let you specify flat depth, reflected depth, or refracted/transparent depth.   But yes, these are frustrating solutions in that they can potentially add a lot of render time and complexity.


Adding mesh to previously rigged object I have a scene that includes an appended rigged hand model that I built previously. For this specific scene, I want to add press-on nails to the hand.

I joined the the mesh of the nails to the hand mesh, but when i go to move the rigging, the fingers move independently of the nail. Is there anyway to make the nails move with the fingers with the pre-exsiting rig? Or do i have to delete the armature and re-rig the hand after joining it to the nails?

I also don't want the nail to be deformed by the rig. How can I avoid this?

You can add geometry after rigging without any need to delete your previous job.
If you used the automatic weights option, probably you will have to manual weight the new vertices: as Mentalist said, assign to the fingertip bone a weight of 1.0, but also check if there is some weight assigned to any other bone: if so you get deformations and you should remove these assignements.
In edit mode, if you select a vertex you can read wich are all his weight assignements in the object properties panel (Hotkey N).


Making a material fade off(progressive transparency from front to back) based on the location of its geometry I'd like to make this object half transparent, on one side and half atmosphere-looking in the front.

Here is what I'd like to look like :

Here is what I currently have :

Also note that the geometry is like this :

The inner part of the object is the light emissive part, and the outer region is for the atmosphere, I gave them both different materials, I want the effect I am talking about on the outer material.

Thanks for any help!

You can try something like this:

This is the same set up from your previous Question what was added was a gradient texture node added to the beginning of the chain of nodes. I put the color ramp node so you can control where the falloff to transparency ends.


Replicate value stored in object into properties of new one I would like to duplicate, for example, a cylinder with its number of vertices stored in its properties, and tweak this value if needded.

To do this, I click on a gizmo, and a new cylinder is created, with the stored value of the previous cylinder. But when I want to change this value within the property panel, the value remains the same.

How can I change it?

Here is an example:

import bpy
from mathutils import Matrix

bpy.ops.mesh.primitive_cylinder_add(vertices = 12, enter_editmode=False, align='WORLD', location=(-2, 0, 0))
obj = bpy.context.object
obj["vertices"] = 12

class CylinderWidgetGroup(bpy.types.GizmoGroup):
    bl_idname = "OBJECT_GGT_cylinder_tweak"
    bl_label = "cylinder tweaker"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'WINDOW'
    bl_options = {'3D', 'PERSISTENT'}

    @classmethod
    def poll(cls, context):
        obj = context.object
        try:
            if "Cylinder" in obj.name:
                goodName = obj.name

            return (obj and obj.name == goodName)
        except:
            return(obj and False)

    def setup(self, context):

        obj = context.object
        mpr = self.gizmos.new("GIZMO_GT_arrow_3d")
        mpr.draw_style = 'BOX'

        self.gizmoWidget = mpr

    def refresh(self, context):
        obj = context.object
        mpr = self.gizmoWidget
        props = mpr.target_set_operator("object.cylinder_update")
        posMatrix = Matrix( ((1,0,0,obj.location.x),(0,1,0,obj.location.y),(0,0,1,obj.location.z),(0,0,0,1)) )
        mpr.matrix_basis = posMatrix

class CylinderUpdate(bpy.types.Operator):
    bl_idname = "object.cylinder_update" # has to be all lower case
    bl_label = "Cylinder Update"
    bl_options = {'REGISTER', 'UNDO'}

    vertices : bpy.props.IntProperty(name="vertices", default=5, min=3, max=100)

    def execute(self, context):
        obj = context.object
        self.vertices = obj["vertices"]
        bpy.ops.mesh.primitive_cylinder_add(vertices = obj["vertices"], enter_editmode=False, align='WORLD', location=(0, 0, 0))
        obj = context.object
        obj["vertices"] = self.vertices
        return {'FINISHED'}

bpy.utils.register_class(CylinderWidgetGroup)
bpy.utils.register_class(CylinderUpdate)

Set verts in invoke method
Set the value when the operator is invoked (run once). Give the new cylinder the operators value for self.vertices.
Demonstration of that change

    def invoke(self, context, event):
        obj = context.object
        self.vertices = obj["vertices"]
        return {'FINISHED'}

    def execute(self, context):
        bpy.ops.mesh.primitive_cylinder_add(
            vertices=self.vertices,
            align='WORLD', location=(0, 0, 0))
        obj = context.object
        obj["vertices"] = self.vertices
        return {'FINISHED'}

Some notes.
To match new cylinder transform to old would
mw = context.object.matrix_world.copy()

before new cylinder op, and assign it to new cylinder.
The poll method could be
def poll(cls, context):
    ob = context.object
    return ob and ob.name.startswith("Cylinder")

The poll method gets fired off a lot. Good practice not to use a try clause here.
The gizmo matrix basis could be
Matrix.Translation(ob.location)

However this is using local coords to make a global matrix and will result in "losing touch" with the cylinder if parenting or constraints are used to locate it.  Worth investigating using
Matrix.Translation(ob.matrix_world.to_translation())

Automatically set the custom property when cylinder added
Check out the way this answer https://blender.stackexchange.com/a/163258/15543 manipulates the newly created mesh primitive.  Recommend doing something similar here.
When the active operator is the add prim cylinder add the custom property.  In this case could poll for "vertices" in ob.keys()  (Maybe change name to cylinder_vertices)


Flexible street script/tool? I'm new to blender Blender and mainly use POV-Ray. Would it be possible in Blender to create scripts or custom tools that generate flexible roads? Like this:

http://lib.povray.org/searchcollection/index2.php?objectName=LegoRoad&contributorTag=SharkD

Except (preferably) modifiable in real time by dragging control points using the mouse?

Thanks!

Using curves you should be able to do something similar.

On top view add a curve, give it some extrusion and depth. Enter edit mode and align the control points by pressing SY0.
Exit edit mode and rotate the curve 90 degrees on the x axis (RX90) Go back to edit mode and manipulate your curve by adding points (Ctrl RMB and manipulating them you can get any shape you want.


Rigify Button when i try to generate weights it moves mesh and dispach part of it and in general doesn't work So i am trying to follow this tutorial(i downloaded free mesh from internet that i like):https://www.youtube.com/watch?v=XHa2Y8zjtZQ&t=9s
And as in title, when i try to generate weights to bones hips will stay in place, rest of the mesh will go down, bones will stay in place and it will generate weirdly, so it will work, but it will deform mesh quite badly. I think problem lays with how mesh is sectioned, but i don't know what to do. Here are screenshots

Before weight applying:

After weight applying:

The problem with parenting is that your Character objects already have some sort of parenting. Select all meshes, press Alt+P > Clear and Keep Transformations. -There is another problem with your meta rig. The 3 bones of the arm are: upper_arm, lower_arm, hand. Yours are aligned as shoulder, upper arm, lower arm. This will create weird deformations.


Time Displacement in Blender? So I have said this earlier, but I love watching Adobe After Effects tutorials, and recreating them in blender. But I have this problem that has happened in a few tutorials now. Its where people use the Time Displacement Modifier. It looks like a really handy modifier, and I am almost certain that it can be recreated for blender. The question I have is: Does an addon already exist? or do I/we need to make it so? Thanks for your help!

EDIT: For those who don't know what time displacement does, watch this video: https://www.youtube.com/watch?v=YCZ3MqXOfYQ

As far as I know this is not possible in Blender, or hasn't been tried properly. You may be able to reproduce the effect, but you will have to develop the process in Blender yourself.

Other people have attempted to do this, but not successfully. As Gandalf said:

  I played around with trying to get this effect in the compositor a while ago but was unsuccessful. I think I decided that the only way to access multiple frames at once was via a lot of image sequence nodes with different offsets. So this would be possible, but you'd need a separate image sequence node for every "time pixel", or every horizontal bar in the case of the vertical gradient. Which means you'd certainly want to use python to add all those nodes :P


Fade out reflection in mirror with cycles With Blender Internal Renderer I can set the max distance of reflections in the material of the mirror object.

How can I achieve the same with cycles?

EDIT: As mentioned in a comment above, using a glossy shader for the mirror and simply adding a small amount of roughness will give a similar result, although you will lose some of the definition in the reflection that you can get with blender internal. My solution is a way to get defined reflections that still fade out.

As far as I know, there is no 'proper' way to do this, as in there is no setting that will allow you to make the reflection fade out a certain distance from the material.

However, there are some ways to fake what you are doing, and in the case of replicating the image above they work quite well. However, if you try to scale this up to larger, more complex models or a non planar mirror you may have some issues (I haven't tested this).

The way to fake this in Cycles is to modify the material on the object being reflected, and leave the plane with just a glossy shader with a roughness of 0. Any roughness will work just fine, but 0 will make everything much easier to preview as you set up. In my file I gave it a bit of a blue color as well.

For the cube, we'll use a combination of a gradient texture and the light path node. Using the light path node, we can isolate the reflected cube by using the Is Reflection Ray Output. If you use the node wrangler addon, you can CtrlShift click on a node to preview it. Which will look like this:

We can multiply the reflected cube by a gradient texture, which will produce a gradient on the reflected cube. You will have to rotate the gradient texture by 90 degrees using the mapping node, and I used a color ramp to adjust the falloff. Again previewing this step results in this:

EDIT: If you replace the Texture Coordinates node with a geometry node and use the position output, as well as set the x location value of the mapping node to 0.5, the result behaves more like the blender internal method, with less reflection the further away the cube is (you will also want to adjust the color ramp to get a nicer falloff as well).

Then we simply use this as a factor for a mix node that combines a diffuse shader and a transparent shader. Which gives this result:

Do note that you will want to disable reflective caustics if possible, as leaving that enabled causes a huge amount of noise and fireflies.

Here is the final node setup for the cube:


How can I delete internal vertices/faces and edges? I will give you an easy example to understand better the situation:

This is my mesh, a simple one

In edit mode:

As you can see there are internal faces,edges and vertices that I want to delete.

I know, one way could be

select my cube (the bigger one),select P and separate it from the main mesh.
then use the boolean modifier - union

and the result would be great

However this method can't be useful if there are many polygons inside our mesh

Is there a script, tool or a modifier that let me delete the internal faces-edges-vertices and let the shape of my main mesh remain, instead of separating each mesh from the main one and using boolean modifier many times?

Thank you!

EDIT FILE BLEND

I think booleans are the answer, but you can do this without separating parts of the object. As of Blender 2.77 you can use the Intersect option in edit mode.

Here I have two overlapping cubes:

Select one of the parts (as shown above) and choose Mesh> Faces> Intersect (Boolean) from the 3D header.

From the toolbar (T) change the boolean type to 'Union':

The two meshes have now been 'merged' with their overlapping geometry removed:

You can either do this once for each piece of intersecting geometry or select all the intersecting pieces (apart from the piece they are intersecting with) and boolean them all at once.


How can I realize "sticky" collision, i.e. that objects connect as soon as they touch? I'm fairly new to Blender (great piece of software btw), so please bare with me.

I'd like to have multiple spheres (up to 50), which move randomly in space and as soon as two spheres collide they should stick to each other and move on together.

How would you approach that problem? I already tried to make the spheres rigid bodies and set the friction parameters insanely high, but it did not work. I also tried to use lennard-jones force fields (I also cranked up the strength fairly high), but that did not work either.

Try the free molecular script Add-on. here is a tutorial on how to use it:
https://www.youtube.com/watch?v=haS3B6q82kY


Export children as root level objects In my blender scene I have several objects that are parented to an Empty. I use this Empty to move the objects around the scene without having to manually move each one. Works like a charm.

However when I export my scene and load it into my program, the child objects of my Empty are only accessible as nodes of the Empty as opposed to being their own reference-able objects.

Is there a way within blender to, upon export, make all child objects of Empty their own object?

The solution to this issue was in fact to remove the empty keeping the children (applying any transformations made using the parent), and then create a group of objects.

Creating a group of objects can be done by selecting each object you wish to have in the group and pressing ctrl+g. To select all objects in the group, simply select one object, press shift+gand select group.


Can't see Physics tab in Properties Panel in Blender strong text

I have Windows 7.Blender version is 2.79 and I can't see any tab after the wrench icon in Properties Panel.

Hover with your mouse over the top, last icon of the property list. Now, roll the mouse wheel, the rest of the icons will display.
You can also do that on all main menus at the bottom of each 3d window to see the rest of the options menus.


Image Transparency doesn't work with alpha mode and alpha blend in both eevee and cycles I followed a tutorial, where I can make custom leaves for trees. I added an image as a plane and I should switch in blend mode from opaque to alpha clip but it does not work. It looks like bevore without any change. I tried it with all rendering modes and also alpha blend and alpha clip. The image is a PNG file with a transparent BG but in blender layout mode it shows the BG black. What did I do wrong? Here is the YT tut: https://www.youtube.com/watch?v=TrfIRDw88bM

I was able to accidentally reproduce the problem. I was able to fix it by reloading the image.
First unlink the existing image by pressing the x next to image name.

Next reload the image by pressing Open and search your image.

You should share your blend file if this doesn't work.


Deforming the initial cube by mouse I would like to move one or two vertices of the initial cube in Blender so that it becomes a bit rhomboidal (deformed) by dragging the captured vertex with the mouse. I cannot find the right place in Blender to
play with deforming the cube. More specifically I need that the cube remains as a whole, just deformed. I have found something similar to this in the l.h.s. but not quite what I need.

I don't have a tool that does this for you, but you can manipulate the shape yourself. Here's how I would do it:

go to edit mode (either press Tab or go to the left corner, change it from Object Mode to Edit mode) you know that you are in Edit Mode if you see the vertices of the cube as dots

now select 4 vertices while holding Shift (the selected vertices appear orange and the one you selected last is white)

press S (for changing the scale) and then press Y (to scale it along the Y-axis, but you could also press X to scale it along the X-axis or Z)

to scale it you just need to move your mouse in the direction you want to scale it
if you are still in the scaling mode (you see a dotted black line coming from the center of your object), you can switch between the axes by pressing X, Y or Z and continue scaling along them

Hope this helps
(if you just want to move one vertex at a time, just click on the one you want to move and then press G to move it in space or G and then Z to move it along the Z-axis)


Animation Nodes - Animating transparency with wait times This is a follow on from the question here:

Animation nodes loop text problem

I am trying to animate the opacity fade of the text object and will use a material's mix shader to set it to transparent BSDF.

The problem I am having is how to trigger this fade-in time in synch with the timing loops set up for the text.

The text element will print (in a typewriter style) for the amount of frames designated by its character length, then hold for a time (designated by its padding), and during this hold time the text should fade out.

I was initially going to approach this problem thusly...:

1) The material output, with a mix shader factor selected, has 21 as its max, which is the equivalent to full opacity.  How can we convert this to a 0>1 slider as opposed to a 0>21 scale?

2) How can we trigger it to fade from 1 to 0 starting at the point that the text length is reached? ( possibly use get element list node ouptuts added together to get the total wait time for each element then PLUS the padding time, before the next cycle kicks in)

3) How can we ensure the animation time from 1 to 0 is in sync with the time the text is present on the screen, (perhaps using the padding number here)

...then my brain exploded.  Hope you can help!

Blender file here:

First, you get the length of the current text being displayed and you subtract it from the relative time like so:

This will give you the time starting from when the text got fully displayed. Next, you may subtract another constant to delay the fading effect and divide the result to slow it down. The result is then clamped to the 0-1 range and is used as the factor in a material:

Note that the delay and speed constant are related to your time constant (The value of the divide node after the time info node). So a delay of 5 actually means a delay of 5m where m is the time constant.


Infinite light in Blender (like c4d)? One thing I miss coming from Cinema 4d is the Infinite light. Is there a similar light in Blender? If not, is there a way to do something similar?
For those of you who don't know, the Infinite light doesn't depend on position (doesn't matter where you put it). Instead, in order to change the lighting you change the rotation of the light.
https://youtu.be/StPAPmZN5gg?t=273
Thanks for any help!

What you want is most likely the sun light: https://docs.blender.org/manual/en/latest/render/lights/light_object.html?highlight=light#sun-light


How do I accurately select half of a symmetrical mesh? I have this mesh that is probably nearly 100% symmetrical on both sides. I want to easily select half of the mesh, in order to hide it to have easy access to its inside. My object is directly aligned with the origin, so would there be like a Hot-key to be able to select any parts of a mesh in one side of the axis?

You can select everything relative to the last selected (active) vertex.

Select the middle vertex
Access the menu: Select -> Side of Active.(Which has options regarding which side/axis).


Select everything except ears from mesh of head I have a triangulated mesh (100k+ vertices) of a head.   I need to select everything apart from the ears, and reduce the vertex density on that selection by 16x or something.

Here is what I'm dealing with:

I've already asked a question on how to do that and got a very helpful answer: Reducing vertex density as distance from point increases

My problem is selecting the ears.  I would like to get a high level of control; simply using box select isn't going to cut it.

So I select a vertex path around one ear:

Now I'm stuck, can someone guide me?

What are the steps I need?   This is my guess:

somehow store the vertex-path
do exactly the same for the other ear
now might there be some tool like Microsoft paint's flood-fill,  where I just hit one vertex on the skull, and it will select be entire skull up to and including the boundaries I've just created (i.e. it will avoid the ears)
then I decimate, which I have instructions for

Is there some tool I can use that will just let me draw on the surface, and then  it will figure out an appropriate vertex-path?   when I do this on a 2M vertex model, it is going to take ages manually clicking 500 vertices.

EDIT: I got one step further:

Another way: If you don't mind adding some extra points on the model, you may also consider to separate ears by cutting them off using Knife Cut or Knife Project tool:

PROS: Almost perfect clean separation.

CONS: Add extra vertices to the original mesh. You may judge and weigh if this is acceptable.

Then CtrlG to add those vertices to a new group for the restraining usage in Decimate modifier panel.


What causes odd deformations when using Subsurf? first time here.

Alrighty, I'm quite new to 3D model design in Blender, but I have a little problem with my book model. The mesh is fine (I think). But there are a good few points where the text mesh goes wrong for some weird reason. If you need to know which version of Blender I'm using, it's Blender 2.69.

When I apply the "subdivision surface" modifier and set the subdivision render to 2, the faces go in and deform in certain areas. As far I'm not sure what is wrong at this point. I've taken two pictures just in case you need them.

Take note that I'm still unaware of some certain tools and common knowledge in Blender, go easy on the in depth reasons and fix details. Just simplify it please :)

Blend file :  http://www.pasteall.org/blend/30527

You have some issues with the topology:

Extra edges on the large inner-top face, creating n-gons (also see this question):

To fix them, select them and press Delete > Edges.
Extra vertices on the edges, also creating n-gons:

To fix them, select them and press Delete > Dissolve vertices.
Internal edges on each corner:

To fix them, select them and press Delete > Edges.
Double vertices one of the corners:

To fix them, either merge them manually, or select everything (or just the area you want to check for doubles, but in this case it doesn't really matter) and press W > Remove Doubles.
No face on the top loop, creating non-manifold topology:

It's a bit hard to see, but if you select it with AltRMB and translate it, it's a bit more obvious:

You can select non-manifold geometry with CtrlAltShiftM.

Example .blend


How come my keyframes don't show up in graph editor? I am using a Python script to generate keyframes for materials(changing the strength of emission node over time). I use the same script to set up keyframes for material A and material B. I can see keyframes for both material in NLA editor but only keyframes for material A show up in the Graph editor. Did anyone have the save problem? Is it a bug or did I do anything wrong? Thanks for your replies in advance.

Both the dopesheet and the graph editor have some options for what they display.

With the cursor button highlighted, only selected items will be shown, for a node tree this means the node that has keyframed values needs to be selected. As you are creating them by script you can set the select property of each node as you create them.

eg.

bpy.data.materials['Material'].node_tree.nodes['Emission'].select=True

The ghost allows you to see items that are hidden, that is the object containing the keyframes is hidden in the 3dview.

The filters list allows you to show or hide based on what data blocks have the keyframes. By turning off the node symbol you won't see any keyframes from nodetree items.


Cannot see background image after reopening the blender file I after reopening by blender file I cannot see the placed background image. You can see the screen capture for reference. I made sure I am not in perspective view, but that does not help. I would appreciate any help on this subject.

Make sure your files are in the same directory as when they were first added.


How can I avoid colored light reflections? so I'm sorta new to Blender and stumbled upon a problem which is probably easy to fix. So I realized that the color of the ground gets reflected onto other surfaces during the render, as seen on this picture:

How can I prevent the green color from appearing on other things than the ground?

Yes, by decreasing the number of bounces in Render settings > Light paths:

However, note that this is a phenomenon in the real world, and disabling it may make your renders look more fake or unrealistic.


Collision bounds for 2D Sprites in the Blender Game Engine How can I make Collision bounds for 2D sprites in the BGE? (The 2D sprite I am trying to make collision bounds for is the image I attached below).

I imported the 2D sprites as planes with the "Import images as planes" add on (I checked "use alpha" when importing the image) but I do not how to make collision bounds for it.

I am also gonna be using "Character" physics for the 2D sprite.

  I am also new to the Blender Game Engine, so please try to explain it
  as good as possible.

Put your logic and physics settings on a different object, and parent your image plane to that object. Set your image plane as "no collision," and your other object's physics to "character." You can edit the collision bounds and other physics settings until you are happy with the result.

This is a setup I use commonly for making projectiles:

Here, I have a no collision plane parented to the collision object, but I am using rigid body physics instead of character physics on that actual physics object. - This would work in your case as well, just use character physics.


How to Model Smooth Models for Games with Low Poly I want to model for games.I'm using Unreal Engine for developing a game.And I have a few questions about modelling smooth looking models with low poly:

How many triangles supposed to be in a basic decorative model for a game which has a large map. Imagine You are modelling a mug and its just a decorative on the table and ı want to be my games graphics look nice I tried to model a cup and it took 2k-5k triangles is this too much? Subdivision Surface Modifier makes poly count very high.But without it models looks angular what am I supposed to do?

I wanted to make poly count lower and  I  tried to bake normals with a very low poly and high poly meshes.Low poly and high poly meshes was really different looking.High poly mesh was modified with Subdivision Surface Modifier twice but low poly was unmodified so when I tried to use this normal map on my low poly mesh it was looking weird(look photos for what ı mean)

Unreal Engine has an LOD system and when I try to make different LODs for my model with decimate modifier what I suppose to do about normal maps?Do I have to bake normal maps for every one of them.And its not just normal maps what about uv's and textures.

EDİT:After Retopolgize

Edit :My expectations

I've worked with various games engines for about 18 years now so I'll try my best to answer your questions.

For something kinda small like that I'd say 200 tri's at the very most. 2-5k is a LOT for a cup considering that weapons tend to be about 2k max. Also creating good levels of detial (LODs) might help a lot as well but I've not really worked that much with UE4 so not sure if people even do that for this engine.

I suggest looking into something called retopology. You basically take your high poly model and then draw your low poly over it making sure to have good topology. It's not super important for non-animated/rigged things but it's good practice. Here's a nice tutorial that demonstrates how to do it and the add-on is free. It'll help you greatly! What software are you using for your texture work? looking into texture baking would benefit you greatly as well, AFTER watching this video.
Blender 2.9 Retopology Getting Started

You won't have to remake textures and normal maps for the LOD's as the LOD's use the texture information of the model itself and, let's face it, from a distance you can't really see normal maps anyway.

If you need further help just ask ^.^


Changing the edge width in edit mode I've been watching BlenderGuru's tutorials, and his lines in edit mode are much thicker than mine.

https://youtu.be/9ViVKUiG8ks?t=3m51s

You can see, his lines are solid 2-3 pixel wide, mine are only 1. They also seem to disappear when I zoom in really close. Any fixes?

You can't do that in the current version. It may happen when 2.8 gets released but in the Blender Guru tutorial, he just zoomed the whole view. I suspect since his mouse cursor is still small that he's using the magnifier in Windows. Every operating system (Mac, Linux) has this functionality.


Launch failure after Download of 2.80 & 2.79 on windows 10 Currently have 2.79 on windows 10. Previously also had 2.80 but got rid of it to download a later build. Now WHEN I download it I cannot launch it successfully:

I proceed as normal to open it... ie click on blender.exe to launch it.But at this point it fails saying. " Code execution cannot proceed because the following cannot be found (though I can see them all there)..
avcodec-58.dll, python 37, SDL2, avformat-58.

Though I already have 2.79 working well - I  downloaded it again (to see if the problem was just 2.80 and when I came to launch it got...  code execution cannot proceed because following not found:
python 37.dll, libsndfile-1, open Al32, SDL2.dll

Any suggestions on how I can proceed to rectify this would be greatly appreciated.

I think what's going on here is that double clicking the zip file in the file browser doesn't actually extract the zip file contents, it just gives you a view of the zip file contents. That looks just like if you had extracted the zip file.

What you should do is:

Download the zip file
Right click it and do "Extract all"
After extraction is done, you should now be able to execute blender.exe from within the extracted folder.

One thing to look out for is that inside the not-extracted zip file, blender.exe will have a generic (non-Blender) icon.

After "Extract all", blender.exe will have the Blender icon.

The above instructions solved my problems when trying to run Blender 2.80 RC2 from a zip file on Windows.


How do I do a third person camera in the Game Engine? I've had problems with getting a third person camera to rotate correctly. I've tried taking first person camera python scripts and modifying them, as well as third person camera scripts already on the internet, and No matter what, they always rotate around the original position of the character, so when I move the character it will be able to move around like moving an object out from a rotating disk, if that makes any sense. Any help I could get with changing the rotation position would be great. Thanks.

EDIT: Nevermind, figured it out. If anyone is having the same problem, let me know and I'll put my answer.

# Third Person Camera - Made by Mobious

import bge
import math
import mathutils as mathu

# constants
# Feel free to tweak these.
SENSITIVITY = .003      # mouse sensitivity
S = .8                  # mouse smoothing
INV_X = 1               # invert x-axis
INV_Y = 1               # invert y-axis
MAX_DIST = 25.0         # maximum distance from player
MIN_DIST = 5            # minimum distance to obstacle or player
DRCAP = .5              # distance restore speed cap
RSMOOTH = 20            # camera range smoothing
FSMOOTH = RSMOOTH / 3   # front obstruction smoothing
ZSMOOTH = 13            # zoom smoothing
LRSMOOTH = 10           # camera LR smoothing
ZOOM_STEP = 1.3         # distance to zoom on mousewheel
Z_OFFSET = 1.0          # Z offset from player
HOR_OFFSET = 80.0        # Horizontal offset factor
MIN_ANGLE = math.pi/20  # minimum angle camera can be from verticle
PROP = 'block_camera'   # property that block camera

# Change 'Player' to whatever object you want the camera to track
scene = bge.logic.getCurrentScene()
player = scene.objects['Player']

# controls
ZoomIn = bge.events.WHEELUPMOUSE
ZoomOut = bge.events.WHEELDOWNMOUSE
ToggleLR = bge.events.MIDDLEMOUSE

def main():

    cont = bge.logic.getCurrentController()
    own = cont.owner

    mouse = cont.sensors['Mouse']
    rear = cont.sensors['rear']
    front = cont.sensors['front']

    # initialize vars
    if 'x' not in own:
        own['x'] = 0.0
        own['y'] = math.pi / 3
        own['dist'] = MAX_DIST
        x = bge.render.getWindowWidth() // 2
        y = bge.render.getWindowHeight() // 2
        own['size'] = (x,y)
        bge.render.setMousePosition(x,y)
        own['zoom'] = MAX_DIST
        own['oldx'] = 0.0
        own['oldy'] = 0.0
        rear.range = MAX_DIST
        front.range = MAX_DIST - MIN_DIST
        rear.propName = PROP
        front.propName = PROP
        own['LR'] = HOR_OFFSET
        own['LRinv'] = 1
        return

    # check and correct for camera obstructions using smoothing
    # obstacle in front of camera
    if front.positive:
        dist = own.getDistanceTo(front.hitPosition)
        if (own['dist'] - dist) > MIN_DIST:
            own['dist'] -= (dist + MIN_DIST) / FSMOOTH

    # obstacle behind camera
    elif rear.positive:
        dist = own.getDistanceTo(rear.hitPosition)
        if dist > MIN_DIST:
            if own['dist'] - own['zoom'] < 0:
                own['dist'] += (dist - min(MIN_DIST, own['zoom'])) / RSMOOTH
        elif own.getDistanceTo(player) > MIN_DIST:
            own['dist'] -= min(MIN_DIST - dist, own['dist'] - MIN_DIST) / RSMOOTH
    elif own['dist'] < own['zoom']: # restore max distance
        dist = (own['zoom'] - own['dist'])
        own['dist'] += dist / ZSMOOTH
    if own['dist'] > own['zoom']: # zoom in
        own['dist'] -= (own['dist'] - own['zoom']) / ZSMOOTH
    front.range = own['dist'] - MIN_DIST

    # mouse movement
    xpos = own['size'][0]
    ypos = own['size'][1]
    x = INV_X*(xpos - mouse.position[0])
    y = -INV_Y*(ypos - mouse.position[1])
    x *= SENSITIVITY
    y *= SENSITIVITY

    # smooth movement
    own['oldx'] = (own['oldx']*S + x*(1-S))
    own['oldy'] = (own['oldy']*S + y*(1-S))
    x = own['oldx']
    y = own['oldy']

    # center mouse in game window
    bge.render.setMousePosition(xpos,ypos)

    # zoom controls
    keys = bge.logic.mouse.events
    keys.update(bge.logic.keyboard.events)
    if keys[ZoomIn] and own['zoom'] >= MIN_DIST + ZOOM_STEP:
        own['zoom'] -= ZOOM_STEP
    elif keys[ZoomOut] and own['zoom'] <= MAX_DIST - ZOOM_STEP:
        own['zoom'] += ZOOM_STEP

    # update angles
    inv = False
    own['x'] += x
    own['y'] -= y

    if own['x'] > math.pi:
        own['x'] -= 2*math.pi
        inv = True
    elif own['x'] <= -2*math.pi:
        own['x'] += 2*math.pi
        inv = True
    if own['y'] > math.pi - 2*MIN_ANGLE:
        own['y'] = math.pi - 2*MIN_ANGLE
    elif own['y'] < 0.0 + MIN_ANGLE:
        own['y'] = 0.0 + MIN_ANGLE

    # LR toggling and smoothing
    if keys[ToggleLR] == 1:
        own['LRinv'] *= -1
    dist = own['LRinv']*HOR_OFFSET - own['LR']
    own['LR'] += dist / LRSMOOTH
    dist = own['LR'] / math.pow(own['dist'], 2)

    # calculate and set new camera position
    own['tdist'] = own['dist']*math.fabs(math.cos(math.pi/2 - own['y']))
    zshift = own['dist']*math.sin(math.pi/2 - own['y'])
    z = player.worldPosition[2] + zshift + Z_OFFSET
    yshift = own['tdist']*-math.cos(own['x'])
    y = player.worldPosition[1] + yshift + dist*math.sin(own['x'])
    xshift = own['tdist']*math.sin(own['x'])
    x = player.worldPosition[0] + xshift + dist*math.cos(own['x'])
    own.worldPosition = [x,y,z]

    #set new camera angle
    vec = mathu.Vector((own['y'], 0, own['x']))
    own.localOrientation = vec


Fastest way to divide plane into set of boards What would be the fastest way to divide a plane into a set of boards?
Ideally, I'd like to be able to loop cut through the plane, and then somehow create spaces through those new edges.

Into this:

I'd prefer a method that I could use for ex. top faces of cubes, etc.

You could simply split the plane along the loopcuts.

Add some new loopcuts
Select > All
Mesh > Split > Faces by Edges


How to have particles pursue a target around obstacles In Blender Game Engine, it is possible to have an object purse a goal around an obstacle using a 'steering' actuator and 'path following' behavior.

Is it possible to do the same thing using particles. I'd like to have a particle system find a path around an obstacle to get to a goal.

I suggest to give each particle a steering actuator too.

Ensure that these particle objects are recognized as obstacles.


hair isn't showing up in render I was trying to make a carpet but hair isn't showing up in in renders...why?

Did you try checking either strand render or adaptive render?  That could be it.  It could also be that you don't actually have any geometry to the hair, just lines, and that you need to add a: curve - circle into the mesh, then use that as the object for the hair.


Tank tracks/treads breaking when rotating hull I am working on an m1 abrams model and I plan on using it in an animation but I have encountered a problem.

I've parented the bezier circle to the hull and all works well when the tank is going straight, but then... i tried rotating it...

Its probably some amateurish mistake but I'm new and i cant find a solution.
googled it, the answers were mostly years ago so I'll also contribute by having a newer thread to look by everyone else

Edit 13th Feb 2019 - Added Blend file for a query in 'Blender Artists'.

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

The answer is in the way it's all put together, particularly the Origin points.  The Curve, Tracks and Empty must all share the same OP.

The steps below (deleted) cured my original tracks that I'd made ages ago and like yours, suffered badly with the screw effect when rotated in the Z axis.

I did this one with a single track, and duplicated it after.

The Details -

Delete all parentage and also delete the Empty.

Select the tank tracks and remove the curve modifier.

"Apply" the array modifier as it stands.  (make it solid)

Set the cursor to 0,0,0 with ShiftC,

Select the tracks, press ShiftS --> "Selected to Cursor".

Select the curve, and do the same (ShiftS)

With the tracks selected again, replace the curve modifier.

Add an empty with ShiftA.

Parent the tracks to the Empty

Parent the Curve to the Empty.

That should do it - you can rotate and move the Empty now without ill effects...

If this hasn't worked the 3D cursor may have been inadvertently moved from location 0,0,0.


What is the point of parenting mesh? Hi. I'am a beginner and studying a given file. I wonder what the point is having a mesh parent related others? just for convenience so that you can move all of them easily? why don't they manage via collection? is there any beneficial reason or situation for doing this for particular purpose?
I thought this feature is only used for rigging.

Parenting provides an important convenience in organizing assemblies of objects - as mentioned in the commentary to your question.

But I guess the most important distinction between joining or grouping objects and parenting them is that, as far as transforms are concerned, the parent-child relationship is one-way. Children inherit the transformations of their parent - but a parent does not inherit the transformations of its children. This is vital to animation and rigging.

Consider a fairly simple animation of, say, the Earth orbiting the Sun, and the Moon orbiting the Earth (even without rotating at different speeds on their own axes) .. try it without parenting, and you'd soon be convinced of the need for it. There would be a lot of maths to do :)


Menu disappearing in UV Edit mode The menu on the right disappears when I go into UV Edit.  Can anyone advise how to get it back please?

1 Go to View >> Area >> Vertical split then Editor Type >> Outliner

2 Go to View >> Area >> Horizontal Split Then Editor Type >> Properties

Hope that helps

Good Luck


Fluid simulation doesn't work while using a sealed container as an effector with the inflow inside? Apologies if this question has been asked before, but i've searched around and couldn't find any solution, especially amidst all the confusion between versions before 2.8 and after.
Also to note : I'm relatively new to blender, only been tinkering with it for a couple of weeks now. I've checked normals, made sure all modifiers are applied before starting simulation. Though in this case, its only a subdivision modifier.
I'm trying to make fluid inflow inside a sealed cylinder, like magic. But after countless hours of fiddling around and searching up online, i've found that :

if i remove the top of the container, fluid particles will show completely.
creating a small cutout on the side of the cylinder will only generate a small section of the particles.
Removing the container as an effector allows full-flow of fluid particles.

Goal : to see if i can show flow through a 'filter' medium.
Cheers :)

Immediately after writing this, i remembered something about planar surfaces and lo and behold, everything worked like a charm! Silly me for not knowing such a simple feature existed.


Is it possible to have a plane with its normal as reference for Transform Orientation Is it possible to have a plane with its normal as reference for Transform Orientation (Global, Local, Normal, Gimbal, View axis)? For example, I would like to select every face and scale to 0 to the normal Z-axis:

But if I select every face then this normal Z-axis changes:

You can create custom transform orientations. The shortcut is ⎈ Ctrl⎇ AltSpace or in the properties sidebar in the Tranform Orientations panel you will find a small + that will create a new orientation based on the current selection, in this panel you can also rename and delete any custom transforms you have created.

Once you have defined a custom transform you can activate it in the transform orientation menu so that your transform manipulator is oriented the way you want.


Is it possible to put an if statement into the scripted expression of a driver? If the y location of a certain object is greater than 0, I want to add a fixed amount to another object's driven channel. How do I achieve that?

A Python expression you can use is:

valueIfTrue if isConditionTrue else valueIfFalse

This is known as a ternary conditional operator see:
https://stackoverflow.com/questions/394809/ternary-conditional-operator-in-python


How to scale plane 2d with bmesh and floatproperty in ui? THe classic method of scale 2d object is like to

###some script to configure ob data bmesh etc.
pivot = Vector(0.5,0.5)
scale_factor = 0.9 decrease scale example

for v in bm.verts:
    v.co -= pivot
    v.co.x *= scale_factor
    v.co.y *= scale_factor
    v.co += pivot

but i whant controll the scale with floatproperty in ui panel like to

pivot = Vector(0.5,0.5)
scale_factor = my_float_property

for v in bm.verts:
    v.co -= pivot
    v.co.x *= scale_factor
    v.co.y *= scale_factor
    v.co += pivot

Clearly this cannot work, I tried to declare a previous value in another floatproperty, so I tried:

def myfunction(self,context):
    custom = bpy.context.object.mycustomclass

    pivot = Vector(0.5,0.5)
    scale_factor = 1- (custom.my_float_property-custom.last_float)

    for v in bm.verts:
        v.co -= pivot
        v.co.x *= scale_factor
        v.co.y *= scale_factor
        v.co += pivot

    custom.last_float = custom.my_float_property

but have some problem,it is not accurate.

Any idea how to control the scale with a slider, in fact (my_float_property)?

Use a setter getter on the property

Can keep the previous value of a property using the custom property ob["scale_factor"] to store the previous value.

Warning will cause an issue if you hit exactly 0.0, which may need to be handled in some way.

import bpy

def draw(self, context):
    layout = self.layout
    ob = context.object
    layout.prop(ob, "scale_factor")

def set_float(self, value):
    prev_sf = self.get("scale_factor", 1)
    sf = value / prev_sf
    self.scale.xy *= sf
    self["scale_factor"] = value

def get_float(self):
    return self.get("scale_factor", 1)

def register():
    bpy.types.Object.scale_factor = bpy.props.FloatProperty(get=get_float, set=set_float)
    bpy.types.TEXT_HT_footer.append(draw)

def unregister():
    pass
    # TODO

if __name__ == "__main__":
    register()

I have done the scaling on an object level here. For a mesh could use bmesh and

bmesh.ops.scale(bm,
        vec=(sf, sf, 1),
        space=Matrix.Translation(-pp), # pivot point (x, y, 0)
        verts=bm.verts)

or simply make the scale and translation matrices and

import bpy
from mathutils import Matrix, Vector
pp = Vector((1, 1, 0))
sf = 2
me = bpy.context.object.data

Sxy = Matrix.Scale(sf, 4, (1, 0, 0)) @ Matrix.Scale(sf, 4, (0, 1, 0))

me.transform(Matrix.Translation(-pp))
me.transform(Sxy)
me.transform(Matrix.Translation(pp))


How to Export "Selected Objects" to fbx in 2.77a I just upgraded from blender 2.72 to 2.77, when trying to export a single model in the scene with the fbx exporter, the export options that exist in 2.72 are all gone. One of the most important ones is the "selected objects" option.
Am I missing something here?

Nevermind, for some reason the UI scrolled all the way down, making it impossible to see the export options. After realizing that I scrolled back up and saw the options...


shrinkwrap deforms mesh I am trying to wrap one mesh around/against another, First I wrap it around with "simple deform" modifier, then shrinkwrap it; however, the Shrinkwrap deforms the mesh. How can I wrap it, without it being deformed?
[edit] .blend http://www.pasteall.org/blend/34302

first use the simple mesh  "before applying the solidify modifier " because it will be flattened when you apply the shrinkwrap
add the shrinkwrap modifier with these settings

select the target and hit  Ctrl + A and apply object transform


Is there a way to convert a constraint to a keyframe? I have a model in Blender with a full rig, including IK bones.
I also have a sword with two bones, on the top bone of the sword I have a set of constraints that copy the location and rotation of a child bone in the right hand.

The sword is then attached to the hand as expected. The second bone in the sword rig is the target for the left hand constraints that copy its location and rotation. In blender that works as expected.

I animate the primary rig right hand and the sword and the other hand moves as expected. The problem comes when I import the blender file into unity.

Unity is only seeing the right hand move but not the left. I can parent the sword to the right hand and it moves as expected. But the left hand data is not changing.

Back in blender I thought that if I were to select the left hand insert a keyframe (LocRotScale), when there was a keyframe for the right hand, that blender would then save the global position of the left hand, but when the new keyframe was inserted it had an orange line to the previous keyframe indicating that the position had not changed.

Is there away to get blender to save a keyframe for the left hand when the constraint moves it?

You could use Object > Animation > Bake action
(Or if you are in Pose mode, Pose > Animation > Bake action)

Bake action was added to the menu in Blender 2.62
(though it was previously available with Space> Search)
Unfortunately, there does not seem to be any documentation for this feature yet.


Trying to make a pie menu with custom operator Trying to understand how i can add the operator i made to a pie menu for me to use, when i run it nothing shows. Treat me like a noob at coding, thank you for your time

import bpy
from bpy.types import Menu, Operator

# spawn an edit mode selection pie (run while object is in edit mode to get a valid output)

class hyperbevel(Operator):
    bl_idname = 'Hyper.Bevel'
    bl_label = 'HyperBevel'

    def execute(self, context):
        bpy.ops.object.editmode_toggle()
        bpy.ops.mesh.select_mode(use_extend=False,use_expand=False, type='EDGE')
        bpy.ops.mesh.select_all(action='SELECT')
        bpy.ops.mesh.mark_sharp(clear=True)
        bpy.ops.transform.edge_bevelweight(value=-1)
        bpy.ops.object.editmode_toggle()
        bpy.ops.object.transform_apply(scale=True)
        bpy.ops.object.shade_smooth()
        bpy.ops.object.modifier_remove(modifier="Bevel")
        bpy.ops.object.modifier_add(type='BEVEL')
        bpy.context.object.modifiers["Bevel"].limit_method = 'WEIGHT'
        bpy.context.object.modifiers["Bevel"].segments = 3
        bpy.ops.object.editmode_toggle()
        bpy.ops.mesh.select_all(action='DESELECT')
        bpy.ops.mesh.edges_select_sharp()
        bpy.ops.mesh.mark_sharp()
        bpy.ops.transform.edge_bevelweight(value=1)
        bpy.ops.object.editmode_toggle()
        bpy.context.object.data.use_auto_smooth = True
        bpy.context.object.modifiers["Bevel"].width = 0.02
        bpy.context.object.modifiers["Bevel"].use_clamp_overlap = False
        bpy.ops.object.modifier_move_up(modifier="Bevel")
        return ('finished')

class VIEW3D_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label = "Operators"

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

        pie = layout.menu_pie()
        # operator_enum will just spread all available options
        # for the type enum of the operator on the pie
        pie.operator("Hyper.Bevel", text = "Hyperbevel")

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

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

if __name__ == "__main__":
    register()

    bpy.ops.wm.call_menu_pie(name="VIEW3D_PIE_template")

Register the operator class

Register the operator class.  The bl_idname needs to be in all
lower case, with one period. Blender 2.8 is a lot stricter on this
and must follow the naming convention between class and operator eg
OBJECT_OT_MyOperator and object.myoperator  [Links]
The operator returns a set that contains one of ('RUNNING_MODAL',
'CANCELLED', 'FINISHED', 'PASS_THROUGH', 'INTERFACE')  in this case
{'FINISHED'} which is a set as indicated by the curly braces.

Amended code.

import bpy
from bpy.types import Menu, Operator

# spawn an edit mode selection pie (run while object is in edit mode to get a valid output)

class HyperBevel(Operator):
    bl_idname = "hyper.bevel"
    bl_label = "HyperBevel"

    def execute(self, context):
        bpy.ops.object.editmode_toggle()
        --- removed for brevity ---
        bpy.ops.object.modifier_move_up(modifier="Bevel")
        return {'FINISHED'}

class VIEW3D_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label = "Operators"

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

        pie = layout.menu_pie()
        pie.operator("hyper.bevel")

def register():
    bpy.utils.register_class(VIEW3D_PIE_template)
    bpy.utils.register_class(HyperBevel)

def unregister():
    bpy.utils.unregister_class(HyperBevel)
    bpy.utils.unregister_class(VIEW3D_PIE_template)

if __name__ == "__main__":
    register()

    bpy.ops.wm.call_menu_pie(name="VIEW3D_PIE_template")


Subdivided mesh cube with texture How can I create a subdivided cube with the texture shown on the example:

An option to achieve this look would be to use a musgrave texture as the factor of two diffuse shaders. For this example, a quick search for 'grid image' gave me an image to use for slight displacement, and to keep things simple as the wireframe node will give triangles, and freestyle didn't look too good either.

This is the image used for the grid:

The node setup is as follows, note that the musgrave is connected to the object output of the texture coordinate node, and the mapping node to the UV output as the cube is uv unwrapped.

Play with the scale on the musgrave texture to get a look that you like, likewise with your grid texture in the mapping node.

This should give you a starting point, hope it helps. Finished result:


Height Map to Mesh conversion considering Transparency I'd like to create several meshes (e. g. mountains) out of a single height map. I'm currently using the displacement modifier. Is there a way that the displacement modifier would consider transparency or a solid color (e. g. black) and ignores these parts during the conversion? Or at least optimizes these parts during vertex creation?
Simplified example, height map:

The lower rectangular area is an example for transparency.
The generated mesh using the displacement modifier looks like this:

Everything that's transparent (or black, whatever works) should not be considered in the final model.
Is there some kind of automatism or do I have to remove the unwanted vertices manually?

The issue here isn't that it's not ignoring black.  It is.  (Technically, it's treating it as 0 displacement.)  The issue is that the areas that look black to you aren't fully black.  Open your image in something like GIMP and click around.  You're going to see that some of these pixels that you thought were 0/255 are actually up to 5/255.

If you're doing displacement in nodes, you could do some math editing there, but based on your goal, I bet it's via modifier.  You can do a little bit of editing of textures to bury the not-quite-black in Blender by adjusting brightness and contrast, but it screws with your picture in ways you might not like.

Really, the right place to do this is in an image editing app.

Displacement modifier is already reading your alpha as 0 displacement (black), despite the fact that the color underneath the alpha is white.  The reason for the border around the alpha, again, is that the rest of it isn't actually fully black.

I would recommend using higher color depth for displacement maps, especially those used at this scale.  Try making your image in Blender as a 32 bit, and if this kind of image is all you need, you should be able to paint it directly in the UV editor by switching from View mode to Paint mode.


Using rigify armature, how do I create a control for eye color? I am using a rigify armature for my character and all works great, but I also want to create an extra control for the eye colors, Like for example to make a nurbs circle that I can move to left and right which will modify the eye textures "Color", could someone give me step by step walkthrough?

Many thanks in advance!

You can add any object to be the controller. Then add drivers to the RGB component of your material. (Right click the RGB color box and click Add Driver). Then for the eyes, go into the Drivers Editor and select the Drier to be of type Averaged Value. For the object, have it be the object you want to control the color. Set type to Y rotation. You can do this for R G B and A. Then when you move/rotate your Nurbs circle (or whatever object you want, the color will change (need to be in rendered view).

Here is a .blend file with a simple set up. If this doesn't quite make sense, let me know!


How do I turn an imported SVG into a sphere? I am very new to blender and am making some models for use with Three.js.

The model I have created is a logo, as show below. I am quite happy with this but was curious if I could take it further.

How can i make this a sphere, instead of a disc? The resulting sphere would still have the white regions 'indented'.

The source shapes are SVG files. One file per colour region of the model.

Import SVG from Inkscape
Add materials.
Extrude all regions
Undo last extrude on white region.

Please see the example SVG file for the dark gray region.

Again, I am a bit of a noob, so please be as verbose as possible. Links to similar tutorials are most welcome.

There is no quick 'one-button-press' way to do what you want easily, especially not directly from the SVG imported Curve Objects. Curve objects are not very suited for modeling other than 'extrusion based shapes.

You can however quickly simulate an approximation of a 3D object by projection. It will yield very bad topology, and the resulting object will not be very suited for further modelling, but visually it may satisfy your needs.

Import your SVG curves, fix their center with the 3D cursor, and center them at the scene origin.

Add two sphere objects and scale one to fit the largest radius, the other to fit the smallest radius. Move the logos above your spheres

By this specific order select the matching curve > the select the corresponding sphere radius.
Enter Edit Mode, select all faces press the Spacebar Menu > search for Knife Project and then tick the option Cut Through.

Press Ctrl + I to invert selection and quickly remove the unwanted faces.

Repeat with the other curves for the corresponding spheres.

Assign materials to chunks of your mesh. Press L while hovering a part of the mesh to select all linked geometry

In the end add a Solidify modifier and an EdgeSplit modifier to your objects.

Have in mind that this is an approximation, and will not necessarily look good viewed from all angles.


How can I unlink all images from a project? I had a big project that I separated into smaller parts, but in every single file I now have all the images that I had in that one huge project earlier.

Unity has some problems with images linked to a project, so I want to keep it clean.

How can I delete all images from a project?
I had a script that can delete unlinked images, but how do I unlink them all?

Combining this and this answers, one may get code like this:

    import bpy

    for img in bpy.data.images:
        img.user_clear()

It will unlink all images in the .blend (one currently selected in the UV Image Editor will remain selected, but also will become unlinked, you can unlink one image by yourself or make improvement to the code).

Then you will only need to delete unlinked images.

The final code might look like this (thanks for evilferber's comment):

import bpy
for img in bpy.data.images:
  img.user_clear()
for img in bpy.data.images:
  if not img.users:
    bpy.data.images.remove(img)


Why are my render results not coming out the same as viewport? When I render my scene, it renders the solid view shading instead rendered view shading.

How do I fix this?

Use OpenGL Render instead:

It renders what you see in 3D-Viewport.

Blender 2.80 beta doesn't bring this function back, it might become available soon.


Help needed with AI generated texture I need to process sets of pictures (1 to 10 real life photos) from mammals to produce 3d models.
I need to automate this process:
1. normalise color among the set;
2. turn the set of real photos into a color texture. The 3d model and the texture layout is always the same for a specific species. I guess image reconstruction is needed;
3. extract the size parameters from the set (distance between eyes, legs, etc.)

Could you point me to the right techniques, people or organization to achieve this?

You should ask this question in computer graphic exchange.

Hiring some 3D artist for these job is a good option, seriously. If you find out the solution, Please submit your work to SIGGRAPH or any top-level conference. That's not an easy job for now but, yes, doable. And I don't think Blender can do anything for you except opening a finished 3D model or showing the result or provide a playground for 3D tweaking.

Answer for the question:

1. Normalize color among the set

A lot of work, just go searching "normalized color python".

2. Turn the set of real photos into a color texture.

Are the photo always take as the same angle? The animal type? If the photo has no obvious description point. It will be very hard to tell computer to recognize them. It's called feature mapping.

Also you will need to reconstruct the 3D model.

3. Extract the size parameters from the set

This is the most easiest part among these step. If you got Step.2 done correctly, you can directly know those 3-dimension coordinate of parts. Just calculate them using Euclidean distance.


hair renders weirdly there is a discrepancy between the viewport hair ( how I intend it to be) and the render in Cycles

What's the reason for this difference

It has something to do with "use modifier stack" checkbox in particles setting and hair grooming. Subsurf level should be the same for viewport and for render.


Completely hard edge in weight paint? I have a very low poly half peeled banana object, and the peels all have bones as they are to be animated. I'd like to have bones that ONLY affect the peels and don't deform the rest of the banana even slightly. The peels are just planes btw. The problem is I haven't found a way to do this in weight paint mode because no matter what if I paint a peel completely red, there will be a gradient touching and affecting the actual banana and neighboring peels a little bit. Shown here:

How can I completely remove that weight gradient so that it's hard transition from red to blue? Is it even possible? Is there a better way to rig this object?

You can select the banana part in Edit mode and in the Properties panel > Object Data > Vertex Groups, in the dropdown menu on the right, click on Remove from All Groups, so that this part of the mesh is not part of any group:


How do I project a texture onto an object on a single axis instead of it wrapping around the object? I'm trying to get a texture to work along one axis but distort along another, I know this sound weird but I'm trying to emulate a corrugated card effect.
At the moment I have your standard node setup:

Please ignore the scaling, I'm doing using this effect along different sized parts and rather than scaling the UVs it seems easier to scale the texture.
I can't sadly share a blend file as the work is pretty NDA heavy but I can provide a photo of the file and a reference for what I'm looking to replicate.
You can see how in the real image of corrugated card, it is cut, thus giving the impression that the effect is stretched around the edge

I've actually figured it out. If you put the camera in front view and project from view then it works perfectly :)
Hopefully this helps someone else as I know this can be really tough to achieve


How can I select all the keyframe for an object or many objects? Example 1:

I have object selected. How to select all the animation keyframes for that object?

Example 2:

I have 10 objects selected. How to select all the keyframes for all the 10 objects?

Goal:

I am to copy objects from one blender file to another. I want to keep the animation for the object but I want animation to happen at different time. So I need to select all the keyframe at once so I can grab them move them all at once.

Problem:

I cannot select the keyframe one by one, it would take too long. I cannot box select all the keyframe because there are too many objects (would take many pages of scroll down and box select) and cannot be selected on one screen. Plus the box select does not work good in dope sheet view. Even if you put the box around all the diamonds, it will not select all the diamonds in the box area. It will only select some diamonds. I have proof:

But this is beside the point. I want to select all keyframe for one object or for many object.

I believe I found a close answer. Since Google was no help, I click on all the buttons. I found butted that looks like mouse pointer on dope sheet bar and it is called "Only incude channels relating to selected objects" and if you click that you will only see keyframe for selected object or objects. So if you select object first then click button you can then select all and only get the keyframe for selected object or objects. If no one post a better answer in couple days I will select this as the answer.


Cycles emission behavior for colors at high strengths I have one object in my scene that I want to make really emissive and purple.

When I input the color purple (#8800FF) and crank up the emission strength to 100, the object turns pink and nearby surroundings turn pink.

When I input the color red (#FF0000), the object and its nearby surroundings remain red.

I realize this is due to RGB math, but regardless, I haven't found a way to fix it.  I'm basically looking for a purple lamp to have the same emission behavior as a red lamp.

Not possibly related @JTheNinja, absolutely related.

The answer is that your colour values are rendered in the scene referred domain. This means that whatever view transform you are using will end up having a "maximum" scene referred value. So what is happening with purple?

In the case of the red, we expect it to actually "blow out", or turn white. This is due to the emergent and learned aesthetic of photography. It however, remains a perfectly saturated 709 (Longer term ITU-R Recommendation BT.709) light red.

In the case of the purple, we are relying on a mixture of the 709 flashlights to mix to the colour. In this case, a purple clearly needs some 709 blue, but also possibly a bit of 709 green. What is critical to understand is that the colour of the purple is a byproduct of the ratios between the flashlights. Those ratios must always remain identical to "hold" the colour we see.

As a result, as the 709 flashlight for red exceed the display referred transform, the other values continue to ascend. The scene referred to display referred transform however, has ceased being able to maintain that ever critical ratio as the lower values crush towards the maximum ceiling. When the ratios skew, the resultant colour skews. In this case, given that we cannot express "more 709 blue", we lose the ratio, and the 709 red continues to crawl up and give you the more fuchsia colour.

So what is a more ideal solution? Ideally, what would happen is that the colour maintains a straight line between the original colour and the Illuminant white point. Why is this more ideal than what you are seeing? Because it allows you in grading to go back and pull in those desaturated values as you creatively need, maintaining the original colour if done correctly. It also "looks more normal" in that as a colour ascends up our virtual camera's dynamic range, it indeed "blows out" according to what our mental models expect. This has a tremendous impact on the aesthetic of renders. So it is win-win[1].

In the case of an ignorant tone map / sRGB transform however, the values have a fixed scene referred value (a dismal and pathetic scene referred value of 1.0 in the case of the sRGB EOTF), and the original colour, or chromaticity in colour nerd terms, is skewed wildly.

If any of this interests you, go take Filmic Blender for a whirl, as it seeks to solve this very issue.

[1] This is in fact a key difference between the hacky cameras such as RED and Ursa, and the more high-end industrial cameras such as the Sony F55/65 and the Arri Alexa. In the case of the formers, they skew their colorimetry precisely as you are seeing in your demo. In the case of the latter, there is a careful hardware transform that attempts to gracefully desaturate higher values such that the chromaticities hold, albeit desaturated.


Eevee. Grass in the distance looks white-grey I use a handpainted-grass for a Scene. In the Near, the colour is right, but in the distance the colour becomes white-grey.

It is a limitation on the way eevee deals with transparency.
As explained here: Cycles vs Eevee 15 limitations

Eevee’s Alpha Clip  layers materials from the front to the back, and looks nice and crisp. The trade-off here is that the material is either fully opaque or transparent, and can’t handle any blend between the two. They also tend to get more transparent as you move away from them. You can see in the example above that the tree in the back has its branches clearly showing through the leaves, even though it should be almost completely occluded


modeling cube into cylinder I am new to blender and currently trying to learn modeling techniques. I would like to change a square into cylinder. From what I've read the easiest way would be to use the array modifier and warp it around a bezier circle and then extrude that object. But I was wondering if there are any tutorials on how to do this using only transforms and only a few subdivides....To be specific, I'm trying to make a pillar object from a cube

I took the liberty to simplify the provided answers.

  Leon Cheung-method:

Bevel Ctrl+B edges and use Clamp Overlap C while beveling.

Example:

  stacker-method:

Enable LoopTools Addon that comes with Blender.

Then, use: W > LoopTools > Circle - Even though sometimes you need to manually adjust some angles.

Example:


Rigify wont generate rig I'm finding it impossible to generate my model's rig so I can animate it.. I've positioned the metarig twice now, re-imported the model as a much lower poly-mesh, checked the mesh's integrity and looked for any detached parts that aren't meant to be detached, and hid the separate meshes from the scene; (which I need visible and unattached for the animation); and it still throws this error.

Every tutorial I've found and followed waits until after the rig's generation to parent the rig and the mesh, but I did try doing that before as well. That resulted in just the circle with arrows at the model's feet, but no actual rig.

The only bones I deleted from the metarig are the face bones, and the only other edit I made to the metarig was for one of the spine bones. Before the NoneType error, it gave me an error that one of the spine bones was disconnected. In order to get that to work, I had to parent the ends of that and the bone it should have been parented with together.

I don't know what to do at this point. I've been bashing my head into the problem for going on 3 weeks now and have made 0 progress. I'd really appreciate some help.

Blend file:

I studied your file and I see there are quite some edits you have made on the metarig. Just for comparison, here's your metarig:

And here's my version, where I only added the Cat metarig (edit note: you used the wolf rig, a little different in the names but that's not a big deal) and moved its bones around to fit your model:

(Note I hid the facial & fingers bones for readability).

See the bones spine.004 and spine.003.
Their heads are in the same position in the raw metarig and in mine, but not in yours. If I separate them in my rig, then I get the same errors you get.
That's one of the things you must pay attention to: when two bones have their heads or tails aligned, you have to preserve that.

In edit mode it's easy, just select both spheres in one shot using a multiselect tool like the circle select. To correct it, you can use vertex snapping (but hide your mesh then) or cursor snapping with ⇧ ShiftS (select one part → ⇧ ShiftS → Cursor to selected, then select the second part → ⇧ ShiftS → Selected to Cursor).

Fix the tail this way and it should work fine.
It works perfectly on my side with your scene so there should be no problem here.

If you need extra edits, then I recommend you to thoroughly study Rigify's manual. It's too long to explain here but the manual does a great job at explaining how to use this addon and also gives tips on how to do things more easy for you and more accurately.

Oh, and... Please correct your bones placement x)

Good luck!