Fade in an image in an animation in blender 2.9 New blender user here, I'm trying to fade-in an image in a 3D Animation in blender 2.9.
I was able to import an image as a plane.
Looked on youtube and there were some tutorial about transparency or visibility, but I wasn't able to replicate any of those because the interface is different. I also can't find any options where I can set or animate the transparency/visibility.
I also tried this: Fade in action applicable to all objects (in cycles) but I kinda failed in the first steps into nodes stuff.
When I pasted the image in Blender with drag and drop I was able to set the visibility, but the image doesnt appear in the final render.
Here is stated why:
Imported image is not showing in render
It's just a reference.
Is there an option I'm missing in the material properties tab or any other tab?
Or do I have to do this with Nodes? If so I am ready to learn more about it.
Or is there another option to fade-in an image in an animation in blender 2.9?
Or I could try to animate it with blender 2.8 instead of 2.9? (Can I open my 2.9 blender file with blender 2.8?)

(NOTE: You need to have the "Import images to planes" addon enabled to do this).
Step 1 (Import the image):

Step 2 (Open the shader editor):

Step 3 (Add a mix shader in between the principled shader and the material output (Change the factor to 0), then add a transparent shader to the bottom shader input):

Step 4 (Go to the frame you want the image to start fading out (For me it's frame 1)):

Step 5 (Add a keyframe to the factor):

Step 6 (Go to the frame you want the image to fully fade out, and change the factor value to 1):

Step 7 (Add a keyframe to the factor of 1):

And you're done!
When you render it, it should look like this:

(Sorry for the image, it was the last thing in my downloads folder).


When I import OBJ file it does not show I have imported this file before an it has worked but not this time. I have pressed Numpad . and that just zooms me into here the picture below. I am not in local view.Last time it worked it had imported absolutely huge bugs scaling it down doesn't seem to work. thanks for your help!

The size of your import is very small.
You can use the S  key to scale the object.


Object Disappears in Camera View Even After Clipping Distance Adjusted I am having a hard time getting an object to show up in my scene.  I already checked the clipping distance and I have messed with the layers to make sure I can view all the layers.  Any ideas?

The clip' you are editing is referring to the world.

This does not influence the final rendering.

What is affecting your scene is the clipping of the camera. This is where you should increase your camera to crawl further.


Python script - apply only to selected Is there a way to tell the script to only apply the changes (moving keyframes in this case) to selected object(s)?

Here is the specific code I'm trying to modify:

for action in bpy.data.actions:
    for fcurve in action.fcurves:
        for point in fcurve.keyframe_points:
            point.co.x **=2

Blender stores a list of the currently selected objects in bpy.context.selected_objects. It's not always as easy as this, to only effect the selected objects, but for your example you would access the current action of the selected object with the animation_data.action property:

import bpy

for object in bpy.context.selected_objects:

    for fcurve in object.animation_data.action.fcurves:

        for point in fcurve.keyframe_points:

            point.co.x **=2


Which color space should I use for 16-bit maps? Many people recommend using 16-bit images for displacement and normal maps.

If I want to create my own displacement maps in, say, Photoshop, which color space should I use? Is 16-bit sRGB okay?

Does Blender assume a particular color space or does it detect it in the image file itself?

If I want to create my own displacement maps in, say, Photoshop, which color space should I use? Is 16-bit sRGB okay?

The term "sRGB" is thrown around far too frequently without an understanding as to what it means.

The best way to think about things like displacement maps and such, is that in many instances they are data, akin to units of measurement. That is, they are not colours.

This means that when you are building data in another application, it should be saved as such. Most image file formats are of course designed to encode colours. The sRGB specification, being designed for images, was likewise designed for colour encoding, not data.

Having data means that in many to most instances, one requires the encoded values to reflect a linear proportion, just as we would expect a ruler to have uniformly distributed markings. If we had a ruler with erratic / nonlinear markings, even if we re-distributed the measurements we took with such a ruler to be evenly distributed, the data would reflect overly sparse or overly dense regions based on the original erratic / nonlinear measurements. As a result, most image formats, being designed for nonlinear colour encoding, exhibit this behavior and are a poor choice as a result.

EXRs on the other hand, were designed from the ground up to encode data, including colour data. By convention, data encoded into an EXR is typically linear ratios, making it a great fit for data.

Being a display referred application designed for manipulating... Well... Photographs, Photoshop tends to be a sub-optimal solution here. Even PS's EXR support has been awful for a long time. Thankfully, FNordware has a useful plugin to use. There are plenty of PS "gotchas" though, so be careful and learn more about colour space encodings and colour management to give you control.

  Does Blender assume a particular color space or does it detect it in the image file itself?

Unlike graphic design applications that have an ICC Colour Management System in place, Blender utilizes OpenColorIO, which is designed to make very few assumptions about encoded data. It leans heavily on encoded data format detection and defaults, as well as filename support, which will hopefully land in Blender proper soon.

It makes assumptions based on the encoding format of the data. If it is 8 bit or 16 bit integer (non-decimal), it will assign a default transform, which is currently only the sRGB transfer function. This may be inappropriate depending on context.

If the file is encoded as 16 bit or 32 bit float (decimal) such as the data in an EXR, the default transform will be set to "Linear", which is also a colour format. When loading data, change the transform to be "Non-Color Data".


How to prevent memory leakage in Blender? I have to load lots of objects/meshes(50k) in Blender and render them for which I have written a Python script. My meshes have lots of vertices/faces (in the range of ~[10k, 70k]). I noticed that memory usage keeps increasing as despite removing them. Memory usage goes down a little after removing the object but it is still increased compared to the time before loading the object. For instance, when I load Blender memory usage is aroun 8MBs but after loading/removing 10 objects memory usage is around 200MBs (more or less). If I do not remove the 10 objects the memory usage is going to be around 300MBs or so. I wonder, does anyone have a solution for how I can properly import and remove objects/meshes so that I can prevent memory leak?

Here's a simplified version of my rendering pipeline:

do while there are still unrendered objects
    load an obj file
    render the mesh
    remove the mesh
end while

So far, I have done the followings to lessen memory foot print:

I use both Cycles and Blender internal renderer for different purposes. However, I do not know what to do in Cycles to reduce memory foot print. In Blender internal, I check the Free Image Textures:

And in User Preferences --> Edit I do the followings:

This is also how I remove the meshes/objects:

 for obj in bpy.context.scene.objects:
     if obj.type == 'MESH':
         obj.select = True
     else:
         obj.select = False
 bpy.ops.object.delete()

where you can check type against any of the following values according to this documentation:

[‘MESH’, ‘CURVE’, ‘SURFACE’, ‘META’, ‘FONT’, ‘ARMATURE’, ‘LATTICE’, ‘EMPTY’, ‘CAMERA’, ‘LAMP’, ‘SPEAKER’]

There is an easy way to get rid of memory leakage issue by resetting everything to factory setting by the following:

bpy.ops.wm.read_factory_settings(use_empty=True)

However, if you want to keep your current settings you can remove the unneeded data blocks manually. For instance, after you remove the meshes/objects in your scene you can execute the following code to remove all the unused blocks that were assigned to those meshes/objects:

for block in bpy.data.meshes:
    if block.users == 0:
        bpy.data.meshes.remove(block)

for block in bpy.data.materials:
    if block.users == 0:
        bpy.data.materials.remove(block)

for block in bpy.data.textures:
    if block.users == 0:
        bpy.data.textures.remove(block)

for block in bpy.data.images:
    if block.users == 0:
        bpy.data.images.remove(block)

IMPORTANT NOTE: It looks like that there is some dependencies between some data blocks such as mesh, texture, image and materials. If you do not remove the data blocks on the highest level of the hierarchy, you will not be able to remove other data blocks or you have to take the risk and remove data blocks with users more than 0. So make sure you use the code above in the following order to remove data blocks. This way you can remove all unlinked (users == 0) data blocks:

remove meshes --> remove materials --> remove textures --> remove images

The followings also have data blocks:

bpy.data.curves
bpy.data.lamps
bpy.data.cameras


I would like to 'draw' a basic 2D mesh of any shape using my mouse I would like to 'draw' a basic 2D mesh of any shape using my mouse. I've read advice on using grease pencil, but if I use grease pencil and convert to a mesh it seems to have lots of different properties and the mesh doesn't behave normally at all. I feel like this would be a straightforward feature that a lot of people would want as it would save a lot of time, so maybe i'm missing something?

For example I want to create the outline of a beer bottle (or any shape using a reference photo), and have as simple a mesh as possible? Instead of creating a basic object and manipulating it.

I would argue that this approach doesn't really save too much time, since handdrawn shapes must be cleaned... manually. But I concede that it's probably suitable if you're just making a sketch!

Anyway: you can definitely do it using grease pencil! What is the problem you're experiencing?

This is a possible workflow. Precondition: use Blender 2.80 or newer.

Add > Grease Pencil > Blank
Get into an orthographic view (e.g. Front Ortho)
Entrer "Draw Mode", draw; then go back to "Object Mode"
Right click on your object > Convert to Bezier Curve
In the Outliner, hide the grease pencil object and select the newly created Bezier curve.

In my version, I have a little bug whereas the Bezier is not immediately visible. Hop in and out of Edit Mode (Tab) to make it visible

Your curve has probably too many handles. To reduce them, enter "Edit Mode", select all the handles (A), then do Right Click > Decimate Curve. In the box that appears, select a suitable value.

To avoid your mesh to have still too many handles, go in the Curve settings and change Resolution Preview U to 2 or 3
Right Click > Convert to Mesh
You've got your mesh! You can use it as any other mesh. For instance, you can use the Screw modifier


How to make rulers permanent visible? Is it possible to keep rulers displayed when leaving the Grease Pencil toolbox? I can only see the rulers when I click Grease Pencil -> Tools -> Ruler/Protactor until I press ESC.

Version: 2.79

Right now I use the good plugin MesaureIt. It is built in in Blender and can be activated in the preferences. However it lacks the possibility to measure difference shapes (boolean operator) but it is far best solution I have found till now.


Cycles Nodes - get actual coordinates I want to make a procedural planet shader in cycles, and I want to for example have some poles at the z+/z- direction and some deserts in the middle (equator). Is there any way I can get the actual coordinates (esecially the Z- one) in the node setup.

Thank you

This node setup allows procedural pole, tempered, desert on local Z axis based on cursor location (it should be at the center). So you can rotate, scale move in object mode without any problem.

The Object Texture Coordinates Outputs -1 to 1 coordinates for all local axis (origin=0, so the origin has to be at the center of the object). Then we separate XYZ vectors because we want the Z coordinates only. Using the Absolute node will give us a mirrored 1/0/1 along local Z.
So now we have coordinates on Z that are 0 in the middle and 1 at each pole.
The 1st mix node is controled by a 'Greater Than' Node 0.2 so the material will use 'Desert' input from 0 to 0.2 and 'Grass' if Z coordinate is greater than 0.2.
The 2nd mix node will use the 1st mix and mixes it with 'Ice' if Z coordinate is greater than 0.8.

To control where the limits are, just change the 'greater Than' values (0-1).
But this setup will work only if your mesh sphere has a size of 2 units (default, size of the object doesn't matter).

So we want to fix this using the Generated coordinates.
The generated coordinates will give a 0/1 on each local axis, no matter where is the origin or the size.

Now we modify the coordinates with a 'subtract' 0.5 so we have -0.5/0.5, 'multiply' 2 to make it -1/+1 as before. This time the spere can be resized in object or edit mode, nothing will change!


White version of a product visualisation loosing reflections I'm working on a visualisation of a black and a white object. Everything looks fine when the product is black. But the closer I come to white the more flat the product appears and the reflections seem to disappear.

I could increase the specular- or metallic-value for the white object to bring back the reflections but that doesn't make sense because it's not a different material compared to the black object. It's just an other color.

Or I could render out a glossy-pass and compose it over my original rendering but this deserves extra work especially with more renderings.

Also I could create another HDRI with increased lights for the white object. But this is extra work again and makes it impossible to have both objects in the scene when they only look good with one certain HDRI.

What I aim for is a consistent look for the black and the white object where I only have to change the color and no other value of the material. I don't understand why it's not working as expected.

White non-metallic surfaces have less shiny reflectivity than black ones of the same smoothness, because white surfaces disperse more light (in multiple directions). Combined with that is the optical illusion that light on a dark object is more visible to the eye than light on a light object. If you already have a white object and you try to make it more white, it's not going to increase as much in visual brightness.

This is how it works in the real world as it works in blender. To force this look with the material you want you can do two things:

You can make the material more metallic by increasing the metallic slider. As you can see that your expected material looks more like aluminium than plastic.
You can increase the specular slider to increase the amount of reflection directly. This slider is there for artistic use like what you seem to be trying.

If you are not at all happy with the workings of the principled shader you can make your own node system by mixing the glossy shader with the diffuse shader and using fresnel (in case of a non metallic object)

Another solution for you might also to increase the contrast of the HDRI by using a gamma node which should make the reflections appear brighter, or use color management to increase the overall gamma of the image.


Collision Bounds/Mask not working? I have a .blend showing an exact copy of the objects that are in my game, but just simplified without any models. I have a head, a torso, rigs for the head and torso, and collision bounds along with the floor. The floor will act as a map. I am trying to have things collide with only certain things, but it doesn't seem to work. In my game, I need the collision bounds to only collide with the map. The head and torso should not collide with anything except projectiles (the floor in the .blend provided). The projectiles should collide only with the map and the character (head and torso). The .blend provided includes all the objects with names to help. Anything is appreciated, thank you!

EDIT: It seems like it does not work because of the parenting, I still need the parenting the way it is. Thus you need to make a script or do something in order to have the parenting not affect the collisions.

It was not necessary to change the parenting at all, or use python.
Your main problem was that you had not checked the check box labeled Ghost

It is also important you change the settings for the collision group and the collision masks.

Basically the head and torso are on collision group 2 and are masked so that they can collide with Every Other collision group except for the first. This is because the ground is on the first.

The main collision group is set so that it can collide with everything Except for collision group 2, because the bullets are on that group.

Notice that ghost is Not checked on bounds. This is because it needs to be able to collide with the ground. It is masked so it can collide with everything except for collision group 2, because the bullets are in that group.

The last important change you need to make is on the bullets themselves.

This is on the same collision group as the torso and head, so they can collide with everything and not cause a problem. because the collision bounds object is on collision group 1, and because it is masked so that it can not detect collisions with the bullets, the bullets will pass through them harmlessly. However, the ground is also on collision group 1,

Using these methods, the end result is that the bullets can collide with the head and torso, the head and torso detect collisions with the bullets, and can decrease health/armor accordingly. The main physics object (bounds) can only collide with the ground. the bullets can also collide with the ground.


Is it possible to give each render layer specific render settings? For example, I have a RenderLayer with my scene that I can render with my GPU, but I have a scene that's point density intensive (still crashes my GPU with 2.77) and needs to be rendered with CPU. Is it possible to press F12 and let Blender switch between GPU and CPU as it renders, but still be able to composite it as normal when done rendering?

You can't switch between CPU and GPU if the render layers are in the same scene, but you can have multiple scenes that each use a different rendering device (CPU/GPU). You can then work in the compositor with the render-layer from the GPU rendered scene and the render-layer from the CPU rendered scene.

So, you need to recreate the render layer you want to render with a different device, in a new scene, and then change the 'device' under render settings. Obviously, this comes with its own complexities if you have a complicated scene as you may have to copy many objects into the new scene to get that render layer to appear correctly.


How to force creases into a cloth object? I want to be able to simulate a cloth object where some of the edges want to crease to some angle. For example, this mesh below has a line of edges marked seam on the left, and on the right I've used edge crease to highly another line of edges.

And I want to be able to tell Blender that the seam marked edges should be bent to 90 degrees, and the creased edges to be bent to -90 degrees, which the following picture illustrates.

Thanks!

I tried to do this once years ago using a sort of genetic algorithm sort of approach, and shape keys, with mixed results, then last night a friend suggested I try cloth simulation, which seems much more promising.

I don't care if the solution has anything to do with seams or creasing, just so long as I can have Blender know it should bend part of a cloth object to some angle.

Edit: I want the physics simulator to do the bending for me, so for example, I would make the original flat mesh, and add something so it would know the edges should be creased to some angle, and then the simulator itself would do the bending for me along the edges as I've defined, to the pre-defined angle.

A Second Edit: What I'm trying to simulate is the way paper folds, as in this video here: https://www.youtube.com/watch?v=2Q-A38tK4SA
The video depicts the result of folding concentric squares into a square piece of paper, which causes it to turn into a saddle, or potato chip shape. I can rig up bones to bend the "paper" model in Blender, but I want Blender to actually do the saddle-shape deformation, based on the fact that the model is creasing.

This is a rigged plane:

And notice it doesn't reproduce the saddle shape. I think it would be area preserving that would mimic paper, since paper can't stretch or shrink, but I don't think volume preservation will work right.

You should probably use pinning for this. If I understand correctly what you want vertex groups will allow you to define parts of the mesh not altered by the cloth simulation.

Select a few corner vertex, as many as you need, the more selected vertex the stiffer the animation will be, and assign them to a new Vertex Group.

Use that vertex group for pinning under the Physics > Cloth > Pinning.
You can use this in conjunction with shape keys and animation to drive the shape from flat to folder or similar.


how can i quickly optimize this mesh out from a curve? this is a hair that i have done for my character there, so its made out from a curve, after convert it to mesh, it gave me too much verts or poly count, i need to optimize it, i tried the unsubdivide option but it gaves me a weird result because of the triangules topology, and decimate modifier but its ugly as fuck the shape and topology, the the result that i want its the first that i tried but unfortunately that issue happened.. its there a better way to optimize this kind of meshes?

Try to tweak the curve properties before converting it to a mesh. The Resolution values get you control over the density of your model, so you can increase or decrease the number of polygons.

And my suggestion is to active the wire/draw all edges options in the Object>Display properties so you can have a nice preview of how many polygons you will have your object after the conversion.


Cant delete background image So my problem is pretty obvious. Add front and side view, tried to move front view picture, it didn't react, so i tried to delete them, side view works as normal, front view picture doesn't react at all.

You have two separate 3D views, one on the left and one on the right. Each 3D view has it's own properties panel with its own settings (including background images). You have the properties panel open for the 3D view on the right, but you are wanting to edit the properties for the 3D view on the left.

Press N while your cursor is in the left 3D view to open its properties panel and remove/change the background images from there.


Solidifying SVG remains 2 dimensional I am attempting to import a basic SVG enclosed path into Blender (2.8) and extrude it so that it becomes a solid. From other website resources, it seems that the best way to do that is to import the SVG, convert it to a mesh, and then solidify it. However, when I apply solidify to the mesh the object still appears completely flat. For larger values of solidify, what looks like a second mesh starts to warp. With smaller thickness values, it appears that a clone of the mesh is superimposed on it (but still no thickness).
Thanks for your help in advance; I am definitely a beginner.
Here's the imported SVG

Here's the result of solidify

Here's from another angle showing the flatness

From the comment, I appeared to figure it out. Selected the mesh, went to edit mode, selected all vertices, press F to create a face, then solidified.


Why my material is not showing on the render but in the preview of the right-side of the screen? i came back after a long christmas break of using blender and i just found this problem while following a tutorial. I made all the steps that are shown in this video https://www.youtube.com/watch?v=V3wghbZ-Vh4 and i see that isn't the same.

A better example:

So, the question is, what's happening? what am i doing wrong?
Just in case, i unwrapped the ball and isn't looking the same as in the right side preview.

This is how it looks with everything included to look "Realistic or photorealistic" (I'm using the Poliigon materials), and there not much changes in the rendered image.

EDIT: i found that i made a miss-step and didn't unwrap correctly. Now i unwrapped it on sphere projection, but still it looks flat :/

You need texture coordinates on your sphere. Either use generated coordinates or UV unwrap your Sphere.

Use the mapping node to transform your texture.


2.8 Curve bevel and taper scaling issues I'm trying to design jewellery in mm scale so I have set my scene length to be millimetres. So far, mostly so good I think.

Importing and SVG is no longer in um scale - yay. I'm not quite sure of the scaling, but it imports a letter at about 18mm wide.

I create a belief circle with a radius of 1.5mm (I want a 3mm diameter wire)

I add this to as the bevel object to my letter and all good. But I want to scale the letter up. But it also seems to scale the application of the beizer circle as well. Hmm, lets tackle it a different way.

Wipe everything, import the SVG, scale the letter to the correct dimension, apply scale. Now the curve is showing the correct dimensions, and 1.00 as all the scales. I apply the same 3mm diameter wire I created above, but it has still doubled the wire diameter. Why?

Also, I want to center the letter, so I grab it and move it. The bit I cannot apply location changes to a 2D object? Why?

Ok, so I scaled the wire circle inversely proportionally to the scale I applied to the path. I'm in an OK place. Now I want to taper the object, but. I can not find a working example in the millimetre scale.

If I create a regular bezier curve, and apply it to the taper of my letter. I get a tiny thin wire. So I know that deflection in the Y dictates the thickness along the taper, however I had assumed that the peak of the curve would be 100% of the full bevel.... but it doesn't. If I grab all the points and move them off the y=0 plane in edit more it gets a little thicker possibly... but I can put the peak at 100m and I still only seem to get a tiny line.

Even with a simple example, it does not work as expected. Is this a scaling bug as above?

Can anyone provide an example of how to make bevels and tapers work in the millimetre scale, or point me at what I'm doing wrong, or where my assumptions are wrong? I can provide a simple blender file if that helps anyone?

Thanks

Partial answer, in order to scale a beveled curve without scaling the beveled section/object,

Scale your curve,
Apply Scale then uncheck the Apply Properties of the Apply Object Transform

As far as Taper goes, it only influences the bevel profile in the X/Y space. I.e. if the taper curve has some Z dimension, it will be ignored.

The full X extent of the taper object applies proportionally (i.e. normalized to) to the full length of the tapered curve. In other words, if the taper object extends between x=-1.0 to x=+1.0 (relative to its origin):

the Y coordinate at x=-1.0 will define the bevel profile width at the start of the parent/tapered curve and
the Y coordinate at x=+1.0 will define the bevel profile width at the end of the parent/tapered curve

The Y scaling is relative to 1m in the Y axis from the origin. Also a side effect is that scaling the taper object in the X axis will not change anything since the normalization to the parent curve length occurs.

If you want to control the exact dimension of the taper effect on the bevel profile in relation to your bevel object,  take the bevel dimension and calculate the scale factor required at the different taper positions along the parent curve and make sure that the Y coordinate of the corresponding taper control point has the right scale factor to obtain the desired value.

For example: with a bevel circle of 3mm radius if you want to obtain a bevel width of 5mm in the middle of the parent curve, make sure that the control point in the X center of the taper curve has a Y value of 5/3m from its origin in the Y axis


Animate 8-shape kite flight pattern with fixed camera mounted to it I am just starting out with Blender and am trying to create a simulation of a tethered kite that has a fixed GoPro camera mounted to its rope looking down towards the ground along the rope.

So far I have created a 2D 8-shape path in the xy plane "up in the air" and used constraints on the camera to create the movement. Using the Follow Path constraint I was able to get the camera to follow the path along with its orientation (rotation around the z axis).
Using the Limit Distance constraint I set the rope length to a fixed value.

The only thing missing now is the camera orientation towards the origin of the rope. I tried this using the Track to constraint and tracking the camera to an object on the ground at the origin of the rope. When I track it to the z-axis I get a view along the rope as desired. However, I don't want a fixed "Up" axis as used by the constraint (see animation below, the camera keeps rotation left and right as opposed to a fixed camera).

I rather want to use the direction of the path to create the realistic rotation while still tracking the origin of the rope.

Is there an easy way to achieve this or are there other better/easier approaches to get the results that I'm trying to get?

Instead of Track To use the Damped Track constraint:

That results in this motion:

Orbiting a cube from above:


Procedural texture of random square clusters I'm trying to procedurally texture some future tech. It has small squares that seem random. I envision making a noise texture pixelated, and then animating the pixilations to move over a cube object, looking very futuristic.
Ideally, I'd layer many pixelation colors over one another so the squares are like a kaleidoscope fading in and out.

If you take a Voronoi Texture's Randomness parameter all the way to 0 it generates squares like you want.

You can take the Color output into a Noise Texture like you suspected and generate lots of different outputs.  What I did here was put a Color Ramp on the other side set to Constant to isolate groups of these squares to use as a mask for whatever you want.

But you can imagine animating some of these values and generating any number of visualizations.


Is there a way to analyze what's using frametime or view all simulated meshes at once? I have relatively large scene in which I did some cloth simulations. I'm sure I don't have any simulation enabled (went through all visible and invisible meshes). But even without apparently nothing running, I get only 2fps. Surely there must be some simulation still running that I can't find. Is there a way to check that? Thanks in advance.

Alright, turns out using simplify solved the issue. I didn't know that the subD modifieres are such a frame eater for nonanimated objects.


How to bake a position map in Blender How can I bake a position map with Blender, I don't have the option in Cycles baking.

To bake a position map you need to create an emissive shader and bake in emit mode.

For the node setup use for the input an Input > Texture Coordinate. You will need to use the generated output of the node, by default the axis in Blender aren't the same as most 3D software so you will need to change the RGB channels. For that connect the Generated output to a Converter > Separate RGB and add a Converter > Combine RGB node, here are the connections:

R > R
G inverted > B
B > G

Then add a Color > Gamma and set it at 2.2 to convert the color in Linear, by default it's in sRGB and doesn't work in other software. Then on the Emissive node.

Here is the result and the complete node setup:


How to set two different HDRI, one for environment lighting, and another for background, in 2.8 using Eevee? I figured out how to use a normal image as the background while using an HDRI for environmental lighting. But I can't figure out how to use a different HDRI as the background.

Please note I already read this answer: https://blender.stackexchange.com/a/81011/50766 but this appears to be different for Eevee in 2.8.

Thanks!

To render a different background than the one used in the environment

Just enable Film>Alpha>Transparent.

Then on the compositor use Alpha over to mix over the background you want to use.

Alternatively you can use a background for the world that is only seen by the camera and not by other rays, therefore not contributing to the lights, reflectons,etc.

Set two different Environment background shaders and use the Is Camera Ray from a Light Path node to control the shader mix.


Soft body edges in 2.78a I've got a hand model, I've rigged it and now I'm trying to avoid the fingers passing through the hand itself.

I understand that to activate Self Collision in Soft Body I have to activate "Soft Body Edges" but I simply can't find it in Blender 2.78a. When I select the mesh, and go to physics, there is no option for it like in previous versions.

How can I make it?

Thanks!

Edit: I've seen that there might be a problem with the model that I have imported. It's this one http://www.blendswap.com/blends/view/81285 and the one used is .x3d. It's a ShapeIndexedFaceSet

REWRITTEN ANSWER: Based on your screenshot, you must be in "Blender Game" mode. The settings you are looking for are available only if you use Cycles or "Blender Render".


Making sense ot the 3D View and aligning and rotating objects by specific values I am trying to line up a camera and a mesh in the 3D viewport.  I am having LOTS of problems.
a) I have a green line - I assume this is the X axis, though it is not labelled, same for the blue line. How do I see all three axes?
b) I set the cursor to world origin and then set my mesh to cursor, but the mesh seems to just go wherever it wants to go - and certainly not to the cursor.
c) is there a trick to navigate around the 3D space without it turning upside down or moving in an unpredictable manner?  How can I even tell if it has turned upside down?  Is there any way to move the view in a single axis at a time?  I am just usinhg my Mac trackpad with 2 fingers but it drives me crazy.
d) after selecting object I noted that the Y scale was slightly different - setting it back to 1 (same as X and Z scale caused the model to disappear altogether - I never found it again...
e) I thought that having a collection including lamp and camera might be causing Blender to snap the collection rather than just the mesh - but I moved the mesh out of the collection and it made no difference.
Really, this is driving me nuts!
f) Setting the mesh origin to cursor evidently does not move the mesh to the cursor - so how do I move the mesh itself so that it is sitting EXACTLY on all three axes?

dI solved this issue by selecting the camera and moving it to the cursor at world origin.  Then with the camera view open in another window I was able to move the camera along the X and Y axes until the model came into view (upside down!) and then rotate the camera until the model was the right way up - using the rotation properties box to specify the exact rotations - 90 / 180 / 180.
The Y axis alignment was done by eye - I could not find any way to centre the camera exactly on the centre of the model.
It will have to do...


Aligning bone's roll accurately to rotated objects I am trying to rig a belt with a lot of things attached to it (small boxes and other accesories). I want to add a bone to each one but the problem is that this accessories are rotated in many different ways and I am not sure about how I should align the bone roll for them.

In the simplified example I provide below I eyeballed it and the result is somewhat decent, but I want to know a better approach. The center bone is supposed to control the other two bones at the same time (but again, I am not sure about its roll or placement) and the arrows indicate the direction I am looking for, which is more or less the normal X in edit mode.

Riggers usually set the bone roll to have the main movements on the X axis (like in your example, possibly having the main rotation with positive values of X). But if you simply parent the external bones to the central, all 3 bones will rotate on the central bone X axis, which is not what you want. One good approach could be setting two drivers, so that every rotation of the central bone will be reflected by the external bones (on their own axis).


UV Unwrapping is eneven I am trying to unwrap a object (shirt) in the blender by marking seams. I added new uv grid image using image texture node.  But for some reason the pattern on unwrapped image is not even on both side. I don't have much experience when it comes to uv unwrpping so I'm not able to figure out what the problem is .I am attaching .blend file, hope that helps.
Thanks in advance.
https://drive.google.com/file/d/1hUIulFz6sgqSMBpHU_EF_8sDqgf0X2nY/view?usp=sharing

Inside the shirt, there is a Ngon that breaks the flow of the edge loops, so your vertical Seam fails to "cut" the model in two halves :

A quick fix would be to add a Seam along on side of this Ngon :

It would also be a good idea to add a Seam inside the arm, same position as outside :

For your future models, i would suggest avoiding unnecessary NGons. Also, you can use the Solidify modifier instead of modelling the outside and the inside, it's much easier and avoid this kind of traps.


How to make a Emission shader RECEIVE shadows? I have baked a floor onto a texture which then I plugged onto an emission shader. However, the floor no longer receives shadows because of it.

However I have a character walking on the floor and I need the character to cast a shadow on the floor. How do I make the emission shader receive shadows?

You can't, either use a shadowcatcher plane that you composite on top of your footage or don't use Emission shader on a surface that is supposed to receive shadow.


Seamless 4 camera setup How to postion 4 cameras and render a scene partitioned in 4 pieces ?
Cameras should positioned seamlessly 2 on bottom and 2 right above.
Then how to setup in compositor that 4 images are merged in 1 bigger image?

You can achieve this result by duplicating your first Camera and than rotating it:

I reccomend not using seamless rotation. If you have a small overlapping part it is easier to match it up in the compositor.

To match the to renders up you can use the translate node:

The first part of the image.

The second part off the image.

Combined.

First, you take your to images. For demonstartion purposes I use to files on my computer. One file can also be the rendered image. Than scale the images to the right size. Make sure that your scene has the size of the combined image.
Than you need to add these to images together. To get the combined size I reccomend using a mask of scene size. Use a "translate" node to get the images into the right position. Using half your image height is a good starting point. Add the first image on top of the mask with an "add" node. Add the second image with a "lighten" node.
If your images don't overlay you can also use an "add" node.
If your images overlay match up the second image to the first one with the "translate" node. Also add another scale node to make the image in  this case a perfect square. This last step is only neccessary if you have overlaying images.

I personaly reccomend doing the matching up in an image editor like Gimp ore Photoshop. It will save you a lot of time.


Texture Paint only draws in black - Blender 2.8 I am new to Blender, so sorry for my inexperience, so I tried Blender 2.8 for the first time.
I want to texture paint on my 3D Object but it only draws in black, even though I want to use different colours.
Does anyone know how to fix this?

I also use these Nodes for the texture

I could solve this problem, I just had to change the brush texture. It seems like I messed it up, and put it to black


How can I freeze part of object while applying simple deform(twist)? As the [Axis, Origin] is set to the Hemi lamp, the whole body twist along the lamp (upper image)

What I really want is to keep the feet freeze while applying the twist.(like lower image)

Is it possible?

thanks.

After using vertex group, the lower body is freeze.
But the weight paint not working well.

I believe using vertex groups/weight painting would be the best way to accomplish this. In the screenshot below the selected vertices are added to a vertex group and plugged into the deform modifier:

Keep in mind that with weight painting, you can also have areas that are only partly influenced: (more flexibility)

Lastly, there are tons of resources on the web about vertex groups, here is one link to the blender manual.


Where can I change the color of the parts marked in red? Where can I change the color of the parts marked in red?

Basically every styles you want to change can be found in Themes panel.


How to mix three different shaders on the same material? So I came across some difficulties with the "Mix shader" node in cycles. I have 3 textures on a label: gold, paper and rough black letters.

How can I mix these effects? I can make 2 textures work together, but not the 3rd one.
Here's the node graph.

Here's the reference.

The textures all have an Alpha channel perfectly prepared for a mask.
So you only need two mix nodes.

But I'd recommend making four different textures instead - Color, Roughness, Metalness and Bump. Then you just plug them all into one Principled BSDF shader, have more control and an easier life :).


What is Dot Product? I am doing this Blenderguru tutorial on Making Fire and at some point he is adding the Vector Math node Dot Product to his material. And he says that he does not understand what he is doing but this seems the way how to do it (he is creating the material for a sphere that is used in the particle system).

Now I realise that I have applied this Dot Product for a number of times and to be honest... I also don't know what I am doing. I googled and found some complicated math about scalar products and it is too long ago for me that I did that kind of stuff on university. Can someone explain in "noob language" what Dot Product does in Blender?

Let's start with some definitions:

Vector: A list of values that are all contained under the same "roof" so to speak. For instance, the location of an object in 3D space is a vector of 3 values (the $X$, $Y$ and $Z$ location of that object).

All Vectors in blender are by definition lists of 3 values, since that's the most common and useful type in a 3D program, but in math a vector can have any number of values.

Dot Product: The dot product of two vectors is the sum of multiplications of each pair of corresponding elements from both vectors. Example:

$$
\begin{aligned}
\vec{V_1} &= (1,2,5)\\
\vec{V_2} &= (2,1,3)\\
\vec{V_1} \cdot \vec{V_2} &= {V_{1}}_{x}{V_{2}}_{x}+{V_{1}}_{y}{V_{2}}_{y} +{V_{1}}_{z}{V_{2}}_{z}\\
               &= 1\cdot2+2\cdot1+5\cdot 3\\
               &= 2 + 2 + 15 = 19
\end{aligned}
$$

The particle velocity example:
In your original question, we see a dot product of the particle velocity with itself. The velocity is an XYZ vector since it has components in all 3 axes.

In a smoke or fire simulation, some particles are going right ($+X$), some left ($-X$), some forward ($+Y$), some backward ($-Y$), but almost all are going up ($+Z$). The velocity data reflects this. If a particle is going straight up, its velocity will be, for instance, $(0,0,1)$. If it's going left, forward and up, its velocity can be something like $(-1,1,1)$.

When you calculate a dot product of the velocity with itself, you cancel out the negative values (negative values multiplied with themselves become positive), so this is a quick way to convert the velocity gradient over all particles from a 3D XYZ gradient to a mostly 2D gradient along the Z axis.

And now the velocity's dot product with itself:

Another Example: Parametric Geometry Input Node:

The Cycles Input --> Geometry node's Parametric option that's used here, generates a Vector (RGB) value for each point on the object's surface (image above). Each color channel's at each point has a value between 0 and 1.

If you calculate the sum of each point's RGB values ($R+G+B$), you'll get a single (scalar) value (top image in the figure below) that ranges between 0 (R=0,G=0,B=0) and 3 (R=1,G=1,B=1).

This is the same as the dot product of each RGB value and a Vector of $(1,1,1)$ (2nd Image in the figure below).

And eventually, if you calculate the dot product of the parametric RGB with itself, you essentially multiply each color with itself ($RR + BB + GG$) in each surface point (3rd Image in the figure above).

In this case it darkens the image significantly, because any value below 1 that's multiplied with itself produced a smaller number/value.


Connecting the center of a polyhedron to its corners I'd like to know how to connect the center of a polyhedron (e.g. a tetrahedron) to its four corners with cylinders (to be bonds), such as in the example below. Thanks!

Finally figured out how to do this! Not sure if it is the most efficient way but it worked for me. Here are the steps.
(a) Go to Edit>Preferences, and click on the Add-ons tab. Enable the Add Mesh: Extra Objects feature.
(b) Delete the default cube if you have it and add Mesh>Math function>Regular Solid. A tetrahedron should come up automatically. If not go to the Source pull down menu of the dialog box that came up when you first added the Regular Solid and change to Tetrahedron.
(c) The tetrahedron will be centered around the 3D cursor. Be sure not to move that cursor. Now add Mesh>Single Vert>Add Single Vert to add an a single isolated vertex at the 3D cursor.
(d) When you add the single vertex you will automatically be put in the Edit mode. So Tab back to the Object mode.
(e) Select the tetrahedron and the single vertex (in either order) and hit Ctrl J to join the two objects.
(f) Tab into edit mode, and select the wire frame view. Select the central vertex and one of the tetrahedron's vertices (in either order) and hit F. This should create an edge between the two vertices. Repeat the process three more times to connect the center of the tetrahedron to the other three corners.
(g) Select and delete the original edges of the tetrahedron. This should now leave four edges (lines) connecting the center of 3D cursor to the four vertices of the tetrahedron.
(h) Tab into Object mode, select the object and, from the Object pull down menu select Convert to > Curve from Mesh/Text.
(i) Click on the Object data properties tab and, under Geometry, adjust the bevel depth to the desired thickness.
(j) This gives the basic structure. Pull down the object menu and Convert to> Mesh from Curve/Meta/Surf/Text/. If you prefer you could add a Subdivision Surface modifier but in that case be sure to change from Catmull-Clark (default option) to Simple in order to retain the shape.


How to Set Up a Scene with Large Units of Scale So recently I've been getting into these "Spaceship" scenes where smaller ships are flying around a much larger ship. And I was wondering there was anything I could do to adjust the units of scale in order to get accurate sizes to the lore of the spaceships. (EX: how to accurately represent the scale of the USS Arizona in Blender)

In my Blender 2.8 default length is in meters, so you can just hit N and write "180m" in scaleX for ship length. And say, "0.5m" for smaller ships.


Align vertices with another vertex, but vertices must stay on their edges I want to align vertices along the z-axis to be in line with another vertex.  I know about S-Z-0 and pivoting around the active point, which aligns the vertices but deforms the edges these vertices are currently on.  Like when pressing GG, the vertices slide along their edges, but I also want to align them to be at the same Z position as some other vertex.

The first image is the object, and the second is the side view.  I want to align the highlighted vertices with the row below (same Z value), but I want the selected vertices to slide along their edges.

I could align the vertices by sight using GG, but is there a more precise way of snapping the vertices into place?

Thanks..

There isn't a simple way. You can move the vertices on the z-axis and use snapping to align them to the other verts, unfortunately snapping does not work while using edge slide.

To get the result you are after -

Select the four corners of the part you want to align to
Press ⇧ ShiftDESC which will duplicate the vertices and leave them in the same location.
Press F to make a face from these vertices
Scale S this face so that it is larger than the outer edges
Choose Mesh->Faces->Intersect (Boolean)
Now select your top vertices and edge slide GG, you can move them right down - against the new vertices that are cut in the edges in line with the inner section.
Now select all A then w->remove doubles,
Select and delete the extra bits left behind. I got an extra 2 faces under the section that is now flat, I deleted the two extra edges and dissolved the two vertices to end up with the desired mesh.


Is there a substitute for poke face option in Blender 2.65? I have been trying to make a dice watching a YouTube video and in that they are using Blender 2.81a. However, I cant afford it as my computer doesn't have the required graphic card and processor (can't buy a new one for this because I am not a professional, just a beginner). So I have been using 2.65 as it is the one which works best in my computer. When I was making this cube, there was a need to make a poke face. But I cant find that option or any other any option to do it. Please help...

If @batFINGER's suggestion doesn't work for you for some reason, then, with Pivot set to 'Individual Origins', in Face mode you can I inset all your faces a little way (or by no distance) :

.. With 'Individual' checked. (This illustration has to be in a later version, but your adjustment should be available in the T toolbar region.)
Then S0 you should be able to scale all faces to 0, followed by the old AltM > B .. or W menu .. 'Remove Doubles'.


How to play action actuator logic brick via python I want to know how to play(send true pulse) to an action actuator via script (logic brick with all the settings) since playAction doesn't have animation property which I need.

You can use python to activate the Action actuator with this script. You will need three logic bricks: A sensor (to trigger it all), the python controller, and the action actuator.

cont = bge.logic.getCurrentController()

act = cont.actuators["Action"] # the name of the Action actuator

if cont.sensors["Keyboard"].positive: # trigger when buton pressed

    #Set all the properties you want
    act.action = "CubeAction"
    act.frameStart = 1
    act.frameEnd = 30
    act.priority = 0

    cont.activate(act) # start the actuator

You can set as many or as few of the settings that you need with python or in the logic brick, however the python will overrule any duplicate settings. Here is a list of all the settings for the Action actuator.
Do note the the two minimum setting you need are the action name, and frame end.


Is it possible to give the procedural checkers more than 2 colors? This is my first stack exchange post so my sincere apologies if i made a mistake.

I'm a really big fan of procedural textures and love to mess around with it and get different patterns. One of my favorites is the checkers texture. One thing that has always slightly bothered me is that i can only choose two colors, and that they're always in a checker pattern. I'd love to make some materials that give those old school pixel vibes.

Is it possible for me to make the procedural checker texture more randomized in hue, saturation and value? Thank you in advance.

Kind regards,

Dylan.

You can feed a checker texture as the color to an other checker texture and play with the coordinates to create endless different combinations.

(click on the images to enlarge)


Is there a way to collect all the files a blend file is using? Is there a way blender can sort of collect all the files that is uses within a session. Because I need to tidy the files on my computer but some of them will have paths to blender session and some won't?

You could Pack all the files being used into the blend file and then Unpack all the files into a new location.

Packing saves any external files that are in use into the blend file itself (but this doesn't remove the originals from the hard drive). Unpacking will save the currently packed files out into directory of the current blend file (a few other options are available), thus 'collecting' all the files.

File> External Data> Pack All Into .blend.
Save the file.
File> External Data> Unpack All Into Files> Write files to current directory.
Save the file.

So, you can essentially 'collect' all the files in use into one location, but you can't actually get the original files to move (using this method).


Mesh darkens after mirroring So, I finally got my model's foot paw look good and decided to duplicate it for the other leg. When I mirror the foot paw, it darkens out (see picture below). Is this something I need to be concerned about? If yes, how do I avoid this from happening?

This happens when you mirror manually instead of using the Mirror Modifier. There may be times when you want to mirror manually, but just be aware that this will happen and recalculate your normals afterward (by pressing CtrlN in Edit Mode with geometry selected).

The reason this occurs is that each point is being moved to its mirror-opposite location and as it moves the outermost points actually cross over the innermost ones.

Let's take one step back. First you must understand what normal vectors, or "normals" are. They are the outward-facing directional vector that each face in your mesh has. If you want to see which way your normals are facing, you can enable this in your Mesh Display options.

Consider the analogy of a sock being turned inside-out. Here is our modeled sock, and as the duplicated sock is scaled on the X axis about the 3D Cursor, the vertices on the tips of the toes cross over the vertices on the rim of the sock, thus turning it inside-out.

And with face normals made visible you can see exactly what's happening. The brightly-colored prongs poking out from each face are a visual representation of your normals.

Vertices (and edges, sort of) have normals too, and you can display those also if you want, but they don't play a role in your shading the way face normals do.

Should you be concerned about inverted normals? Yes. While they may not cause you trouble in all situations, there are plenty of situations in which they will - for example, they may cause your materials or textures to look wrong, cause texture baking to go wrong, cause your booleans to fail, cause 3D-printing to fail, and more.

The dark shading is Blender's viewport telling you: "I think this is the interior of your object", so if you see dark shading on the exterior you should examine your normals.

In short, you can prevent inverted normals by using a Mirror Modifier instead of manually mirroring, or simply recalculate normals afterward.


Cloth and smoke simulation not working So I was creating a smoke sim (in 2.82) and had a cloth fall onto the smoke to act as an obstacle, so that it would collide with the smoke, however it did not. I have set the cloth to be an effector but it won't move the smoke what so ever. What setting is there to help with this?

Since my comment worked, here it is as an actual answer:

When your collision object has no thickness, you either need to add thickness (e.g. by using solidify), or check the Is Planar box, and fake thickness with the Surface Thicknesss slider.

A lower value will be more realistic, but risk smoke passing straight through, while higher values will more likely stop the smoke, but might look weird as the smoke will stop before reaching the geometry.


TypeError: Converting py args to operator properties: enum "LocRotScale" not found in () So I've got this row of code: (line 115)

bpy.ops.anim.keyframe_insert(type='LocRotScale', confirm_success=True)

And it produces this error message:

Traceback (most recent call last):
  File "D:\{super secret path}\lab1.blend\lab1", line 115, in <module>
  File "D:\Windows Programs\Blender\2.78\scripts\modules\bpy\ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
TypeError: Converting py args to operator properties:  enum "LocRotScale" not found in ()

Problem is, this exact code worked just a minute ago, i ran it once, cleared the keyframes from the time line and atempted to run the script again, then this error occured and its been this way ever since.
I've tried both restarting blender, restarting the pc and even reinstalling blender (through the 64bit msi installer, repair mode).

I've even tried running the same code on a different machine, and that works.

Why do i get this error, and how do i fix it?

System Info:

OS: Windows 10 Home - v1607
Blender: v2.78a

The context object needs to be in 'OBJECT' or 'POSE' mode to run bpy.ops.anim.keyframe_insert(type='LocRotScale', confirm_success=True)

Test in python console, in 'OBJECT' mode

>>> bpy.ops.anim.keyframe_insert(type='LocRotScale', confirm_success=True)
Info: Successfully added 9 keyframes for keying set 'LocRotScale'
{'FINISHED'}

In 'EDIT' mode:

>>> bpy.ops.anim.keyframe_insert(type='LocRotScale', confirm_success=True)
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "/home/batfinger/src/BlenderGIT/qtcreator_build/bin_current/2.78/scripts/modules/bpy/ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
TypeError: Converting py args to operator properties:  enum "LocRotScale" not found in ('Available')


How can I protect my addon code from scammers? I am working on an addon which I am close to finish and I'll share it totally free with a game community. But... As in outer life, this game community has some "weird" guys. These "weird" guys takes your work, whatever it is, they change some things so to make it looks a bit different, they put a price on it, they move your hard work into an other server, where you are unknown as person and they earn a lot of money of it!!! So what I need is your advice and your knowledge so to encrypt my addon code or protect it in some way from all this situation.

Especially if it's targeted to a specific community, your best shot (IMO) would be to advertise what you are doing as widely as possible. Post about your addon in forums, on your homepage/blog (if you have...), maybe also Blender Market etc. as early and transparently as possible.
Then, whenever you encounter one of the scammers trying to make money of your code, put out a comment linking to your original post and tell everybody that they can get the same value for free.
Spreading knowledge about your work helps others to spot such fraudulent offers early.
Having traceable proof of your original code ownership might come handy if some of the scammers turn real nasty and try legal action.
Other that that, I dont't think that you have a real chance by obfuscating your code. All you do is make life difficult for yourself and the legitimate users.
P.S: You might find this an interesting read in the context: https://www.blender.org/press/re-branding-blender/


Pinching an edge in the middle of geometry without additional creasing So, I'm modeling a car and I've encountered a rather unexpected problem. When I add subdivision modifier to my low poly starting model to smooth things out, I still want to keep sharp edges on some places. And some of those places are in the middle of other geometry. I've dealt with this before, always with adding additional creasing, but in this case, this ruins the shape of my model.

I ask for a way to sharpen edges in middle of other geometry, without adding additional creasing.

Oh, just for information, extruding edges inwards and then adding creases to newly created edges works only on right (look picture 4.).

Here are some pictures:

Edges I want to make sharp are those that already have creases on them.

Picture #1 in wireframe.

Original geometry.

Extruding edges inwards and then adding creases to newly created edges (works only on right).

Extrude the vertices in the corners, then add edge crease to the newly created edges:

These edges won't be rendered.

It seems that the direction has no/few influence on the result:


How can I associate collections with different view layers? Can I have collections separated into different view layers and combine them in the compositor? If so, how do you assign a collection to a view layer? I see the option to enable/disable a view layer for a collection, but the selection applies to all collections.
For example, I have BG, Mask and Objects collections and View layers BG, Mask and Objects. If I select the BG view layer and enable the view collection and disable the others, only the BG collection remains included.
If I select the Mask view layer, and do the same with only Mask being included, only Mask is included.
But then, if select the BG layer, the Mask collection is included, not the BG layer. How do I make BG include BG, Mask incude Mask and Objects include Objects?

It should be pretty straightforward.
I didn't understand the shortcut you used to disable collections from your question. This is how you exclude collections from view layers in the outliner :


Why is the ring at such an angle when animated? So I was doing a ring attached to chains... I've been helped before and decided to start over again... however this time when I animate by alt+a this happened: the ring stays at this angle... I've included the blend file... any help would be appreciated... thx

And also...can someone tell me how to increase the preview animation in the timeline (so that its longer than 250 frames) setting the end frame to 300 doesn't animate it further than 250... it's like the 50 frames were never there...

Here is the file:

To not to have any issues with Rigid Body Simulation remember to always apply Scale and Rotation for your objects - Ctrl+A and also keep in mind that really small objects will behave strangely.

In your case, after applying Scale and Rotation you will need to change ring Mass to something like 1.

Secondly, to increase Rigid Body Simulation time you will need to go to Scene tab and under Rigid Body Cache set the End value to match your Timeline value.


Black artifacts in some rendered images of a text I'm a complete newbie and was wondering if I had set up something wrong.

I used the 20th Century fox blend and successfully rendered 600 jpg images. Looking good, except that about 30% images have a corrupt T in "Century".

I've spent several hours going through about 200 frames trying to smooth the error out with Gimp. Just wondering what cause the fault and if there is any way to correct it a bit quicker..

It looks like a topology problem.  You can convert the text to a mesh (Alt +C) and try the following.
 - Recalculating the normals (enter edit mode, select all, Ctrl+N)
 - Check for non-manifold geometry (edit mode - vertex mode, make sure nothing is selected then Ctrl+Alt+Shift+M)
 - Remove double vertices (edit mode, W - remove doubles)

If you would prefer to keep the text object, go to the object modifiers tab in the properties window, then try the following:

add a decimate modifier
set the type to planar


Why does subtracting weights add weights to other parts of the mesh? So my problem is that I'm trying to subtract weight, and it works in some areas, but in other areas of the mesh it just adds unsubtractable weight to the mesh. Is this a bug, or is this something that I'm just doing horribly wrong? The mesh is not originally mine, and I'm pretty new to blender.

Here's the file:

Turn off "Auto Normalize" and it'll work as expected.

What normalizing means:

Let's say we had a vertex group with four vertices that have a weight value of 0.1, 0.3, 0.45 and 0.7.
Normalizing these values would mean that every weight is scaled up so that the highest value is 1. To achieve that, divide 1 with the highest value and multiply your other weight values with the result.
In our case this would mean 1 divided by 0.7 = 1,4285714286.

If we apply this equation on our values, we get 0.14, 0.43, 0.64 and finally 1.

(Every value rounded to two decimal places.)


How can i turn a few Planes upside down? Im currently modeling a 3D Character in Blender. Im learning from a Video Tutorial Serires of Darrin Lile on Youtube, because im a total Blender Noob. I finished the surface of my Character using Planes. But now half if my Blender figure is covered in Shadows/Dark (?). Its really hard to describe that, especially when youre not a native speaker so here are some screenshots.

PLS HELP. Thank you :D

Some of your Normals are reversed. TAB into Edit Mode select everything A In the Tool Bar go to Shading/UV's and under Normals choose Reclaculate.


Applying texture to plane: Get rid of diagonal repeat pattern I wanted to add an image to a plane. Here is what I tried:

Created a new plane
Added a new material and added a texture
Selected .png

and this is what I get

And this is what is shown in the preview:

Why am I getting the diagonal pattern? And why is it applied by default?

Enable "Import Images as Planes add-on" that ships with Blender, and try importing the image directly already mapped that way - it helps avoid weird problems that occur. I use it even to do cutaways later.


How can I set a default value on a Dynamic EnumProperty? I am trying to fix a bug in the Animation Nodes addon.

The loop nodes has a dynamic EnumProperty and I need to select a default value. But only when the EnumProperty contains Items.

For that I need to know what the value of default is when I don't give it a value. I thought it was an empty string

selectedLoop = bpy.props.EnumProperty(
    items=getStartLoopNodeItems,
    name="Selected Loop",
    default="",
    update=updateActiveL)

but this does not have the same behaviour as if I left out the default parameter

selectedLoop = bpy.props.EnumProperty(
    items=getStartLoopNodeItems,
    name="Selected Loop",
    update=updateActiveL)

Does anyone know what I have to pass to default in order to have the same behaviour?

EDIT: I discovered that when I add the default parameter the EnumProperty is not created apparently because when I try to add it to the layout later it gives me this error:

rna_uiItemR: property not found: mn_LoopCallerNode.selectedLoop
/home/mathieu/.config/blender/2.73/scripts/addons/animation-nodes/nodes/system/mn_loop_caller.py:66

There is no default when items is a function (you'll get an error if you try to specify it).

I'll update the doc, this info is missing currently…

Note even with 'static' enums, not specifying the default is not the same as giving "" or None, currently. Not very pythonic, but a consequence of our current C <-> python code.


Wierd micro displacement I have a strange behavior as I am trying to setup micro displacement. I use blender 2.79b. My mesh have a Subsuf modifier from the experimental feature set with the adaptative option turned on, the displacement settings in the material is set to true.

This is a part of the shamefull result. These black stripes follow the seams I used to unwrap the UVs. On top of that the micro displacement does not show up.
Do you know can cause this ?

Ps : Tell me if you need more details.

This is the material nodes setup I'm using. No displace modifier involved.

Making a normal render did not fixed the issue. The object has rougthly 100k+ vertices accross 150 blender units in x and y. (subsurf modifier unapplied)

You have to add a displacement node (shift+A vector/displacement) to your texture and plug it to height socket.


Imported image is not showing in render I have a imported image in a scene in blender. Yet when I render the image.

This is what I get:

Images added to be used as "reference" or as "background" will not render, they are reference only. The same is valid for Images used as empties. Think of those images as "virtual" or "auxiliary objects" or with no renderable attributes (like a surface or material).

If you want a plane that uses an image as a texture then you have to enable the "add images as planes" addon in the preferences window.

Now you can add an image as plane. The difference is that this addon will create real object: a plane with 4 vertices and a face that uses the image as a textures on the material. This new object is renderable.

Read also: How to map an Image on a plane manually?


Interpolating continous rotation I need some help with animating a rotating object.

I am attempting to rotate the object with the help of a generated rotation matrix. I insert a keyframe for for every 5 frames with quaternion coordinates.

Here is some example code:

import bpy
from mathutils import Vector, Matrix

f = lambda angl: Matrix(((cos(angl), -sin(angl), 0, 0),
                     (sin(angl), cos(angl), 0, 0),
                     (0, 0, 1, 0),
                     (0, 0, 0, 1)))

obj = bpy.data.objects['Cube']

obj.animation_data_clear()

obj.rotation_mode = 'QUATERNION'

frame_start = bpy.context.scene.frame_start
frame_end = bpy.context.scene.frame_end
step = 5

for i in range(frame_start, frame_end, step):
    loc, rot, sca = obj.matrix_world.decompose()
    mloc = Matrix.Translation(loc)
    mrot = rot.to_matrix().to_4x4()
    msca = Matrix.Scale(sca[0], 4, (1, 0, 0)) * Matrix.Scale(sca[1], 4,     (0,1,0)) * Matrix.Scale(sca[2], 4, (0,0,1))

    Rm = f(pi/frame_end*8*i)
    obj.matrix_world = mloc * Rm * msca
    obj.keyframe_insert(data_path='rotation_quaternion', frame=i)

The mathematical model works just fine. The cube is rotated around the z axis like it should.

My problem arises when blender transforms the rotation matrix in obj.matrix_world to quaternion coordinates. The resulting curve becomes:

The cube in this case rotates one turn. Then blenders interpolation causes the cube to quickly spin back 360 degrees before countinuing its rotation. The problem may be tied with how I insert the keyframes with quaternions.

I would like the rotation to appear continous without this back-spin. There are modifiers that can take a rotation and repeat it, but that wont work for me since i want to visualize a mathematical model.

So my question is if anyone has any idea on how to mend this.

Thanks.

In your current F-curve the interpolation between frames (75,80) , (125,130) is linear, and because there is 5 frames between the frame sets I mentioned instead of 1, the rotation reverses in those 5 frames, causing the object to spin backwards very quickly. What you can do:

Bring all the keyframes starting from frame 80 back 4 frames, so the
gap becomes 1 frame instead of 5, and I recommend changing the
interpolation from linear to no interpolation, so if you change the
framerate or move the keyframes a little bit, the backward rotation
will not be visible a lot.
Do that with the keyframes starting from
    130, and for any similar 5 frame gaps.


Cycles 'vector' pass meaning of W, X, Y, Z I have a scene with moving objects and I want to extract the optical flow (apparent motion as seen by the camera). I am using Cycles. I include the 'Vector' pass and save the result as 'OpenEXR MultiLayer'. When I open the resulting file in Python I get the following channels:

RenderLayer.Vector.W
RenderLayer.Vector.X
RenderLayer.Vector.Y
RenderLayer.Vector.Z

What is the convention here? Could you provide a source for the information?

Guided by @micaelh in the comments, I ended up doing some experiments moving objects in a controlled way, the results are below.

Vector.X - X displacement from previous frame to current frame
Vector.Y - Y displacement from previous frame to current frame
Vector.Z - X displacement from current frame to next frame
Vector.W - Y displacement from current frame to next frame

Values are in pixels. X displacement is positive to the left, Y displacement is positive downwards.


Why can I not change Particle System settings anymore? I'm kind of new to Blender, so this might be a really easy question to solve - I just couldn't find anything on the internet so far.

I created a particle system and already changed the settings to how I wanted them to be.
Now I want to change the lifetime of the particles (make it longer) but I can't figure out how. When I try to do it how I did it the first time, it doesn't work because the setting panel seems to be 'blocked' or so (see picture).

When I select the Particle Setting specifically, Blender tells me that it is not yet implemented.

That's because you have baked data. Simply press the Free Bake button under the Cache section, and you'll be able to edit your settings; you will have to re-bake, though.


Cycles: Render result doesn't match render view I'm having trouble getting blender's render result the same thing I see in object mode + render view

Here's render view:

Here's render result

I was following a tutorial tutorial but it didn't seem to encounter the same issue. perhaps I missed or toggled something. Things were going fine until I got to the "preview render" step towards the very end, when my render result showed what seemed to be the objects but with no material or lighting. Messed around a bit whit the UV mapping and world > surface and the result got a bit closer but still not what I expected. I was also having issues getting the camera & lamp to display, they are shown in the outline but in 3D view they are invisible.

project file:

https://drive.google.com/open?id=0B6jU39F0oQekVDQ2a2dDeVM0d2c

The issue is that the 'table' object isn't set to appear on any layer. You can see this by looking at the Relations panel for the 'table' object:

The rows of icons that represent the layers show that it isn't assigned to any layer in the scene and so it won't/can't appear in the final render.

I think this happens when you add a new object while in 'Local View'. If you are unaware, 'Local view' is a way of temporarily isolating any selected objects from the rest of the scene. This is done by selecting an object and pressing the Numpad /. 'Local' is then displayed as a label in the top left of the 3D viewport next to the view mode:

'Local View' can be exited by pressing the same key and it appears that it's only when exiting 'Local View' that new objects are assigned a layer.

To fix your file, either manually assign a layer to the object by pressing one of the layer buttons in the 'Relations' panel for the 'table' object (shown above) or exit 'Local View' (as your 3D view is already in Local View) with Numpad / to have the object automatically assigned a layer.

Bug Report

I did file a bug report about this issue here, but until the bug can be reproduced from scratch not much can be done.


How to build a rectangle with convex edges and rounded corners? I am trying to build this shape. what is the more efficient way to make these blue rounded polygons? I would like to create rectangles with convex edges and so rounded corners.

I suggest you this: if the exact shape is important, trace the bitmap to svg, then import the svg and import it to Blender, convert to mesh, clean the mesh... done! Here it goes:

Open Inkscape, paste the png and trace it like this:

you need to clean the traced paths, delete whatever is not your desired shapes...

then delete the bitmap, save the svg and import it in Blender: scale the imported curve enough (I did 50x), and put "geometry to the center" using the toolbox function (left panel).

then, convert curve to mesh, and change material color if you wish:

Then, convert all mesh triangles (many) to simple ngons, using limited dissolve:

there you are! Of course you have many vertices...

Of course you could also just keep the vector/curves....


Rendering single .exr from passes with different shaders? How can a single .exr containing all passes from a scene be created if certain passes have different shaders applied. For example the matte pass might have different color surface shaders while you need something like a lambert for the diffuse pass.

Is it possible to get all of the layers rendered even if they have different shaders into the same .exr file. If so how would it be set up?

I researched this as a Maya user looking for an alternative, only the most current version of Maya 2016 has this option or some of their more expensive renderer options like vray. (Maya 2016 .exr multi-pass option)

There is a tutorial here showing how matte passes would be handled in an older version of Maya with mental ray: Tutorial on multi-shader passes & .exr.
It renders out two .exr files, one for all of the main passes and one for a matte rgb pass. With this method you would have to create a seperate .exr for every pass that uses a different shader on a seperate render layer.

The first tutorial lists a number of different shaders that may have their own render pass. Cycles doesn't separate the render result based on the shader used, cycles uses node based materials that can combine many different shader types to get the final result.

In cycles the passes that are available will each contain a portion of the scene that when combined makes the final image (or render layer). The way that the passes are combined is shown in the manual and has been explained in a few video tutorials. If an object's material has only a diffuse node then all the information for the object will be in the diffuse pass. If it has a mix of diffuse and glossy then it will have information on both the diffuse pass and the glossy pass that when combined give the final appearance of the object. When saving a render to an OpenEXR Multilayer file, each render layer and it's passes will each be saved as a layer in the one file.

The second tutorial you linked to talks about creating object masks and combining them into one OpenEXR file. We have a few options to perform a similar task. Every object can have an ObjectID and every material can have a MaterialID. These ID's can be used by an IDMask node to get a mask matching the object/s or material/s with the same ID. We can also assign a single material to a render layer that makes every object visible on the layer render using the same material.

When using the compositor we have the option of adding a File Output node. If an OpenEXR Multilayer format is used for the file output then we can add as many layers as we want and choose what goes into each layer, that may be a direct render pass result, an edited and combined result or even object masks. When other file formats are chosen each input will be saved to a separate image file.


Laser beam pathway with refective mirrors I want to create a beam of laser light.  The laser beam will bounces off many mirrored surfaces that can change their angle and positions.

This would be a simulator to help me calculate the geometry for the size of mirrors and the area needed.

Has anyone seen a tutorial or can please help explain how this is done?

I created a test blend to verify the concept. You can find it here:

There is a 'laser emitter' which has a simple particle system enabled, along with three 'mirrors' with very simple collision enabled. Also, the scene has had gravity disabled.

Once you open the blend, immediately look at the particles property page on the right side. Look for and click the 'Bake' button. Then go to the Timeline at the bottom and click the play button.

You should see a flow of 'photons' being emitted from the 'laser', bouncing off the mirrors.

Adjust the mirrors to your liking. Make copies of the mirrors to add more.

After any adjustment of the mirrors, click the 'Free Bake' button. It will free the computed particles and the button will revert to the 'Bake' button once again. Click the 'Bake' button to 'apply' the new mirror configuration, then play to watch the new laser beam path through your mirrors.

Hope this helps.


Low res texture in UV map with repetitive polygons I have a really simple object with less than 20 polygons, that is used on a platform for my game. I was able to model and unwrapped it, but I want to resize all the side polygons so they are 32px high, and stack them together (as they are all the same).

Also, I wanted to know if it was possible to set the resolution of the UV-map viewport (where the 2D texture is displayed) so it has a resolution according to my target texture, and the polygons faces are aligned.

Here is the picture of what I have done so far:

In the UV Editor (as shown in your picture), select one of the 'sides' (position the mouse cursor over one and hit L) then hit ctrl P - this will make it fill the image vertically at 64px high. Now scale it by half S (.5). Do the same with all the other 'sides' (not the top or bottom), they should now sit neatly one on top of the other, and be 32px high.
Position the 2D Cursor on one of the vertices at the bottom of the 'sides' (select a vertex and hit shift S > Cursor to Selected),

and then set the pivot to 2D Cursor.

Now grab G the 'bottom' and position one of it's vertices on the 2D Cursor and then scale (S) until the next vertex lines up as shown.

Do the same with the 'top'. Now all resolutions should be the same and the sides will be 32px high. I hope this solves the problem.


Animation not working after appending node group I have a question concerning node groups and animation.

I have a project in two files, both containing node animations. But, how can I merge the two node configurations together?. Of course I can re-create the node circuit manually in blend2; So I did. But then I thought there had to be a better way to do this, and the words Group and Append came to mind.

The appending process worked; but to my surprise, when I connect the appended group to the node circuit of blend2, everything works except for the animation.

Is there any specific step or configuration required to append the actual animation together with the rest of the imported node configuration?

Even though my question is generic, the two blends are available (if required).

Thanks in advance for all your help.

Sept

The animation data is getting ported with the node group, just not applied. You can import a whole scene and it will work fine.

No solution has been found to re-link the animation data.


Blender 2.8 - where is Multiple Importance Sampling? I am working on  my render and I have an hdr word background, I am trying to activate Multiple Importance Sampling like in previous Blender and I can't find it. Anyone knows where is it or what changed? thanks alot in advance.

It is under the Properties Window > World Settings > Surface change Sampling from Auto to Manual.

Multiple importance sampling is only available for volumes, under Volume > Sampling change from Equiangular to Multiple Importance.


Blender crashes with GPU installed On a recently assembled computer, attempting to run the BMW Benchmark using CPU render causes the screen to flickers after a few minutes and blender crashes, while using GPU render works fine. After removing the GPU and installing Intel Integrated Graphics drivers, the CPU render completes normally. I think that it could be the Nvidia driver version 398.82 which is causing the issue. Does blender recommend a specific driver to use?

Specifications:

i7 8700K stock speed

Gigabyte GTX 1080 Ti

Windows 10

If you had internal GPU and dedicated GPU then something is wrong while detecting the GPU.
Disabling and re-enabling the dedicated GPU would solve the issue.

I hope this helps you


Can you export stl file from one object in one layer? I had several pieces of a project in different layers.  After modifying a piece in layer e.g. 4, it was selected, active and in object mode.  I selected 'export', 'stl' and executed.  The file statisics show a very large file, and when I import the stl file, the entire project, from all layers, show up on one layer.
What did I do wrong?
TIA

When exporting from File > Export > STL in the file browser tool shelf, in the bottom right tick the option Selection Only.

This will export you current selection though, I don't think there is a direct way to export current layer only, but you can easily select all visible objects if you turn off other layers so it should suffice.

You may need to be in object mode for this to work though


Texture and Color mixing I need to mix 1 gray-white texture with yellow color.

Here is a model with a gray-white texture without the applied yellow color.

I was able to apply a yellow color through the nodes, but it does not appear in the render.

I need the same result, only to make the model yellow in the rendering.

please show me where I made a mistake =)

You cannot mix a color(or a texture) with a shader in Cycles. You are currently mixing a texture with a Diffuse BSDF shader - that's the problem. It will be enough to disconnect it and set the color directly in the MixRGB node to fix this.

If you wanted to have a separate node for the color for some reason(for example if you want to connect it to multiple inputs so you can change them all at once), you can use RGB node that you can find among Input nodes.


Merging a shape onto another shape and removing excess polygons? Diagram: Black shape is base shape that I want the Blue shape to merge onto. I am guessing I can fix the way they bond afterwards.

I want to merge the two shapes into one so that they are no longer separate in Edit Mode. I then want to delete any hidden faces and maybe tidy up where the ramp faces meet the hexagon as well as delete the submerged base of the hexagon in line with the cylinder top.

Here is another diagram of what I mean...

Thanks again!

You can bool the shapes directly in Edit Mode, as long as they exist in one single mesh already. If you have two different meshes, joint them by selecting both and hitting Ctrl + J. Then make sure the normals are all pointing outwards (Ctrl + N recalculates normals if they are off), otherwise the boolean operation fails.

Now, select one of the meshes: Select one face, and using Ctrl + L select all connected faces), and using the Spacebar menu search for Boolean, like this:


Particle Systems adding margins and placing on top I am trying to place cubes on top of a plane using particle systems.
However, I have two 'constraints'.
I do not want my cubes to be going too near the edge of the plane. Therefore I kind of want to add a margin to my particles. (I don't want to use weight paint because I want to be able to automate this with the blender python framework.
Also, my cubes are currently going through the plane, whereas I want my cubes to be placed ON TOP of the plane.
What particle systems settings should I be looking at? I can't find anything helpful online except outdated responses.
Thanks in advance

We will be changing the origin position of the cube. The particle system works by attaching the origin point of the selected object to the surface of another. By changing the origin point, we can also change the position of every particle on the object.

Select the object to be used as a particle (the cube in your case).
Go into edit mode, and press A to select all vertices.
Move the cube geometry.
Go out of edit mode. As you can see, the geometry of the cube should have moved, but the origin point remains the same, effectively changing the origin point of the cube.

As for the part where you need to add a margin, a simple fix that I thought of (and should be easy to make using python) is to duplicate the plane and scale it up. There are no settings in the particle system that allows you to create a margin to my knowledge that doesn't involve using some sort of painting.


Get surface area of a mesh? How do I get the surface area of a mesh? Preferably no python involved.

Enable the '3D Print Toolbox' addon.

2.79

Open the '3D Printing' tab in 3D view > Tool shelf.
Under statistics, press the Area button. (there's also option for volume and other checks for geometry).

2.8+
The Addons shelf has been moved on the right of the screen. Press N in the 3D Viewport or click the arrow in the top right of the area to expand it.


How to use Blenders GUI? I was making a game with blender like creating buttons and stuff but um... I don't know how to use Blenders API, or GUI. I wanted to create functioning buttons and creating user input on the screen like you would in Tkinter for python. I am really confused on what to do with Blenders GUI stuff... I meanm like how to access and create stuff with it. So is there a way to use Blenders API (mainly I want to have control over blenders GUI to do what ever I want)?

And when I import blenders game engine like this "import bge" or "from bge import *" but it says model don't exist. What should I do? am I missing a module?

You may be able to learn the Blender interface while working on your game, but I suspect that this is more of a challenge than you need to take on. If you're totally new to Blender, I think you'll find it salutary to gain some familiarity with the Blender and the Blender interface tools by working through one (or both) of two online courses, one by James Chronsiter at [http://www.cdschools.org/Page/455], with video supplements at [http://4chron.home.comcast.net/~4chron/CDCADTutorials.htm], or alternatively Neil Hirsig's course at [http://gryllus.net/Blender/3D.html]. These will give you a solid introduction to the interface, and some introduction to the BGE.

There are also a number of books available that can help, including free downloads from Wikibooks [http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro], and a book by John Blain (a bit out of date, but still using basically the same interface as the current edition), [http://download.blender.org/documentation/pdf/John%20M%20Blain%20-%20An%20Introduction%20To%20Blender%203D%20-%20A%20Book%20For%20Beginners%20%282011%29.pdf]


How to split objects to increase effective resolution of particle effects Blender has a hard limit of 250 for the resolution of its particle effects. I am using Blender to "voxelize" complex 3D models using its particle system in a tight grid of cubes, and I am trying to find a way to increase the effective resolution by applying the particle effect to parts of the model separately instead of the whole model at once. For example, if I split a model in half my effective resolution can be as high as 500, as I can apply 250 resolution particle effect to each half. I would like to be able to do this splitting procedure in Blender with python. I need the model to be clean so that the particle effect works as intended (is as close to the original model as possible). The method described to me here in a previous question of mine did not work for me, as the cut meshes did not work well with the particle effect.

As the particle system is just a way to obtain the result, I propose to do it another way. A script was needed anyway, so the following script does a voxelisation directly.

Instead of PS, it uses a script and dupliverts.

The script creates a mesh with vertices only so that the duplivert can be applied:

It takes a mesh as input
Calculates its boundings
Maps x, y, z inside the boundings at voxel size steps
Then uses a BVHTree to test the distance of these (x, y, z) to the original mesh

Once done, you just have to create a cube at the same voxel size and parent it to the generated mesh (with duplivert).

From that, you may want to make an exportable mesh:

Select the dupli
Use the menu 'object>apply>make instance real'
Select the instances and join them

Performance: tested on this bunny at 2mm voxel size. That's about 350k vertices. So 1mm should be around 8 times this amount.

The calculation is relatively fast, but once the duplivert set up, Blender becomes a bit slow.

The script:

import bpy
import bmesh
from math import ceil
from mathutils import Vector
from mathutils.bvhtree import BVHTree
from itertools import product

# Create an object from vertices only
def create_object( context, vertices ):
    mesh = bpy.data.meshes.new( "voxel" )
    obj = bpy.data.objects.new( "voxel", mesh )
    context.scene.collection.objects.link( obj )
    bm = bmesh.new()

    for v in vertices:
        bm.verts.new(v)

    bm.to_mesh( mesh )
    bm.free()

    return obj

# Get object bounding as min max vectors
def boundings( obj ):
    min_x = min( (Vector(b).x for b in obj.bound_box) )
    max_x = max( (Vector(b).x for b in obj.bound_box) )
    min_y = min( (Vector(b).y for b in obj.bound_box) )
    max_y = max( (Vector(b).y for b in obj.bound_box) )
    min_z = min( (Vector(b).z for b in obj.bound_box) )
    max_z = max( (Vector(b).z for b in obj.bound_box) )
    return Vector( (min_x, min_y, min_z) ), Vector( (max_x, max_y, max_z) )

# Voxel
def voxelize( context, obj, size ):
    # Get boundings
    min_bounds, max_bounds = boundings( obj )
    # Delta vector
    delta_bounds = max_bounds - min_bounds
    # Vertex count in all dimensions
    counts = Vector( (ceil( delta_bounds.x / size ), ceil( delta_bounds.y / size ), ceil( delta_bounds.z / size )) )
    # Reajusted starting position
    starts = min_bounds - ((counts * size) - delta_bounds) * 0.5

    # A BVHTree from the mesh
    depsgraph = context.evaluated_depsgraph_get()
    tree = BVHTree.FromObject( obj, depsgraph )

    half_size = size / 2.0
    vertices = []
    # Cross products of the wanted ranges
    for x, y, z in product( range(int(counts.x)+1), range(int(counts.y)+1), range(int(counts.z)+1) ):
        # Corresponding position
        vert = starts + Vector( (x * size, y * size, z * size) )

        # Test the proximity to the mesh with the BVH tree
        result = tree.find_nearest_range( vert, half_size )
        # If close enough add the location
        if result:
            vertices.append( vert )

    # Create an mesh from the result
    return create_object( context, vertices )

# Get current object
obj = bpy.context.object
# Define voxel size
voxel_size = 0.002 # <<< Change this to change the resolution (in meters)

# Create the voxel
voxelize( bpy.context, obj, voxel_size )

The file with low res voxel:

Another example:

Complements:

To use the script:

This is not an addon to Blender, so you have to open a text view in Blender, create a new text and paste the code in it (same way it is in the uploaded blend file)
The script contains a parameter in the line commented '<<< Change this to change the resolution (in meters)' above. This 'voxel_size' parameter corresponds to the size of the cubes
Then select the mesh (active mesh) in the 3D View and run the script using the button 'run script' which is on the top right of the menus of the text view (you can also use AltP when the mouse is in the text view)
The calculation starts after that and Blender may hang for some seconds. This calculation time depends on the 'voxel_size' parameter and on the mesh dimensions. The ratio 'dimensions/voxel_size' power 3 gives the voxel cubes amount. I preconize you start with a relatively high value for voxel_size so that there is few cubes in result. After that and depending on your configuration lower this value.
Once done, the script has create a new mesh which is vertex only (no faces). You'll have to follow what is written above about dupli and parenting to make a base cube of voxel_size dimension fill the mesh


Can't use pen to navigate in viewport When I middle click, as soon as the pen is in hover distance, the blender viewport starts to rotate, and if I were to try to rotate again, the rotation will snap depending on where on the screen I put my pen.

I want it to behave like when I touch the pen to the surface, it starts to rotate as I move the mouse from that position and when I take the pen off, the rotation stops. But basically anytime I have middle mouse down even without touching the screen, it rotates wildly. The same is true if Im trying to zoom or pan.

Also, the emulate middle mouse button doesn't do anything.

How do I fix this? Thanks!

the emulate middle-mouse button does not directly navigate for you when you use the pen, rather it adds a key or keys that in combination with the pen touching and moving navigate like with the mouse.

In that regard, once activated, the Alt button held down will be used to rotate with the pen like you would with the MMB.

If you use Alt+Shift, you can pan the screen like you would with Shift+MMB.

And using Alt+Ctrl gives your pen the zoom based on moving up or down movement like you would normally do with Ctrl+MMB.

As you can see, the emulation essentially replaces the MMB with the Alt key. So some other functions like loop select that would normally use Alt+LMB, will have other keys like a double LMB(click).

Happy Blending.


how can I cut a sphere by selecting all the faces that intersect a plane? I have a sphere made of 512*256 faces. I'd like to be able to cut the sphere so that only a thin ring remains.
I attach a picture of the objective, I have manually selected a portion of this ring, the problem is that the sphere is so dense that selecting the faces at the poles is difficult.
My objective is to select only the faces that touch the meridian, so that the ring actually becomes thinner at the poles.
Any suggestion on the workflow? I thought I could add a plane and then select the faces that touch this plane, but I have no idea how.

Go into front view 1 on numpad, go into wireframe mode tab and press B. Then you can select all of the faces you want. With the faces selected, press P and Separate by selection.


Object disappear from 3d view but show in outliner and edit mode is disable Object disappear from 3d view but show in outliner and edit mode is disable
what happen ? hundred of object are invisible

export to .stl and it still exists

Could they be hidden? Try Alt-H with the mouse over the window in object mode.