For Blender, which is the better language to learn - OpenGl or OSL? And why? I have only yesterday started to learn OSL. Since OSL tutorials are scarce in Youtube, I am beginning to wonder if OSL is becoming obsolete as I get the impression that it is overshadowed by OpenGl. I am confused.

Now, I want to know if I should drop OSL and learn OpenGl instead - or learn both. I want to do many things with the languages, for example: making textures, physics simulations, mechanics, etc.

Short answer is: (probably) neither

OpenGL is a framework for writing (not advanced) render engines, such as the Blender solid shaded viewport. It's pretty powerful, but isn't really useful to know as an artist.

OSL was designed by Sony to be a powerful, versitile language for creating Shaders at a fundamental, mathematical level. It's supported by quite a few notable production quality render engines, and is used widely in the VFX industry to create otherwise challenging shaders.

Fortunately though, Cycles Render has a quite excellent shading node system, so it's not really a nessesity at all. As a solo artist it's not something you should spend time learning, but if you plan on doing shading/LookDev for as a career in VFX, it would be fantastic to know.

I would recommend to actually learn a program called Substance Designer, rather than OSL or OpenGL. Substance Designer is a node-based software for creating procedural textures and materials, which are compatible in any render engine. Not only can Designer be used to make extraordanarily detailed and realistic materials, it supports MDL (material definition language) creation. MDL is becoming more and more recognized, and is starting to be implemented in more and more render engines. So yeah, learning Substance Designer would give you some extremely powerful knowledge, and it's safe to say it will keep it's relevance for a long time.

I hope this helps!

P.S.

Neither of these affect anything other than rendering, texturing, and shading, so if you want to be able to do other things in Blender like procedural modeling, simulations, creating add-ons, and things like that -- Python is definitely the right choice.


Issue with multiple edge selection from vertex in Beldner 2.79 I have been working trough a youtube tutorial on making a low poly space ship. After several attempts I can't get the same result as the instructor at time 5:30.
BLENDER-EP/02 - how to model a low poly spaceship 1/2

When selecting the a vertex, I notice not all edges connected to it are highlighted. It would appear I have some how created two vertices in the same point.

Is there a way to prevent this from happening? I have followed the Tutorial step by step multiple times yet I still get this issue and later on when I UV unwrap, my model is a mess.

Thanks in advance.

Tutorial:

My Model:

It's hard to tell how it happened, perhaps you've duplicated your mesh by mistake, anyway, select all and W > Remove Doubles and it will fix the problem.


How to redirect output from 'bpy.ops.*'? When calling operators such as bpy.ops.mesh.remove_doubles() it outputs how many vertices were removed into console.

In some cases its better to silence it, but you may also want to catch it and use it within the script.

How can I redirect or otherwise silence the text from printing into the terminal?

This can be done by temporarily overriding the output using redirect_stdout.

eg:

Short example:

from contextlib import redirect_stdout
import io
stdout = io.StringIO()
with redirect_stdout(stdout):
    bpy.ops.mesh.remove_doubles()

Commented answer with redirect:

# Python module to redirect the sys.stdout
from contextlib import redirect_stdout
# So we can create a file-like object
import io

# our new output
stdout = io.StringIO()

with redirect_stdout(stdout):
    # any printing or operator output within this block
    # will go into 'stdout'
    bpy.ops.mesh.remove_doubles()

# if you like to get the output and use it
# you can read it as if its a regular file.
stdout.seek(0)
output = stdout.read()
del stdout

print("We caught the output, it was %d long!" % len(output))

Note, that this can also be used to re-direct operator reports for your own use, and example of this is a benchmarking tool which extracts output from the draw timer.
https://gitlab.com/ideasman42/blender-fps-bench/blob/master/blender_fps_bench.py#L196


Is it possible to change an object's color depending on its distance? For example I have a semitransparent sphere which contains another object which is a cylindrical line. Let's say this cylindrical path is blue. Is it possible to change the color when I rotate my object?
For example the color of the line is darker when it's closer to my viewpoint and lighter when it's further away. So the line would be a color spectrum of blue.

Thanks for your answers!

This is my object: a cylindrical path.

Animation Nodes can be used here. I shall show two methods for computing the distance between the objects and the camera.

Passing Camera Location To Cycles

The easiest and most efficient method is to use Animation Nodes to pass the camera location to cycles and compute the distance there through the Object Info Node. This is done as follows:

Notice that the distance between two points $A, B$ is equal to $\vert\vert\vec{AB}\vert\vert = \vert\vert\vec{B}-\vec{A}\vert\vert$. But for some vector $\vec{V}$, $\vec{V}\cdot \vec{V} = \vert\vert\vec{V}\vert\vert^2$ and it follows that $\vert\vert\vec{V}\vert\vert = \sqrt{\vec{V}\cdot \vec{V}}$ which is what we used to compute the distance above.

Using Vertex Colors

If more advanced computations are required, then you can compute the distance in Animation Nodes and pass it to cycles in the form of Vertex Colors. I compute the distance between the object and active camera, remap it by subtraction and division, though you can use the Remap Value Node if you are more comfortable with it, compute a color in whatever way you want, set the vertex color of the object to that color.

Why don't we use the distance a a Hue for the color?

Why don't we use the scale of the object as the saturation for the color?

I showed how to do that for a single object, however, you can do that for any number of objects using a simple loop:


Smooth a Cylinder in one direction I think this question is already answered anywhere, but I couldn't find a solution with my search terms :/ .
So I got this model and I only want to smooth out the cylinder parts, but not the extruded edges.

So here is my original model, I think it's kinda clear what should be smoothed out, it is supposed to become a rifle scope.

This happens with the normal smooth button, but I already tried it with a Bevel modifier and subdivison surface aswell.

Solution: Edge Split Modifier with Smooth:

Use an [edge split modifier] with smooth shading to round some areas and keep sharp edges.


How do I set up the bone constraint Floor? I wanted to use the floor bone to save on animation time by making my robot feet hit the ground when stepping and act like a suspension by bending the flaps. Using the flap bone IK to the floor bone (small green bones) but since it can't be connected to the rig to work it ends up not working as it wanders away from the end of the feet bones. As the one on the left of the image is doing.
How do I set up the floor bone to cause the feet flap to keep from digging into the floor automatically?
Basically, when the purple object goes downwards the white flaps should bend from the hinges to avoid going through the floor.

You can parent the control bones (the small green ones in your image) to your robots foot so they stay with your foot, they just can't be parented to the flap bone. The easiest way to set this up is to use the IK constraint, so you're on the right track.

Here's the rig that I used to test this out on. It's a simple IK setup with one extra bone as the main foot control and the flaps and control bones parented to the foot bone. The center green bone has a copy rotation constraint so that it follows the IK control bone.

Once you add the floor constraint, you will need a floor, so make sure you have  a plane for the foot to collide with. Once you add the floor constraint and have the IK constraint setup as well, it should collide. If it doesn't, see if you can move the control bone manually. If you can't move it manually, constraints can move it either, so make sure you can move each flap manually.

Since it doesn't look like the flaps will move that much in your case (not a huge angle) this next step might not be necessary. However, you may still notice that as the control bone hits the floor, the IK bone will still point at the root of the control bone (as it should), but the distance from the control bone to the root of the flap bone will have shrunk, meaning the tip of the flap bone will dig into the floor a little bit as the tip passes through the root of the control bone (the more the flap has to move, the more noticeable this will be). To fix this, we can use the limit distance constraint on the control bone. Set the target to be the corresponding flap bone. Set the clamp region to Outside so that the control bone will always stay a set distance from the root of the flap bone. The default distance should be fine, if not just click the reset distance while the foot is off the ground and you should be good to go.

Now you may notice another issue. After adding this constraint, the control bone stays at the tip of the flap, but now passes through the floor a bit. I'm not sure why this is exactly, but I think it has to do with how blender handles multiple constraints. A quick fix is to add a second floor constraint to each control bone  with the exact same setup, so you have one floor constraint before and after the limit distance constraint. The control bone should now stay on the floor better (in my test is still passed through but only a tiny amount that wasn't noticeable except when looked for closely).

My final rig looks like this:

The flaps have an IK constraint and nothing more.

After recreating this to add some images, it some of the bones seem to glitch after a transform and they end in the wrong position. Once I move them again, they snap back to normal though. This may simply be an error in how I did my setup, but if you have issues with it I will look into it further.


remove node links by python Will someone tell me what is wrong and way this is not working

import bpy

for mat in bpy.data.materials:
    mat_node = mat.node_tree.nodes
    for node in mat_node:
        if node.name == "Principled BSDF":
            link = node.inputs[0].links[0]
            if link is not None:
                node_tree.links.remove(link)

It is indeed mess, but this is visual, of what i need.

If there are no links you will get indexerror, so I would rewrite your last three strings of code:

for mat in bpy.data.materials:
    mat_node = mat.node_tree.nodes
    for node in mat_node:
        if node.name == "Principled BSDF":
            for link in node.inputs[0].links:
                mat.node_tree.links.remove(link)


How to bevel selected edges in non-destructive way? Before submitted that question I have made quite extetensive research and could not find the answer. I am quite new to Blender so I believe there is a chance the answer to my question might be simple but due to my lack of experience with Blender I did not recognize that.

The problem seem to be simple yet it is pretty complicated for me especially that I am trying to do beveling in non destructive way.

I have a simple plank with excision on one side. The excision was made in destructive way but the beveling is applied through modifier with weight kimit method (I am using speedflow and fluent).

Then what I am trying to do is to apply small bevel (about 1 mm) to all edges of the plank except four of them which are adjacent to one face.

I can - using bevel modifier - apply that additional beveling to all edges using angle as limit method but I do not know what to do to keep the selected edges sharp.

Not using any limit method (None) creates strange artifacts

While it is impossible to use vertex group as the edges I want to keep sharp are between verticies which are also part of the other edges that I want beveled.

----- EDIT -----

I have tried the method suggested by Merlin - applying bevel weight to individual edges - but it only works with simple geometry.

With more complex geometry it creates artifacts again.

You can set bevel weights on individual edges.

To enable this feature in the modifier, select Weight

Now go into edit mode and make sure you are in edge selection

Now select the edges you want to bevel (shift click for multi-select).

Now go to the Edge menu and select Edge Bevel Weight

Move the mouse to modify the value.

Once done you can use the panel as shown:

You can fine tune this after by hitting F9 to modify last operator.

Update

So while this works for most geometries, it seems that something odd has happened in your file.  I suspect that one of your addons has already been weighting your edges and combined with what we are trying to do here, makes for an unhappy mesh.

So I removed all you modifiers and created a vertex group with 4 vertices for the excision ( cut-out). Then, I recreated your bevel modifier with 40mm. The trick to getting this working correctly is adding an edge-loop in the center as shown.

Now you should have your rough cutout shape.  Here's the settings I used for this first modifier.

N.B. you must use Width Method: Width here:

So now it's time to setup the second bevel modifier weights as described above.

Make sure to pay attention to which edges have weight here:

And finally the settings I have used for this second bevel modifier are:

And the final geometry:


Auto-Run disabled? should i be concerned with this error? i am just getting into rigging in blender, and in the graph editor with the properties panel open i get a error message saying "ERROR: Phyton auto-execution disabled." Another thing that i noticed is a message on the top menu bar saying "Auto-run disabled."

I am in the graph editor because i want to create a driver for a simple but convent 2d ball rig, and i was wondering will be a problem for me later down the road. Also, what the heck should i do about the message. I don't like "ERROR"  sign being thrown at me.

Thank you,
Chris

This is a feature of Blender that tries to prevent you from running (possibly) malicious code when opening a file.

Animation drivers are actually Python statements (if I recall correctly, there is a way to make them multiline), which normally serve to control l parameters in some advanced ways; rigs tend to have a few drivers, since it's just easier to make work properly that way. However, if someone wanted to, they could, for instance, delete all your files, capture and send private information like passwords, keys and tokens, possibly, without you even noticing.

If you open the file from within Blender, there is an option to mark a file as trusted and thus run all scripts inside. Use at your own risk.

Another option is, in the User Preferences (CtrlAltU), to allow scripts, from all files, to run; if you don't save the user preferences, they'll only apply to the open file. You can also exclude some directories, if you want; if you do this, I recommend disabling it for your  "Downloads" folder. Again, use at your own risk :P


When working with different scenes, lower channels fade out I am using Blender 2.74 with LUbuntu 14.10. In this case preview and rendering acted different, as I explain below. I tried also in Blender 2.69 and in this version preview was showing the same behaviour as rendering, which is what I am trying to resolve.

I've got a project with 6 channels. Channel 1 is just for Color strips, to easy the process of fading in and out. Channel 2 is a Movie strip. Channel 3 is the (processed) audio of that movie and channels 4 to 6 contain different Scenes with text fading in and out.

The movie and its related sound also fade in and out. I play with Keyframes and opacity for all fades. When previewing everything runs smooth.

But when rendering, with no apparent reason the movie strip fades out to black just a short time after its programmed fade in, and stays that way short before ending, where it fades in again (by itself) before performing its programmed fading out.

If I move that strip from channel 2 to channel 7, then its channel 4 (i. e., one of the text scenes) the one fading in and out with no apparent reason.

I've checked Keyframes in Graph Editor for the different strips and I can't see anything abnormal. All the strips have an Alpha Over blend except the color strips in channel one, with a Cross blend.

I found the answer. In the properties tab of the text scene, render, shading, alpha has to be turned to Transparent. I guess there is a bug in version 2.74 that shows the preview in the wrong way.

Tx!!!


Denoise is not showing in the Scene tab I am using version 2.79, yet the Denoise option is not showing in the Render Layer Scene Tab.

Looks like you're using Blender Internal. Denoising is only available with Cycles Render.

You can change the render engine in the info header at the top of the window:


Face reflects light differently to others I'm currently working on a Stryker, i'v came across a problem which make it so one of the faces reflects light differently than all of the others.

Thanks to anyone who helps/attempt's to help :D
Here is a picture of it

This is a problem related to the normals.  To correct it, go into edit mode and select everything. (This can be done by pressing A once or twice.)  Then, click Shading/UVs > Normals > Recalculate.  If this does not work, select the single face and click Shading/UVs > Normals > Flip Direction.


Can't weld overlapping UV's I have 2 identical islands stacked together. Blender doesn't merge the vertices that are in the exact same position when I use Remove Doubles or Weld. It only works when the vertices are NOT in the same exact position.

Here's a GIF:

I've tried this, and even after doing the welding, most of the time, it is temporary (maybe I am doing something wrong - Oh Well).

Regardless of this, the easiest solution to this is to turn on proportional editing O, and scroll the influence area way down. This way when I move one vert, then everything directly under/over my active vertex comes along for the ride.


Pokemon texture model i'm new to blender and i have found some pokemons model i like but there is a problem with the eyes. Here's a picture of the issue and a link to the site where i've found the models(it's the models that have .fbx and .dae file only):

https://free3d.com/3d-models/pokemon

I use the FBX format model.

I think the problem stems from the .fbx importer not by default treating the eye's image texture as having a transparency channel (an Alpha channel, in addition to the RGB color channels), although I am not sure why this would happen on some but not other models downloaded from the same site and created by the same modeler. Still, this seems to be the cause in the particular case of the Dragonite model you downloaded.

By default, this situation results in an import that renders like (note that this is in Eevee; the problem exhibits distinct visual problems in Cycles, but presumably the fix would be similar there, accounting for the somewhat different handling of Transparency in Cycles):

If we open a Shader Editor window, and select the eye material (an image texture that is mostly transparent, except for a small section in which the eye is painted; note that this is likely to be the last of four Materials on the Dragonite model, for you), we see something like:

There are two issues here:

The material's "blend mode" is set to Opaque, which does not use the Alpha Channel, and so ignores transparency.
The Color rather than Alpha output from the Image Texture has been connected on fbx-import to the Principled BSDF Shader Node's Alpha input channel, so Black-White is being interpreted as Alpha. If we fix these problems (see squared areas in this image), the problem appears to be fixed:


Please explain logic of this transparency material nodes For the texture coordinates, I take the vector of the plate that is under the cube.
The length of which of the object vectors is taken? And why if I change the 2nd value in "Less Than", the transparency area increases? After all, the output in "Less Than" must be 0 or 1. This result suits me completely, I just want to figure out how it works.

Blend file: enter link description here

This seems to be some form of crude "Wipe" effect.
By using the object's local Z coordinate as input and running through the Less Than math function it basically makes an horizontal line mask.
In the vector node the X and Y axis Scale value to zero is turned down, which makes it basically output the pure Z axis, as opposed to all axis at once which would give a 45º tilted angle. This has basically the same effect as using a Separate XYZ node.
By linking it to transparency it basically makes the object opaque or transparent above/below a certain Z value defined in the Less Than node.


Texture painting on backface I'm new to Blender, I have modeled a naga and I'm painting a texture and some parts are unpaintable from the out of my model.

Them parts are "back faces", how can I enable painting on them from both sides ?

Edit : Here's the exact symptoms, I cannot draw on the part at right, the undrawable part disappear when checking the "Backface culling".

Black lines of the undrawable part have been made from the inner of the head.

Often I find that view camera affects my painting as well. – Craig D Jones

It's my problem, I have disabled the "Norm" option  and now I can paint everywhere. This option is located in the left panel of 3D View in texture paint mode (show with T) > Option tab > Paint by projection > Normal

Uncheck it and  nowyou can paint on faces at 180° of the view...


Rigify rig main properties and rig layers disappeared Rigify rig main properties and rig layers disappeared in N panel

so, the worse part, is cannot switch from IK and FK... how can I restore it and if I cannot, how can switch from IK and FK without the Rig Properties tab?

Thanks

Open a Text Editor and see if there is rig_ui.py file there.

If there is click Run Script and check also Register. Your controls in N panel should reappear. Also make sure for future that you have Auto Run Python Scripts enabled in User Preferences under File tab (so the registered scripts are run automatically when you open blend file).
If you linked the rig into a new file, look in the original file if there is one. Both the rig and it's script need to be linked.
If there is none script to find anywhere, you need to make a new one. Create another blend file, create some rigify rig there and copy the script.

There is however a complication, each Rigify generated rig has a unique id, that matches with the script file, so the script we took will have some new random id and won't work with the original rig. Making these codes to match solves it:


How can i remove the white dots I dont know how to remove these white dots. I already tried to make the lamp bigger. More samples does not work aswell. I dont know what can I do?

Those white dots look to me like light fireflies. To fix this, use denoising. You can enable this in the second render collections tab in the properties panel.


Completing Blender Guru Donut Tutorial: extruded object does not snap to face I am having a fight with a donut. I am on Part 4 Level 1, and I'm trying to extrude the drips from the icing.
Earlier, I wasn't able to get anything besides a rectangle to appear (no roundness, despite what was selected under proportional editing), but after a couple hours of messing around it seems like the issue is that the extrusion is freely piercing the plane. It is not snapping to the surface, but rather, it can swing freely inside and outside. That makes it really hard to get a good drip.
Here's a link to a video for visualization for what I am talking about: https://youtu.be/BgAEUB91apY
This is my first time with Blender, so I'm sure I'm missing something quite simple, but I'm totally stumped. Halp?

Looks like you are doing the right steps.  The only setting I can't really see from your file is in the Snap drop down menu.
In the snap drop down,  "project individual elements" must be checked, or enabled.


How can i apply gobos to a spotlight to make it look like a real life moving head light? as you may know most moving head lights used on live stages and dj shows have a gobo feature which allow the light to be restrained on some parts of the spot, as if a cookie cutter was placed in front of the light source, this results in various shapes.
How can i recreate this effect in blender on a light ?(i'm using 2.8 and Eevee)
i already have some black and white gobo textures ready if it can help (see picture below)

Many thanks in advance !

What worked for me (for the same exact purpose) was to use either geometry (as @RBlong2us suggested - with the wanted shape made firstly as a vector image and then extruded in Blnder) or even simpler (as is in my example) by using a plane and put it in front of my spotlight (as a real gobo would be) with an alpha texture. In order to make this working you should take care of the blend Mode and Shadow Mode of the plane's material. You may take a look on the image below.


Boolean non working, shows red box in the modifier panel I'm using Blender 2.79 with factory defaults.

I select the default cube, then Add Modifier > Boolean, it shows a red box in the modifier options.

I then duplicate the cube, select both, again Add Modifier > Boolean  and it shows a red box again.

What am I doing wrong?

If the name of a modifier is higlighted in red, it means that the Modifier is currently not having any effect because its parameters don't produce any effect (for instance, if you add a Subdivision Surface with level "0").

In your case, your Boolean modifier hasn't got an effect because you haven't selected an Object in the "Object:" dropdown menu of the modifier.

Indeed, the boolean modifier doesn't work by selecting two object and adding a modifier, but selecting ONE object, adding the modifier, and telling the modifier what other object to use for the operation

Example usage of Boolean: cutting part of the green cube using the white cube

Note that only the green cube is selected. The white cube is just chosen for the operation. As soon as the choice is done, the red highlight under "Boolean" is gone.


Create spiral out of circle I want to create a spiral that looks like this:

From green to purple is one "circle", but the green part is below the purple. This circle repeats below and so on

Actually it just a circle (pie chart) that is cut at a radius line and then "drawn down" so there results a spiral if you add multiple of these circles.
Does someone have an idea how to achieve this kind of model?

Create a simple mesh composed of only one edge progressing along the X or Y axis.

Add a Screw modifier to it, adjust properties as desired, mainly the Steps for smoothness, Screw for height, and Iterations for number of turns.

To assign different colors to your mesh you will have to apply the modifier though, then create multiple Material Slots, assign them to the desired faces, then create your colors as desired.


Can't select bones in pose mode I'm new here so I don't know if I'm making this question in the right place, but I'm having an issue with bones in Pose mode and would be so thankful if anyone could help.

I can select them without any trouble in Edit and Object mode, but whenever I move to Pose mode I can't select them anymore. I could select them on the Outliner, but that isn't very practical nor intuitive.

Also, whenever I do select the intended bone, I get no outlines, just a very faint coloring on the object. That gets really confusing when I'm using bendy bone segments, as I can't tell whether they are there or not in side and front views.

I'm on Blender 2.82.7

I tried uninstalling and reinstalling the latest version, updating my drivers, but nothing has worked so far.

Sumarized:

I can't select individual bones in pose mode unless it's from the outliner
Whenever I can select the bones, I can't see their outlines

I had this exact same problem when trying to bring an armature from 2.8 into 2.79, and I found a solution that worked in that case, so maybe it will work for you as well. Try the following:

Create a new additional armature with a single bone in your project file. Then in Object mode, select your problematic armature (the one you can't select bones from in pose mode), shift-select your new single bone armature, and join the two (ctrl-j).

When I did this I was able to select all of my original bones in pose mode again.


Transitioning from Walk Cycle I need to have a character take a slow walk through different areas of large scene.I'll be using a walkcycle for most of it.  Imagine your in a house walking slowly from one room to another.  You would be at rest position... then begin the walk to the next room where you would then come to another rest.

There a many walk cycle tutorials, but I have yet to see on where the character transitions to a stop or goes from a stop into the walkcycle.
I'll be using Blenders video editor most likely.

Can someone describe how this is properly done? If anyone has ever done this, Maybe you can post a blend file, so I could study how it is done.

Use the Non-Linear Animation Editor.  First make an action of the character resting, standing or whatever you want him doing, then, having that strip set to 'Hold Forward' make another strip for the walk cycle.


How to set the current scale to 1? I want to take an object that I have scaled in object mode and set the current scale to 1. I can find the current scale, clear the scale with Alt+S, and then switch to edit mode and scale to what it was before I cleared the scale. Is there a built in way to do this? Modifiers build off of the object scale, so it would be nice to set the current scale as 1 rather than just clearing the scale and resizing in edit mode.

You can do this by selecting the object that you want to apply the scale to,  press  Ctrl  +  A  and select Scale


Script works inconsistently I'm importing 300-400 images via Images as planes add-on, stacking them at world origin and below each other (0.001 offset). Render engine is Blender Internal. Then I want to disable interpolation for all textures with this small code:

import bpy

for x in bpy.data.textures:
    x.use_interpolation = False

Sometimes it works, especially for amounts of images less than 10-20, but usually it throws error:

   AttributeError: 'Texture' object has no attribute
  'use_interpolation'

Non blender internal textures

There may be some textures in blend that don't have the use_interpolation property.  For example switch to cycles and add a new brush texture.  bpy.data.textures["Texture"] the newly added one, doesn't.

Check whether the texture has the attribute with hasattr

>>> for t in bpy.data.textures:
...     t.name, hasattr(t, "use_interpolation")
...
('dice', True)
('Tex', True)
('Texture', False)

Find all with that property, then set.

bi_textures = [t for t in bpy.data.textures if hasattr(t, "use_interpolation")]
for t in bi_textures:
    t.use_interpolation = False

or get the textures from the materials on the planes. Test code to get all textures on selected nesh objects

import bpy

context = bpy.context

textures = [ts.texture
        for o in context.selected_objects if o.type == 'MESH'
        for m in o.data.materials
        for ts in m.texture_slots if ts and ts.texture]


Script to make copies of a shape key, each one with an isolated translate channel I have been reading Jason Osipa's "Stop Staring - Facial Modeling and Animation Done Right". In the book, there is an interesting Mel script I am trying to port to Blender, so far with no success

Basically, the script copies a shape_key andcreates 3 new shape keys, and in each one, the vertices translations in each axis are isolated. Thus we have three new shape keys, one being for the X axis, another being for the Y axis and another for the Z axis. The three combined are equal to the original shape_key.

I know I can access the coordinates of the vertices in the shape key through:

object.data.shape_keys.key_blocks['Key 1'].data[#].co

('Key 1' being the shape key name and # the vertex index)

I also know I can access the vertices in their original position through:

bpy.context.object.active_shape_key.data[#].co

(# being the vertex index)

Thus, I thought the code would be something like:

import bpy

context = bpy.context
scene = context.scene
obj = context.object
shape_name = obj.active_shape_key.name

obj.shape_key_add(name=str(shape_name) + "_X", from_mix=True)
obj.shape_key_add(name=str(shape_name) + "_Y", from_mix=True)
obj.shape_key_add(name=str(shape_name) + "_Z", from_mix=True)
bpy.ops.object.shape_key_add(from_mix=False)
bpy.ops.object.shape_key_remove(all=False)   #Hack to select the last shape_key in the list

shape_name = obj.active_shape_key.name #Update the active_shape_key.name

for vert in obj.data.vertices: #Isolate the translation on the Z axis first
    obj.data.shape_keys.key_blocks[shape_name].data[vert.index].co.x = obj.active_shape_key.data[vert.index].co.x
    obj.data.shape_keys.key_blocks[shape_name].data[vert.index].co.y = obj.active_shape_key.data[vert.index].co.y

obj.active_shape_key_index = obj.active_shape_key_index - 2

shape_name = obj.active_shape_key.name

for vert in obj.data.vertices: #Isolate the translation on the X axis
    obj.data.shape_keys.key_blocks[shape_name].data[vert.index].co.y = obj.active_shape_key.data[vert.index].co.y
    obj.data.shape_keys.key_blocks[shape_name].data[vert.index].co.z = obj.active_shape_key.data[vert.index].co.z

obj.active_shape_key_index = obj.active_shape_key_index + 1

shape_name = obj.active_shape_key.name

for vert in obj.data.vertices: #Isolate the translation on the Y axis
    obj.data.shape_keys.key_blocks[shape_name].data[vert.index].co.x = obj.active_shape_key.data[vert.index].co.x
    obj.data.shape_keys.key_blocks[shape_name].data[vert.index].co.z = obj.active_shape_key.data[vert.index].co.z

However, it does not work and it's driving me mad. Any suggestions?

First point would be that shape_key_add(from_mix=True) will copy the shape key as it is, you may want to be sure that the shapekey is in effect when you copy it.

obj.active_shape_key.value = obj.active_shape_key.slider_max

Rather than changing the active shapekey for each step, get the index of each as you create them and use that when adjusting the copy. The new shapekey will be added to the end of the list so it's index will be len(key_blocks)-1

xshape_idx = len(obj.data.shape_keys.key_blocks)-1

Now the key point -

obj.data.shape_keys.key_blocks[shape_name].data[vert.index].co.x
  = obj.active_shape_key.data[vert.index].co.x

you set obj.active_shape_key_index then you copy active_shape_key.data[vert.index] into key_blocks[shape_name].data[vert.index] that is two ways to the same data. I would suggest setting the unwanted locations to the Basis shapekey locations.

obj.data.shape_keys.key_blocks[xshape_idx].data[vert.index].co.x
  = obj.data.shape_keys.key_blocks['Basis'].data[vert.index].co.x

I finished up with -

import bpy

context = bpy.context
scene = context.scene
obj = context.object
shape_name = obj.active_shape_key.name

## enable shapekey before copying
skey_value = obj.active_shape_key.value
obj.active_shape_key.value = obj.active_shape_key.slider_max

obj.shape_key_add(name=str(shape_name) + "_X", from_mix=True)
xshape_idx = len(obj.data.shape_keys.key_blocks)-1
obj.shape_key_add(name=str(shape_name) + "_Y", from_mix=True)
yshape_idx = len(obj.data.shape_keys.key_blocks)-1
obj.shape_key_add(name=str(shape_name) + "_Z", from_mix=True)
zshape_idx = len(obj.data.shape_keys.key_blocks)-1

## reset shapekey
obj.active_shape_key.value = skey_value

for vert in obj.data.vertices: #Isolate the translation on the X axis
    obj.data.shape_keys.key_blocks[xshape_idx].data[vert.index].co.y = obj.data.shape_keys.key_blocks['Basis'].data[vert.index].co.y
    obj.data.shape_keys.key_blocks[xshape_idx].data[vert.index].co.z = obj.data.shape_keys.key_blocks['Basis'].data[vert.index].co.z

for vert in obj.data.vertices: #Isolate the translation on the Y axis
    obj.data.shape_keys.key_blocks[yshape_idx].data[vert.index].co.x = obj.data.shape_keys.key_blocks['Basis'].data[vert.index].co.x
    obj.data.shape_keys.key_blocks[yshape_idx].data[vert.index].co.z = obj.data.shape_keys.key_blocks['Basis'].data[vert.index].co.z

for vert in obj.data.vertices: #Isolate the translation on the Z axis
    obj.data.shape_keys.key_blocks[zshape_idx].data[vert.index].co.x = obj.data.shape_keys.key_blocks['Basis'].data[vert.index].co.x
    obj.data.shape_keys.key_blocks[zshape_idx].data[vert.index].co.y = obj.data.shape_keys.key_blocks['Basis'].data[vert.index].co.y


Bone Heat Weighting Failed. No solution works I have an object, that always result in a "Bone Heat Weighting Failed" error when I try to set parents with automatic weights.

What I tried as a fix so far:

It's only one lose part.
Just using a single bone.
Making sure scale of bone is applied.
Making sure bone is inside mesh.
Making sure they have the same origin.
Remove doubles in mesh.
Check normals.
Applied modifiers.
Checked vertex groups, UV maps.

Can someone with some rigging experience quickly take a look at the .blend file and help me out?

http://pasteall.org/blend/index.php?id=51166

The solution is to scale up your object, parent, then scale back down (if you want to). I gave it a quick test with a single bone, which failed at default size, but worked after scaling both objects by a factor of 10.

The reason this works is because the automatic weighting system has a hard time with vertices that are very close together. Scaling up spreads everything out, making it easier to calculate.


world lighting doesn't affect objects with Eevee renderer i want an object to be evenly lit with a flat color, but i can't achieve such result - scene lights work, but world color does nothing and i don't know any other way of adding an ambient light.
here's the file with preview of how it looks like https://pasteall.org/blend/df6fc53b54dd49fdac33a9d0bd65ea0c
(i've set the world background to bright purple just so that it would be easier to notice the difference in case some intensity setting affects it - like it was the case with my green point light)

found out i could do this with baked lighting:

in viewport shading dropdown settings have "Scene World" enabled;
Properties - Render - Indirect Lighting - Bake Indirect Lighting;
slightly inconvenient as it requires rebaking if changes to the background are made. otherwise works fine - i was expecting the baked lighting to break when objects gets transformed.

alternatively, increasing sizes of existing lights can help, but it realyl screw with the scene setup:

have a Point, Sun or Spot light type
set Power and Radius (or Strength and Anlge in Sun's case) to something large, like 50kW 50m
Sun type looks smoothest
it's not directionless and still leaves faces completely black if they're facing in opposite direction of the light, but it's better than nothing

if there's a better way - please let me know.


How to model this complex knot? Have been struggling to model this knot. I've tried using paths but I always somehow mess it up. Is there a way to perhaps box model this? I've been really stuck on this, It is called a Sageo and is a knot found on katana scabbards. If anyone knows a tutorial for this or something else, that would be great!

Instead of using a single object to make the whole ribbon you could use several in order to fake it, like that (material is not good):


Create a shower hose with correct physics I'm making a shower hose that follows the handle when it moves.

I've created it successfully following THIS tutorial, but the hose is too "elasticy". I'm wondering which settings I should change (from the tutorial) to make it more rigid.

I also want it to have less "bending points" when it's moved, it should really only have one major curve like shower hoses do when you move them around.

Cheers.

I believe the Softbody Simulation won't give you enough control over the movement. Here is an alternate method using a rigid body simulation.

The flickering is caused by the gif compression and not by a simulation error artefact.

It uses a chain of rigid bodies like in lemon's answer.

Enable the rigid body world.

Add a cylinder, make it a cylindrical rigid body. Then duplicate it. ⇧ ShiftD

Create an empty and place it inbetween the cylinder rigid bodies. Make it a rigid body constraint. Set the type to Point and select the two cylinders.

Create another rigid body constraint (on another empty): a generic spring. Enable the springs you need. I would use a very high rotation damping value, since a hose wouldn't wobble around. [0.9999]
I parented the generic spring constraint to the first point constraint, and the point constraint to the first cylinder, but this is just for easier visualization. The point constraint acts like a spherical joint between the two cylinder and the spring pushes the cylinder back to their original positions, ensuring minimal bending.

Create more cylinders, constraint and chain them. They're now ready to be simulated.

Note, how the twisting of a single joint in the chain influences its surrounding joints.
You can now transfer with movement to an armature with Copy Transforms constraints.

You can also connect it to a curve using many hook modifiers. The drawback of this method is, that the rotation of the rigid bodies is not used.


How to UV unwrap a christmas tree cookie Thank you for getting back to me.... Here is the cookie. I agree it is bad topology. I am not sure how to proceed with making a Christmas cookie any other way yet. I would again appreciate any advice. Here it is: enter link description here

Can anyone think of a better way to do this? I want this shape for a cookie. I thought about using it as an outside for a plane and shape it that way but I cannot figure out how to do it. Thank you for your help if any one could please let me know how to do this I would appreciate it

First off, a question; Why do you use so many overlaying faces? I was going to try and make your UV simpler for you, but after removing about 30 faces on the top side alone, I gave up and made a new one.

This one does not have the same bumps and such as you had on yours, but it's simple. No overlaying faces.

I'd suggest making a new mesh from scratch. If you want the level of detail you went for on your file, simply subdivide the mesh, and do as you will. But overlaying faces is not necessary, and it will bite you in the butt sooner or later. As you've probably experienced already.

Remember, keep meshes as complex as you absolutely have to.

If you do it as I did in in the picture below, you'll have a really easy time doing the UV and texturing.

Here is how you can easily unwrap your mesh:

EDIT: On request of the OP, here is how I made the shape of the object.
First, I made a new cube (SHIFT+A). I then pressed Z to go to wireframe mode and removed the bottom part of the cube (I could also have simply added a plane, thought of that later).
I then shaped the square to match the shape of the object the OP made.
After that, I selected two verts and extruded them with E a bit down. From there, I moved the verts to match the corners of the original object.
Repeat and repeat (Selecting the two newest verts and extruded them further down)
Making sure the verts were at the right place, I started removing the faces. After that, I selected 3-4 verst at a time and pressed F to fill a new face between the selected verts to make up the shape of the object.

Once the shape was all done, I went to the modifiers tab (The one with the wrench icon) and added a solidify and adjusted ut to give it a nice thickness.
I then proceeded to apply the material to the object, giving it the original appearance.

I never did it, but you can then TAB out of edit mode, and apply the solidify modifier to be able to select the verst on the bottom of the cookie.

Done.

Hope this helped.


Inset Faces Giving Weird Results When I select the front face on this object and use the Inset Faces features, I get very weird results in the corners (see second image)

Things I have tried:

Applying all transforms
Merging vertices by distance
Recalculating normals
Manually checking for any weird/duplicate vertices around the areas that are causing problems

Nothing seems to help, but as I'm very new to Blender I assume I'm just doing something wrong (although from googling it and following other tutorials I can't see what). Any suggestions?
Thanks

all the edges go in in their direction so as you can see they all go in the right direction, if you do not want this do E and then right click and then while the face is still selected Resize it with S and that will do the trick usually.
Side note, if you are using clipping on your mirror node it will not inset normally.


Blender Cycles - Hair Edges are Gray I've been trying to render hair in Cycles, but for some reason when I render them with transparency and what not the textures come out with grayish edges. It might be something to do with the alpha settings but I'm not entirely sure. For the sake of simplicity i omitted her other hair particles besides the ones shown. Is there a way to get rid of the white outlines?

Any help would be appreciated. Thank you!

It might have to do with pre-multiplied alpha channels in the PNG image, though I am not sure how to solve it correctly in Blender.

I suspect the problem here is the alpha map transitions softly from hair color to transparent, but the Cycles transparency has a different color from the opaque area (in this case white).

One way to work around it that might mitigate the problem is to change the color of the transparent material to match the color of the hair.

Try plugging in the Image color output to the color input socket of the Transparent node also, to see if it helps.

Depending on how the hair color is setup (if the transparent areas of the image still have hair color) it may reduce the issue.


How to exclude an object from Freestyle render? The question is how can I exclude an object from the freestyle render?

What I need to do is create a Clay render with the wire only on the airplane.

My scene is simple I only have two objects the "Toy Plane" and the "floor".
For the Clay render I only override the materials to a simple clay material and done.

But this happens when I use freestyle. How can I tell freestyle to ignore the "Floor"?

So you want freestyle on the plane but not the plane :)

This is very easy to do. Add the plane to an object group. Select it and press CtrlG.

Now in the Scene tab of the Properties panel scroll down to the "Freestyle Line Set" section, and add Group to the "Selection By:" setting. (outlined in red in the image below)

Set the group you made earlier as the "Group" (the group field will be on the bottom).
Now depending on which plane you grouped, click the "Inclusive" box if you grouped your airplane; because you want to only include objects in the group in this freestyle lines. Conversely  if you grouped the ground plane click the "Exclusive" box, to exclude the ground plane from freestyle.


line segments with edges into a curve I want to give these line segments a continuous cylinder shape, like a Spaghetti noodle. My aim is to make this path visible in render mode. At the moment you are not able to see it in render mode because it has zero thickness.

I already converted them into a Bezier curve and played around with the Bezier Circle. The result were a lot of cylinders behind each other with a lot of gaps between them because the whole line has edges as you can see on the picture.

I also tried to solve the problem with a Skin-Modifier, but this didn't give me a good solution either. Maybe I should combine it with another Modifier.

So I was wondering if it's even possible to convert an 3D edged path into a curve path with a cylinder shape.

I would be very glad if someone could tell me how I get a good solution.

Thank you very much!

If I understand it right.

Make path, edit it as you need.
Make Bezier Circle.
Select Path and under Object data tab select Bezier Circle as Bevel Object.

Now you can resize Bezier Circle as you need.


My Mac Mouse has only a left button My Apple mouse has only one button (a Left button). Normally I use                   ctrl + left mouse as a way to use the left mouse button but it doesn't work with blender. what do I have to do. Because I can't select anything.

You can set selection to be with the left mouse button :

got to File➝User Preferences➝Input
in Select with click Left

also you can search and reassign all what is related to the right mouse button


Adding contact shadows on glass table There are no shadows that indicate the objects are on the top of the glass table.
How can I add shadows?
I'm using Sun and an Area lamp on Cycles.
This is the glass material that I've used from online:

The closest I was able to personally achieve that resembles your setup is below. It isn't perfect - it changes the look of the glass a little, and requires some very bright, or very close (or both) lights to be properly visible. As you can see from the image, I had to put the area light close enough that the light is glaring off the surface of the glass. It also seems that as is usual, the smaller the light radius, the better for the shadow. Therefore, keep the size of the area light as small as possible, and even consider swapping the sun for something else maybe even a very bright point light). However, one thing that works well in your favor is that the shadow shows up best at a shallow angle (like the one in your photo) so you can probably get away with less bright lighting. Also, the change in appearance of the glass shouldn't be as noticeable because the glass you are using is very thin. Regardless, have a try and see if it works, or at least gets you closer.


Best way to go about making a roof for a complicated object Wondering what would be the best method for creating a roof for this building. I don't what the roof to be anything other than a flat square that covers the top of the object.

If you don't want to 3D print it then:

Knife project the perimeter onto a plane
Remove unnecessary faces
Lower the roof to .001 above the model
Ctrl + J  to combine.


Two colors on one material on many objects with one blinking at a time I need a cycles material that has two colors, say red and blue. This material is assigned to many objects. While animating, only one random object can be red at a time, the rest must be blue. How would I go about doing this?

Use the pass index (= Object Index in Object Info Node) to mix the shaders. You can animate it if the blue object should change over time.


Moving a movie strip into next free channel If a script tries to move a movie strip to a channel that is full, does the script abort with an error?

Is there a flag I could use, to increment the strips channel so it moves the strip to the next free channel?

How could I do this?

You can aways use the "G" shortcut to grab along the Y axis in most editors, including VSE.

Just press G and then Y.


Clip depth field of view in nodes I am a beginner in Blender. This is what I do to save the depth:

I can get the real Z in meter from the camera to the object. But how to simulate the field of view of the depth sensor?

Concretely, this is what I would like to do but using some mathematical nodes:

if (depth(i,j) < z_max) {
  if (depth(i,j) > z_min) {
    depth_clean(i,j) = depth(i,j);
  } else {
    depth_clean(i,j) = 0;
  }
} else {
  depth_clean(i,j) = 0;
}

This is how to do it using the Python API, see this answer for a reference:

add a viewer node and connect the Z ouput of the Render Layers to the Viewer node
get the pixel data of the viewer
perform the depth "clipping" in Python
copy back to a bpy.ops.image
save the image in OpenEXR format

Script:

import bpy
import numpy as np

# https://blender.stackexchange.com/questions/35191/how-to-get-color-and-z-depth-from-viewer-node/71264#71264
bpy.context.scene.render.use_compositing = True
bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree
links = tree.links

for n in tree.nodes:
    tree.nodes.remove(n)
rl = tree.nodes.new('CompositorNodeRLayers')

vl = tree.nodes.new('CompositorNodeViewer')
vl.use_alpha = True
links.new(rl.outputs[0], vl.inputs[0])  # link Render Image to Viewer Image
links.new(rl.outputs[2], vl.inputs[1])  # link Render Z to Viewer Alpha

#render
bpy.context.scene.render.resolution_percentage = 100 #make sure scene height and width are ok (edit)

step_count = 251
scene = bpy.context.scene
for step in range(1, step_count):
    # Set render frame
    scene.frame_set(step)

    # Render
    bpy.ops.render.render()

    #get the pixels and put them into a numpy array
    pixels = np.array(bpy.data.images['Viewer Node'].pixels)

    width = bpy.context.scene.render.resolution_x
    height = bpy.context.scene.render.resolution_y

    #reshaping into image array 4 channel (rgbz)
    image = pixels.reshape(height,width,4)

    #get only depth
    z = image[:,:,3]

    #simulate depth sensor fov / depth range
    def clip_depth(z, z_near, z_far, default_value=0):
        if z > z_far:
            return default_value
        elif z < z_near:
            return default_value
        else:
            return z

    clip_func = np.vectorize(clip_depth, otypes=[np.float])
    z_near = 1
    z_far = 8
    z_clip = clip_func(z, z_near, z_far)

    #save depth to OpenEXR format
    image_settings = bpy.context.scene.render.image_settings
    image_settings.file_format = "OPEN_EXR"
    image_settings.color_depth = '32'

    #create an HDR image with name 'img_z'
    image_name = 'img_z'
    bpy.ops.image.new(name=image_name, width=z_clip.shape[1], height=z_clip.shape[0], alpha=True, float=True)
    img_z_clip = bpy.data.images[image_name]

    z_clip_rgba = np.dstack((z_clip, z_clip, z_clip, z_clip))
    img_z_clip.pixels = z_clip_rgba.ravel()
    img_z_clip.save_render('/tmp/blender_z_depth_clip_%04d.exr' % step)


How do I get the path my script is running in? I am writing a Quake 1 .BSP import script with python and I want to extract the textures from the .BSP so that the mesh can be textured. However, the textures are paletized (instead of a color, only an index into a palette is stored for each pixel) and the palette is not contained in the .BSP.

I'd like to include the palette in a file with my script, and load it from the script at run time. However, I don't know how to get the path to the palette file, so I can't load it. Is there a way to get the path my script is running in? I've tried using just the file name of the palette, but it didn't work.

p.s. I know I could store the palette in a python file, but I'd rather use the original .PAL format so that users can swap it for another palette if desired.

Python has a built-in __file__ global to access the path a script is running at. You can use it in your script by using this code snippet:

import os
script_directory = os.path.dirname(os.path.abspath(__file__))


Structure left after deletion I'm trying to create a very basic arrow, and I've cut it from a cube, only to find that this persists after deleting the cube. I am not entirely sure what to call it, hence searching for help has been pretty hard, but if anyone could answer, it would be much appreciated.

The dashed cube is drawn because you've enabled the texture space option. This can happen accidentally by a shortcut.


Animating a plane into a conical shape How can I animate a plane into a conical shape.
Here's an example of what I'm trying to get from a plane

I tried using the simple deform modifier using bend which gives me a cylinder

But when I try and bend it using the simple deform modifier for a conical shape it doesn't work how can I fix this?
The top portion doesn't close all the way.

If you start with a square plane, you can use a Simple Deform/Bend then a second Simple Deform, for the second one use the Taper mode with an empty as Origin:


Blender compositing, blur node problem I am using mask for motion tracking scene, and I want use blur for mask in compositing. what is problem: blender node is bluring mask and make it larger, that causes problem for me, is it possible to make blur inside region of mask? ( blured mask, but in mask area, not outside) Last image has red area, that shows how blur node make mask larger
Thanks

Just use a Dilate/Erode node set to 'Feather' instead of a Blur. Setting a negative Distance will erode the edges based on the set Falloff - so it will always be within the region of the mask. For more control of the falloff, set the Falloff of the Dilate/Erode to Linear and add a Color Ramp node or similar so you can control the falloff profile manually.

Note the Split Viewer showing the comparison in the Image Viewer window between original (right-hand side) and 'feathered' (left-hand side).


Increase Object Selection Accuracy? I have two cubes in the viewport about 40 pixels away from each other. Clicking in the empty space between the cubes will alternate selecting one of the cubes instead of de-selecting it like I'd expect from that far away.

This "slop" seems to extend the selectable "hit box" of an object about 20 or so pixels beyond it's visible bounds. Is there any way to increase the precision so that the "hit box" doesn't extend so far past the object? It's resulting in a lot of accidental selection/tweak-drags and is really annoying.

In the source code for VIEW3D_OT_select I can see this property:

prop = RNA_def_int_vector(ot->srna, "location", 2, NULL, INT_MIN, INT_MAX, "Location", "Mouse location", INT_MIN, INT_MAX);

Is the 2 after "location" a multiplier of some kind responsible for this effect I'm seeing? If so is there any way to change it without having to recompile Blender?

Or is there a simpler way in the user prefs where I can adjust mouse selection sensitivity?

Thanks for any help.

EDIT:

Experimenting with Border Select I found that invoking a single pixel border selection like this:

bpy.ops.view3d.select_border(gesture_mode=3, xmin=x, xmax=x, ymin=y, ymax=y)

has the same sloppy selection behavior as VIEW3D_OT_select, which is also using a single pixel coordinate for it's 'location' property.

But invoking a 2x2 Border Select like this:

bpy.ops.view3d.select_border(gesture_mode=3, xmin=x, xmax=x+1, ymin=y, ymax=y+1)

gives a very precise selection.

Unfortunately because it's Border Select doing this when two objects are very close or overlapping it can sometimes select multiple objects with a single click.

But I think it shows that when you give Blender a single pixel selection search it's doing something funky under the hood to multiply or widen it's hit detection, which is really too bad. I can't imagine why that would ever be desirable behavior?

It's been a while but I forgot to answer this after I figured it out.

Unfortunately there is a whopping 28 pixel hitbox hard coded in to Blender's selection tools.

I cover my findings here in this post:
Object Selection Accuracy

But long story short, for some reason this massive hit-detection area is hard-coded giving the user no control over it. Maybe one day in the future... :\


Cycles: access actual length of hair strand? For materials pertaining to hair strands, Cycles gives us a Hair Info node with a scalar output called Intercept,
whose value will be 0 at the root and 1 at the tip, irrespective of how long the hair strand actually is (in Blender units, e.g. meters).

Knowing where we are along a hair strand, we can achieve visual effects such as banding along each hair.
But (by the use of vertex groups for density, kink, and length) I also wish to bring about
a smooth transition from hairless to full-crop —e.g. along the nape of a character’s neck—
and this will result in a range of hair lengths that can span an order of magnitude.

If we lack information on the actual length of a hair strand, any banding algorithm
that relies on Intercept and works well for full-length strands
will necessarily give a compressed and visually dissatisfying result on the shortest hairs:

To compensate, algorithmically, we need the ability
to read the actual length of the strand being rendered. Actual length information is, of course, available somewhere inside Blender
before the Cycles rendering is invoked.
Is there any way for a materials developer to read that information, in Blender 2.79 or 2.80?

Or, at the very least, is there a way to read the vertex weight of a vertex group
(such as: the one that is modifying hair length)?

Alright, here is a provisional solution, as evidenced by this image:

(compare with my original, above).

A satisfactory solution would make use of each hair strand’s actual length at render time.
This length depends on many factors, including:

The hair particle’s initial velocity (normal and tangent).
The influence of gravity, if any.
Serious kink, notably Spiral.
Added randomness.
Surprisingly, the damping factor.
The vertex group for length control, if any.

So, the product of intercept times length control is proportional,
only approximately, to the hair strand’s actual length,
but this is what I use for the image above, and it is the reason why I call this a provisional solution.

Unfortunately, vertex weights are not yet (September 2018) available to the Cycles material developer;
not through the Attribute node, not through OSL, and not even through some clever driver expression:
so says Grand Guru Brecht Van Lommel, here.
Thus, my provisional —and clumsy— solution, suggested by Brecht himself,
is to copy the length control information over to a Vertex Color layer, which is,
oddly enough, accessible via the Cycles Attribute node.

Here is a quick Python hack to achieve said copy:

#Given: active object with active vertex group and active vertex color layer
#
#Does: Copies vertex weights into red channel of vertex color layer, leaves rest untouched.
#
#© Tom Telos 2018, submitted freely to interested users, for experimental purposes only.
#
import bpy

bpy.ops.object.mode_set(mode = 'OBJECT')
ObA = bpy.context.active_object
if ObA == None : raise RuntimeError("No active object")
else : print( "Active object" , ObA.name , "found." )

VgA = ObA.vertex_groups.active
if VgA == None : raise RuntimeError("No active vertex group")
else : print( ObA.name , "act vx gp " , VgA.name , " found." )

VcA = ObA.data.vertex_colors.active
if VcA == None : raise RuntimeError("No active vertex color layer")
else : print( ObA.name , "act vx colors " , VcA.name , " found." )

for loop in ObA.data.loops : #Crazy, but this works.
    iV = loop.vertex_index
    iL = loop.index
    try :  #fails if vertex not in vg
        VcA.data[iL].color[0] = VgA.weight(iV) #weight() not [] !
    except: continue

It is in lieu of Varkenvarken’s much more sophisticated addon
which, unfortunately, does not work for me with recent builds of Blender 2.79,
ostensibly because of a Python version mismatch, but, more likely because,
in recent Blender 2.79 builds, the number of vertex color “channels”
has been increased from 3 to 4.

My hack is simply paste-and-run,
and assumes that there is an active object with an active vertex group and an active vertex color layer.
For each vertex in the active vertex group, it copies its weight to the red channel of the color layer.
That’s all. It does not modify the vertex color of any vertex not present in the vertex group.

P.S. Brecht Van Lommel, here, confirms that, as of September 2018, there is no user-level access to actual hair length.


I want to texture paint but it says "Missing texture, detected!" After clicking to try and paint, I see the missing texture error warning.

Blender Guru's video helps explain it. https://youtu.be/nht2RoYBUfA?t=212
I know 10 images may seem excessive, but I know a lot of new people may get lost and would need it.

First, create a new image or open an old one. (I will create a new one)

Create the image. (mine's name will be "Untitled")

You would get a black image.

But you still can't paint. That's because the image isn't connected to the texture of the model.

Go to "Shading" from the top bar.

Add a new image texture. (Add>Texture>Image Texture)

Connect the nodes. (Color-Base Color)

Press the Image button and choose the image you created or opened before. ("Untitled" in my case)

Selected.

Now you can paint!


Does FLIP fluid support more then one domain in one scene? I would like to be able to repeat the animation many times in one scene. Fluid and gas solutions How to bake multiple fluid simulations in one scene? don't seem to work here

The FLIP Fluids addon does not support more than one domain in a .blend file at the moment. A workaround to have multiple simulation animations in a scene is to export the simulation to the Alembic format through File > Export > Alembic (.abc). Once exported, you can import the animated Alembic files back into your scene.

More information can be found in this documentation topic: https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Alembic-Export-Support


BGE: Expression to check if Collision Sensor's property is True or False In this simple demonstration of the problem there is a blue cube. When it falls and collides with an object having the property "obstacle" (while the player is also performing some action) the cube should turn red. What kind of expression syntax can accomplish this?

If an And Controller is used instead, the cube turns red. The problem is that it will do this whether the property of the object it collides with is True or False. I want it only to happen if 'obstacle'==True. How can this be accomplished? Thanks.

No Expression Required

I don't know if there's no way for a Collision Sensor to pass along the value of the property it's watching. Instead, we can have the object collided with send a Message, and receiving that Message can be one of the conditions required by an And Controller in order to trigger the Actuator.

Obstacle Logic

Cube Logic

As for expressions, here is a reference. I'll re-post it below:

Table 26-1. Valid expressions

Expression type  Example
===============  =======
Integer number   15
Float number     12.23224
Booleans         TRUE, FALSE
Strings          "I am a string!"
Properties       propname
Sensornames      sensorname (as named in the LogicBrick)

Table 26-2. Arithmetic expressions

Expression       Example
==========       =======
EXPR1 + EXPR2    Addition, 12+3, propname+21
EXPR1 - EXPR2    Subtraction, 12-3, propname-21
EXPR1 * EXPR2    Multiplication, 12*3, propname*21
EXPR1 / EXPR2    Division, 12/3, propname/21
EXPR1 > EXPR2    EXPR1 greater EXPR2
EXPR1 >= EXPR2   EXPR1 greater or equal EXPR2
EXPR1 < EXPR2    EXPR1 less EXPR2

Table 26-3. Boolean operations

Operation        Example
=========        =======
NOT EXPR         Not EXPR
EXPR1 OR EXPR2   logical OR
EXPR1 AND EXPR2  logical AND
EXPR1 == EXPR2   EXPR1 equals EXPR2

Conditional statement: IF( Test, ValueTrue, ValueFalse )

Examples:

Table 26-4. Expression examples

Expression           Result          Explanation
==========           ======          ===========
12+12                24              Addition
property=="Carsten"  TRUE or FALSE   String comparison between a Property and a string
"Erwin">"Carsten"    TRUE            A string comparison is done

And if anyone figures out syntax for testing the value of a property, please share.


Issue with Collision Detection I am not sure if I am doing something wrong or there is an issue with the Collision sensor.

I have a sensor embedded on the floor, with 2 objects that are moving over it. If the two objects pass over the sensor at different times, then I can register them correctly, i.e. I can detect which hit the sensor and at what time.

However, if they step on the sensor concurrently, then I can only detect one and the other is never detected.

Here is the setup:

Objects 1 and 2 are identical with the following properties: Rigid Body, Actor and Ghost (I tried to also with this disabled, but did not change the behavior)
The python code at the sensor:

own = cont.owner
collision_detector = own.sensors["MyReader"]
objects = collision_detector.hitObjectList
if collision_detector.positive:
    print(own,' detected: \t',objects)

So when I have the two objects move over mydetector.000 one after the other, then I get:

    mydetector.000 detected       [Obj1]
    mydetector.000 detected       [Obj2]

However, if one (sayObj1) is already onmydetector.000` and the other passes by then I get the following output:

    mydetector.000 detected       [Obj1]

and Obj2 is never detected. I would have expected the object objects to become a list, when both Obj1 and Obj2 are on top of mydetector.000, however this is not the case.

According to your own comment, the objects are not colliding at the same time (same frame).

Sensor triggering

All Sensor types will trigger the controller when:

The evaluation state changes from not positive to positive.
The evaluation state changes from positive to not positive.
[True Level Triggering] The evaluation state is positive after [Skip] frames.
[False Level Triggering] The evaluation state is not positive after [Skip] frames.
[Level] The state of the build-in state machine changes.

([Tab] and [Invert] manipulate the evaluation result. The trigger rules apply as above after that manipulation)

Applied to your observation:

f+0:

no object is detected
-> sensor remains not positive no controller gets triggered

f+1:

the first object gets detected
-> the sensor changes status from not positive to positive

according to the above rules -> the controller gets triggered
The controller prints  mydetector.000 detected       [Obj1] to the console

f+2:

the first object still gets detected
-> the sensor does not change state as it is already positive
no rule applies -> no controller gets triggered

f+1+n:

The first and the second object get detected
-> the sensor does not change state as it is already positive
no rule applies -> no controller gets triggered

Sensors detecting multiple objects

With sensors that sense more than one object (collision, near, radar) you often want to know when the detected object set changes. Therefore they have an additional parameter [Pulse].

So you can consider following rule that applies on that kind of sensors:

[Pulse] the detected set of objects changes (e.g. other objects are detected/already detected objects are not detected anymore)

f+1+n:

The first and the second object get detected
-> the set of detected objects changes (=new object detected)
according to the sensor rule -> the controller gets triggered

The controller prints  mydetector.000 detected       [Obj1, Obj2] to the console

Solution

Switch on [Pulse]

(switch off [True Level Triggering])


What would be the best way to hollow out the space for nostrils while modelling a head? I finally got the skull where it should be more or less. Is it possible to add in some nostrils? What would be the best way to hollow out the space? Thanks.

There are many ways to do this. One way would be to just inset some faces and then extrude them towards inside.

You will probably want to edit the topology of your model using another modelling tools later to add more detail to the forms. That's why I would recommend watching some video tutorials about modelling.


Which is the better Topology? Left or Right? - [With Image Reference] Which is the better topology for swimsuit?
Left or right.

I am thinking right because legs might move around.
But when i combine the meshes and sub-D them the left one looks better.
What do you guys think?

i started with planes to draw the line of how the V of the shape is made.
And from there i would build inwards. i also already make the center.
But you always get in trouble at some point. xP

Also is it best practice to keep every square same size?
cause sometimes i see people having way longer squares like i have at the edge.

  (Was already answered with it being a choice not a fact)
  "Entirely depends on what you're doing. It can make certain things easier, like UV mapping (especially if you have to unwrap manually), and animated meshes will deform better (more predictably) if all the polys are the same size, but the renderer shouldn't care."

Its bottom part of swimsuit btw.

Ty so much everyone for all the tips.
I am trying my best to make this edit the best ^^

<3

It entirely depends on what you're making. Edge-flow is a well-studied science all its own, so there are some good articles out there about how to make those decisions, like this one.

That being said, you ask if it's good practice to keep all the polys the same size. That also entirely depends on what you're doing. It can make certain things easier, like UV mapping (especially if you have to unwrap manually), and animated meshes will deform better (more predictably) if all the polys are the same size, but the renderer shouldn't care.

The most important thing you need to do here is merge the center line into one line. Other than that, we need more info about what problems you're facing and what you're trying to accomplish.


how to create a texture with random circles on an irregular shape I tried to do it exploiting the Voronoi texture, but the result shows elongated circles on the surface of the body. How can I change the node tree?

I think the answer might be simpler than you think. I think part of your problem is that you switched the nodes to 2D - this is generally for things without depth or that have a texture that is mapped to a UV map. Have a try with this setup (note that I set the randomness of the Voronai to 0 - this is to make the most "perfect" circles possible, but it also takes a bit of randomness away from the distribution - balance as needed):

Increase the scale of the Voronai for more dots:

If you're looking for more diversity of shape (randomness to the edges), you can warp your input vector using a Vector Math node and some other texture (I used a Noise Texture). As you can see, I used a MixRgb node to mix the values from the noise texture with almost pure white, otherwise the "Warp" effect is far too strong, and leaves undesired results.


Want to undo a step but it is not in undo history I applied subsurf modifier, saved the file and then quit the blender but when I reopned it I realized that I need to go back but it doesn't undo it and my undo history is empty. Can anyone help me?

There are several options.

Check in the folder where you have your .blend if there are several files with the same name, but with the extensions .blend1, .blend2 and so on. When you save a .blend, the previous version of the file gets renamed to .blend1, and if there already exists a .blend1, it gets renamed to .blend2. This is a setting in Blender, but if I remember correctly, it's enabled by default. CtrlAltU to open up user preferences, then click File and check the rightmost column to find out whether you have it enabled.

There may also be previous versions of the file lingering in your temporary folder. These could have either the same name as your original file, or they could be named by the process ID of the Blender instance that last had it opened. The temporary folder is usually /tmp on Linux and other Unix like systems. On Windows I'm not 100% certain, but C:\Temp or C:\Windows\Temp may be good places to start searching. On MacOS I have no idea.

You may also try the Decimate modifier, set to Un-Subdivide. On a complex mesh, it probably will not exactly reverse the subsurf, but it might be worth a try.


Adding a color effect strip to the video sequencer using Python without the operator? I'm trying to run this code headless to avoid the context error however I can't find any information about adding a color strip without using bpy.ops. How can I convert the following code to not use the operator please?
bpy.ops.sequencer.effect_strip_add(
    type='COLOR',
    frame_start=1,
    frame_end=int(file) * filesCount,
    channel=1,
    color=(
        backgroundColor['r'] / 255,
        backgroundColor['g'] / 255,
        backgroundColor['b'] / 255
    )
)

I think it has something to do with new_effect however I can't see an option to add rgb values.

@batFINGER to the rescue! The answer to my question can be found here: https://blender.stackexchange.com/a/142392/111345 for anyone else that needs it.


How do I show the preview image in the background when compositing? I am compositing in Blender and although I have my backdrop on, I am unable to see a preview of what I am compositing. How do I preview my composite in Blender?

Add a Viewer output from Add Menu(Shift+A) -> Output and connect something to it.

Use V and Alt + V to zoom out and in and Alt + MMB to drag the image around.


How to automatically make Blender choose random colors for your render I want to make this render but don't know which color to use for the logo. How to make Blender render with random colors for me to then check and use the best one.

While there's no way to have blender check and choose the best color for you, as that is quite subjective, it is possible to set the color to change every frame and to render an animation of those multiple different colored frames.
To do so, first head over to your material tab, and select the shader currently applied to your text object. Now press Shift+A and create a color ramp node, and a value node. Then plug the Value into the Fac of the color ramp. Then plug the color into your principled BSDF or wherever you need it to be. Then go to the first frame of your timeline, put your mouse over the value nodes number, and press I to keyframe it. Go to a different frame in your timeline set the value of the node to 1 and then press I on it again. Now when you play your animation the value node will change from 0 to 1 and control the color ramps output color.
Now just input the colors you want into your color ramp, go to the render tab, turn down the output resolution, and turn on render regions and make them scaled down to just cover the relevant parts of the scene. Render an image sequence to a folder, and then you can go through and see a ton of different color options to use.


Quads snapping up or down when displacement is animated I am trying to make a 80's style grid mountain valley animation with the scene slightly animated by a noise texture displacement.

However when some deformed faces cross a certain point they "snap" either up or down creating a very distracting and bad looking effect.

I have made the initial mountains by applying a noise texture to a plain and modifying it to create a valley path for the camera which resulted in some faces being distorted or "bent" by having two opposing vertices below the other ones, this creates a jumping or snapping effect when the displacement makes the geometry cross the threshold of the "bend" being in the opposite direction.

Is there any way i can fix this? Like, disabling the snapping, or making it always face one direction without manually readjusting 150k+ faces?

I have converted my mesh into triangles and used this to wireframe it instead:
https://www.youtube.com/watch?v=67Q2Z4vVrMI&t=588s
It seems to have resolved the issue.


Meshes appear traslucent/white when they are not I was using blender when I accidentally switched to cycles instead of eevee, and the program crashed.
After restarting blender and seeing that the engine already switched back to eevee, I noticed that the mesh that I imported from an .svg, which has been extruded, appears as white/translucent, light passes through.
I tried messing with the materials but nothing worked, everything seems normal and not out of the ordinary.
I don't know what to do, i want to go back to how it was before the crash (object appeared black and blocked the light from behind), I'm a beginner btw
Oh and all of this problems are present in the viewport only, when I render, it seems to be correct, but I can't work on stuff that I can't see until when it's done.
Help please, it's urgent
Thank you

It might be worth looking here to see if you can recover the previous state of your scene.


Cannot rotate a camera on a motion path that is targeted to an empty. I am fairly new to Blender and have run into a problem I cannot seem to overcome.

I have a camera on a horizontal, semi-circular motion path and it moves nicely around an object. The camera is targeted to an empty inside the object so as the camera moves around the object it continues to point at the empty (and hence the object).

What I wish to do is to rotate the camera slightly to tilt the view as the camera continues to move along the path. The tilt would be on the axis that does not disrupt the camera pointing to the empty.

The problem is that I cannot rotate the camera. All xyz rotation setting changes have no affect on the camera. Rotating the targeted empty is possible, but does not affect the orientation of the camera.

I suspect targeting to the empty has locked the orientation of the camera and I am not sure how to override this - if even possible?

Based on the description of @batFINGER, I was able to perform the steps to allow for camera rotation during the animation.

Setup:

empty for tracking (target)
empty for camera (dolly)
camera
BezierCircle (path)

Constrains:

for the camera empty:

follow path "BezierCircle" (don't forget to click "animate path")
Track to "empty for tracking" (make sure to set -Z and Y)

for the camera itself

constraint: child of "empty for camera"

This should now have the camera tracking the "empty for tracking"

go to camera view and select your camera: it is still possible to rotate the camera


How can I combine two materials in Cycles? I was wondering if it is possible, using Cycles, to combine two materials.

For example, I have wood cubes which have a procedural wood material from Blendswap, but each of them needs a texture on it (a letter).

Actually, I duplicate my "wood" material and plug my texture on it.
So I have 3 materials (wood-A, wood-B, wood-C) while the "wood" part of the material is always the same, only the texture is changing.

Is there any way to make this easier to handle ?
Like combining a "wood" material (identical for the three cubes) with a different texture for each of them ?

That part you've labeled "wood" - group those nodes.
Then you can drop the group into each material: 1, 2, 3.
A group is a shared datablock, so changing its contents inside of one material changes it for all instances.


Break end of cloth mesh into particles in an infinite looping animation I'm trying to experiment with both Cloth physics and particles, and I need a little help.

I have a character with a long coat, and I'm trying to get the bottom edge of his coat to kind of... break(?) into little bits, like embers or smoke or something; but at the same time, I don't want to break his entire coat.

Cloth physics work OK on the coat itself - it behaves.

Is this possible? Just to 'break' a little bit of his coat while still allowing it to move like clothing?

Tell me if I'm being too vague, and sorry in advance if I am.

You can put a particle system after the cloth one and then use Explode modifier to break the mesh.

If you input a vertex weight map to protect some faces it will randomly break the unprotected ones and create effect like this:


Replacing Points with objects Completely new to this. I have a series of points in a 3D graph and I am trying to either replace all the points with points with Spheres or make the points visible during graphing (whichever is possible/easier). How would I go about making this happen?

Thank you in advance for your help.

If the vertices are all one object, you could also use Dupliverts:

If the vertices are separate objects, join them with ⎈ CtrlJ
Parent the object to the vertices object.
Select the object you want to replace the vertices with and then the vertices object, then press ⎈ CtrlP> Object.

Enable Dupliverts in Properties > Object > Duplication on the vertices object:

If you want the duplicates to be on top of the vertices, make sure the object origins of both objects are in the same place. Use ⇧ ShiftS to snap the 3D cursor to an object and ⎈ Ctrl⎇ Alt⇧ ShiftC to snap the origin to the cursor.

Using dupliverts has the advantage that the object is instanced to each vertex, with in very efficient memory usage.

I just tested this by instancing a UV sphere to a > 20,000 vertex object with no trouble.


I have 4x4 Planes subidivided , i would like to sculpt them all at the same time so the remain connected at the edges I know i can select multiple thing to sculpt but that still leaves me with disconnected edges. : - )

BUMP

OK. Bringing the comments to an answer.

Create the plane, enter Edit Mode and subdivide it once.

Select that new edges and use Mark Seam.

Select all and subdivide it at your taste.

After sculpting the terrain, enter Edit Mode again. Change selection mode to Face.

Hit L over some part so select what you want to separate and separate it.

Image with the process here:


I can I shape a 3D object in a 2D, and the put the unwrap in a new 3D conformation without any deformations? Hello Blender Community!

I would like to know with this exemple, how to bend a 3D object : the skin of a nose in this exemple (so a 3D form into a 2D form without any lost of informations), exactly like a surgeon would put out the skin of the nose and put it in a 2D shape on a table after removing it from a patient. I try to unwrap the skin of the nose.
! (/Users/pc-doc/Desktop/Capture d’écran 2016-06-12 à 01.09.02.png)

Then I would like to put this unwrap nose, without deformations, on the forehead so in it's 2D form but now with the shape of the forehead. Like that, the surgeon will have a mold to draw a new nose on the forehead.

The answer is by no means without flaw.

Start by enabling Import-Export UV Layout && Import-Export: Scalable Vector Graphics in add-ons

In UV editor select desired map + open UVs menu --> Export UV Layout

Make sure to export as .svg

Last File --> Import --> svg

Every polygon is going to be its own curve so Alt + C --> convert to mesh from curve and join them after.

It's not perfect


Can I make a pen draw a solid line? I have tried to make an animated pen draw a solid, curving line - with limited results! I tried dynamic paint, but couldn't get a decent line, just a big fuzzy mess! The best I could do was with a particle system, but that is made of dots and, the faster the pen moves the further apart the dots appear - not quite like the kind of line a pen makes. I don't want a pre-determined (animated) line, I just want it to draw wherever I make the pen go. Is this easy, or a bit of a tall order?

Dynamic Paint

Particle System

There is more than likely a better way to go about this… but for the time being, it seems this can occur for several reasons, such as how dense your canvas is and the size of the part of the 'brush' touching the canvas etc.

Using the default canvas and brush settings for the most part, you can get around this easily enough by cranking up the number of subdivisions in your canvas mesh and optionally by increasing your Sub-Steps.


Snapping to vertex while scaling I want to snap the outer circle to the inner.

For that i turned on snapping to vertex, selected the scale affect, selected the outer circle and try to scale it down until dimensions of inner circle. But when cursor snaps to one of inner circle's vertices, the outer circles's dimensions jump to infinity, i guess. Like on the image:

Why is this happening?

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


Mesh is not moving with bone even with correct weights The bones are moving outside the mesh during deformation. I have manually painted each bone in the leg, yet the mesh still does not conform to the bones. Also, I did paint the underside of the foot.

I would use automatic weights, and verify that the mesh is moving with the bones and then manipulate the automatic weights with your weight painting. I'm a novice though.


How to unwrap a saw blade? I have a problem, I just started with Blender. Couldn't find an answer for it on the internet. I'm trying to UV unwrap a saw blade I modelled yesterday, so I could apply a texture to it.

First, I selected all the outer edges on side a, and side b, and then I marked them as seam, but after unwrapping sides of the blade got cut in half. Also, it had some strange connections, so I had to convert the saw blade to tris.

Unfortunately, I can't find a workaround to my problem. Could you please help me out?

This is close to what I need, but it has to be both sides + edges:

When you unwrap, you should be selecting only the edges that you want to be separate in the UV editor as seams (it looks like you selected a whole bunch of unrelated ones).

If I was unwrapping this saw blade, I would select all the perimeter edges around the sharp blade part of the saw on both the front and back and that's it.


Image Texture not showing up The object is UV unwrapped, I set the material's base color as Image Texture, you can see the nodes. It does not appear on the model either in Viewport Shading and Rendered. I cannot figure out a way to make it appear. Here is the node setup and material settings.

The object has no UV map: Blender does not know how to map the texture.
You can either add a "texture coordinates" and change the "image texture" to "box" and tune the "blend" value:

Or create a UV map.


What happens when you plug a BSDF into a value socket? What happens when you plug a BSDF (shader) socket into a value (float/color/vector) socket, or vice-versa?  Obviously there is no way to convert a function to a value, so what does blender do?

From some simple testing it seems that it converts the BSDF to 0.5, but sparked by the discussion in comments on this answer I would like a more definitive answer.

It doesn't do anything.

Cycles will use the value specified for that socket and ignore the invalid connection:

This example uses a color input, but the same applies for value inputs.

As you can see, the render result is the same with or without the diffuse node in the above setup.

For some explanation on why cycles works like this, see Convert cycles closure (shader) output to colors?
For a workaround, see Is it possible to use the output of a Renderlayer in the material nodes of another RenderLayer?


Action Animate Visibility in BGE Is it possible to animate a given object's visibility inside an Action in Blender Game Engine?

I've been trying to make it by animating the "Invisible" button in the physics tab (it enables the Restrict Render property in the Dopesheet). Every other animation plays as it should within it's Action, but the visibility won't.

The "Restrict Render" setting only applies to the Cycles or BI renderer, but not the OpenGL renderer (used in the viewport, and for the Game Engine).

If you want to achieve something similar, animate the "Visible" attribute instead.

Note that this is a binary state. There's no way to fade, or gradually shift from visible to invisible. It will be totally visible one frame, and totally invisible the next frame.

If you're wanting to fade, you'll need to animate the Alpha channel instead (though there is some benefit to turning "Visibility" off, once something is totally transparent).


Is it possible to test for a previously created folder on the hard drive I'd like to create a folder on the hard-drive for the first time the selected model is exported.

After this, the script will fail, because the folder being created by os.mkdir already exists:

directoryPath = "//_MODEL_FOLDERS_/"
path = bpy.path.abspath(directoryPath)

# fails if dir exists
os.mkdir(path + obj.name)

It should be tested.

So does anyone know of a way to test if a folder already exists before trying to create it?

I would suggest to use os.path.join() instead of +.

To test you can use os.path.exists(os.path.join(path, obj.name))


Subsurf, triangulate and UV texture problem I am using triangulate and next subsurf modifier on my tent project. I have huge problem with UV mapping.

Without triangulate it is porblem too, there are any freak "faces" under model, I don't know why:

Do You have any idea how to solve this problem?

I tried make subdivisions in edit mode, also making offset near edges. There is less errors but it still looks horrible but UV map is a lot of worse (I need UV for walls with "sample text" to be this "cuted triangle" like it is now).

Thanks,
A.

Blend file: https://www.dropbox.com/s/sb70islclejgmys/Tent_0.22.blend?dl=0

The mesh is the simplest as it can. It is surprise for me that sometimes it is no problem to texture complex mesh but with this simple mesh it is a problem. Maybe I am using wrong technique?

Blender doesn't subsurf n-gons or triangles that well. Try retopologizing the mesh, and then applyong the subsurf and triangulate modifiers and UV them after that (you can duplicate the mesh before you apply the modifiers so you have a backup)


What does this triangle icon mean and how can I add another one? Can I add another one? Because the plus sign just opens up the list.

That triangle indicates that your object is a Mesh Object.

Each time you add a new mesh object in Object Mode, it will be listed in the outliner:

Objects that are not meshes will appear with different icons:

If an object is parented to another, then the parent-children hierarchy will be reflected on the outliner:

If you switch to Edit Mode and add a new mesh, that mesh will be part of the active object, and it will not be added as a new object in the outliner:

To read more about the outliner visit: https://docs.blender.org/manual/en/dev/editors/outliner.html?highlight=outliner


How to have Denoiser ignore certain objects? I have a scene with some objects that have image textures. Denoising the entire scene makes the image textures on certain objects to look less sharp.

How do I get Blender to denoise an entire scene excluding certain objects?

I know there's probably a way with Render Layers and the Compositor but I don't know for sure.

The Denoiser in Blender version 2.79 can be activated per Render Layer, and as such you can mix denoised and noisy footage as you like. If you ever wondered why the Blender Devs have put that Denoiser into the Render Layers context of the Properties Panel, that's why.

All you need to do is separate your scene into Render Layers with the objects in question on them, and using the little checkbox on the Denoiser activate Denoising only for one of them. The same trick can be used if your objects demand different denoise strength settings, of course, and also to render the layers at different sample counts if you wish.

Here's a demo .blend that shows the approach in action:

The first render layer contains all geometry on Layer 1, and has Denoising activated:

The second Render Layer contains only objects on Layer 2 (monkeyhead), Denoiser is turned off for this one:

When you render this using F12, you should get two Render Layers, which then are combined using the correlated Alpha method described in this question here: Where do the white lines come from in my composite?

That trick is really only needed if both render layers mask out each other, which in this case is useful for performance reasons. The result looks like this (floor and cube denoised, monkey noise as usual):


How to make glass reflect illuminated objects but glass itself doesn't reflect light source? I want to make heat distortion effect in Cycles, but it reflects light source. If move effect on another Render layer & exclude light, then it reflects objects behind without light. How to make that this material not reflect light source, but to reflect objects behind with light on them?

Try going into ray visibility and fiddling with the settings


How to make the game engine render stereo on 2 monitors? I am trying to use the game engine to display side-by-side stereo on two monitors. Does anyone know how to do this?

I have been successful using the standalone player to display side-by-side stereo on a single monitor, but I need each image to go to the corresponding monitor.

Also, when I disable 'fullscreen', I have been able to make a large window (2x 1600) display across both monitors. The problem is that the player starts on the right-most monitor, forcing me to drag the window onto the left-most monitor. The window border is not desirable either.

You need to setup your desktop to "span" across both screens.

This way both screen areas will be treated as a single desktop. How to accomplish that depends on your OS and graphic card. A good way to test if it's working is to take any application (not-Blender) and see if maximizing it takes over both screens or only one of them.


Can a image be render on planes through scripting? Setup: Blender 2.82

I have multiple images that i take from a CNN and i want to put on planes

I tried like this:

mat = bpy.data.materials.new(name='test')
mat.use_nodes = True
bsdf = mat.node_tree.nodes["Principled BSDF"]
texImage = mat.node_tree.nodes.new('ShaderNodeTexImage')
texImage.image = bpy.data.images.load(image)
mat.node_tree.links.new(bsdf.inputs['Base Color'], texImage.outputs['Color'])

bpy.ops.mesh.primitive_plane_add(location=(k, y,  l ))
bpy.context.active_object.name = 'plane'
plane = bpy.context.object

if plane.data.materials:
     plane.data.materials[0] = mat
else:
     plane.data.materials.append(mat)

How can the image be loaded from an numpy array of pixels ?

Additionally to this, does the image added to the plane needs to respect some format?

The only solution is to save the image that you want to put it on the plane and to load the image from there

texImage.image = bpy.data.images.load("path to your image saved previously in code")


Solid View better recognizable? is there a way to change the Material for the Solid View?
Like in 3ds Max you can change to Clay Mode for Example.
I wouldn't mind with a normal grey object but somehow in Blender the Objects have such a weird lighting that its difficult to recognize edges in my objects.

I'm not talking about wireframe mode. I dont want to see every edge n my object. But when for example i extrude minimally into the surface then its hard to see without turning the camera until you have an angle on it that lights it with good difference.

Hope you can understand what I mean.

Thanks

When in solid view in viewport, open up the right toolbox by pressing N. Down there, under shading, activate Matcap and Ambient Occlusion. This improves the view remarkably. If there is another way to improve the viewport, especially with large grayscale models, I'd like to hear.