How can I view my scene using the Oculus Rift CV1 and the OpenHMD branch of Blender? On Graphicall there's a branch called OpenHMD, which basically should enable Blender to interact with VR glasses like the Oculus Rift. I do have a CV1 (consumer version) available, as well as a DK2 (development kit 2). When running the branch, I can open an OpenHMD window just fine, and I can also start the session as expected. The tracking even works well, when I move the Oculus, the viewport updates. Here's a screenshot:

But the Scene is never drawn on the goggles. I've followed the instructions of the manual here regarding switching the device to immediate mode. But that should mean I need to somehow move that window over to the Oculus. Thing is: I can't do that. The window snaps to all screen boundaries, I can never move it off-screen so it would show on the Oculus. Any ideas welcome.

Assuming you are using Windows:

The way to enable this is to switch the Oculus in Extended Mode, this is done by running a specific tool that Oculus delivers with the driver (example is https://www.reddit.com/r/oculus/comments/4nvy7o/rift_dk2_possible_to_activate_extended_mode/).
Opening the HMD window in Blender should start the display in extended mode, if you can not view your desktop through the Oculus before moving the window, It is not activated correctly.

When using Linux:

If you are running Intel or AMD, this should work fine out of the box, with Nvidia, if you have recent drivers, you may need to enable Extended mode by adding AllowHMD in your Xorg, instructions can be found here: http://us.download.nvidia.com/XFree86/Linux-x86/378.09/README/xconfigoptions.html


clear ID Properties completely I want to add some custom properties to a bone by an if statement

if len(bpy.data.armatures[armSearch].bones[boneSearch].items()) > 1:
    itemCount = len(bpy.data.armatures[armSearch].bones[boneSearch].items()) + 1
    bpy.data.armatures[armSearch].bones[boneSearch]["skName"+str(itemCount)] = shapeKeySearch

elif len(bpy.data.armatures[armSearch].bones[boneSearch].items()) == 1:
    bpy.data.armatures[armSearch].bones[boneSearch]["skName"] = shapeKeySearch

else:
    bpy.data.armatures[armSearch].pose.bones[boneSearch]["skName"] = shapeKeySearch

But when I look for the ID properties in the console there are already tow of them even though I deleted them. How can I delete them completely ?

You delete custom ID property by:

del pose_bone["ID_prop_name"]


How can I make a texture flow along a bent mesh? My Goal is to create a texture that flows along a path.
An analogy would be like liquid flowing through a crazy straw.

As an example, I've created a Texture Coordinate. This links to a Checker Texture node. Then plugs into a Material Output

To animate the texture, I animate an Empty to move along it's Y axis. This Empty is linked to the Object selector in the Texture Coordinate node and the Checker Texture's Vector input is hooked up to the Object output from the Texture Coordinate node.

This works pretty well on a stretched out cube:

But fails when I bend that geometry. Technically, it's doing exactly what we might expect given the order of the nodes, but my goal is to have the pattern flow down the geometry and through deformations.

The solution that comes to mind is to change the node order, but Texture Coordinates doesn't have an input.

I get this when I remove the Texture Coordinate node, but lose the ability to manipulate the texture position along the mesh:

If anyone can help me figure this out, I'd appreciate it.

Note: controlling the texture with an Empty isn't a requirement. I just need something that can be key framed, such as a Math node.

Edit: It looks like the problem has been fixed in the last version.

Old answer:

In 2.8 it looks like you need to mark seams and unwrap, then in the Shader Editor use the Texture Coordinate UV socket, play with the Location values of the Mapping node to make the texture move along the object. In the UV Editor you need to make sure that the UV is well placed if you want the texture to go in the right direction.

In 2.79 you can use the Texture Coordinate > Generated output socket instead of the Object output, then plug it into a Mapping node, play with the Mapping > Scale value to have the right proportion. Now with the Mapping > Location value you can make it move.


cycles: ghost material / object alpha without texture I would like to create a ghost material like this:

It's like in Blender Internal, making some complex material and reducing its alpha value.

But since Cycles is a physically correct renderer, I can't simply add a transparency shader – it always shows the inside of the object.

Here's my material setup so far. Simple enough, it's just a standard material where I want to add transparency. I saw some promising nodes, like Light Path with Transmission Depth but couldn't get any useful result so far.

Is it possible to get this result, without rendering in several layers and composing the picture later? If using this approach, I get difficulties with e.g. reflections.

You probably want to filter out back-facing sides when using transparency.


How do I "unlink" or "make local" a created proxy? How can I remove a linked library that pertains to a created proxy without deleting or altering the proxy or proxy's data?

Using the "make local" function,L in object mode, simply unselects the selected proxy without making any changes.

As a workaround, one could save the proxy's associated data(Animation,Materials,etc) through fake users, then delete the associated linked library in the outliner, append the original object or armature the proxy came from, if the file is still available, and then reassociate the data.


Can I make my own Allow/Deny selection switch? Let's say I restricted all objects from being selectable from the outliner except for one that I can use to control the state of other object's selectability.

I just need to know can an object's state affect the state of another object's selectability other than using the outliner? And how would I do it?

We can use drivers to control a property from another property. Note that there are some limits, for example, an objects visibility doesn't seem to trigger an update of drivers that use it.

Lets start with three objects, a cube a monkey and a torus.
Add a custom property to the cube (see below), click edit and rename it select_control then set the value to 1, as we enter a whole number it will prevent decimal numbers being entered.
In the outliner, right click on the selectability of Suzanne and choose Add Driver->Single From Target. This will give you an eyedropper cursor, click on the cubes custom property we just created. Note that the value is now highlighted in purple. This applies to 2.78, previous versions you choose Add Driver and then manually edit a driver expression.
Repeat for the torus

Now as you alter the value of the cubes property, the selectability of the monkey and the torus also change.

Drivers can be any python expression and can be edited in the graph editor in driver mode.

A custom properties panel can be found in several tabs of the properties editor, for this situation a property attached to an object makes sense, a scene property could also work. Adding a custom property is as simple as clicking the add button, it can be useful to also edit the property to give it a more meaningful name and adjust the limits if you want values larger than 1.0.


Does a child object inherit the matrix from the parent? When you create a hierarchy with nesting like so:

Does Circle inherit the properties from the parent matrix? Or is first the matrix of Cirlce.001 applied followed by the matrix of Circle?

You can't tell by the values in the editor since it could subtract with the parent values.
So hopefully a programmer can answer me this.

Basics of Local and Global Coordinate systems

Each object in blender has a number of matrices. Its global transform matrix ob.matrix_world its local space matrix ob.matrix_local.  The basis matrix ob.matrix_basis, this is what you see in the "editor"

and its parenting matrix ob.matrix_parent_inverse (This is set when choosing parenting Keep Offset for example)

Relation between basis and local

ob.matrix_local = ob.matrix_parent_inverse @ ob.matrix_basis

As an example, select an object and calculate its global matrix by going up the hierarchy chain.

import bpy
from mathutils import Matrix

context = bpy.context
ob = context.object
M = Matrix()
print(ob.matrix_world)
while ob.parent:
    M = (ob.matrix_parent_inverse @ ob.matrix_basis) @ M
    ob = ob.parent

M = ob.matrix_basis @ M

print(M)

similarly

import bpy
from mathutils import Matrix

context = bpy.context
ob = context.object
M = Matrix()
print(ob.matrix_world)
while ob.parent:
    M = ob.matrix_local @ M
    ob = ob.parent

M = ob.matrix_local @ M

print(M)

Result on test case, Cube is parent of Cube.001 is parent of Cube.002 some random transforms applied to each.

<Matrix 4x4 ( 0.3256, -0.9107,  0.8122, -3.8782)
            (-0.6125, -0.9379, -0.8588, -6.2457)
            ( 1.5886,  0.1065, -0.9282,  4.2578)
            ( 0.0000,  0.0000,  0.0000,  1.0000)>
<Matrix 4x4 ( 0.3256, -0.9107,  0.8122, -3.8782)
            (-0.6125, -0.9379, -0.8588, -6.2457)
            ( 1.5886,  0.1065, -0.9282,  4.2578)
            ( 0.0000,  0.0000,  0.0000,  1.0000)>


Any way to recreate this procedurally and random? I've recently been trying to create a personal library of node groups and materials to get a better understanding of blenders material nodes, but I'm a bit stumped on how to recreate this

I'm trying to use something like this to create coordinates for a material I'm working on, as well as add a gap with a dynamic profile like the brick texture by using a color burn and color dodge. I also mocked a graph of the values in desmos to help in understanding

It may be possible to extract the right information from Blender's own Voronoi texture, but you'd have to call it twice, and I'm not sure it would save any nodes. (Someone will correct me now...)
So this is a roll-your-own 1D Voronoi. That is to say, it is per-cell random, not full-space random. The method:

Divide X into unit cells
Seed a random 0-1 number for each cell using the cell's index (its minimum coordinate).
Consider the random number to be the offset of a feature-point F for that cell, from its minimum X.

Now, for any shading-point P, we know the location of F in its own cell, and the location of the feature-point F' in the previous cell. That's enough.
If we're to the right of F, then f(x) =  P.x - F.x . If we're to the left of F, f(x) = P.x - F'.x.
That all takes more plumbing than you might expect, and unhelpfully, in the illustration, I've called F P_this, and F' P_prev:

You may be able to trim it down..


Is there anyway to make particles have an influence area around them that will let them collide, without having to turn them into rigid bodies? I want to make a particle simulation, however, is there any way to set a sphere as a child and then set an "influence radius" around each particle as like a collision box? I know you can set them to rigid bodies but that really slows down the simulation.

You can add a force to the particles to effectively repel each other as in this answer https://blender.stackexchange.com/a/84426/29586. It isn’t ideal as it relies on the particles being all the same size and it isn’t physically accurate (but is a quick and dirty method).

Another option is to use the Molecular Script add-on (http://pyroevil.com/molecular-script-docs/) which physically simulates the particle collisions.


How can I make it so materials are linked to objects instead of data, with Python? How to add material to selected objects via python?
Material must be linked to Object (not Data).

If you hover your mouse over a button, it will often tell you the python binding that can be used to invoke similar actions to the button. In this case:

So first you assign it a material, and then go and, from the object, change the data link.

To set all materials to 'object' for a single material:

obj = an_object
for mat_slot in obj.material_slots:
    mat = mat_slot.material
    mat_slot.link = 'OBJECT'
    mat_slot.material = mat

I am not sure why re-assigning the material is necessary, but hey, it works!

To set a single material slot (untested):

obj = an_object
mat = a_material
mat_slot = [m for m in obj.material_slots if material_slot.material == mat][0]
mat = mat_slot.material
mat_slot.link = 'OBJECT'
mat_slot.material = mat

To assign a material, something like this could be written (untested):

def applyMaterial(obj, mat, mat_slot=0):
    obj.material_slots[mat_slot].link = 'OBJECT'
    obj.material_slots[mat_slot].material = mat


Extract the rotation (or heading) from local matrix (Blender Python) If I use physics then the objects rotation not changed but I want to detect the object rotation based an another empty axes (or the world mtrix).

I tried extract rotation attribs from local matrix but I stucked.
Are there a built in function for extract the actual rotation values of the objects?

Quaternion.rotation_difference(...)

Can represent the matrix world of both your objects as a quaternion. Its rotation_difference(...) method returns a quaternion describing the rotation required to go from one alignment to the other.

Test script, select objects, then axis last so it will be active object. Script below prints the XYZ Euler rotation required by axis  to match object.

import bpy
from math import degrees

context = bpy.context
ob = context.object
others = context.selected_objects
others.remove(ob)
axis = ob.matrix_world.to_quaternion()
for o in others:
    q = o.matrix_world.to_quaternion()
    rotdif = axis.rotation_difference(q)
    print(o.name, tuple(degrees(a) for a in rotdif.to_euler()))

Result of running on default file with "Camera" as axis object.

Cube (-54.05801712949699, -40.65919063845337, -25.28499489226661)
Lamp (-10.627706900421787, 53.1995955395152, 34.18299651274404)


How do a create a foldout UI panel? I have an add-on with rather a lot of UI options and am trying to find a way to clean it up so that not all the options need to be shown at once. I've noticed that some of the default tools have foldout sections, but I can't figure out what UI component I need to use to get the same behaviour.

Here is an example of what I'm talking about, showing the Color Picker panel open, but Color Palette and Options panels folded up. Is there a simple UI component I can use to emulate the behaviour and visual style of this in my add-on?

These UI elements are called panels. When using bl_options = {"DEFAULT_CLOSED"} they will start in a closed state.

The following example add-on creates three panels in the sidebar of the 3D View in a closed state, which looks like this:

bl_info = {
    "name": "Multiple panel example",
    "author": "Robert Guetzkow",
    "version": (1, 0),
    "blender": (2, 80, 0),
    "location": "View3D > Sidebar > Example tab",
    "description": "Example with multiple panels",
    "warning": "",
    "wiki_url": "",
    "category": "3D View"}

import bpy

class EXAMPLE_PT_panel_1(bpy.types.Panel):
    bl_label = "Panel 1"
    bl_category = "Example tab"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_options = {"DEFAULT_CLOSED"}

    def draw(self, context):
        layout = self.layout
        layout.label(text="This is panel 1.")

class EXAMPLE_PT_panel_2(bpy.types.Panel):
    bl_label = "Panel 2"
    bl_category = "Example tab"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_options = {"DEFAULT_CLOSED"}

    def draw(self, context):
        layout = self.layout
        layout.label(text="This is panel 2.")

class EXAMPLE_PT_panel_3(bpy.types.Panel):
    bl_label = "Panel 3"
    bl_category = "Example tab"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_options = {"DEFAULT_CLOSED"}

    def draw(self, context):
        layout = self.layout
        layout.label(text="This is panel 3.")

classes = (EXAMPLE_PT_panel_1, EXAMPLE_PT_panel_2, EXAMPLE_PT_panel_3)

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

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

if __name__ == "__main__":
    register()

Notice that as of Blender 2.8x, we can have sub panels to save even more space:

class EXAMPLE_panel:
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Example Tab"
    bl_options = {"DEFAULT_CLOSED"}

class EXAMPLE_PT_panel_1(EXAMPLE_panel, bpy.types.Panel):
    bl_idname = "EXAMPLE_PT_panel_1"
    bl_label = "Panel 1"

    def draw(self, context):
        layout = self.layout
        layout.label(text="This is the main panel.")

class EXAMPLE_PT_panel_2(EXAMPLE_panel, bpy.types.Panel):
    bl_parent_id = "EXAMPLE_PT_panel_1"
    bl_label = "Panel 2"

    def draw(self, context):
        layout = self.layout
        layout.label(text="First Sub Panel of Panel 1.")

class EXAMPLE_PT_panel_3(EXAMPLE_panel, bpy.types.Panel):
    bl_parent_id = "EXAMPLE_PT_panel_1"
    bl_label = "Panel 3"

    def draw(self, context):
        layout = self.layout
        layout.label(text="Second Sub Panel of Panel 1.")


Unable to position the camera perfectly [![I used blender's old versions many years ago. In 2.8 UI has been changed. I am at a loss. I am in need to get a rendered image tomorrow, a cars interior picture, I got the .blend file from internet (https://free3d.com) (url will be given below) but unable to render the image with intended perspective (intended one is shown in green in picture).

Please help me get a nicely rendered image of the required perspective. It will be very helpful for me. URL of .blend: https://we.tl/t-2b2hcIFG9y ]2]2

If you want, as it were, to change the crop of the existing perspective you can see, that's a (true) zoom, rather than a track/dolly of the camera, which is what the scroll-wheel gives you.

Select the camera by left-clicking its border in Object Mode, go to its Properties > Data tab, and change its Focal Length setting.


How can I get the Clone tool in texture painting? My goal is to learn texture painting. I was watching this tutorial, but got stuck, at 7:45, when they switch to the clone tool, in texture painting. Since I'm using a more recent version of Blender than the one on the tutorial, the button I'm looking for is not in the same place. So, where is it?

According to "someonewithpc" I need to give up trying to use the clone tool. I think there must be a way to get from where I am at in the process, to making a UV Map that I can wrap around the geometry using a combination of the front and side projections that I created on those sides.  I think that is what is shown in the answer given, but I am stuck.  How would you finish the project?

Obviously the side needs the most work, also the top and back.

Consider using a source texture to paint on the mesh.

Edit 12/22/2015.

Your question now shows more of your progress.

Historical Note.  At first I thought you were getting no texture paint results at all.  Thus I encouraged you to use an image source and the simpler brush first as step 1 for major results.  I estimated  the clone brush could wait a learning period. From you edits above your are ready to use the clone brush.

TexDraw brush step 1.  Clone brush step 2.  Then you decide and refine in step 3 and beyond.  Those are my suggestions.

Nooks and crannies that might not be visible in your reference photographs are suited to clone paint as your video shows.  Some people also have top of head photos.  Neck photos.

The interface of texture painting has changed since your video.  I was not really emphasizing this change in the very capable and complex texture painting.

Apologies for lack of clarity.

Here is an image below.

The sphere is using a texture in this first image.  This will be the target of your painting work.  Under the Tools pane on left you see the human figure texture as the source of Stencil painting with a regular [TexDraw] brush.  The Image editor windows show some results on the target texture.  In the 3D View / Texture paint window.  You see the large transparent brush stencil next to some finished painting work on the sphere placed in the distance. The arrangment is for discussion purposes.

A alternate image explanation.

Note the brush is a TexDraw brush.  Brush mapping is Stencil.  Do not use Clone Brush yet.  First feel comfortable with the TexDraw.   Clone Brush is a second step.

You may look at the history of this document to see the previous version.


Remove unwanted material So guys here is the problem. I add a material to a mesh, then I feel like I don't want that. How can I delete it? Even when I am deleting it, it's still there after reopening in the drop down list of materials. Now the thing is it says that it has 3 users although i can't see any. Please do help me I am attaching the file as well.

Link to file : https://gofile.io/?c=VltNPo

To find all the objects currently using a material.

If you have one of the objects selected,  ShiftL (Select Linked) > Material will select all visible objects using the same material as the one in the active slot. ( you may have to unhide objects to select them).
If you can't easily track down the object, you can switch the Outliner to Data API view (highlighted)..

.. select the material you're interested in, right-click, and, again, Select Linked.

To unlink a material from all objects ..
(Setting users to 0, even if you haven't found them)

Shift-click the 'Unlink' button in the materials panel ..

..Although it will continue to appear in the dropdown, the material will not be saved in the .blend file. Next time you open the file, the material will be gone.


How do I get my Cycles materials into blend4web? Just downloaded and installed blend4web.  Very nice tool.

Have a nicely textured model in Cycles, but when I export to .html it is all black.  No materials, no lighting.

Couldn't find beginner tutorial how to apply materials.  Could someone please describe what we need to do?

I hope it does not involve baking the textures.  Would like a simpler way.
Thanks

In Blender there is the Cycles render engine (non-real-time) and the GLSL viewport (real-time). Both has its own set of material nodes. Blend4Web is a real-time engine and thus leverages the viewport's nodes.


Tracking: Object Solver not following tracks (with file) I am working on a scene where I have to track the camera motion and the motion of a prop with markers. I get a good camera track and a decent enough object track
(It's just as a reference to the animators).

My tracking markers for the object track are being scaled so that they are exactly where I need them to be in space and the camera track is scaled to match real world units from the set.

Just judging from the markers, everything is exactly where it needs to be, moves exactly as I need it to. However I am completely at a loss why I can't just have an object follow the object trackers movement. The object solve just puts it in a weird place behind/above the camera, moving the object by hand doesn't do any good either. It can't be that hard, can it?

Just make the mesh follow the trackers (which already move fine in 3d space).
Even using the follow track constraint instead of an object solver (cue desperation) and selecting a specific track out of the object track (which highlights correctly!) it still puts it all in a completely wrong position with a wrong motion. I tried parenting something to the object with the solver, to extrapolate the motion to my scale, to no avail.

Can anyone help me figure out what I have to do differently?

EDIT:
Seems to be a scaling issue. Apparently Blender doesn't allow me to scale the camera track at all (for it to match real world units) without messing with my object track. Anyone has any idea how to avoid it? I fear it might be a bug?

Find the cleaned file here:
http://pasteall.org/blend/index.php?id=52941

I think I got it working: http://pasteall.org/blend/index.php?id=52943

The key for aligning the "Tracks" mesh from the 3D Markers To Mesh operator is to add the object solver, choose tracking object and tracking camera, and then hit "Set Inverse". After that it should be lined up fine.

I deleted everything before in order to start from scratch.

Not sure how you setup your camera solution, but I used Tripod solving, as there is nearly no movement at all, so tracking only rotation should be enough. And when you do Tripod, you don't need so many markers. A handful is usually enough.
When you do the Object Solve you have to turn off Tripod of course.

What made the file behave a bit weird for me was not having the footage, so I was a bit confused which resolution to use. Using 256x256 seems to work though. Seems that when you solve and no footage is present Blender screws up the solve, as it tries to apply a square aspect ratio to the original resolution or something like that.

In fact, if you are only after the object's motion, you do not need a camera track at all. Simply ignore the camera motion and add an additional "object" in the clip editor so you can solve the object motion.


How can I effitiently pack texture according to existing UV? I have an UV (f.e. projected from view) and an image, and I want to rip the image and destructure UV to pack texture more effitiently. Can I somehow auto-generate a new image and UV that uses 100% of texture space (removing unused parts)? Or is it unnesessary since I export mesh into glTF? (don't know how exactly texture is stored in that format tho)
upd:

that's my uv, and i wondering how can i easily remove "unused pixels" from my texture, f.e. auto-stretch uv (and pixels below) into 256x256 rect. i want to use maximum area of texture, but don't want to modify uv mannualy.

I'm not sure you will gain something keeping your current UV, you will have a hard time getting accurate and precise texel density & texture details on your mesh.
Using orthographic projections like that is not that effective, at least not on organic shapes and not with some help from other projections and other techniques.
I'd suggest you use your current technique only as a way to quickly build a final texture that correctly wrap around your mesh with no waste.
A simple way to do that is simply to bake your current projected-from-front texture into another texture that's based on a more correct UV map.
Assuming you start with such a scenario, with your mesh, unwraped by projection, with a simple material like a sole emission shader with your texture plugged in:

Head to the Properties editor > Object Data tab > UV Maps panel > click the + icon to create a new UV map and give it a nice name.

With that new UV map selected, make you new unwrap to your needs. Using auto UVs unwrap methods or manual unwrap, or both, ... as you wish.

In the shader editor, add a UV Map node and a new Image Texture node. Plug the UV Map output in your new Image Texture node, ans select your new UV map in the UV Map node. That's what will enable your new texture to use that specific UV Map instead of the default one. Then use the Image Texture node's New button to create the new texture in which we will bake.

Make sure you keep that image texture node selected, and only that one. That's how the baking will know in which texture to bake.
In the render settings, set the render engine to cycles. Then in the Bake panel, if you plugged your color texture in an emission shader as I did, set the bake type to Emit. Otherwise, you would probably need to set it to Diffuse and check only the Color influence. Also play with the margin value, the baking will overflow your uv islands a little to avoid empty pixel parts, but if you est it too big it will overflow on other islands.

Hit the Bake button, it will bake your first UV map's result into your second uv map. Once done, you will have your new texture that uses your UV space as you want:

Then you can replace the texture in your shader.
Be aware that when you have multiple UV maps on a mesh, only the one with the camera icon can be used in your shaders without manually specifying it via a UV Map node. So if you don't want this, check the camera icon on the new UV Map to set it as default, or even delete the other UV Maps if you don't need them.


Does Blender 2.8 have the abililty to make a cylinder with round ends As the title says, does Blender 2.8 have ability to create a cylinder with round ends; as part of the cylinder creation.

I have seen the options discussed for previous versions, and will likely use the bevel option if this cannot be done.

Thank you,

Jim

There isn't a builtin Capsule, which is activated by default.

But since it is a sphere with extra steps, I'll just demonstrate the steps in case they'll help someone.

Add a UV Sphere. ⇧ ShiftA
Go into edit mode. ↹ Tab
Edge Loop Select the equator. ⎇ Alt RMB
Do the Rip Fill. ⎇ AltV
Border Select the rip filled half. B
Move the half along Z. G Z
Add loops. ⎈ CtrlR,  MMB scroll


Cannot deselect edge loops in blender 2.8 with Shift+Alt+LMB Cannot deselect already selected edge loop with Shift+Alt+LMB. The hotkey selects edge loops perfectly fine, but deselection is not working for some reason. Is there a menu where I can change hotkey for it or maybe I need to turn something off for deselection to work?

I had the same problem back in 2.82.
I unchecked Emulate 3 Button Mouse in the Input tab on User Preferences which is unfortunate because although I have a three button mouse, I prefer to use the Alt + LMB.


blender api - get current location and rotation of camera tracking an object I have a camera with an object constraint to track an empty plain axes. I want to get the camera's current rotation, since when the axes move, or when the camera changes location, the camera rotates in order to track the axes.

however, when I read the value using  C.scene.camera.rotation_euler, the values never change, even though the camera clearly has rotated in order to follow the axes.

>>> C.scene.camera.rotation_euler
Euler((-0.2408553957939148, -0.0, 0.0), 'XYZ')

How do I get the correct values of the camera rotation?

Use the matrices

Use the cameras matrices to get the visual transform.  For global transform use ob.matrix_world

>>> C.scene.camera.matrix_world.to_euler()
Euler((1.1093189716339111, -0.0, 0.8149281740188599), 'XYZ')

>>> C.scene.camera.matrix_local.to_euler()
Euler((1.1093189716339111, -0.0, 0.8149281740188599), 'XYZ')

The matrix can be decomposed to location, rotation and scale. The quaternion rotation can be converted to Euler if need be.

>>> loc, rot, scale = C.scene.camera.matrix_world.decompose()
>>> rot
Quaternion((0.7804827094078064, 0.483536034822464, 0.20870360732078552, 0.33687159419059753))

>>> rot.to_euler()
Euler((1.1093189716339111, 4.011331711240018e-09, 0.8149281740188599), 'XYZ')


How do I export a model to .obj format? I use Blender to create my 3D models for my Android app that uses OpenGL ES. The default output format for a Wavefront file (.obj) is not compatible with my Wavefront file parser. How do I get Blender to output a Wavefront file that has the following elements:

All Verticies and Faces (faces as triangles, not quads)
Texture coordinates (UV Mapped)
Preprocessed Normals

If you wanted to export a simple model such as:

as a .obj file that is compatible with OpenGL or another 3D graphics platform then all you do is go to export:

Look for the export options in the toolbar in the bottom left corner. This will allow you to choose the specifications for the output file:

The options I am using above are compatible with OpenGL ES, you may have to adjust your properties accordingly. This type of export will produce a .obj file (geometry file) and a .mtl file (materials and textures file).


How do I merge multiple animated Armatures? I have multiple armatures, each doing its own thing something like this:

I want to merge all the armatures and bake all actions into one.
The problem is if I try to select all armatures and press Ctrl + J, only one of the armatures keeps its action, the rest looses it.

Do the following:

Copy all armatures in object mode and merge by ctrl+j. You will lose animation data, but this not a problem, we will copy keyframes from separate ones.

Enter the Pose Mode and add one keyframe to all bones. We need this to get animation tracks.

Now move to the dope sheet editor and copy all keyframes from the separate armatures. When select new one and paste keyframes there.

Now you don't need old armatures, remove them


Attempting multiple loop selects with Alt+LMB; faces are being selected in some parts as well? Why is this only occurring on the top/bottom of the model, not on the sides?
How do I avoid this happening? (I only wish to select the edges while in edge select, not the faces also)

I'm using v2.81.16. Switching to Vertex or Face mode causes even more faces to be selected than the image below. I am unsure if that is intended behavior.

Thank you in advance

The faces are not being selected, Blender auto-highlights faces that you have selected all the vertices/edges for.

When you are switching from edge to vertex mode, all vertices connected to the selected edges are selected. However, if those vertices happen to encompass the entire face, the entire face becomes highlighted. Then when you switch back from vertex selection to edge/face selection, all edges/face between/surrounded by the highlighted vertices are selected.

This is demonstrated below on a cube. I first selected the top and bottom edges, then switched to vertex mode. When you switch back to edge mode, all edges between adjacent vertices are highlighted, resulting in you having all four edges selected.


How to edit normals so light is even all the way around for grass patches? I've been trying to do this with the edit normal modifier, but I can't get it how I want, and that is because I don't full understand how to use that modifier.  Maybe there is a better / simpler way than what I am doing?

I am making grass in Blender that will be used in Unity.  I have a mesh with the grass texture on it.  I make a grass patch out of these meshes, then export to Unity.

Here is an example of a patch of grass (it's not very good, but am not after realistic looking grass, it's more of a learning exercise).

Here is what it looks like when in Unity (note:  I import the normals).  The shader the patches are using is the Standard shader with culling off.

So patches are placed down with a random rotation, but you can see that some faces of the patch don't receive the light evenly.  I assume this is due to the normals.

Here is another image where I try to edit the normals in Blender.  You can see it has slightly better lighting.  I don't full get what I am doing with the modifier, but I tried different things (box seems to work the best so far).

The modifier.

I basically want all faces to receive equal lighting.

For this case you need to select "Directional" and "Parallel Normals". The vector from your object origin to the target object origin is set as the normal for each of the vertices.

For grass usage case I would recommend trying a normal that points straight up as this is unaffected by rotation around Blender Z / Unity Y axis. But please note that this will make the faces' shaded color identical so the only difference in color will come from albedo / diffuse texture.


Blender Constraint : Slide Link I am writing this post because after hours of browsing I can't really find what I am looking for... Or maybe  didn't look in the right place...

So I'd like to know how I can simply apply a slide link with a constraint between a tube and a cylinder :

I have both of my objects on blender but I can't find a way to link them...

Thank you very much for your help !

killian

In my example the bigger cylinder is parent of the small one,and it's rotated 45 degrees on its Y axis. The small one has X and Y loc locked, so it can only slide on its Z local location. The same can be achieved with bones, locking their local attributes.


How to get to the Material tab of the properties window? Each tutorial for coloring and painting mention a Material tab, that icon never shows on my screen. How do I get to this option?

Select an object and make it active. Either click on it in the 3D View, or select it from the Outliner

If nothing is selected, or if the active selected object doesn't support materials (for example a lamp, empty or camera etc) no material tab will be displayed.


Can't select or interact with downloaded objects unless in edit mode need some help.
I downloaded this free car model, and everything worked great until i tried to move it around.

It is made of many parts so I selected everything with A and tried to rotate the whole thing.

Problem is, 4 objects (namely the 4 rims of the wheels) stayed put and didn't do a thing.

I can see the meshes, but I cant select/box select them. I discovered that pressing "A" does not select them at all, and when selecting them from the collections (blender 2.8), i still can't move them.

I also tried Parenting them to other objects but with no result.

The only thing I can apparently do, is go into Edit mode which actually highlights the mesh normally.

I tried merging the mesh with other objects, duplicating and splitting it into another mesh, but nothing has worked so far.

Am i missing some obscure setting that prohibits me from interacting or is it an actual issue with the mesh/file?

Thanks in advance for the help!

simply export the blender 2.79 file as an .FBX file to Blender 2.80

blender 2.79b or earlier are not 100% compatible with 2.80 or later, you should use another format such as OBJ (object) or FBX which is the one that works best for me personally


I'm trying to recreate the camera as a mesh in python i'd like to recreate the active camera as a geometry (it's for optimizing particles in the viewport with a dynamic paint modifier)

i'm almost there, the last part is just finding the correct hypotenuse value.
half of the camera and half of my created geometry are right triangle.
so the FOV value of the active camera is half of the value of one of the angle (non right)

i created my geometry to have an hypotenuse value of 1 and a opposite edge value of one too. But im stuck at the angle calculation. it's not so fresh anymore.

here is the code

import bpy, bmesh, math

CAM = bpy.context.scene.camera
bpy.context.view_layer.objects.active = CAM
FOV = bpy.context.object.data.angle
#bpy.context.object.scale.xyz = 2.00
bpy.context.scene.cursor.location = CAM.location
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
bpy.ops.mesh.primitive_cube_add(size=2)
BOOL = bpy.context.object
BOOL.rotation_euler=CAM.rotation_euler
BOOL.name = "SCATTER:[Active Cam Boolean]"
BOOL.display_type = 'WIRE'
BOOL.hide_render = True

bpy.ops.object.editmode_toggle()
bpy.ops.mesh.select_all(action='DESELECT')
mesh = bmesh.from_edit_mesh(BOOL.data)
for f in mesh.faces:
    if f.index ==5:
        f.select = True

bpy.ops.mesh.select_mode(type='EDGE') #update
bpy.ops.mesh.select_mode(type='FACE') #update
bpy.ops.mesh.merge(type='CURSOR') #now we have camera shape
bpy.ops.object.editmode_toggle()

dimension_x=bpy.context.scene.render.resolution_x /1000
dimension_y=bpy.context.scene.render.resolution_y /1000
BOOL.dimensions.xy = (dimension_x,dimension_y) #to get correct ratio

add_to_200 = 1 - bpy.context.object.scale[0] #to have 100cm value
BOOL.scale.x += add_to_200
BOOL.scale.y += add_to_200

bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
bpy.context.object.scale[2] = 1/math.sin(FOV/2) #This is not working ? i tried SOH CAH TOA, not working idk why.

this script work pefectly

import bpy, bmesh, math
deleted = [ob for ob in bpy.context.scene.objects if ob.name =='SCATTER:[Active Cam Boolean]'];bpy.ops.object.delete({"selected_objects": deleted})

if bpy.context.scene.camera == None:
    bpy.ops.object.camera_add(align='VIEW',location=(0,0,0),rotation=(1.5708,0,0))
    bpy.context.scene.camera = bpy.context.view_layer.objects.active

CAM = bpy.context.scene.camera
bpy.context.view_layer.objects.active = CAM
FOV = bpy.context.object.data.angle
bpy.context.scene.cursor.location = CAM.location #

bpy.ops.mesh.primitive_cube_add(size=2)
BOOL = bpy.context.object
BOOL.rotation_euler=CAM.rotation_euler
BOOL.name = BOOL.data.name = "SCATTER:[Active Cam Boolean]"
BOOL.display_type = 'WIRE'
BOOL.hide_render = True
cy=BOOL.cycles_visibility ;cy.camera=cy.transmission=cy.diffuse=cy.scatter=cy.glossy=cy.shadow= False

bpy.ops.object.editmode_toggle()
bpy.ops.mesh.select_all(action='DESELECT')
mesh = bmesh.from_edit_mesh(BOOL.data)
for f in mesh.faces:
    if f.index ==5:
        f.select = True
bpy.ops.mesh.select_mode(type='EDGE') ; bpy.ops.mesh.select_mode(type='FACE')
bpy.ops.mesh.merge(type='CURSOR')
bpy.ops.object.editmode_toggle()

bpy.ops.object.transform_apply(location=0,rotation=0,scale=1)#=FFT
bpy.context.object.scale[2] = 1/math.tan(FOV/2)

CAM.select_set(state=True)
bpy.context.view_layer.objects.active = CAM
bpy.ops.object.parent_set(type='OBJECT', keep_transform=True)
for i in range(0,3): BOOL.lock_rotation[i] = BOOL.lock_location[i] = True

dimension_x = bpy.context.scene.render.resolution_x /1000
dimension_y = bpy.context.scene.render.resolution_y /1000
BOOL.dimensions.xy = (dimension_x,dimension_y) #to get correct ratio

if dimension_x>dimension_y:
    divider = 2/dimension_x
else:
    divider = 2/dimension_y
BOOL.scale.xy = (BOOL.scale.x*divider,BOOL.scale.y*divider)


Smooth cylinder after do kife cut? As the image shown I did a cut inside a cylinder, then I want to smooth cylinder but keep the cut sharp. When I did smooth the shape distort around the circular hole :(

I suppose you did a Boolean cut. That gets the job done fast, but you'll have a hard time cleaning up the mesh after the fact. You would be better off by first cutting a hole in the cylinder with the Knife Tool, taking care that the topology is correct (quads only). Then select, inset and push the polygons that form the perimeter of the hole inside the cylinder. After that, select the edges surrounding the newly formed hole and bevel them. After you apply the Subdivision Surface Modifier you should have a decent looking mesh.


How objects move in rendered image when camera position changes Imagine we render a scene which contains some objects. Now we move camera 1 unit down (no changes in objects) and render a new image. It's obvious that objects would look a little upward in second image (specially objects which are closer to the camera).

My problem is to calculate that how much each object relocates in rendered image based on amount of camera motion and the z-index (depth) of each object. For example camera has moved 1 unit and object A with z-index=4 has moved 15 pixels upward and object B with z-index=10 moved 5 pixels.

So we have depth of each object and amount of camera motion so mathematically it can be calculated, but my main problem is the relation between the measurement system in blender and pixels in rendered image.

So if anyone can give me any idea about this problem I'm dealing with, I would be thankful.

Actually, this is a mathematical question and belongs to math.se.

Moving the camera "down" would be the same as moving the object(s) up. I'll move the object up for illustrative purposes.

For the calculation, you need the focal length and the sensor height of the camera. They are marked lime in the image. You can get that information from the camera. I've set the sensor measurement to vertical. If it is set to horizontal, you would have to calculate the vertical sensor height from the horizontal sensor height and the dimensions.

verticalSensor = horizontalSensor / horizontalDimension * verticalDimension

Next you need the distance from the camera to the object. It is important that the distance vector is an extension of (0, 0, 1) from the camera. The vertical movement is labeled as Object Shift. This vector must be an extension of (0, 1, 0) in camera space for your case. (If the first position of the object is not on the vertically centered horizontal axis of the cameras view space, you have to adjust the calculations.)

With the rule of proportion, we can get the relation between these four values.

sensorSpaceMovement / focalLength = objectShift / objectDistance
sensorSpaceMovement = objectShift / objectDistance * focalLength

To get the sensorSpaceMovement (the shift on the sensor) in relation to it's size, we divide by half the sensor's height. (Note, that the lime arrow is half the image's height in the illustration.)

sensorSpaceMovementRelative = objectShift / objectDistance * focalLength / sensorHeight

The objects shift is now relativ to the sensor size and will have a value in [0.0, 1.0] if it doesn't leave the field of view.

To get this value in pixels, multiply it with the number of vertical pixel rows: dimensionY. This is the height of your rendered image.

pixelShift = objectShift / objectDistance * focalLength / sensorHeight * dimensionY

If the relation is rotated in 2D or 3D space, you'll have to use a little more math. The object shift has to be measured relative to the camera's XY plane and the objects distance parallel to the cameras (0, 0, 1) view vector.


Why two objects behave like one? After a boolean operation, I had a quite "broken" object, reverse sides which weren't fixed by "fix normals" etc. I decided to create a fresh object, in a hope that it will turn out better this time (the cube to the left). But these two objects are somewhat linked.

For example, why selecting one of these objects selects also the other one? Why there is only one "Cube" in the menu?

You added the new cube while still in Edit Mode.
So both meshes are now part of one object - as shown in the Outliner.

You can easily split them into separate objects through
Mesh > Separate > By Loose Parts


Sverchok. A file which worked fine 2.8* no longer works in 2.91.0 With reference to a previous post of mine (Sverchok. Duplicating an object along a path), the linked file at that question (grille6) no longer seems to work in 2.91.0.
I've replaced the 'deprecated' Polyline Viewer with another viewer of the same name, but so far, no luck.
What am I missing?
* the previous version might have been 2.79 - I can't actually remember

reget object in
reget path
switch POLY in viewer
https://yadi.sk/d/li_uYmjR2dLsxA
try this


Why are some textures disappearing in the game engine? I have a mesh that I am texturing for the game engine and everything was fine until the last setups I've done; Some of my textures don't appear anymore. What strikes me is that the colors are correct so pictures are taken into consideration but not displayed correctly.

Is it a UV problem? Can't I use more than two UV layers on my object?

How do I include the blend file in this post?

So instead of using multiple UV layers for scaling the textures i used the 'size' option in the 'mapping' panel. It runs faster...


How to create objects in blender using matrices So i have gathered that matrices are 4x4, and I'm hoping to try to create a neural network to take pictures of trees and such and convert it into a 4x4 matrix with  openCV, but my one question is how would you import a 4x4 matrix into blender and spit out the 3d object?

A matrix on its own is not a model, as discussed in the comments. In 3d graphics, 4x4 matrices are normally used to for projections (e.g. camera projection) and transformations (e.g. specifying the location, rotation and scale of an object).

To load a matrix into blender, you best bet would be to export the data from whatever program you are creating it in as a text file like a csv or something and use python to read it in. You will need to use a python script to do anything useful with it anyway.

However, having some experience working with computer vision and related concepts, if you don't understand what a matrix is, and some of the underlying maths, what you are proposing is likely to be exceedingly difficult for you, so I would recommend learning some of the basic concepts first.


Smoke-like material without simulation? I'm trying to find a less techy alternative to render water splashes in a river than the smoke simulation.

All what i've found is tutorials to make waterfalls that have been done with the smoke simulation, where the results are awesome.

But i can't go that way, basically because i'm not Pixar and i need to have the final render (wich will be a 1 min. long animation) whitin a reasonable amount of time.

I'm trying to figure out the way it was done before simulations...I don't need it to look realistic at all.

Thanks in advance!

PD: this is totally related to this question

To elaborate on Joel's recommendation of using smoke sprites: I believe he is suggesting an instanced set of small face primitives positioned in a scattering at the surface of the water object. Vary the transparency, size, and the magnitude of a small animated shimmer movement so that each small face (sprite) has an additive motion overlaid onto the base water object(s) in the waterfall. Also assign material and texture from a collection of smoke pngs.

A key consideration is that these sprite elements should remain roughly normal to the camera view plane...not parallel to the water or its not really acting as a sprite just another texture-mapped animated object.

The cumulative effect of the instancing is to allow variability of the image, shimmer motion, size, position, and transparency while reducing discrete object definitions. The art is in making the sum of sprite variations appear like hydraulic effects such as turbulence!

(Note :if my 'comment all' creds came thru I would have simply commented on Joel's comment instead of adding a new 'answer' with these details.)


Object looks fine in material view but black in rendered I have referenced StackExchange post as well as a post from the Blender Forum. However, unlike their case, my output node seems fine and I only have one UVMap and thus, I cannot have chosen the wrong UV Mapping as well. Moving the position of the lamp did not help. In addition, I could not find out where the override all materials option is, so, I could not test out that option. As such, I really appreciate your help and thanks in advance for your help.

My .blend file can be found here.

The material of the text is maden by a texture (missing in the .blend file) going into a background node wich feeds the material input (and into the displacement input also).

Background node is intended to be used in the world tab, not the material tab.
I used a diffuse node instead, turned the world to pure black, reduced the lamps intensity to 1000 and assigned a simple wood seamless texture:
this is the result.


Is there a way to have a mesh extrude or retract itself during an animation while rigging with bones? Basically, I've got this mechanical mesh I'm making where I need a lid to hinge down to cover the top of a cylinder-ish shape.

This hinge is rigged to the lid. It rotates from a 45 degree tilt to a 90 degree tilt as the lid closes from a 90 degree tilt to a 0 degree one.

See? The bottom part of the hinge extends through the bottom of the mesh. Do you guys know a quick fix?

When I try to make this hinged lid shut, part of the hinge sticks out of the bottom of the mesh. What would you guys recommend I do? If I flat-out shorten the bottom of the hinge arm, then it won't connect correctly and would look like it's floating. If I keep it like it is, the hinge can be seen poking through the bottom. What should I do?

Add a stretch to constraint to the bone that deforms the connecting rod. In the constraint settings you will also want to set volume variation to 0.0 so that the connector doesn't shrink as it gets stretched.


Object does not show when pasted into scene As a Blender newbie --Man sometimes it's the stupidest things that get me stumped. I downloaded a skull from blendswap. Changed the material to glass and then copied it, pasted it into a new scene. It shows up in the upper left elements list --but it's NO where in my scene! What am I not getting? Some so simple and yet -- arrrgh.

The file I copied it from is here: http://www.aworkofmarc.com/1/blender/SculptStudio.blend

The file I pasted it into is here:
http://www.aworkofmarc.com/1/blender/Crystal_Rack1.blend

Can someone please look and see what's wrong?

When the mesh is imported from another blend, - either linked or appended, it is placed on the same 3D Layer where it was in the original file.

To see whether there is something on any layer, look at the layers tab:

Layer 1 is selected, while both - 1-st and 2-nd have dot in the middle of the small rectangle.

This dot is orange - currently active object is located on that layer.
This dot is grey - there is/are some objects on that layer.

To show the mesh located on another layer, either Shift click on that rectangle, or press Shift + number of adjacent layer (in this case 2-nd). The mesh will be shown.


Exact meaning of "film exposure" in blender cycles Rendering with blender cycles, I noticed the option "exposure" under the "film" section in the rendering menu. Clearly, increasing the exposure value increases the image brightness, but does anyone know what function is used?

Naively, I'd expect increasing the exposure by a factor of x would be equivalent to multiplying all RGB channels by a factor of x, either before of after applying an image gamma.

Is this hypothesis correct, or is a different function being used?

Based on the code on gitHub (kernel_film.h), it looks like the exposure is indeed a simple multiplication, applied on the linear space before gamma correction:

ccl_device float4 film_map(KernelGlobals *kg, float4 irradiance, float scale)
{
    float exposure = kernel_data.film.exposure;
    float4 result = irradiance*scale;

    /* conversion to srgb */
    result.x = color_scene_linear_to_srgb(result.x*exposure);
    result.y = color_scene_linear_to_srgb(result.y*exposure);
    result.z = color_scene_linear_to_srgb(result.z*exposure);

    /* clamp since alpha might be > 1.0 due to russian roulette */
    result.w = clamp(result.w, 0.0f, 1.0f);

    return result;
}


Increase brightness of HDR to light the scene, but keeping the background at a lower exposure I have a scene in which I am using an HDRI texture as a light source.  However, I am also trying to use it as a background, but when I turn up the strength of the sky it just turns white.  I am looking for a way to render the sky again(at a lower exposure) and then composite the sky under the rendered object.

Use two nodes for the background, one to light the scene at the intensity you want and one with the normal exposure that is only seen by the camera:
Control the mix using a light path using Is Camera Ray.


Blender 2.8 Eevee. Can't find Material Blend mode option I am trying to get alpha leaves in a tree from an older file to work.

All the tutorials say got to Material > Otions > Blend mode. And switch the Material's Blend mode to something other than Opaque.

My problem is that my material options look nothing like any of the tutorials suggest, and I get no Blend option to get my alphas working.

Below is a picture of my shader nodes and what my options look like.

NOTE: when I create the material in a fresh scene I do get the Blend option.
But any material I create in my current scene just looks like the screen shot below.
Is there something I can do to fix my scene ? I'd hate to have to recreate this scene from scratch just to get this working.

Your screen looks like you have set Cycles as Render Engine not Eevee.

When you switch to Eevee render engine in Render Properties Editor ...

... than you will have available Blend mode from properties panel

(Shader Editor > Properties > Options)

Also availaible from Material Properties Editor > Settings > Blend Mode


How to use "self" in a driver expression to refer to transforms of a bone in the parent armature? I have created a rigged low-poly character which I intend to use for a crowd simulation, i.e. the plan is to create multiple linked instances of it, each with its own animation cycle, and add them to a group for particle instancing.

Some of the animation is based on shape keys which I can control via the armature. I did this by assigning a driver to the shape keys which evaluates the transforms of non-deform bones in the parent rig.

However, my drivers currently reference the armature object directly via a transform channel variable. This of course works fine for a single character but any (linked) copies I create will keep being influenced by the bone from the original rig rather than the one associated with that copy.

I saw in the Blender 2.78 release notes that driver expressions can now use "self" to refer to the object being processed. Can this be used to resolve this problem and create "instance-friendly" drivers? If so, what would the expression have to look like? How do I get from "self" (which in this case would be my mesh object) to a bone in the parent armature?

Update: I have attached a very simple demo file to illustrate the issue. There is an armature controlling the shape key of the default cube via a driver. I then created a linked copy (Alt-D) of both armature and mesh. As you can see, posing the armature of the copy (right) does nothing while the armature of the original (left) controls both instances.

For completeness' sake here's the current driver setup from the sample file:

The question is how to rephrase that expression, probably using "self", so that the driver works properly on instances as well.

TL;DR: read below ruler for straight-forward answer - however, this will not give you per-instance shape-keys as I was hoping - this has nothing to do with the self-option, though.

Longer version:

I've tried doing some RTFM'ing but apparently the "Use self" option has not yet been documented in the official manual (nor anywhere else AFAICT).

By lots of trial and error I now figured out that "self" in my case is actually not referring to the mesh object (instance) as I expected, but rather to the ShapeKey object that the driver sits on. The problem then becomes that the shape key itself sits on top of the mesh data block (that is shared between the linked instances) rather than the object instance...

If I'm not mistaken this means that it is not possible to have linked duplicates (and by extension: particle instances) with distinct shape key values, regardless of the whole self in driver expressions issue.

Please feel free to correct me if I'm wrong on this.

However, to answer the question as I originally worded it in the title, if we take the Shape Keys out of the equation and put a driver on a property of the mesh instance itself (e.g. the Y translation) then we could use a driver expression like the following:

self.parent.pose.bones['Bone'].location.z

If you do not mind that instances cannot have distinct shape key values, here's an expression I came up with that will get you from the shape key to the bone of the parent armature:

bpy.data.objects[self.id_data.user.name].pose.bones["Bone"].location.z

These are still very early steps for me finding my way around the Blender object hierarchy, so I strongly suspect there is a better way to express this - especially without the bpy.data.objects[]-lookup - but it was the best I could come up with so far.

Note that this expression relies on the assumption that the mesh data block is named the same as the object that uses it, as is usually the case if you haven't manually changed it.

Also note that Blender will display a warning saying "Driver expression may not work correctly" and also a hint to "Use variables instead of bpy.data paths" - which IMO would defeat the point of using "self" as it would again force you to statically refer to an explicit object...


Blender game engine development directions? I know that the these forms like to have questions that can be nicely answered, and I might be slightly passed that line... But anyway, what are the blender game engine development ideas? Is it still a part of the main focus of development? Or is it just a side feature that is worked on now and then.

I read the recent patch notes, and some nice new features has been added, but will it (or is it already) get on/close the same level as the mainstream engines? e.g. Unity, Unreal, or Cry.

I ask this because the posts/articles I've read about the blender engine is quite outdated, 3 or 4 years old, and I want to know how the blender engine is standing relative to other engines out there today.

Ton Roosendaal covers this in the Blender roadmap – 2.7, 2.8 and beyond

  What should then be dropped is the idea to make Blender have an
  embedded “true” game engine. We should acknowledge that we never
  managed to make something with the portability and quality of Unreal
  or Crysis… or even Unity3D. And Blender’s GPL license is not helping
  here much either.

If you want to develop a game today you can model assets with blender, but should better pick another game engine.


MTL materials are not being applied I have some free downloaded OBJ 3D objects like this cat (http://www.cadnav.com/plus/download.php?open=0&aid=48009&cid=3). It have its material MTL file to give the cat a real appearance. (http://img.cadnav.com/allimg/190709/cadnav-1ZF9121629.jpeg)
I have both files in same folder, of course. However, after I import the OBJ and press Alt + Z, it seems Blender ignores the texture. It happens with other OBJ/MLT imported.

Please, could you help me? What am I doing wrong?

The problem is that the .mtl file is not assigning the texture. There is no map_Kd attribute saved.

newmtl Material__27
illum 4
Kd 0.50 0.50 0.50
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
Ni 1.00
Ks 0.50 0.50 0.50
Ns 18.00

If you append map_Kd cat.png as a new line, it will load the mesh with a texture. However the UV layout seems to be made with a mirror modifier applied which causes the texture to look very glitchy. This could be solved if you're willing to fix it.


Grease pencil darker and thicker before lifting stylus I'm kind of a newbie to the grease pencil tool, and while trying the different brushes I've noticed after a while that any line I draw is a bit darker, thicker and more opaque but then go back to their normal material look when I lift the stylus from the line. It's really annoying and I can't seem to find what could be the parameter for this, but I've noticed it won't do this on a new file. I've already tried to copy and paste my drawing in a new file, but the grease pencils material are linked to the strokes and it won't change anything.

If anyone knows how to fix this, I'll be grateful.

Ok I've found the answer: It only happens on layers with a sub 1 opacity. I hope this helps anyone with the same issue.


How to smooth curves in Graph Editor by Script I have an armature with bones. Each bone has an animation data which iI'm trying to smooth.

fcurves = bpy.context.active_object.animation_data.action.fcurves
 for curve in fcurves:
     bpy.ops.graph.smooth()

But I don't know in what context and how to get right access to the bones animation to smooth it by script.

Using Blender 2.8. I'd appreciate all the help I can get.

Basically, you have to take care of two things: first selecting the relevant bones you want to smooth and second to switch to the graph editor context. For some reason, selecting and deselecting the respective curves did not effect the operator. I rather locked the respective curves I did not want to smooth.

import bpy

# types = {'VIEW_3D', 'TIMELINE', 'GRAPH_EDITOR', 'DOPESHEET_EDITOR', 'NLA_EDITOR', 'IMAGE_EDITOR', 'SEQUENCE_EDITOR', 'CLIP_EDITOR', 'TEXT_EDITOR', 'NODE_EDITOR', 'LOGIC_EDITOR', 'PROPERTIES', 'OUTLINER', 'USER_PREFERENCES', 'INFO', 'FILE_BROWSER', 'CONSOLE'}

def smooth_curves(o):
    current_area = bpy.context.area.type
    layer = bpy.context.view_layer

    # select all (relevant) bones
    for b in o.data.bones:
        b.select = False
    o.data.bones[0].select = True
    layer.update()

    # change to graph editor
    bpy.context.area.type = "GRAPH_EDITOR"

    # lock or unlock the respective fcurves
    for fc in o.animation_data.action.fcurves:
        print(fc.data_path)
        if "location" in fc.data_path:
            fc.lock = False
        else:
            fc.lock = True

    layer.update()
    # smooth curves of all selected bones
    bpy.ops.graph.smooth()

    # switch back to original area
    bpy.context.area.type = current_area

    # deselect all (relevant) bones
    for b in o.data.bones:
        b.select = False
    layer.update()

# currently selected
o = bpy.context.object
smooth_curves(o)


How to create a prism using the API I am surprised at how difficult it is to do elementary things with the  blender api, or at least find the information on the web to do elementary things like lines, texts and in the case, a prism.
So I hope to make a great contribution to the blender community with this question and in general with every question I ask because I'm starting from scratch and I think is the case of many people.
I suspect that the way to do it is through a cube.

Use add primitive cylinder to make a prism

Basically by definition a cylinder in blender is really a regular ngon prism.  Therefore, to add a prism via the UI, simply add > mesh > cylinder with the amount of sides you want the ngon end to have. For example for a triangular prism

This is a simple call to the  operator:

bpy.ops.mesh.primitive_cylinder_add(vertices=3)

change the value of vertices to make other ngons on the ends of prism.

And via the bmesh API with bmesh.ops.create_cone

Rather than having a create cylinder bmesh has a create cone, which allows us to create a prism by setting the end radii the same.  Simple code to add a triangular prism.

import bpy
import bmesh
context = bpy.context
bm = bmesh.new()
bmesh.ops.create_cone(bm,
        cap_ends=True,
        cap_tris=False,
        segments=3,
        diameter1=1,
        diameter2=1,
        depth=2)
mesh = bpy.data.meshes.new("Prism")
bm.to_mesh(mesh)
prism = bpy.data.objects.new("Prism", mesh)
# link to scene
context.scene.objects.link(prism)


Transfer UV maps or Join as UVs? I'm trying to apply textures to a 3D character that I have modelled following a tutorial where has been used blender 2.66.1,while I'm using blender 2.76. At a certain point,I see there are differences between versions. As you can see from the pictures,if I do "CTRL + L",the last item is called "Transfer UV map",while in the tutorial the same feature is called "Join as UVs". I'm not experienced but I think that since there is a difference,I have to follow another procedure than that used on the tutorial. Also because,on the tutorial the 4 claws are the same size but my model has 4 claws of different size.

I have separated (with P in edit mode) claws from the rest of the body and this is what happens when I try to transfer the UV maps of two claws :

So,what should I do at this point ? thanks.

The operator name from "Join as UV" in 2.66 is the same as the one used in 2.76 for "Transfer UV Maps" - bpy.ops.object.join_uvs() which would indicate that the description has been changed to better describe the function that is performed while the function performed is the same, meaning you should use Transfer UV Maps in a newer version of blender to do the same thing.

In the current release it is described as

  bpy.ops.object.join_uvs()
  Transfer UV Maps from active to selected objects (needs matching geometry)

While back in 2.66 it was described as

  bpy.ops.object.join_uvs()
  Copy UV Layout to objects with matching geometry

If you also want to compare the source code you will find that the description used in 2.66 and the description used in 2.76 is the only part of the operator that has changed.


"Fade out" with Blender internal engine? I'm doing a small project for someone, it's just text and a plane object. A total of 17 objects including the lamps. I want to achieve the same effect as the transparency node in cycles to fade out, but rendering at 350 samples for over 24 hours only rendered 250 frames. I am stuck with CPU rendering, and using a laptop, but that's what I have for now. If I can do this with the internal engine then that would be ideal. The finished project will be around 1440 to 2160 frames at minimum. If it makes a difference for guidance in the most efficient way to do this, the vertices count is around 2,000,000 on the .blend file, and I will be adding a glossy to the materials, and the world setting will be a texture. Just have to remember how to set that up, I haven't done that for quite some time in BI. Thanks in advance everyone!

Certenly is possible, but you have to consider that Blender Render and Cycles handle transparecy in a different way, so you'll probably have to make a few adjustment to your scene to get similar results.

You can animate the alpha factor directly from the Material's menu

Or the alpha output factor in the node editor (if you are going for node based material).

Don't froget to enable Z Transparecy or Raytrace option for transparency calculation method (for node based material you can find it under Render Pipeline Options).


How to Link or Append objects from another file? I've tried the instructions here but cannot get linking and appending to work.  I have a file with just the default cube in it. Then I create a new file and go to File >> Link, and browse to the file and select the cube mesh but nothing shows up.  Same result for appending. Using Blender 2.79.   Thanks

Found the issue.  I was selecting the item to link/append from the list of Meshes, but needed to select the item from the list of Objects.


Blender 2.79 Windows 64Bit - Web-Cam starts on Start-up I have a strange behavior, when I start-up the newest official Blender-release, my WebCam starts up.
I cannot find any point. where to stop this. I guess, there's something "connected" to the start-up of Blender concerning "session-recording" for training-vid-production... I never had something like this.

Could please someon hlp me out of this?

Thanks
Greetings
Mike

I found the issue. It's really somewhat amusing:

I got and installed a new Graphics-Card on my system. (Geforce GTX 970)
The set-up also installed NVIDIA GeForce Experience (V. 3.10.0.95) and during install it set-up also "Game internal overlay", which basically opens the possibility for gamers to record videos of their game, the gamer himself, via WebCam and voices/sound.

The strange behavior is, that the Nvidia software recognizes Blender as a "Game" and switches on all the stuff. (I am not a gamer, so I never realized, that this is available at all)

After setting off this feature, everything turns back to normal.


How do I draw a solid line when texture painting? I'm trying to draw on my model a bump map of smooth lines to make a hair effect.
I notice that when I draw with a thin brush it starts looking more like Morse code than a line.

So how do I get the brush to draw a thin solid line?

It's hard to say without seeing it, but smoothness will be based upon number of vertices and size of UV map.

So subdividing your model may help, and possibly setting shading to smooth, but more likely than not increasing the UV texture size will be your best bet.

It generally defaults to 1024x1024, but when you draw a thin line, those pixels get stretched over the surface of your model, so resolution can make a big difference.

For broad strokes, small maps are OK... but for fine details, you need more pixels.  Try 2048x2048, or possibly more, especially if your model is large, or you need even more detail.


How to adjust texture coordinates with a distortion texture? For a turbulent fluid texture I'm working on, I need to distort texture coordinates in a repeated, step-wise fashion, so this seems like a job for OSL. Specifically, I need to offset each point in a texture by a small amount based on the value in a noisy color texture that represents a velocity field (r=vx, g=vy, b=vz=0).

In the illustration below, I've used small arrows to represent the velocity field rather than the RGB texture I'll actually use. Each blue dot represents a starting point to trace the velocity field. Each blue curve represents a path that is consistent with the local velocity field at each point along the way.

However, the examples I have found here and on other sites offset texture coordinates globally (the same offset or scale applied to the entire texture).

I'm looking for a method to distort texture coordinates non-uniformly in small repeated increments to follow the velocity field similar to the blue curves in the illustration above. I will use the resulting coordinate map to warp a simple color texture.

I can imagine this effect could be achieved with a Particle System and a Turbulence Force Field, but (1) I can't imagine how I would fill the entire surface with color without using an enormous number of overlapping particles and (2) I can't figure out how to constrain the particles to the surface of an arbitrary mesh.

I opted for OSL because I hoped to generate a distorted coordinate system for every point in the texture and let the renderer sample the texture appropriately.

No need for OSL, just use a Converter > Vector Math node.

The above node setup uses the image texture on the left to offset the UV (or any other) texture coordinates by adding the distortion map pixel values to the mapping vectors (RGB is automatically converted to XYZ).

If you want a little more control over the distortion strength  and directionn you can add a Separate RGB and Combine XYZ node and use some math nodes in-between.

With the above node setup you can adjust the strength for each direction independantly, if you want the same strength in all directions and don't want to have to play with 3 different values you can plug an Input > Value node into all 3 math nodes.


How to select uv faces using python? I have a cuboidal structure. I have it uv unwrapped. Now, I need to apply a same seamless texture to all the sides. In effect, I need the uv faces one over the other. The code snippet below shows my approach in selecting the faces and placing them over each other,

bpy.context.area.type = 'IMAGE_EDITOR'
//Translating the faces, to place them one above the other
bpy.ops.uv.select(extend=False, location=(0.0, 0.0))
bpy.ops.transform.translate(value=(0.378906, 0, 0))

bpy.ops.uv.select(extend=False, location=(0.25, 0.0))
bpy.ops.transform.translate(value=(0.135343, 0, 0))

bpy.ops.uv.select(extend=False, location=(0.75, 0.0))
bpy.ops.transform.translate(value=(-0.351892, 0, 0))

bpy.ops.uv.select(extend=False, location=(0.6, 0.0))
bpy.ops.transform.translate(value=(-0.108398, 0, 0))

While I achieved as much as that, the next step requires me to scale them, so as to apply the image texture properly. So, once again I started selecting the same faces using the same method above. The only change was that "extend" was set to "true", in order to extend the selection. Well, simple as it felt, it didn't work. Then I realized, it selects based on the location and now all the faces have been translated to the same location.

It meant, I can't use this same selection statement. But this is the only method I know and I am still new to blender python.

My question. Is there an effective and easier way to select the uv faces, say like faces[0]? If so, please share.

New Edit:

Now this is the sequence of operations which I executed in the console,

>>> import bmesh
>>> bm = bmesh.new()
>>> obj = bpy.context.active_object
>>> bm.from_mesh(obj)
>>> bm.faces.
             active
             ensure_lookup_table(
             get(
             index_update(
             layers
             new(
             remove(
             sort(

As you can see, bm.faces does not have any attribute named loop.

Manipulating the UV coordinates of a face is usually done via the bmesh API.  Here is an example extracted from http://web.purplefrog.com/~thoth/blender/python-cookbook/barber-pole.html

def spiralUVs(mesh, xPlus):
    # add a UV layer called "spiral" and make it slanted.
    mesh.uv_textures.new("spiral")
    bm = bmesh.new()
    bm.from_mesh(mesh)

    bm.faces.ensure_lookup_table()

    uv_layer = bm.loops.layers.uv[0]

    nFaces = len(bm.faces)
    for fi in range(nFaces):
        x0 = fi*2/nFaces
        x1 = (fi+1)*2/nFaces
        # assume a quad; 0..3
        bm.faces[fi].loops[0][uv_layer].uv = (x0, 0)
        bm.faces[fi].loops[1][uv_layer].uv = (x1, 0)
        bm.faces[fi].loops[2][uv_layer].uv = (xPlus+x1, 1)
        bm.faces[fi].loops[3][uv_layer].uv = (xPlus+x0, 1)
    bm.to_mesh(mesh)

Other examples that manipulate UV maps include http://web.purplefrog.com/~thoth/blender/python-cookbook/expand-uv-to-fit.html and http://web.purplefrog.com/~thoth/blender/python-cookbook/uv-from-geometry-cubic.html


Waveform not showing while checking audio scrubbing When I add an .mp3 sound file to the VSE and go to Playback and check Audio Scrubbing, I don't get the waveform. Why?

Turning on the waveform display is a separate setting in the 'View' menu:

If you have a long MP3, you may have to wait for the previews to generate (after turning 'Waveforms On'):


Uninterpretablity in depth maps: why the pixel values do not necessarily represent a valid distance? I am rendering depth maps from different angles for many meshes by placing my cameras on a sphere with fixed radius. The meshes I use are all normalized (all within a sphere with radius 0.5) and centered at (0, 0, 0). After rendering I load the depth maps in Python using imageio package or scipy.ndimage.imread I noticed that each individual depth map always has a maximum value of 255. However, what I actually expected was to obtain depth maps whose values are interpretable and intuitive. By interpretability I mean a distance of 40 in one depth map rendered from mesh X will be the same as distance 40 of another depth map rendered from mesh Y. But this is not the case as of now, even within the renderings of the same mesh. To make it more clear: if I have a very small mesh whose furthest vertex would be very close to (0, 0, 0) I would still have values of 255 in the rendered depth maps. However, I will still have pixel values of 255 in the depth map renderings of another mesh which is much larger than the previous one. The same issue persists if I normalize the output values of the Z-pass: all renderings have a maximum value of 1. I'm afraid the issue is related to the PNG saving pipeline that might be doing something weird to the rendering results, as discussed here. So I wonder does anyone know if I am doing something wrong? Any thoughts/solutions would be greatly appreciated.

FYI, here's the code I use for rendering:

scene = bpy.context.scene
scene.render.image_settings.color_depth = '16'
scene.display_settings.display_device = 'sRGB'
scene.view_settings.view_transform = 'Raw'
scene.sequencer_colorspace_settings.name = 'Raw'
scene.use_nodes = True
for node in scene.node_tree.nodes:
    scene.node_tree.nodes.remove(node)
renderNode = scene.node_tree.nodes.new('CompositorNodeRLayers')

depthOutputNode = scene.node_tree.nodes.new('CompositorNodeOutputFile')
depthOutputNode.format.file_format = 'PNG'
depthOutputNode.format.color_depth = '16'
depthOutputNode.format.color_mode = 'RGB'
depthOutputNode.base_path = 'somePath/'
depthOutputNode.file_slots[0].path = 'fileNameDepth#'

scene.node_tree.links.new(renderNode.outputs[2], depthOutputNode.inputs[0])

bpy.ops.render.render(write_still=True)

Update: I just did file depthImg.png in Ubuntu and confirmed that the generated depth maps are 16-bit. It's likely that the image packages in Python do not support reading png files with more than 8 bits per channel! I tried a couple of methods and non works. Any solutions for this?

As @troy_s suggested, PNGs are not suitable for this use. PNGs are more suited to image color data only. For depth information you should use a format such as Open EXR. This can be achieved easily by simply changing the depthOutputNode.format.file_format = 'PNG' line to depthOutputNode.format.file_format = 'OPEN_EXR'.

The resultant image should now contain the correct depth information. For example, it can be loaded into the compositor, normalized, and passed to a Viewer node as shown :


Searching for 3 posing buttons in Blender 2.8 i use these little guys a lot in Blender, but i cannot find them in Blender 2.8,where did they go?

Important note,i am not looking for the shorcuts with the keyboard


All faces duplicated My character model's faces have somehow been duplicated. If I delete a face, there's still a face there and I need to delete the face again to see the inside of the character. And its not just one area, it's all faces.

I tried opening an earlier version of my model and I can delete the faces normally. What could have happened on why the faces are doubled? And what can I do to remove them (I tried selecting all, then Remove Doubles, but nothing happened)?

EDIT:

I just fuond out that its happening everytime I add and apply a Mirror modifier after having already applied one. But why is it? I already applied a Mirror initially, I want to edit the mesh again so I need to add a Mirror modifier again. The 3rd time added, faces are now quadrupled.

Somewhere along the way, you probably duplicated all faces by accident.  If that were the case, you should be able to delete them all at one time, because they're connected.  Select one of the extra faces and hit ctrl-L.  This selects all geometry that is connected to this face.  Now you can delete it all.


Grease Pencil Mesh Warp Is there anything like this smart mesh warp for blender's grease pencil? I know you can move vertices around, but it might be nice to apply a mesh to your drawing to warp like this: https://my.smithmicro.com/anime-studio-pro.html

I don't know of a way to do exactly that. For distorting a whole drawing there is the lattice modifier for grease pencil:  https://www.youtube.com/watch?v=tLZ6F9mQAdk


How can I convert an edge loop to a curve? I saw a cryengine video in which an edge loop is dragged to adjust it just like the ones in paint. I am not sure if that feature is available in Blender. If yes, would greatly help in modelling objects like bridges, arches etc. The link to the video: https://m.youtube.com/watch?v=0X123xPlyWM the curve is used in 00:18 of the video.

Anyone who lands here from a search engine, in Blender 2.8, Alt + C doesn't do anything. Curve from Mesh is not even available in the space bar menu. You have to select it from Object > Convert to menu.


Surface normals still regular in edit mode after displacement map I am trying do perform a displacement map in a conical shape. I created a circle, extruded in Z and resized at the other side. After that, I selected everything and subdivided to have a bunch of small faces. Then, I added a displace modifier and a image texture, so that it becomes like the surface in the top (Object Mode):

The problem is, when I change to Edit Mode I can see that the normals keep as the surface was completely regular, which is not desirabe. I wanted the normals to follow the surface relief, is there a way to do that?

Edit: Accepted answer from Robin Betts, results (I extruded the surface, so that I can have normals on both sides):

If, in the Displace modifier, (as you could with most other modifiers) you click the little mesh-triangle tool-tipped 'Adjust edit cage to modifier result', you should be able to edit the vertices, and see the normals, of the modified mesh.


How to move multiple faces along their individual normals? I'd like to grab multiple faces and move each one along its normal. Is there a grab individual command?

Set Transform Orientation to Normal (, 2) and Pivot Point to Individual Origins, then hit G and then Z button twice to move along normal.
Using Alt+S shortcut will do the same for individual faces, but will scale faces that are connected.


Aliased edge around light source in cycles Often when a mesh light is visible in the camera, the edges are not anti-aliased.

No matter how many samples I do, the lamp border always looks jagged and pixelated.

Is this a rendering error? How can I get around this issue?

And zoomed in 4x:

This is not a rendering artifact, everything is behaving exactly as designed.
First an explanation of why these edges appear aliased, but if all you want is to solve this issue and don't care about the background info, scroll down to the Solution.

Why it occurs
Cycles works by randomly shooting rays from the camera into the scene. It does this many times per pixel, and gets the resulting color of the pixel from the average color of samples in that pixel.
Take for example three adjacent pixels, rendered with 20 samples:

The green shape is some surface, the white part is a light source, and the red dots are the sampled points.
If the white light source has an intensity of 1.0:

The left pixel will be completely white (RGB: 1.0, 1.0, 1.0) because all the samples are also white
The middle pixel had 4 green samples and 16 white samples, meaning the resulting color will be more white than green.
The right pixel had 10 green samples and 10 white samples and so should be exactly halfway between white and green.

So because the final pixel color is the average color of the samples, what happens when we have a light source with an intensity greater than 1.0? Say, 4.0:

The left pixel will still appear white on our screens, but the actual RGB value stored there is 4.0, 4.0, 4.0.
The middle pixel will be much lighter now, because the white samples have 4x more effect on the average.
The right pixel, will also be much lighter than before for the same reason.

So if our light source is very bright (as it often has to be due to the natural quadratic falloff), the pixels on and immediately around the light will be very bright as well, since the average sample color is bright.
That's the theory, and here's proof:
A (zoomed) render of some rotated planes with varying intensity of Emission shaders:

The intensity starts from 0.5 and doubles until the second last plane (intensity of 16), then jumps to 1000.0 to show an exaggerated effect.
Below the horizontal line the intensity has been divided by 4 - so starting from 0.125, reaching 4.0 and jumping to 250.0.
Notice that the more the intensity increases, the more aliased it appears.

Solution
There's an easy way to solve this issue: Simply get the light source to appear as regular white (RGB: 1.0, 1.0, 1.0) to the camera, but still let it be brighter to non-camera rays so that it can light the scene properly.
To do this, use the Is Camera Ray output of the Light Path node as the Fac for a MixRGB node where two values are connected to the colors (the top input being the actual light intensity, and the bottom input being the intensity the camera will see):

Which results in:

But as you can see, because our light was colored it now looks a bit dull.
To fix this, we just need to use a similar light path trick for the color input to make the light appear white to the camera, but the original color to the scene:
click for full size

Note: The Light Color node in the screenshots is simply a node group containing some nodes which only allow light to be emitted from the front side of the mesh.
So there ya go! Nice anti-aliased light sources :)
The only down side of this method is if you are relying on those brighter-than-white values for compositing glare/glow - but usually the glare/glow itself will hide those nasty aliased edges.


How do I prevent hair flickering in Cycles? I'm working on a scene for a short film, and one of my characters uses Cycles strand rendering for hair. When I render out the animation, I notice the hair flickers like crazy and I'm not sure why.

Here is the video: https://www.youtube.com/watch?v=oF662SBlZpo

Here is the node setup for his hair:

This becomes VERY apparent when the character is moving and not so much when he is still.

It could be your UV coordinates, which are "generated". Since they are probably calculated in world coordinates, moving the object also moves the UV coordinates. It could cause shimmering "noise".

I don't think your node set up is what you want really. You should use the hair BSDF shader. Put 2 nodes using hair BSDF, one for reflection (hair color), and one for transmission (hair translucency). Mix between them and you are done. Consider creating manual UV coordinates and not using generated ones.

Good luck!


Problem with creating a box on a cylinder I'm making a box on my cylinder for my Luke Lightsaber modeling practice but by doing so I always create a pinch around the attaching points like

I'm new to blender and I just finished blender guru's beginner tutorials and the anvil tutorials. It's always painful to perfect my mesh and vertices but I really want to learn how to solve these sort of problems so I'd be more than grateful if anyone like to give me a hint, instructions, or even just pointing out the problem (cause I can't even tell.)
Thanks!

It good that you try to keep the geometry as simple as possible. But in this case you need more geometry to avoid pinching.

In the inner (curved) edge loop I used the "Loop Cut and Slide" tool and selected Even (E) offset. You can Flip (F) from where it's even.

You can keep the other sections of the light sabre low in geometry. There are usually no reason to merge different parts seamlessly merged to each other.

You will find more tools and how you use them is up to you. I think that discover your way of solving problems is one of the more rewarding things with modelling. It's also quite tidies to do step-by-step instructions ;-) and at then end not that helpful.


Trouble: i have a fresh project and hitting view animation shows a video, i didn't even make anything yet! SO basically, i installed blender 2.8 a while ago. I am now trying to create a scene using camera momevements. When I go to the view animation function under the render tab, it shows some video that i tried to edit with blender like 4 months ago. How is this in my fresh project and how the hell do i get it out and never have it repeat again?

Delete the old video file (or image sequence) in you temporary folder. On Windows it's in "C:\tmp", on Linux or MacOs it's in "/tmp".


Best way to fix this mesh? I exported this CAD model from a SolidWorks assembly using eDrawings in STL format, then imported into Blender:

As you can see there is alot of bad geometry. I have already done the following:

Removed any double vertices
Converted Quads to Tris with ALT+J
Mesh -> Clean Up -> Degenerate Dissolve

But I'm still left with a bit of a mess. Adding a Decimate modifier in Planar mode might be able to fix some of this but I will still be left with a less-than-perfect mesh.

Any tips on how I can make this any better? The model will be UV-unwrapped and imported into Unity.

If you mean less than perfect in term of the exact volume, than this is problematic for numerical reasons already. A treshold is needed at some point to determine which edges can be removed.

The order in which you use the operations play a major role. As you mentioned, the Decimate Modifier in Planar Mode is probably your best bet for this. Note that dissolving and decimating will be similar in this case, but I would try Decimate first and then Dissolve in the next step.

Also don't use Convert Tris to Quads before using Dissolve or Decimate, it will make the geometry more messy. It should be the last step and probably guided by hand. Selecting some important loops and using sharp/seem edges will help to get cleaner Quads. Check Compare Sharp or Compare Seam.

`Beautify Faces" might help, but might make it worse aswell. Trying can't hurt.

You might also play with the export settings and try a different file format in SolidWorks.


Is it possible to have coordinate system with 3D cursor as origin? I would like to do some precise vertex positionning with regard to the 3D cursor, eg put a vertex at coordinate (0.1,0.1,0.1) from 3D cursor (which I can position very easily to a convenient position). Is that possible? I am not talking about the local coordinate system, which takes the object's origin as origin.

Xavier, you can position a selection at a set of coordinates in the edit menu by using the 3D cursor location on the Properties menu N.
You can then move a selected point to the cursor location using the Snap menu Shift+S and selecting "Selection to Cursor"
This positions the selection using the global coordinate system.

You can also enter the coordinates of the active vertex directly using that same menu.

Beneath the coordinates, you  specify weather the location is in local or global coordinates.
You could then combine that with the cursor location.


Annoying menus popped up in dope sheet, can't remove them Yeah. I know it didn't come out of nowhere, I probably trigged it with the endless buttons or keystrokes everywhere. It's really annoying and it's the only one that has it there...

In the dopesheet area, you have enabled sliders.

Disable them by unchecking sliders in the dopesheet menu View > Sliders.


Script to remove animation from a specific bone instead of the armature using script I found a way to point to bones in an armature

import bpy

armature = bpy.data.armatures["Armature"]
for bone in armature.bones:
    print(bone.name)

Here I want to check for names of bones and if those name match then I am looking to remove all the animation from that bone including all Scale , Location and Quaternion Rotation.

Thanks in Advance

As batFINGER suggested in his comment. This can be done using bpy.ops.anim.keyframe_clear_v3d(). To do this in python you need to select the bone first then apply the operation. Below is a script to delete animation of a specific bone, in this example, a bone named 'Bone' will have its animation deleted:

import bpy

arm = bpy.data.objects['Armature']
bpy.ops.object.mode_set(mode='POSE')
bpy.ops.object.select_all(action='DESELECT')
arm.select = True
bpy.context.scene.objects.active = arm

bpy.ops.object.mode_set(mode='POSE')

bpy.ops.pose.select_all(action='DESELECT')

for pb in arm.pose.bones:
    if pb.name == 'Bone':
        arm.data.bones[pb.name].select = True
        bpy.ops.anim.keyframe_clear_v3d()
bpy.ops.object.mode_set(mode='OBJECT')


Where is the Alpha Convert Node in python? I do not want my alpha premultiplied when saving images. In blender you can use the compositor Alpha Convert Node to convert from Premultiplied to Straight. I can't seem to find this node in the Python API.

CompositorNodePremulKey
You can find a complete list of available compositor node types here: https://docs.blender.org/api/current/bpy.types.CompositorNode.html.
alpha_convert = tree.nodes.new(type='CompositorNodePremulKey')
alpha_convert.mapping = 'PREMUL_TO_STRAIGHT'

However, sometimes it's pretty hard to figure out since the names doesn't really match. I'd suggest create the node in the compositor by hand and print its type to the console to get an idea:
import bpy

class NodeOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "node.simple_operator"
    bl_label = "Simple Node Operator"

    @classmethod
    def poll(cls, context):
        space = context.space_data
        return space.type == 'NODE_EDITOR'

    def execute(self, context):
        space = context.space_data
        node_tree = space.node_tree
        node_active = context.active_node

        print (node_active.type)
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

Or use Node.bl_rna attribute which returns the actual struct (to copy the name from):
>>> node_active.bl_rna
<bpy_struct, Struct("CompositorNodePremulKey")>

Related: Controling compositor by python


Clipping Border doesn't work sometimes I'm pretty new to Blender and I have created an environment. I import a vehicle model using the apend option but I have problems when trying to display only a portion of the car model. I press Alt+B and select the zone I want to cut, but for some reason Blender does weird things like making all objects disappear or cutting other zones. When I use the same tool in the project where i take the vehicle model from I don't have any trouble. What could be the origin of such issues?

Edit:

So this is my environment with the car model imported

I press CTRL + 1 to have the next view.

And I select an area with ALT + B. The result is this:

As you can see, everything disappears and I can't see the portion selected. There is another annoying thing. The vehicle surface is smooth in the original file, but when imported it is not like that anymore. Any ideas?

I think problem in clipping settings:

The end point is extremely big! Set end point less than one thousand.


Displacement node doesn't seem to work I've been trying to get the displacement node to work in blender 2.80, but am having no luck:

It doesn't seem to show up in the cycles render either:

anyone know what I have to do to get it to work?

If you are attempting to use simple "fake" displacement (basically bumpiness that is affected by lighting, but is not visible in silhouette), you've already got it working. If you are attempting to use "true" displacement from the displacement node in the material, this will not work in Evee. Use Cycles or the displacement modifier.

Also, even in Cycles, the results of true displacement from the material displacement node do not affect the mesh in edit mode view: it is computed at render time.