Why are my vertices all disconnected? I built a character using the mirror, skin, and surface smooth modifier, and when I was ready I applied visual geometry to mesh and deleted half the character, then re-added the mirror modifier so I could start sculpting the vertices directly.

At first each vertex moves normally, then suddenly its like all the vertices are disconnected from each other. The odd thing is that the edges and faces move normally, they warp as if they're connected, but the VERTEXES do not and this is the second character I've had this experience with.

I've tried merging vertices and this changes nothing. I wonder if perhaps they're not disconnected but I've accidentally toggled something that disconnects them when I move them?

Can anyone help? I'm also only about 3 days into using this program so I'm definitely a beginner. Thank you!

UPDATE: As of right now this isn't happening anymore. I reopened the file and everything was magically stuck back together, so I think it might be a bug of some kind. If it happens again I will upload the file. Thanks for your comments and advice.

UPDATE 2: I'm having the same problems! I'll upload the file so you can take a look at it, also uploading another image to show how every vertex seems to move independently. This seems to start when I select the whole mesh and write "merge by distance", suddenly everything is disconnected and won't merge back together again. What's happening?

While I'm not certain what process you went through that resulted in your edges being split wierdly, you should be able to fix all wierd verts on the model by selecting all, pressing Alt+M and selecting "By Distance". This merges vertices that are X distance from other vertices.


Movie clip editor playback problem Edit: It seems the problem is the format of the video file, Inter-frame and stuff, as converting it to an image sequence works perfectly (but awfully slow), I will try to convert it to another codec and report. Report: Apparently using intra-frame format makes the file big and slow as hell, same as image sequence. But at least it works.

I'm learning about motion tracking, and I'm having a weird problem. In the movie clip editor, the video is kind of stuttering and jumpy. At some frame it would freeze for 3 or 4 frames then continue, but skipping those frames ( sometimes continuing from the frame it stopped, or jumping back, resulting in the video losing some frames and becoming a complete wreckage ), while the trackers would act as if there was no stutter at all (their motions match the motion in the original video). All other video players haven't this problem. Using another program and played frame by frame aside each other, Blender is completely out of sync with the original.
An interesting thing is that when I reload and prefetch the clip again, the problem is gone, the clip plays smoothly and the trackers match up nicely, but after some time of working, it returns, and it always does when rendered.

This happens at many points in my clip, and when rendered the 3D objects seem to be out of sync with the video. I have tried rendering the 3D elements as transparent and later putting in on the video, and it works much nicer. Any help will be appreciated.

I'm going to take a guess and say that your video is somehow corrupt, or you are dealing with issues with a delivery codec, meaning a highly compressed video files that use long GOP compression. Let me guess: h264, mp4, mts, AVC or AVCHD... or if we are talking about something recorded from a computer game... could be that you have one of those horrible videos that uses variable frame rate...

In any case there are a couple of solutions.

If your system has plenty of RAM, increase the cache size on the system preferences>System>Sequencer/Clip Editor>Memory Cache Limit.

Other thing to do is to transcode your video to an image sequence and use that to track instead.


Texture brush doesn't make clear or smooth geometry on sculpture I have a fairly dense sculpture over (1.5-2 million verts). I downloaded a texture! And assigned it to one of the brushes textures! When I tried sculpting over the sculpture,even with dyntopo and applying scale to the model, it kinda made a lowpoly stroke rather than a smooth stroke, what could be the problem?  Isn't it how you add details to your sculpts?  Thank you!

These so-called Alpha brushes require a very high polycount to look good. I've done some tests with the Lips Alpha brushes by Todor. You can get the Light version here for free (https://gumroad.com/l/lipsfree) if you want to try it out yourself. It comes with a short manual for the brush settings.
The following images show the included example blend. The lips are low-poly with a Multires modifier, with 3, 4, and 5 subdivisions. 6 subdivisions (=2.4 million vertices) show no improvement in comparison to 5 subdivs.
If you have a fully sculpted character or creature you will end up easily with a few million verts like in this video: Create High Resolution Sculptings in Blender (24 million verts)
If your PC can't handle such a high amount of verts you can use a Bump Map and paint the details on a texture as shown here: Node Based Texture Painting in Blender 2 8
Hope that helps :-)


Wired face after boolean modifier that make the faces impossible to texture I am trying to apply texture to these faces on my model, but the texture is messed up as shown in the image because of the wired face I get after I used the boolean modifier.

I want the brick texture on nicely without any wired stretch or rotation.

Booleans will often not take into account surrounding vertices, edges, etc, and just cut away what they need to. You'll probably need to go in and do some surgery to the mesh itself to straighten things out a bit, or you could back out, subdivide the main rectangle first, then do the boolean routine.   Hope this helps!


Moving mesh in object mode, armature is not moving, mesh stretches im trying to do a robot walking animation, i already did a walking cycle im quite satisfied with, but when i try to move the robot in object mode, the armature does not move and the robot stretches. Anyone know where could be the problem?
Here is the blend file : https://en.webshare.cz/#/file/ZuNNgzrKUF/anim-2-blend

The issue was caused by proportional editing feature in blender.


Edit tab not in Tools panel I do not have the Edit tab in the Tools panel.

Assuming 2.79: it only exists in Object mode.

Select this mode from the header/footer of the Viewport (or, if you are in Edit mode, just hit Tab)

If you are using Blender 2.80+ and following a <2.79 tutorial, then most of the transforms that used to be under Tools > Edit are now in the header of the Viewport under "Object".


Why do my bones displace model objects? Sometimes when i move objects around the attached bones displace the objects. Why does this happen.

Is it correct to assume that bones should NOT overlap with a model poly? Would this prevent object displacements upon object move?

While an armature has not been adjusted in pose mode the object it deforms can be moved without being deformed. Once an armature has been moved in pose mode and the object is moved in object mode without the armature some weird deformation can happen. This is caused by the way the armature and object are linked together.

Once an object and armature have been linked, they need to move together as one. Normally the armature will be the parent of the object and should be moved in object or pose mode to relocate the object.


Cannot resize the part of the object while the viewpoint is fixed at the zero point of the axis I'm using blender to modeling an object, but I can't resize the part of the object while the viewpoint is fixed at the zero point of the axis，how to solve this problem?

Try to switch the pivot point (point that acts as center of rotation and scaling) from "3D cursor" to "Median point".


How to install a Blender Plugin? Trying to install the CATS plugin (https://github.com/GiveMeAllYourCats/cats-blender-plugin)
I extracted it and it was a bunch of confusing files, no .exe files in sight. I downloaded this as a zip. What do I do?

I think you do not need to unzip the archive. Go to Edit > Blender Preferences, then choose Add-ons section from the sections on the left side and press "Install an add-on" button on top, browse for your zip file, choose the file and press "Install Add-on" button on the bottom next to Cancel button, after add-on is installed you need to enable it.


Edit Mode - XRay Clutter - Edges/Faces/Verts The picture on the left is a subdivided Cube in a fresh new project in edit mode.
The picture on the right is that same cube in edit mode but in my current project.
As you can see: obscured edges are partially visible, without me toggling Z.
There are slightly less edges visible in perspective view (as opposed to orthographic) but it is still significant enough to cause clutter.

I've tried porting the project from 2.8 to 2.81 but it seems to be project specific.

How do i get get rid of this pseudo x-Ray effect and display only the edges/faces/verts that are not obscured?
Any pointers?

Probably you just toggled the actual X-Ray mode

and changed its alpha value.


how to fix jagged vertices I've been having trouble with jagged vertices happening in more detailed parts of my sculpture. I've tried just selecting those jagged areas and subdivided so I could just using the smoothing tool, but they don't divide, the other areas around will though. I've also tried just smoothing the area then trying again, but because its all one area, it comes up together and is all jagged again. The only other option I see at this point is to subdivide the whole sculpture, but I'm afraid if I do that once or twice again I feel like that will create to many vertices and crash the program forever, this is what happen to my last version of this project. If you have any solutions, please let me know

Thoose jagged artifacts are happening because you're trying to push the geometry over its natural boundaries: the mesh should remain evenly spaced, manifold, without overlapping and intersecting geometry.
This can be reached with more subdivisions and an accurate building of the strokes.
3k vertices is extremely low for a sculpt, this level should be used only for defining main planes and forms, further details need lot more geometry, it's usual to go up to 100K for a mid detailed model, and more than 1 milion for a full detailed one.
Make some experiments to check which is the number of vertices your machine can handle without crashing or lagging, and make use of Dynamic Topology, which adds geometry only where you sculpt.
During learning process, I find it useful to turn on the geometry viewport overlay, to better see the effects of strokes and dynatopo.
Be aware anyway that fixing the problem with so little geometry is simply impossible.


Why do baked textures turn out checkered or blocky? I've been having issues with baking textures recently and I have no clue how this happened and how to fix this. If anyone has suggestions or solutions I'll gladly accept them. Thanks]1

Try to increase/decrease that parameter before baking:
Render - Baking - Ray Distance.
Begin with small ray amount - 0.1 or around it.
Also, some information from this video also can help:
https://www.youtube.com/watch?v=0r-cGjVKvGw

P.S. As i can judge by shape - you unwrapped your mesh properly? Re-check it, just to be sure.


Fluid - "pancakes" instead of flow I did the usual water simulation, resolution divisions is 100, initial velocity on normal is 15 (extra fluid speed). I wanted to get usual flow, but I have this (picture). How to fix it?

This probably has to do with the timestep rate. The fluid is moving so fast that the timesteps are too little in order to accurately capture the motion, causing the "broken apart" effect you are having.
Just go into the simulation settings and bump up the "maximum timesteps" value.


How to create a realistic jelly sweet that is dusted with sugar? A sphere or hemisphere of jelly sweet would suffice.  Or a square? Whatever shape you decide.

Mesh: Default Cube with single loop cut Ctrl+r and the top Face scaled. With a Subdivision Surface modifier and Smooth shading.
Feel free to make this mesh a bit less "perfect".

Attempt 1: Just using materials.

Looks complicated but it can be broken down into simple areas.
The Far left Object Info and ColorRamp are just so any duplicated meshes get a random colour.

This leads into the base Diffuse BSDF which is mixed with a bit of transparency using the Fresnel as the factor.

Then the top set of nodes use the Generated texture coordinates through a Noise Texture (with quite a large Scale) into a constriction ColorRamp. If you play with the colour stops you change the pattern and distribution of "sugar". We then use a Bump node to create a Normal Displacement to give the "sugar" depth.

Attempt 2: Particle Emitter

Add another Cube (I have named mine "sugar") and setup the particle emitter settings for your sweet mesh.

I am opting to use an emitter not hair. The End is set to 1.0 so the particles are all created instantly. Render Object is set to "sugar". Children is Simple and size set to 0.25. Render is set to 10 but you can tweak to increase the total rendered amount.

FYI I added an Emitter Shader to brighten them up this time.

There is lots of room for improvement but I hope this gets you started.


Joining two rigged models I currently trying to join two rigged (and animated) models, which both has separate meshes, separate bones and separate animations. The first mesh is the horse while the second mesh is human:

So I am interested to join human model onto horse model to make a rider:

I think the best way would be to make horse as a parent and human as a child during the join process. In that case I would like that all horse animations (there are 3 of them - idle, walk and run) would remain as they are, while I can lose human animations, as I will need different ones for it. I was also thinking to make human root bone as a child of one horse back bones, that when horse moves up and down it would move entire human mesh together. It would be also good to keep the same weights that human bones would not start deforming horse mesh and vice versa.

I tried to use Ctrl+J by selecting various combinations between bones and meshes in object mode, however, I noticed that it messes up scaling and rotation of the child object. So I was wondering how it would be possible to properly join these models to create a rider?

Have you tried doing exactly this selection?

Select the rider armature (in object mode).
Shift-select the horse armature (also in object mode).
Then do Ctrl+J.

If you've already tried this, ensure all the meshes' object transforms are zeroed out first, and then repeat the above.  If that still doesn't help, check out any constraints/controls you have.  If you have a master-slave style rig, you'll probably have to re-apply the constraints after doing the join.

Posting a .blend would help too.


drop with a specific shape into a quiet liquid water surface with mantaflow I'd like to realize something like this
https://www.youtube.com/watch?v=RLn1ErhxOPo

With the previous fluid simulator in Blender I was able to set a shape as a quiet basin of liquid, and another shape as a falling drop of the same liquid, and when the two meshes touched they interacted accordingly.

Is there a way to do that with mantaflow?

I'm very new to this simulator and I can not find proper documentation online yet. Any hint is well accepted!

Thank you, Riccardo.

I was also trying to do something like the video. I was able to do it on blender 2.8 but not with mantacore.
After some tries I was able to get something similar (materials pending). The following images are from blender 2.90.1. If anything else needed let me know.
Water:

Ball (crosses the water object in 10 frames and has the scale of 1/3 of the water object)

CollisionBox part 1:

CollisionBox part 2:

The final result on frame 30:


How to make a sandbag wall? I need help trying to figure out the best way to make a sandbag wall.
I've tried a few methods, but it doesn't look that good. I could just try again, but before that, I want to know if anybody out there has some tips that I could try out.
I would appreciate any!

I have no issues making the sandbag itself. I just want to know the best to stack them without it flattening everything and going into each other. How would you do this?

Here's how I want them to look like:

THANK YOU in advance!

edit!

Here is what I've done so far:
I created a big mesh I call the barrier to form the shape I want the sandbags to fall into. It was my collision/passive mesh.

I duplicated my sandbag more than 20x and made it to active. I let gravity do the work and this is how it turned out.

I liked it, but I it doesn't look like a bag sand, but a bag of styrofoam.

I combined all the sandbags into one mesh so I can easily edit the cloth physics panel to reflect all of them. Not sure if that was a good idea or not.... but oh well.
I thought doing a weight paint in the middle would help retain the middle and then do the cloth physics.. well that didn't look good. Okay now I know pinning isn't the best choice.

Basically I want the sandbags to stack onto each other and I really don't know how to make it work. I could definitely do this manually, but I was hoping to find out if there was an easier way to do this. Maybe if there's a manual way to go about this without it going through other objects that would be great too.

Thanks again!

Final result:
You can use Array modifiers along with simple Sculpt to achieve similar result. It's a bit more of manual work but it's pretty simple and rewarding at the end.

Mesh:
You will need something similar to mesh from the screenshot. The goal is to have brick-like array. Top part is duplicate of the bottom part, cut in a half and manually placed.

Modifiers:
Here you will need at least two Array modifiers (width and height) or three if you want to have some multiple rows.
One of them (width, in this case X axis) should have checked Merge to connect top part of the mesh.

Sculpt:
When you make the wall with desired size it's time to duplicate it to another layer. To have some backup.
After it, apply modifiers from top to bottom. It's good idea to go to Edit Mode, Select All and Remove Doubles just in case.
You can add Mulitresolution modifier (I've added it with Subdivision 1) but it can stay low poly.
Go to Sculpt Mode, turn off Symmetry Lock X, choose Grab Brush and start tweaking the mesh. Remember to change Brush size/strength once in a while to give it more detailed look.
You can do this with mouse, no need for tablet to do this.

Blend file:
First layer contain mesh with Array modifiers, second one is the final mesh.


Adaptive subdivision ocean modifier I am in the process of creating a large ocean, which I would like to use the ocean modifier for. My scene currently consists of a plane being displaced by the ocean modifier, but I would like to have 5 repeats on both the x and y. With the detail I need, the amount of polygons will be absurd without adaptive subdivision.

Since I can not enable adaptive subdivision when the subsurf modifier is first in list, how can I use the ocean modifier with adaptive subdivision?

Unfortunately, adaptive subdivision (at least as it is now) works by applying the subdivision to the UV dynamically with respect to the view.  It must be dynamic.  However, the ocean modifier obviously radically changes geometry and it does so by modifying a known geometry.  With ASD, the geometry is unknown and is in flux.  For this reason, ASD must be applied last.

This is just a workaround and it may not even be applicable to your needs (and you've probably already thought of it).  It's not adaptive but you can lock the camera to plane and maybe make it appear as if your subject is moving through the ocean.

Create a plane and subdivide it in sections:

Apply Ocean mod Set Geometry to Displace.  Play with settings:

Sorry for the crummy sky hdri:


Grease pencil too dark render EDIT:
Its supposed to look like the first image
Sorry if this is answered already i cant find the answer on the internet but im having a problem rendering this scene
This was the work around i found that works

I dont know if this is the correct method but this one
works for me turn the world and viewport to white


What is and how can I use the bpy.types.UIPopupMenu? I want to use the bpy.types.UIPopupMenu in my addon but it turns out that it can not register.

  (Console:UIPopupMenu does not support registration).

Can i use this class for addons? and how is it possible?

class testpopup(bpy.types.UIPopupMenu):
    bl_name = "Name"
    bl_idname = "wm.testpopup"
    bl_label = "Popup Menue Test"

    info = {}
    def draw(self, context):
        layout=self.layout
        colsub=layout.column()
        split = colsub.row().split(percentage=0.15)
        split.label(text="Some")
        split.label(text="layout")

You don't need that class, just call bpy.context.window_manager.popup_menu():

import bpy

# only executed if run in operator context EXEC_*
def main(context):
    for ob in context.scene.objects:
        print(ob)

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    @staticmethod
    def draw_func(self, context):
        layout = self.layout

        col = layout.column()
        split = col.split(percentage=0.15)
        split.label(text="Some")
        split.label(text="layout")

    def invoke(self, context, event):
        wm = context.window_manager
        wm.popup_menu(self.draw_func, title="THE TITLE", icon="INFO")
        return {'RUNNING_MODAL'}

    def execute(self, context):
        main(context)
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.object.simple_operator('INVOKE_DEFAULT')


Move selected faces/verts towards 3D cursor without scaling If I am in an mesh edit mode, I can select several faces, then press S to scale and set the target to be a 3D cursor. When I move the mouse, the selected faces will start to scale and move towards the 3D cursor.

Is this possible to do this with translation instead of scaling? I want the selected faces to move towards the 3D cursor in a straight line just like in scaling, BUT without any scaling going on. (Another way to imagine it would be pressing G to move it, but it would move in a straight line towards the 3D cursor.)

You can snap it to the cursor using Shift + S and select "Selection to cursor (offset)".


Batch convert smd to fbx files I have thousands of .smd files I need to convert to .fbx files. I have an add-on that lets me import .smd files, but going one by one will obviously take forever. I need the script to search the main directory and all sub-directories for the .smd files.

I'm assuming this is how the script would work:

Get main directory and sub-directories
Put all of the .smd files in a database or something
Factory Restart Scene
Delete all objects in the scene
Import a .smd file
Export the .smd file as a .fbx without replacing the original
Remove from list in the database?
Loop back to the beginning until no files are left?

I know nothing about python, please help me.

Python isn't hard to start learning, try this tutorial. You can use the python console in blender if you don't have python already installed.

You don't need to create a database as you can walk through all files in the directories and just use the filesystem as a todo list. This is the basics of what you want to do but you may want to make some adjustments, you will at least have to swap bpy.ops.import_scene.obj for the smd importer that you have.

import bpy
import os

for root, dirs, files in os.walk('/path/to/smd/files'):
    for name in files:
        if name.endswith('smd'):
            # delete everything
            bpy.ops.object.select_all(action='SELECT')
            bpy.ops.object.delete()
            # adjust this to match the import smd operator
            bpy.ops.import_scene.obj(filepath=os.path.join(root, name))
            # export as fbx
            bpy.ops.export_scene.fbx(filepath=os.path.join(root, name+'.fbx'))

You can paste this into blender's text editor, edit and then click the run script button.


Why do I get this unexpected syntax error on the Python console? i'm trying to get output from a list, but i get a weird syntax error.

facecountt = []
for polygon in bpy.context.scene.objects['Torus'].data.polygons:
    facecountt.append(polygon.index)
print(facecountt[2])

i don't get why it won't work.
whatever i try - for as long as the list is filled with polygon.index i get this error, even when i tried to convert the values to integers.
i can print polygon.index itself, but not within the list.

This behavior is intended and is how Python knows you intend to terminate a loop. You have to end the for block, by pressing Enter on an empty line, before writing anything outside it.

Oppose:

>>> f = []
>>> for p in bpy.context.scene.objects['Torus'].data.polygons:
...     f.append(p.index)
... print(f) #Notice how this line starts with an ellipsis

With:

>>> f = []
>>> for p in bpy.context.scene.objects['Torus'].data.polygons:
...     f.append(p.index) #Hit enter _twice_ after this line
...
>>> print(f) #Notice how this line starts with three greater than symbols

Note that this isn't specific to Blender, the same behavior can be found in Python's default console - just by running "python" from the command line.


Shading / smoothing - how does it work with edges, faces, vertices? There are options in edit mode in Shading/UV to mark faces, edges and vertices smooth or sharp / flat, but I don't understand how do they work and can't find it anywhere in internet. I understand basics and I see difference between smooth / sharp edge. But how are those three (edges / faces / verts) related?

I see I can make a face smooth and this changes the look in Blender, but it doesn't make the edges around this face smooth. Are these unrelated? How does it work then? What is a difference between marking all edges of the mesh smooth, or marking all the faces smooth? What is the point of having all edges around the edge sharp, and the face itself smooth? Or the other way around?

Then there are also vertices which can be smooth or flat, but this seems to be related to edges. It looks like it just changes all edges connected to this vertex to sharp / smooth. Is this correct?

It would be great if someone could explain it a bit.

If you have a cube and you set everything to render as smooth, then the faces of the cube will be shaded as though the object were a sphere. You can still clearly see that it's a cube since that's obvious from the geometry of the mesh, but the shading will try to behave as best it can as though the cube was actually smoothed say using the subdivision modifier.
Now take a cylinder. If you create a standard cylinder then you can clearly see that it's not perfecly round, that the sides are made of 32 faces. In order to make this appear perfectly round you could increase the resolution of your mesh, which would lead to worse performance and longer render times, or you could just change the shading to smooth. Now if you change the shading to smooth for the whole cylinder then the shading will again try to make the cylinder look as though everything was smoothed, that's good for the sides, but it's not what you want for the caps, since you still want the cylinder to clearly be seen as such. That's when you'd need to go and change the shading of individual faces of your mesh in order to maximise the appearence. Go to edit mode, select only the top and bottom faces (the caps) and mark them as flat. Exit edit mode and you'll see the cylinder displayed perfectly, smooth on the sides, but flat on the caps.


How to recalculate bone transforms/constraints to originate from armature origin point? I'm trying to make an export script, and I need all the exported bones to be positioned at the armature's origin point. The trouble is that I would like to be able to position the bones anywhere in the scene so that the animation process is more efficient. While for me it is quite doable if I only work with individual bones, the complicated part for me is that I also want to be able to add constraints and other bones it would be linked to. (These would be discarded in the export process)
Here is a link to a blend file. In that I have two rectangles which are each applied to a bone. "BoneTransform" has a bone which is located some place other than the origin point, while "CursorTransform" has a bone which is located at the origin point. My basic desire is to be able to animate with an armature set up like BoneTransform, but for the export to output the transformation data of CursorTransform with the added twist of constraints and what not, so please address this in any answers which you might post.

I found a solution for myself. However, it regrettably does use bpy.ops. If anyone has a solution which does not use bpy.ops I'd gladly take a look at that answer.
Here is the blend file for anyone who wants to take a look.


All addons are disabled I just tried to install Node Wrangler. When I went to enable it, the box was greyed out. But not only the new Node Wrangler addon, ALL of them! Every single addon is greyed out so that I cannot click the checkbox to enable them. How can I fix this and enable my addons?

I figured this out. Turns out, it was just a huge oversight on my part. I had simply neglected to actually CLICK the checkboxes. All plugins are functioning normally


Curve Bevel going outwards not inwards How come my bevel is going outwards and not inwards? I'm trying to create molding but can't get it to go in the right direction

Two way to do this :

Rotate the bevel object in edit mode 180°
Select the curve ( not the bevel object ) , enter Edit mode and select all points with A (or twice) than adjust the tilt angle from the transform panel :


How to use AN struct from a script node? (Animation Nodes) I have a Dictionary that is created by a script running in a subprogram node. I want to output the dict from the node, but it seems Animation Nodes doesn't support regular python dictionaries. Apparently it uses its own ANstruct and various struct nodes instead? So I am trying to output my dict as an anstruct. I set the script node to output a struct type with the same name as the dict, but it is empty.

What do I do to get my dict to be a struct? Or is there any other method to handle this problem?

Looks like you can use ANStruct() in place of a normal dictionary and add to it with the usual commands. So instead of dict = {}, do dict = ANStruct().

But there is a big caveat that doesn't seem to be documented anywhere. When working with a regular dict, you'd add to it with: dict['key'] = value. But ANStruct actually has a 2 part key, with the first part of the key being the Animation Nodes Type (ie, Text, Integer, Text List, etc). So you actually need dict[('Type', 'key')] = value

If you don't have the two part key, you'll get errors when trying to use the outputted Struct with the various Struct nodes, or when trying to Print it.


How do I make a render with a background image in Blender Render? How do I render an image behind my objects using Blender Render?

Let's say I have a cube.

How could I render this cube with a background image shown. Like when you press Numpad 0 with a background image selected in properties?

I've done some googling and all I found is how to do it in Cycles.
My last resort is to edit my render in a photo editing program. But I hope I don't have to do that.

Thanks!

The are plenty of ways to do this.

Place a texture on a plane in the 3D View. UV Mapped plane.
Render with a transparent alpha for the cube.  Place on background image by whatever image processing means including GIMP or the Blender Compositor.
There are also HDRI images free for the background


Format IntProperty/FloatProperty in GUI layout.prop? Is there a way to format how the value of Float/Int properties are shown in python blender GUI?

Right now it's always the same 'text' + 'value' (+ 'unit' if specified in the prop options).
But what if I want to display
f"text {value} text"

Or even better, format the value with thousands separators?
f" text {value:,} text"

Having a formatted text inside the active part of the UI component is not possible, as far as I know.
What you can do, if it suits the UI you would like to get, is to put a label before and after the component with the value, and display only the value.
row = layout.row()
row.label(text="prefix")
row.separator(factor=1.0) # Optional. just in case you need more space between components
row.prop(propertyOwner, "property", "text="") #will display the property value without the text inside
row.separator(factor=1.0) # Optional. just in case you need more space between components
row.label(text="suffix")

Or, if you don't need the value component to be interactive, you can just draw a simple label, which you will be able to format as any Python string.
str = f"Prefix {propertyOwner.property:,} Suffix"
layout.label(text=str)


Why isn't merge by distance allowing me to merge doubled vertices from different meshes? Starting with a pyramid on top of a cube, selected all, and click merge by distance with an appropriately small distance with the intention of merging the points at the base of the pyramid and top of the cube:

As you can see, 13 verts selected and zero merged.
Now if I increase the merge distance to the point where it may merge multiple points on the same mesh, I get this:

So merge by distance IS working, it just doesn't want to be the tool that combines meshes. Why?

The merge by distance work on single mesh data only. It doesn't need to be connected, but at least same mesh.

Usually you will need to join two meshes first and then merge doubles vertices. As an user dominant program, Blender should not do anything that user was not expecting for. It could be a good feature to make an option in operator. But multiple meshes editing is a new thing in 2.80, this is a new use case that developer need to consider.

So you might want to file your request as described here


How can I use hair dynamics with instanced geometry and have it deform like hair? I am trying to figure out how to make an animated wheat field with ears of wheat swaying in the wind.

What would the simplest way to achieve that.

I already modeled the wheat and made some variations and added it to a group but i am not sure how to get it to deform using hair dynamics.

To instance geometry onto hair particles and have them use hair dynamics I created the geometry.

Then I added a plane with a hair particle system using dynamics.

On the geometry to be instanced using the hair I added a Particle Instance modifier and selected the plane containing the particle system as a target as the target.

The orientation of the mesh was not what I expected so I activated the create along paths option in the particle instance modifier. Orientation was still off.

I edited instanced geometry and changed its orientation by rotating it on the X axis 90 degrees, and presto!

Adding a turbulence force field with a high strength (23) that deformed the hair and the instanced geometry along with it.

Here is the blend file to dissect. Blend File


Reproducing the "From Instancer" example from the Blender documentation Is anyone able to reproduce the From Instancer example from the Blender documentation? Checking the option From Instancer in the Texture Coordinate node gives no effect in Blender 2.83.2 for me.
Here is my Blender file:

1 - This is for Cycles only
2 - You need to be in Rendered mode (not Material Preview)


What is the key for the curve modifier to work properly? I created a snail-shaped curve using Bezier curve, and a straight tube using BMesh. I hope to deform the shape of the tube, so that its long axis follows the path of the curve, but the modifer does not give me the right outcome, no matter which axis I chose (neither did the translation work). Is there anything I missed? What is the key for it to function properly?
The file is attached here:

It will simplify if you set the origin of both your objects to their geometry (right click and Set Origin to Geometry)
Once done, put the 2 objects at the same location (select one object, press ShiftS > Cursor to Selected, select the other object and ShiftS > Selection to Cursor)
Create some edge loops all along your tube if you want it to bend
Give it the Curve modifier with the curve as Object


Why can't I adjust proportional size? I am new to blender and am trying to grab only a part of the mesh and move it with the sphere tool for the falloff. I read that you press g and scroll up and down to make the scope bigger/smaller so you don't move the entire mesh, but when I do that, a dotted yellow line and square appear instead and the whole mesh starts rapidly moving around.

I would really appreciate some help on this, it's driving me insane!

You have to select proportional editing first(at the bottom the 3d view), then hit g to grab.


How do I keep in development add-ons under source control and easily reload changes in Blender? I've been developing Blender add-ons for a while now, and one thing that I've always struggled with is how to keep a single copy of the add-on so that I can make changes to the code and quickly test in Blender AND have it all under source control. I don't want my Git repository inside Blender's add-ons directory, as it can easily get deleted by Blender (via the remove add-on button), and it enforces a particular folder structure on the repository.

Currently, I mainly use an external text editor (Sublime text) to work on the add-on, and then zip it up and install when I want to test my changes. As you can imagine, this is slow and laborious, so I'd rather work in a way that allows me to simply reload the scripts and have everything work, but not have to copy changes from the Blender folder back to my source repo.

I'm sure this must be a solved problem, so could someone explain how I can set up my repository so that it's safe from accidental deletion, but can easily be reloaded in Blender.

This is my workflow for developing add-ons outside of the Blender add-on directory:

Save script files in text editor
Run a script to copy script files into Blender add-on directory
Reload script files in Blender

Run a script to copy script files into Blender add-on directory

When you install a .zip add-on installation file inside of Blender, the application simply unzips the file and places the contents into your Blender add-on directory. You can also install the add-on by placing the script files manually or using a script to copy the files.

The add-on directory location depends on your operating system. A quick way to find the location of a specific add-on is to select the add-on in the Preferences > Addons menu and look at the File attribute:

There are many ways to create a script that will copy files from one location to another. Some examples are:

A Windows batch script (.bat) using the xcopy command
A MacOS/Linux shell script (.sh) using the cp command
A Python script (.py) using the shutil module

Reload script files in Blender

Once you have your scripts copied over, you can reload your scripts in Blender using the Reload Scripts operator:

in Blender 2.79: F8 hotkey
in Blender 2.8x: F3 > Reload Scripts

An important thing to note is that the reload scripts operator will only reload your __init__.py script and will not reload other add-on script files. See this answer for how to structure your __init__.py script to reload other scripts and modules: https://blender.stackexchange.com/a/28505/81365

You can also restart Blender to update all script files.


How does the fac on Mix Shader work? So if I plug in a black and white image to the fac of the mix shader node, what is happening? What's the difference between when A and B is connected to each socket and when A and B is switched to the other socket(basically switching two lines of wires each other)?

When you connect a BW image into the FAC input of the Mix Shader:

Black areas mean A
White areas mean B

When using the FAC slider:
0 means A
1 means B

Universal rule:
For all nodes (roughness, metalness, fac...)
Black means 0, white means 1.
You can use gradual transition as well.


Cut a solid along an edge If I have this cylinder,

How can I cut it along the edge passing through?

(another question: is necessary that edge I created to prepare the cut?)

Try using the Bisect tool.

Click Numpad 5 to enter into Orthographic View, then click Numpad 7 to go to top view.

Click A to select everything, then click Spacebar and type Bisect.

Click and drag across the cylinder while it is selected. This will cut a line into it along where you clicked.

Next, on the left tab, under bisect, make sure Fill and Clear Inner (or Clear Outer) are checked, or uncheck them if you simply want to add the edges along the mesh.


How do I make a compositor filter effect affect only a specific part of the render? So, this is my node setup and as you can see the sunbeams affect the entire image.

However, I only want it to emit out of the doorway. So I created a mask for that and plugged it into the factor input.

But the output isn't exactly accurate.

So, how do I solve this?

The mask was limiting the result of the sunbeam node to the doorway itself. You can multiply the mask against the image, then run that through sunbeam and add the result to the original image.


I don't know how to get rid of this grid I am trying to make bones for my character but when I use shift+A in edit mode I get a mesh displayed. Earlier I could make an armature bone, but now I cannot. Here is how it looks now:

I would like to know how to get to normal faze like I had it before this problem.

You're in Edit Mode. In Edit Mode you can only edit data of an object (in this case your mesh).

Go into Object Mode by pressing the TAB key.


Weird box that I can't get rid of on the viewport When I made alt b this red box outliner showed up and no matter what I do I couldn't get rid of what should I do. I restarted blender and nothing has changed.

In the viewport:
Press Ctrl + Alt + B to remove a render region.
Press Alt + B to discard a clipping region.


Python BMesh: index of new verts? When i try to create verts with BMesh i get always the same verts index.

bm = bmesh.from_edit_mesh(active_obj.data)
for i in range(20):
    vert = bm.verts.new((0.0, 0.0, 0.0))
    print(vert.index)

index of all 20 verts will be -1.

How to get right index or correct it manually?

you'll have to reassign the vertices indexes using an built in function or using your own code as mentioned in the DOCs

  index_update()

Initialize the index values of this sequence.
This is the equivalent of looping over all elements and assigning the index values.

so your code should be :

bm = bmesh.from_edit_mesh(active_obj.data)
for i in range(20):
    vert = bm.verts.new((0.0, 0.0, 0.0))
    vert.index = len(bm.verts)
    print(vert.index)

or use

bm.verts.index_update()


How to easily build concentric curved tubes to make layered tubes? I have built tubes by Bezier Curve, converting to mesh, and adding solidify modifier. I want concentric tubes now. I could not directly scale the duplicated tube, which will cause it to be not concentric (as shown on the left in the Figure 1).
I have been able to duplicate the Bezier Curve and go through the process and add thicker layer (on the right of Figure 1) to make concentric tubes. But there seems to be a little gaps between the outer tube and the inner one. However, this process will not work for dynamic tubes, especially when they change locations.
Figure 2, I tried using curve modifier, but only can move or rotate it or a little shrinkage. I think I need subdivisions on the cylinders, right?
Figure 3(left), Later, I tried more subdivisions, which works good for one cylinder, but not for concentric cylinders joined together. Even I also set subdivisions for the inner cylinder.
Figure 3(right) using array modifier to elongate the cylinders and join them, add curve modifier, and separate them by loose parts. Make sure the origins of the cylinders and the curves at the same spot.

I say you try this as a solution:
Add a cylinder. Delete the top and bottom faces of it. Give it a solidify modifier. Duplicate it and scale it down by locking the Z axis until it's boundaries fit in the inner boundaries of the biger cylinder.
Once you are happy with the thickness and scale apply the solidify modifier. And then hit Ctrl+A to apply scale on both the objects. Then select both of them and hit Ctrl+J to join. Then rotate them along the X axis by 90 degrees. Then go to Object>Set Origin>Origin to Geometry. Then apply the rotation. Then add in an array modifier. Set the X and Z offset to 0 and the Y offset to 1. The count on the Array Modifier will change the lenght of your object. Then add in a path.
Rotate the curve on the Z axis by -270 degrees. Then add in a curve modifier on your object and select that path. Then scale that path to be as long as your object. Now if you go into edit mode on your path you can play with the verticies of your path and your mesh will be deformed.


Merging Multiple Vertices I am wondering if there is any tool or way to kind of Weld (merge) multiple vertices at once,

AltM > Merge at Center doesn't do the job.

Doing by one takes a lot of time so it's inefficient way of going about it.

Use the Bridge tool from the Loop Tools addon to connect the loops, then slide them into each other and remove doubles. You can also cut a new loop between them to get the exact midpoint.


Normal/Bump map show in Look Dev but not on Render I am trying to bake a diffuse texture with all the shaders applied to it, including the bump map effect just applied to the texture instead of having a seperate normal map.
In Look Dev I can see the result I want to achieve, but when I switch the viewport to Render the bump map is missing.
I watched several tutorials already but I am apparently still missing something crucial and just can't figure out what.
This picture shows my shader setup and settings for the bake. Also you can see what I am trying to achieve in the Look Dev Viewport compared to the Render I get.

Okay, I did some more testing around and finally came to a solution. Apparently a Mix Shader into a Shader to RGB make the bump map get renderer in Look Dev but not in Render. The solution (and in hindsight the more reasonable) approach is to use a Mix RGB node instead.
I'm not sure if this can be considerer as just plain stupidity or of it's an actual bug.

Here is my new setup that works:


Animating wire/cable/rope wrapping around a cylinder I have searched everywhere on the web for a way to do this, but I can’t find anything. Someone have any ideas for doing this without using physical simulations? The operation should be this:
the red wire passes through the blue object (which is static) and is anchored to the yellow object, which can rotate
When the yellow object rotates, the wire wraps around the cylinder in a similar way to a fishing rod.

This is a somewhat similar answer to @moonboots', perhaps expressed in a different way.

Using the shipped add-on Add Curve: Extra Objects, create an Archimedean Spiral.
Create your rope as a straight subdivided cylinder of some kind: it could be an array of segments, or simply another curve. Mine is long along X.
Use a Curve modifier to deform your rope along the spiral.
As you move the rope along its deforming axis (my X), it will wind itself around the spiral, and, when it runs out of curve, project itself from the end in the direction of the spiral's last segment. With (T)interpolation set to 'Linear' in the timeline, keyframe the rope's start and end positions, for a whole number of turns.
Now, the trick is to keep the fixed end of the rope stationary in the length-dimension of the spiral. Again, with interpolation set to 'Linear', keyframe the spiral's translation the other way, to compensate for the movement  of the tail of the rope along it. Neither the spiral nor the rope rotate.
Create a spool that does rotate, inside the spiral; keyframe its rotation to sync with the rope's progress around the spiral. You know how many turns the rope has travelled between start and end frames; just keyframe that number of turns into the spool.


how to import a .3ds model in Blender 2.65 via console I just need to import a .3ds model into the scene using the console/scripting.

The main file is in C:Users\Me\Desktop\Maps and the .3ds model is in C:Users\Me\Desktop\Maps\Models

I'm pretty sure I should be using bpy.ops.import_scene.autodesk_3ds() but I honestly just keep getting the following errors:

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "C:\Program Files\Blender Foundation\Blender\2.65\scripts\modules\bpy\ops.py",
    line 185, in __call__     C_dict, C_exec, C_undo = BPyOpsSubModOp._parse_args(args)
  File "C:\Program Files\Blender Foundation\Blender\2.65\scripts\modules\bpy\ops.py",
    line 142, in _parse_args
  raise ValueError("1-3 args execution context is supported") ValueError: 1-3 args execution context is supported

Exactly how should I type out that line?

This line of code worked for me:

 bpy.ops.import_scene.autodesk_3ds(filepath = 'C:/path/to/your/file.3ds')

The tricky place is that you have to prepend 'filepath = ' before the actual path. You will be getting an error otherwise.


How to use textures with transparency with eevee's principled bsdf? the method I was told to use involving mix shader doesn't work

The setup you have there will not work. You cannot plug a shader into the Base Color socket of the Principled BDSF. That socket is expecting RGB input. Generally, you can only plug a Shader into the Material Output or a Mix Shader node.

Your Mix Shader node should come after the Principled BSDF. It should mix between the Principled BSDF and the Transparent shader, and plug into the Material Output node.

As an alternative, you can also use the transmission property of the Principled BSDF itself (towards the bottom), eliminating the need for mixing. I would personally advise that you do this as it's cleaner and easier. You then have just one shader.

That would be it for Cycles. To get it to work with EEVEE, however, there are two additional settings:

In the materials panel for your material, under Settings, you need to change the Blend Mode to Alpha Blend.
In the render panel, you need to turn on Screen Space Reflections, and then tick Refraction.

That should do it.


Linking the color of one mesh to a second mesh I have a series of tubes that were inputted as VRMLs with varying colors. I have made a path out of them and have the sphere following the tubes. I want to link the color of the sphere to be the same as the tube while the sphere is traveling in time over the tubes. How can I link the colors? I also want the sphere to glow with the color of the tube.

I found a way to do this using translucency and some node tricks to make the tube emit light when it is under the ball, it isn't perfect but it works fairly well.
First give the ball a pure white transparent shader mixed with a translucent shader based on the is camera ray output of the light path node:

This will make the ball invisible to everything but the camera, this isn't necessary but will reduce noise, artifacts, and rendering time.
Next give the tubes a diffuse shader mixed with an emission shader (with a very high strength) based on the is transmission ray output of the light path node and plug the vertex colors into both the diffuse and emission shaders:

This will make the tube emit light when a ray is traveling through an object (such as a translucent object), but the tube will look like normal (the diffuse shader) elsewhere.
This is the result:


How to render from Eevee in Blender 2.8? I have the Blender 2.8 version from the 21st Sep 2018
I was looking forward to render a test sequence but cannot find a render button anywhere?
Does anyone know where to find it?

While the pre-release builds of 2.80 were setup with Alt-F12 as the render shortcut, the final 2.80 release returned to using F12 to render an image and ⎈ CtrlF12 to render an animation.

You can find each render option in the render menu at the top left of blenders window.

The render buttons previously found with the render settings are no longer there in 2.80, although it is possible to replace them with an addon.


Blender won't render image properly Anyways, I have been rendering this office for a while now, and everything was fine. I came back after modelling something else and everytime I render an image this screen appears.  How can I fix this black screen?

Never mind, I fixed it. I had an image strip in the video editor but I deleted the images and so it didnt render anything. I deleted the strip and it renders like it used to.


How to model a window screen I am currently working on an architectural project and I was stopped at the window screens; I have no idea how to go about creating such a fine mesh without reaching ridiculous poly counts.

I could find no information whatsoever about the topic.

Can anybody help?

Thanks in advance.

dunno

As long as you aren't going to be doing any really up-close shots of the windows, just use a plane with transparency. You don't even need an image. You can procedurally generate the texture. Mix an Anisotropic BSDF shader with a Transparent BSDF shader using a Brick Texture as the mix factor. To change the size, adjust the Scale: parameter.

Result:

If the renders are looking too dark/taking too long, you can add this to the node tree:


What is the difference between a Billboard and a Plane? I seem to have missed out on something. What is a billboard?

In CGI, billboards are images/textures mapped onto a flat plane to approximate 3d object. They are usually used for particles or distant objects in games. They are also typically setup to always face the camera, so the flat side is never visible.

So basically a billboard is a plane used in a specific way, but not all planes are billboards.


Why does my extruded text go wonky like this? Why does my text go weird when I convert it to a curve? I am making a 3D logo.

When I create a text object and use solidify mod to make it thicker it does this:

When I don't use the solid mod, and instead convert it to a curve to do a curve extrusion it does this:

Why is it doing this?

Did you try using the text settings rather than manually extruding it?


Soccer goal net movement I am creating a soccer animated series.

Picture a soccer goal, how do i make the net move smoothly once the ball makes contact with it?

Thanks

You have several solutions. The more realistic one would be to use a cloth simulation then use it as a Mesh Deform to deform your net. You have 2 much more simpler solutions, with Lattice and, more flexible, Warp modifiers:

Cloth: It's the most realistic solution.

Create a plane about as large as your net. Give it a Physics > Cloth simulation, enable its Cloth Collision option. Pin it on its border.
Create a ball, give it a Physics > Collision simulation.
Animate the ball and simulate the movement of it hurting the net and falling on the ground. The net should deform accordingly.
In the Properties panel > Object > Display, change the display of the plane, choose Wire.
Bring your net object, give it a Surface Deform modifier, put it above the other modifiers. Choose the plane as Object. Click on the Bind button. Now the plane should deform the net.

Lattice:

Create a lattice and in Object mode, scale it so that it encompass your net object. Subdivide it a bit.
Give your net object a Lattice modifier. Choose the lattice as Object.
Assign a vertex group to the whole net vertices except the borders that are supposed to be pinned, choose this group in the Lattice modifier.
Put the necessary modifiers below the Lattice one.
Select your lattice, in the Properties panel > Data > Shape Keys, create a basis shape key and add another one, keep this second one selected.
In Edit mode, deform the lattice so that it deform the net the way you want.
Back in Object mode, play with the value under the shape keys list. You'll be able to create keyframes to animate.

Warp:: This method is more flexible as it allows you to animate more easily.

Create 2 empties, in front and behind your net.
Give your net object a Warp modifier. Choose the 2 empties as objects From and To.
If a part of the net is supposed to be pinned, select the vertex group in the modifier.
In Falloff Type, choose the kind of deformation you want, you might prefer Curve to create your own one.
You can move the empties, therefore animate the movement of the bump.


How to get the worldspace location of a rendered pixel from Python I need a way to find the underlying 3D coordinates for each pixel of the camera in Python.

I to create a function like:

GetCoordinatesForPixel(xPixel, yPixel)

which returns a (X, Y, Z) vector.

I found the following threads:

How to get world coordinates of pixels?
which is supposed to be a duplicate of this one:
How to render world position pass

The latter solution works in that it procudes a render. However, I do not see a way to access those values in Python.

Blender's Python API currently doesn't expose access to the pixel value of render passes.

(You can access image pixels but renders's are a more complex structure).

However since you mention you need to store the values in a file, just save the OpenEXR file, this will store the values in a file.


How to make blender confirm closing an unsaved file? I know that this question has already been asked here, but it was 5 years ago, and I want to know if the answer has changed.

Can I make blender confirm closing an unsaved file? (I am using ubuntu linux)

Thanks!

Open File > User Preferences (Ctrl + Alt + U), under Interface tab on the lower left Prompt Quit


Gradient in a Checker Texture's individual cells How can I add a gradient in a Checker Texture's individual cells procedurally?
My goal is to create a procedural carbon fiber material.

I think this is a good start :

Make sure to match the Mapping node scale to the checker texture scale. You'll need to adapt the mapping nodes as well as the Modulos plugs depending on the orientation and the face you need to display on.


What's the easiest way to make consistent simple walls? Blender beginner here. I imported an image of a floor plan into Blender, aligned it with the grid, scaled it so one unit = 1 foot (it's from the 60s so Imperial). But I'm having issues making the walls:

First I tried putting a loop cut in my first wall and extruding it, but I don't know how to make a cut that's exactly the same width as the existing wall.

So then I tried copying and pasting the first wall instead, rotating it 90 degrees, and snapping it to the first wall. But it doesn't want to snap even though I turned on snap.

Is there a better way to go about this process?

Solidify modifier.

For recent builds (2.82) with the complex mode

Consider using the solidify modifier. Model your walls as simple edges on the plan.. When done extrude to wall height to. Add a solidify modifier to give walls thickness.

Fiddle with settings, for example making offset negative half thickness will keep original edge mid wall.


How to change the sticking side in Snapping? I have such an object

How can I change the side of gluing ???

The easiest solution is to move your origin point.

Check Origins ✓ tranform
Enable Vertex snapping and snap your origin point to the lowest vertex
Switch fo Face snapping and snap your object


Spot light shows dimly through solid plane I'm attempting to shine a spot light through text that has been cut out of a plane. The effect works pretty well, but some of the light from the spot light that is behind the plane shows through as seen in this picture:

The plane uses default settings and has no material or texture associated with it, though adding a solid black material has no effect on the render.

Lamp is set to Spot, Buffer Shadow, Halo, Step=1, Distance=10, Size=130.  Other settings are pretty much the default settings.

I've been playing with this for hours and can't seem to figure this one out.  Any ideas?

Thanks!

I think is the blocking object, it's 2D. Try to get another one starting from a 3d even slightly extruded plane (extruding your gives me weird results), carving out the text. Then you might need a slightly more powerful (energy) spot, but in this way I got it working.


Get Blender scripts path Is there a clean way to get the absolute path to the scripts folder for the currently running version of Blender?

The following code works (on Windows) but it feels a bit hackish.

from os.path import dirname, join, normpath
from bpy.app import binary_path_python
normpath(join(dirname(binary_path_python), '..', '..', 'scripts'))

Results in C:\\Program Files\\Blender Foundation\\Blender\\2.77\\python\\scripts.

There is a few nice helper methods hidden in the bpy.utils module space. For instance, calling

bpy.utils.script_paths()

will return all current Blender paths where Python modules can be put. Even if you (like I do on my system) redirect the Scripts Folder to a custom location, so they stay around when updating Blender, using this method you'll get a valid pointer. See this output here:

But you could also use

x = bpy.utils.script_path_user()

to retrieve the current location of your user scripts. This will return a string, and as a fallback your scripts home directory if no custom path was set.


Vertical align of mixed panel? Is there a way to vertically align this too, meaning to remove the space between the rows and make the elements connect?

import bpy

from bpy.props import *
from bpy.types import Operator, Panel

bpy.types.Scene.test = IntProperty()
bpy.types.Scene.test2 = IntProperty()

class LayoutDemoPanel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "Layout Demo"
    bl_idname = "SCENE_PT_layout"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"

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

        scene = context.scene

        # Create a simple row.
        layout.label(text=" Simple Row:")

        row = layout.row(align=True)
        split = row.split(align=True)
        split.prop(scene, "test")
        row = layout.row(align=True)
        split = row.split(align=True,  percentage=0.7)
        col = split.column(align=True)
        col.prop(scene, "test2")
        col = split.column(align=True)
        col.operator("render.render")

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

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

if __name__ == "__main__":
    register()

You understand the formatting wrong - see this with comments:

        # simple label
        layout.label(text=" Simple Row:")

        # create column to be able to merge vertically with align=true on a column
        col = layout.column(align=True)

        # create test row inside the column
        row = col.row(align=True)
        row.prop(scene, "test")
        # even if there is only 1 item in this row it needs aligning because otherwise the column align would'n work

        # create the test2 row within column and allow horizontal merge with align=true on this row
        row = col.row(align=True)
        # we don't want to put anything else on this row other than the 'split' item
        split = row.split(align=True, percentage=0.7)

        # put 2 things inside the split
        split.prop(scene, "test2")
        split.operator("render.render")

You can also make the button span across 2 rows if you order the elements in a different way:

        # simple label
        layout.label(text=" Simple Row:")

        # start with a splitted row - we dont want to split the whole layout if something
        # needs to be added after these elements
        row = layout.row(align=True)
        split = row.split(align=True, percentage=0.7)

        # put 2 columns inside the split
        colA = split.column(align=True)
        colB = split.column(align=True)

        # fill first column with props
        colA.prop(scene, "test")
        colA.prop(scene, "test2")

        # put a row into second column
        row = colB.row(align=True)
        # adjust the row's Y scale
        row.scale_y = 2
        row.operator("render.render")


Pinning cloth to moving model I'm having trouble figuring out how to properly pin cloth to a moving object. The cloth is acting as a mane for a horse and therefore needs to be pinned in multiple places. I've looked at several tutorials but can't really 'transfer' the technique used to get the result I want. How can I pin cloth to multiple points on a moving model?

Select the cloth. Enter Weight paint mode with CtrlTab, assign weights of 1 to the vertices you want to pin (paint with brush these vertices red)
In cloth physics settings, check 'pinning' and select the vertex group
Then enter Object mode with CtrlTab. Make sure to select the cloth first and then the object you want to pin on.
Parent the cloth to the object with CtrlP and select 'Set parent to object'


Why is my imported obj not showing up on the grid where I need it to be I'm having trouble with my imported object. Its nowhere near the center of the grid where I need it to be.. I press the . key on my numpad and it takes me to it, but I am using a minecraft rig and need my object near the rig. This is probably basic to most of you but something I really need help with if you could! Thank you!!

The rig I am using shows up perfect in the center of my starting view where it needs to be

This method has always worked for me:

Firstly, is the origin of the Obj object at the center of the scene (0,0,0)?

If so, skip step 1 and go straight to step 2.

Select the imported obj object whilst in object mode; press Shift+Ctrl+Alt+C. A menu will pop up with a few options - choose Origin to Geometry. (An orange dot should appear near the center of the object).
Press Shift+C to reset the 3D cursor to 0,0,0 (this will change the view but as long as you  don't deselect the imported object this won't be a problem).
Press Shift+S and select the option Selection to Cursor - which will move the selected object to the center of the scene.

You will probably want to apply the location of the object after this. You may also need to get the origins to match, but that's for a different question and probably has already been answered somewhere.


Different EnumProperty design How do I get this design of an EnumProperty?
My code(basically just the standard Operator File Export template):
import bpy

def write_some_data(context, filepath, use_some_setting):
    print("running write_some_data...")
    f = open(filepath, 'w', encoding='utf-8')
    f.write("Hello World %s" % use_some_setting)
    f.close()

    return {'FINISHED'}

# ExportHelper is a helper class, defines filename and
# invoke() function which calls the file selector.
from bpy_extras.io_utils import ExportHelper
from bpy.props import StringProperty, BoolProperty, EnumProperty
from bpy.types import Operator

class ExportSomeData(Operator, ExportHelper):
    """This appears in the tooltip of the operator and in the gener ated docs"""
    bl_idname = "export_test.some_data"  # important since its how  bpy.ops.import_test.some_data is constructed
    bl_label = "Export Some Data"

    # ExportHelper mixin class uses this
    filename_ext = ".txt"

    filter_glob: StringProperty(
        default="*.txt",
        options={'HIDDEN'},
        maxlen=255,  # Max internal buffer length, longer would be clamped.
    )

    # List of operator properties, the attributes will be assigned
    # to the class instance from the operator settings before calling.
    use_setting: BoolProperty(
        name="Example Boolean",
        description="Example Tooltip",
        default=True,
    )

    type: EnumProperty(
        name="Example Enum",
        description="Choose between two items",
        items=(
            ('OPT_A', "First Option", "Description one"),
            ('OPT_B', "Second Option", "Description two"),
        ),
        default='OPT_A',
    )

    def execute(self, context):
        return write_some_data(context, self.filepath, self.use_setting)

# Only needed if you want to add into a dynamic menu
def menu_func_export(self, context):
    self.layout.operator(ExportSomeData.bl_idname, text="Text Export Operator")

def register():
    bpy.utils.register_class(ExportSomeData)
    bpy.types.TOPBAR_MT_file_export.append(menu_func_export)

def unregister():
    bpy.utils.unregister_class(ExportSomeData)
    bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.export_test.some_data('INVOKE_DEFAULT')

You also need to add a draw method to your operator like this
    def draw(self, context):
        layout = self.layout
        layout.use_property_split = True
        layout.use_property_decorate = False  # No animation.

        # column() is what makes it go vertically
        layout.column().prop(self, "type")


Blender for Architecture I would like to know which are the benefits of using this program in relation with the architecture. I would like to know if it is a tool from the architects to know something about lights or something like that.

I'm Adrián from Spain, and I'm discovering Blender now because I'm doing a kind of tesis about this program.

Thanks :)

I think @atomicbezierslinger might be correct, but I think Blender can be great for architectural renderings, but not necessarily designing. There are plugins that add Architectural Desktop-like features, but Blender is more like Maya than AutoCAD.

Two good resources to see what's capable in architectural rendering in Blender are: Blendswap and Blender Artists (for example: this recent rendering posted by the artist)


Precise commutative rotation on global X and Y I am trying to find a way to rotate a vector with python so that the angle between the z axis and this vector is exactly _x° from the right ortho view and the angle between the z axis and this vector is exactly _y° from the front ortho view.

[![Front ortho][1]][1][![Right ortho][2]][2]

Using the XYZ Euler rotation system dont look a good way to perform such a rotation since an y rotation will modify the initial x rotation, and rotating around the local y axis after the first x rotation will keep a valid x rotation but give an invalid _y angle from the global point of view.

What i am trying to find is an Axis angle, (or quaternion) were the rotation axis is a combination of global x and y vector ([1,0,0] and [0,1,0]) and a corresponding angle.

In this case if _x==_y , the resulting rotation vector will be [0.5,0.5,0.0] and the corresponding angle will be a little more than _x. But i have some difficulties to figure out the maths to find this vector and this angle for any _x and y between 0 and 89.99° (90 would be a problem for sure), or a built in function in Blender that could give this exact result.

NB: The example given here is based on blender global axis but my problem is actualy to rotate around any two perpendicular vectors (local axis of an object). A basic solution in global referential would be enough to find the solution to my initial problem.

The angle between a vector and the Z axis and a vector in the right ortho view appears to be such that tan(θ)=y/z.  The angle between a vector and the Z axis in the front ortho view appears to be such that tan(φ)=x/z.

As long as θ and φ aren't going to be π/2 you can pretty easily set z=1 and then y=tan(θ) and x=tan(θ) .  If the π/2 is a possibility you'll want to have code to check for that case and use an alternate formula like tan(π/2-θ) = z/y and similar for φ.

So after following that procedure we have an <x,y,z>, but since you talk about rotations, I assume you have an object with some feature you want to align with this vector.

To accomplish this requires an understanding of quaternions, or you just copy the code from http://web.purplefrog.com/~thoth/blender/python-cookbook/rotate-to-match.html

import bpy

from mathutils import *
from math import *

def compute_rotation(src_vec, dest_vec):

    a = src_vec.normalized()
    b = dest_vec.normalized()

    c = a.cross(b)

    theta = asin(c.magnitude)

    if (c.magnitude>0):
        d = c.normalized()
        st2 = sin(theta/2)
        q = Quaternion( [cos(theta/2), st2*d.x, st2*d.y, st2*d.z] )
    else:
        q = Quaternion( [1,0,0,0] )

    return q

obj = bpy.context.active_object

obj.rotation_quaternion = compute_rotation(Vector([1,1,1]), Vector([1,0,0]))

The src_vec is a vector on the object (it might be the X, Y or Z axis, or some other important feature like an antenna) and dest_vec is the world space vector we want that source vector to be rotated to match.

Another thing to consider is that there are many orientations that are compatible with dest_vec = q*src_vec (just imagine spinning the object around src_vec), but the q calculated by this procedure will have the minimum θ.

To see how messy things can get, read http://web.purplefrog.com/~thoth/blender/python-cookbook/narratives/animate-random-spin.html


Did I create N-gons? I have modelled an oven.
The front has some details, but the back should be plain as nobody will see it.
To remove unnecessary geometry from the back, I select it, then choose "Dissolve Faces".

This looks good to me, but I am afraid that I might have created N-gons.
How could I check if I did that?
Thank you!

Yes you created an ngon in the back. Being that It's in the back maybe it's not a problem. If you are encountering a problem a very easy thing to try is to inset the ngon face which gives you quads around the perimeter of the ngon which will solve some problems. If you want to rework your topology so that you don't have ngons or unnecessary geometry on the sides without detail I recommend watching this video which shows how to step down your faces while maintaining quad geometry: https://www.youtube.com/watch?v=HGL6QpVRyXk&list=PL0v8ug1WwacVeXGNVRHexenYbip_7LMPD&index=19&ab_channel=DECODED


What's the difference between the different Rig Types ? (Rigify add-on) I've made a metarig (a ready-to-use skeleton) for a character mesh and I've added some extra bones for the feet (my character has long floppy flippers). For each new bone, I need to assign a "Rig type". To do so, in "Pose Mode", I select my new bone and I go to the "Bone Panel" and I scroll down to "Rigify Type" and "Rig type". Here there is a all variety of usable types of rigs...

My question is: With Rigify, what's the difference between the different types of rigs and in which situations should we choose one specific type of rig instead of another ?

Rig Types are the Properties Collection used by Rigify to identify
  what kind of rig the user is building.

Choice should depend on what controls you want to get for your bones.

Rig types description is in link below.

https://archive.blender.org/wiki/index.php/Extensions:2.6/Py/Scripts/Rigging/Rigify/#Rigify_Rig_Types


Hide Group Instance lines Someone said, group instances are rendered faster, so I've decided to replace actual bolt objects with group instances. Though, my model turned into a hairy mess, that I can't see through. Yes, it disappears, when you turn active "Only Render", but I need to work with it!

Selecting all by type "Empty", going to Empty tab in Properties window and setting size to 0 with holding Alt helped.


Is there an addon to improve the knife tool? I see how to use the knife tool to draw shapes by clicking points along, say, an imported image in the background. But I want to know if there is a way to draw 2d shapes with precise angles (90 degree, 30 degree, etc), curves, and precise line lengths, to make closed shapes that one could then extrude into 3d.

There doesn't appear to be a way to do this with the knife tool (unless I'm missing knife settings somewhere), so perhaps there's an addon that'll do this.

Thanks!

You can try PolyQuilt. It does many other things, but also what you want.
If I remember correctly, once you click the 4th point it closed the quad automaticall, so it may be a bit anoying for you if there is no option to change that or you can't work around it.
In any case, give it a try.


World displays as grey even though set to white I am using the 2D Animation preset and so far every new scene I made had the same bright white background. Now my two latest scenes (created with 'copy settings') have a light grey background even though they are set to white.
There's also no difference in surface, nodes or strength.

There are apparently exist different background shades with an off-white color but selecting the white one doesn't help either

"White" is not an absolute value. The values change depending on the transforms  used in the color management section.
If you are using sRGB, with a sRGB view transform, white should be 1.
But If you are using filmic view transform, white is at a value of 16.29
The Color Management settings can be found in the Render Properties :


Camera dimmensions different than render dimmensions I have a camera in my scene which is placed at the ideal position. With the button  I look through it and with the settings for camera I calibrated the dimmensions of the camera viewport (the orange-border looks great). But If I'm going to render it, the aspect radio seems to change (see the pictures).

How can I solve this?

You appear to have the Aspect Ratio set to 4/3 as shown in the below image :

This changes the ratio of the camera. You should generally leave the Aspect Ratio to its default of 1.000/1.000 for 'square' pixels and use the Resolution to set the dimensions of rendered image.


increasing density of beam light in volume rendering I am simulating in animation a film projector with a light beam in volumetric.  On the pic attached you can see that the beam is quite light.. I want to densify the beam more like an intense light coming from the lens..  I attach the blend file http://pasteall.org/blend/index.php?id=45259 and a pic showing my current state..
I have tried to balance volume scatter and  absorption but with no satisfactory result.. Can you suggest something
Thanks

When you are using scattering you need increase the intensity of the light.


I want to get the names of all models in blender in order I want to get the names of all models in the blender in order
I use  blender console for the first time
 objs = bpy.context.scene.objects
 for obj in objs :
  print(obj.name)

..... it is omitted
pasted__piriformis
pasted__puborectalis_part_of_levator_ani
pasted__prerectal_fibers_part_of_levator_ani
pasted__pubococcygeus_part_of_levator_ani
pasted__anal_sphincter_external
pasted__anal_sphincter_internal
pasted__iliococcygeus_part_of_evatorani
pasted__Deep_transverse_perineal
pasted__superficial_transverse_perineal
pasted__central_tendon_of_urogenital_diaphragm
pasted__anococcygeal_ligament

....it is omitted

>>> print(bpy.context.scene.objects)
<bpy_collection[844], SceneObjects>

It was successful but console line number limit is low.
The console size itself is small, so only a fraction of the 844 is displayed on the console, and the displayed ones are quite small.

because it's a dictionary
keys = bpy_collection[844]
values = SceneObjects

so you can easily get keys by this command line:
 print(bpy.context.scene.objects.keys())

python script:
import bpy
objs = bpy.context.scene.objects.keys()
for key in objs:
    print(key)


Select vertices, which are affected by a shape key Is it possible -- without using a previously defined vertex group -- to select those vertice, which are affected by a shape key?
How?

I think a shape key stores the coordinates of any vertex of the mesh, regardless of whether the position has been changed or not. So it seems as if the only way to select vertices affected by the shape key is to individually compare whether the position of the vertices is the same for different shape keys.

import bpy
tolerance = 1e-5
obj = bpy.context.active_object
shape_keys = obj.data.shape_keys.key_blocks
sk1_data = shape_keys['Key 1'].data
skb_data = shape_keys['Basis'].data

bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.select_all(action="DESELECT")
bpy.ops.mesh.select_mode(type="VERT")
bpy.ops.object.mode_set(mode="OBJECT")

for i, (x, y) in enumerate(zip(sk1_data, skb_data)):
    if (x.co - y.co).length > tolerance:
        obj.data.vertices[i].select = True

bpy.ops.object.mode_set(mode="EDIT")

EDIT: As per batFINGER's suggestion, replaced comparison based on equality with a tolerance based approach.


Error on Launch "Can't Detect 3d Hardware Accelerated Driver" I'm not sure if this is a valid question, but it's about launching Bender?

Every time I try to open blender, it just says this:

Even though whenever I checked, it DID use the hardware acceleration?

I cannot comment on m.ardito's comment due to my rep level. But, I want to add that I was having this problem with version 2.78 when I got this error. I went to SourceForge and found version 2.76. I did get the message when I started the app. But, in this version you are allowed to proceed to open and use the app. The message is just a warning with version 2.76.

I haven't had any problems so far. But, I'm only doing simple beginner stuff.

I should note that I am using library computers and running the Portable version off my flash drive. Some of the library computers will run version 2.78 and some won't. There are about 50 computers in each of the different library branches I visit. None of the computers are configured the same way. And, they just started installing Win 10 on some computers, which may cause...who knows what.


Blender function to transform a selected edge along a custom axis How blender is Setup:
In Blender I have created a triangle and extruded it. Selected an edge and created a new transform in the UI and named it "Edge.001" it is currently active. Now I have selected the edge perpendicular to it and I want to pull that edge along one of the custom defined transform's axis.

I am trying to write a python function to do the following.

Make an extrusion of the selected edge.
Transform the edge along a particular axis with defined length.

That is equivalent to doing:

"Pressing" E to extrude and pressing "Esc" so that the duplicate is on top of the original edge
With the custom user defined transform ('Edge.001") selected pressing "G" to grab and constraining along the y axis of the custom defined transform by pressing the short cut corresponding to the  axis (lets say "y" axis) twice i.e. "YY".

I have the following code.

def pull_edge(axis,length):
    # Note: Please define axis before calling function
    # Extrude mesh but do not transform
    bpy.ops.mesh.extrude_region_move(MESH_OT_extrude_region={"mirror":False}, TRANSFORM_OT_translate={"value":(0, 0, 0), "constraint_axis":(False, False, False), "constraint_orientation":'GLOBAL', "mirror":False, "proportional":'DISABLED', "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "gpencil_strokes":False, "texture_space":False, "remove_on_cancel":False, "release_confirm":False})

# Pull along local axis
# Unclear how to do this.

I cannot understand how blender in the info panel gets those transform values they are different from the value specified while grabbing.

E.g. Grabbing an edge along  y axis of the custom defined transform by a value of 0.26 seems to generate the  values (-0.216937, 0.0633597, -3.36766e-009). This is what blender does.

bpy.ops.transform.translate(value=(-0.216937, 0.0633597, -3.36766e-009), constraint_axis=(False, True, False), constraint_orientation='Edge.001', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

How do I proceed ?

I think http://web.purplefrog.com/~thoth/blender/python-cookbook/extrude-edge-along-custom-axis.html will accomplish your mission.  Here's a copy in-line:

import bpy
import bmesh

def guess_edge_order(bm, edge):
    """ We need to create a new face,
    but if that face is going to have a normal consistent with an adjacent face
    we need to choose the order of the vertices carefully.
    """
    v0 = edge.verts[0]
    v1 = edge.verts[1]
    if len(edge.link_faces) != 1:
        # it is going to be non-manifold.  balls!
        return v0, v1

    face = edge.link_faces[0]
    nverts = len(face.verts)

    i0 = [ i for i in range(nverts) if face.verts[i].index == v0.index]
    i0 = i0[0]
    #print(["indices", i0, face.verts[i0], face.verts[i1], i1])
    i1 = (i0 + 1)% nverts
    #print(["next", face.verts[i1] , "==", v1])

    # does the polarity of this edge match the order of the vertices on the face?
    if (face.verts[i1].index != v1.index):
        return v0, v1
    else:
        return v1,v0

def mission1(obj, axis, len):

    bm = bmesh.from_edit_mesh(obj.data)

    # collect a set of all the vertices from all selected edges (without duplicates)
    verts = set()
    for edge in bm.edges:
        if edge.select:
            verts.add(edge.verts[0])
            verts.add(edge.verts[1])
    print(verts)

    # create new vertices "extruded" from the vertices of all the selected edges and
    # stash them in a hash so we can map from the old vertex to its extruded partner
    newverts = {}
    for v in verts:
        v2 = bm.verts.new( v.co + axis*len)
        newverts[v.index] = v2

    # for each selected edge create a new face from the original edge plus the extruded vertices
    for edge in bm.edges:
        if edge.select:
            v0,v1 = guess_edge_order(bm, edge)
            v2 = newverts[v1.index]
            v3 = newverts[v0.index]
            bm.faces.new( [v0, v1, v2, v3] )

    # if we don't do this, it will look silly in the editor, and maybe even cause problems during render
    bm.normal_update()

    # apply all the changes we made back to to the target mesh data
    bmesh.update_edit_mesh(obj.data, destructive=True)

#
#
#

obj = bpy.context.active_object
scn = bpy.context.scene
# which custom orientation are we using?
orientation = scn.orientations['Face']

x_axis=0
y_axis=1
z_axis=2
m1 = obj.matrix_world.to_3x3().inverted() # this is what we need to map from world space to object space
m2 = orientation.matrix.transposed() # we transpose this so we can extract a column
global_axis = m2.row[z_axis] # this is the custom orientation axis we want in global space
axis = m1* global_axis # now we have the necessary extrusion vector in the object's local coordinate space

if True:
    print (m1*m2.row[x_axis])
    print (m1*m2.row[y_axis])
    print (axis)

mission1(obj, axis, 1.5)


Need to make (node setup) of realistic dirt/ grime/grunge on top of image texture of ceramic tiles I've already created a node setup with bump mapping and gloss, but I have no idea how to add or combine an image or texture to create a realistic dirty/worn look on the clean tiles.
I tried the tutorial http://www.blenderguru.com/tutorials/how-to-grunge/ , and I can bake the image but I am not sure how I would combined them to give the desired effect.

The image I wish to improve on or change (add dirt to) can be found here.
http://www.cgtextures.com/texview.php?id=65010&PHPSESSID=rklgncit37atdpanj155e3jvg5

Any advice would really help me out! Thanks

Adding convincing dirt and grunge to any model requires multiple layers of shaders.  I usually use three main layers, surface dirt, crevice dirt, and dust.

Surface Dirt:

Surface dirt is just smudges and such that accumulates across the surface of an object.  To create this just mix your normal shader for your material with a dirty shader using a grunge texture for the mix factor.

Note:  Make sure the image texture you are using for a mask is set to non-color data.

Crevice grunge:

Usually grunge doesn't accumulate evenly over an entire object, it likes to get caught and pile up in corners and crevices where it isn't easily brushed or blown away.  To simulate this in Blender I will be using the brand-new pointiness input from the input > geometry node (so make sure you are using Blender 2.74 or later).  You usually have to tweak it's output with a color ramp to get some better contrast, then just add it to the grunge mask you are already using.

Dust:

Dust usually doesn't stick to an object very much, it just settles on the top.  To get this effect I plug the normal output of a geometry node into a Seperate XYZ node, the Z output of this node will give how much the face is pointing upwards.  Just use this output, multiplied by another grunge texture, as a mix factor for the dust shader.

Here's the final result:


How to: Exponential Fall Off for Volume Density? I'm trying to create a photorealistic Earth Atmosphere. Several papers written on the topic of atmospheric scattering state that our atmosphere's density has an exponential fall off, with most of it in the 25% of the roughly 100km of its visible height.

How can I implement exponential fall off into the density of the volume scatter node? ColorRamp node doesn't seem to have exponential gradation. RGB Curves might not be precise enough. Is there a way to implement an exponential math function?

EDIT: This is the relationship between height (altitude from Earth's surface) and atmospheric density:

$$\text{density} = \exp\left(\frac{-h}{8000\text{m}}\right)$$

or

$$\text{density} = e^\frac{-h}{8000}$$

where $h$ is the altitude in meters

Is it possible to implement this math function?

EDIT2 :  I see a grid like pattern appear in my atmosphere, from the edges of the UV sphere mesh, no matter how much I subdivide (it fades near the poles). Also, if I make the sphere much bigger than Earth, I get really weird patterns in my volume. Here's a link to my blend file

You can use Vector maths and Maths nodes to calculate the 'altitude' above the planet and from there the atmospheric density and use this to control the density of the Volumetric Scatter.

To achieve this, add a mesh around your planet to act as a domain for the scattering. The domain's centre should correspond with the centre of the spherical 'planet'.

Create the following material :

This uses vector maths to determine the distance from the centre of the planet. The Planet Radius value node determines where the atmosphere starts - it should correspond to the radius of the 'planet' object.

The 'Falloff Factor' determines how quickly the density of the atmosphere falls off - it should be negative and values closer to zero will provide a 'deeper' atmosphere (extending further from the surface of the planet).

The RGB node controls the 'color' of the atmosphere and the Multiply just prior to the scatter controls its 'thickness' at sea-level.

(Don't forget to increase the number of Volumetric bounces in the Cycles Light Paths settings.)

This can produce the following result :

Blend file attached

Note : I've also created a material using and Emission shader instead of scatter - faking the planetary shadow - and this is far more efficient than using Scatter. The vector maths are far more complicated than in the above material so I've omitted it here for simplicity. I can provide additional details if it would be of interest.

Breaking down the nodes to explain this a little, we're starting with two coordinates - the centre of the planet (which is the same as the centre of the domain mesh) is provided by the Object Info node, and the point in space (where we want to determine the density) is provided by the Geometry node. Both of these are in 'World Space' coordinates (points relative to the centre of the world).

By subtracting one from the other we get the vector between the two points. The length of that vector represents the distance from the centre of the planet to the point in space and the Dot Product and Power nodes convert this into an absolute distance (rather than a vector). [Using the Dot product in this way (with the same vector connected to both inputs) produces the square of the distance of the vector. The Power(0.5) performs a square root, generating the actual distance.]

Next we subtract the radius of the planet. This will result in the actual altitude above the surface.

For the exponential falloff we need to use a Power node with the the first input set to the exponent (in this case '2') and the other input set to the altitude. For a 'falloff' we need a negative value and the Multiply node provides this as well as allowing the effect to be scaled. The final Multiply allows the overall density of the atmosphere to be adjusted.

As an example, if the Multiply node is set to $-1$, at the surface of the planet (0 altitude) the density would be :

$2 ^ 0 = 1$ (since anything to the power of 0 is 1)

At 1 blender unit above the surface,

$2 ^ {-1} = 0.5$

At 2 blender units above the surface,

$2 ^ {-2} = 0.25$

At 3 blender units above the surface,

$2 ^ {-3} = 0.125$

ie, The density falls off exponentially.

Adjusting the Falloff Factor to larger negative values will give a faster falloff.

EDIT: With your sample Blend file the patterns you are seeing are a result of rounding errors in the exponential falloff being amplified by the 250 multiplication factor (you have an atmosphere that is dropping off very sharply conflicting with it being very dense). Using your sample Blend file as a start point, perform the following steps :

Scale the Earth Atmo mesh by a factor of 2
Remove the unnecessary Subdivision Surface modifier
In the Earth Atmo shader, change the Multiply factor from 250 to 2
Change the division factor from 0.0012557 to 0.012557
In the Render settings change from Path Tracing to Branched Path Tracing (this renders the volumetrics better)

This should then produce the following result :


Video Editing in blender 2.8 - FFmpeg renders nothing I'm trying to edit a video sequence in 2.8, tried it in 2.79 aswell but same results. I'm importing a mp4 with audio attached to it and the only thing I'm trying to do is to cut it down and render.

When I render to FFmpeg the render just gives me a grey empty render. Doesn't even render a empty file anywhere. I can render single frames in any format just fine and I can render AVI JPEG without problems, but that gives no sound.

Is there something I'm missing? It's driving me insane..

I had the same problem.

Rendering animation from 3d keyframes worked fine, the same as you rendering into avi jpg or raw worked fine but ffmpeg just left a blank render window and nothing happening, no errors nothing.

As input I use a png image sequence of size 4800x6299 [px] (this is important).

I decided to add an effect transform with 2 keyframes at the beginning and the end with position x set to 0 (so no movement, just to get some keyframes to see what happenes) then I tried rendering and got an error saying: output dimension is not divisible by 2.

So I deleted the transform effect, changed height from 6299 to 6300 (1px is not going to make much difference anyway), hit render (this time again only the pure image sequence) and it started rendering.

So not sure if this can help you or not but I'd try checking that your output size both width and height are divisible by 2. If that doesn't work try adding some effect or something with keyframes and check if you get an error message as I did and try to check if yo uget any errors at the bottom.

This is after official 2.80 release so I'm nto sure if it's still relevant with your or not so I'm leaving this here if it helps someone else in the future.