Documentation for CollectionProperty (CRUD methods) I cannot find any documentation for the existing CollectionProperty methods.

Regardings properties, generally i find .../bpy.props.html helpful, but it doesn't have any method declarations.
Usually with other properties this isn't necessary, as they just give me a value of a regular python type that I know - like StringProperty which yields a string.

With a CollectionProperty this is different: it gives me some sort of collection, I can iterate over it, but it is not a simple python structure.
There is the official doc of .../bpy.types.CollectionProperty.html, but it lacks documentation for the add and remove methods (it never mentions them).

Related Question:
Remove from CollectionProperty

Apparently there is also a move method:
CollectionProperty - change item's index

Are there anydocs out there?

P.S. digging through the blender source (of some cloned repo, because I like browsign github) I found this:
https://github.com/dfelinto/blender/blob/master/source/blender/python/intern/bpy_props.c#L3029

However I cannot find any hints in there with respect to the existing methods.

You are right about the documentation. The Python Console is your friend here. It offers autocomplete "intellisense" when you hit CtrlSpace after a . or a (:

You get the methods documentation from the source if there is one. In CollectionProperty case there is none:

The traceback error gives another hint:

If this does not help you search google, this site, blenderartists or your favorite blender python blogs for the functions you are interested in for more info or code examples. Since you now know what is available and what you are after, this should give better results than searching just for documentation.

If that still fails, chances are that you are after something only couple of people in the world know. You can look into the source code where you find bpy_props.c and then you dig. If you don't get too far the best bet in this case is to contact developers on official channels (mail, IRC) and ask there.


Textures and colors not imported from OBJ file when using Cycles render I'm trying to import a bunch of models from OBJ files (with their MTL files) to a blender scene that I have.
When using Blender Render the materials and textures are imported successfully.
But when using Cycles Render the material names are imported, but not their actual data.

This behavior is also noted by How can I get a .MTL file to show on an .OBJ model I imported in Cycles?

Is there a workaround for this? I prefer to use Cycles for my rendering (for using GPU devices, and node control).

As far as I know, cycles does not yet support importing materials due to the great difference in the way materials are designed in cycles.

There are some plugins such as blender material to cycles node converter

http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Material/Blender_Cycles_Materials_Converter

I would recommend importing while under blender internal renderer, than either hand creating the cycles nodes, or using this plugin to generate them.


Motion Tracking + MatchMoving -- What am I doing wrong? I'm trying to track the camera in this piece of footage and then also track the object on the stick (to replace the object with a 3D object and remove the pole).

I am a newbie, but I think I got the trackers to a low solve ERROR, so it should be working right --- I also plugged in my camera lens (35mm) and my sensor size, (Fujifilm T3 -- I looked up it was 28mm but maybe I read it wrong).

The results are horrible -- with the camera shaking hysterically. I do not know what is happening but this happens often when I try to motion track and match-move this kind of footage.

Can anyone help this idiot? lol. If you want to contact me privately, I will tip you a little bit for your time.

Here is a link to the videos that illustrate what the camera track is looking like: https://f.io/smQOQvPd

Picture with specs here:  https://f.io/gX-H3BrI

If the camera is static you need a different kind of solver then the default. Use tripod solver for the camera, and exclude the trackers for the object in the camera solution.
Then track again the object only, and solve the object separately.


Sun imitating partially cloudy sky My scene is an exterior shot of a couple of industrial buildings.
Is there a way to light my scene that implies the sky is partially cloudy? I don't need to show any cloud, just tweak the "Sun" so that it looks like there are clouds in the sky.
I was thinking of using a Noise texture in some way so the sun's intensity isn't always the same (thus imitating a non constant cloud cover), but nothing I've tried so far makes any changes. Maybe there's a really easy way that I'm not seeing?

To give the impression of a partially cloudy sky you could place a plane above your scene and use a Mix node to vary between Diffuse and Transparent shader using a Texture such as Musgrave or Noise as shown :

With the plane high above your scene it won’t be visible to the camera but will still affect the parallel rays of the sun lamp. Alternatively, if it would be visible to the camera due to the camera angle you could use a Light Path ‘Is Camera Ray’ node to make it fully transparent to the camera while still casting shadows.


How to produce glitch effects I wonder how one could produce animated video glitch effects, like digital codec or connection problems or even analog cable problems.

I wonder how one could do something that can work on top of a video (to displace parts of it, mess up the colors in rectangular areas, create different noise patterns etc).

Reference 1:
This movie poster, even though completely static, has very nice blocky artifacts. That are dependant on input image (the photo):
http://www.motionelements.com/stock-video-8919500-noise-glitch-video-damage

Reference 2:
(follow the link and watch video demos)
http://www.motionelements.com/stock-video-8919500-noise-glitch-video-damage

What can I do to achieve similar effects?

I used particles with refraction shader, with random rotation in Global Y axis.

The particles were rectangular planes, and their material used the "Object info > Random" value to randomize what each particle does.

I used Math > Multiply and Modulo to vary the randomized value into multiple different values to change the IOR for Refract shaders, optionally use some stretched noise texture for bump-map to add extra horizontal stripes.

It uses an orthogonal camera that looks down at a textured plane - whatever you put as a texture on that plane will be the source image or video.

Result: https://youtu.be/m-h_f6KX-dw


Objects do not appear in rendered image My son is working on the BlenderGuru’s donut lesson.
Everytime he tries to render the image, the donut and the coffee mug don’t show up in the render.  The icing and everything else does.

What are we doing wrong?

Shift select the other layers, you need them selected to render.


How can I improt a motion file (animation) and then connect a skeleton to a mesh with animation working? I have been working with Daz Studio, Mixamo, and Blender trying to get proper animations working. If I try to import Mixamo animations to Daz it's broken, the main focus of this question is obviously Blender related. When I import the motion into Blender, it imports a fully rigged skeleton and the animations work properly, however the skeleton is separate from the mesh and is counted as a separate entity. how can I easily add the skeleton to the mesh and have the mesh function properly with the animation.

A major issue with this is the model (which comes from Daz studio originally) has many different vertex groups such as index finger Left, or right hip making parenting bones very difficult if not impossible (for me as an unskilled Blender user).

Follow the below steps:

Select your armature (skeleton) and go to the armature panel and hit rest pose
select your mesh and position it to be fitting on top of the armature
while selecting the mesh hit shift+right click to select the armature as well
hit ctrl+p then choose automatic weighting

Now the mesh should be parented and weights assigned automatically with the armature bones.


Importing multiple movie clips inside one directory via script I want to import multiple movie files via script and add an offset to each file. What I came up with so far returns an error:

"Python script fail, look in the console for now"
but there is nothing in the console.

import os, bpy, sys
from bpy import context
scene = context.scene

path = "/Volumes/Temp/Grau_Benjamin/VIDEO/STab_Kippe_Einzelbilder"

files = os.listdir(path)
files.sort()

file_start_increase = 12
end = 5
i = 0 # count variable

# create the sequencer data

scene.sequence_editor_create()

while i <= end :

    starta = i * 48 + i * file_start_increase

    print (frame_range_back_start)

    bpy.ops.sequencer.movie_strip_add(
                filepath=os.path.join(path, files[i]),
                channel=i + 1, frame_start=starta)

    i += 1

Thank you!

Glob all movie files in a folder

Below is a script to glob all movie files in a given folder, and add them to the VSE as movie strips using Sequencer.new_movie an offset of 12 is added to start frame of each. Edit to suit.

Note the use of bpy.path.extensions_movie Blender's list of movie types it can open.  For my blender

>>> bpy.path.extensions_movie
frozenset({'.mpg2', '.mov', '.avi', '.vob', '.flc', '.mpeg', '.movie',
 '.avs', '.xvid', '.webm', '.mv', '.ogg', '.r3d', '.dv', '.mp4',
 '.flv', '.m2ts', '.mts', '.wmv', '.mpg', '.divx', '.ogv', '.mxf',
 '.mkv', '.m2t', '.m4v', '.ts', '.m2v'})

The script.

import bpy
import os, glob

# glob all movie files from
vid_dir = "/home/batfinger/Videos"
exts = bpy.path.extensions_movie
files = [f for ext in exts for f in glob.glob(os.path.join(vid_dir, "*%s" % ext))]
files.sort()

# get sequence editor
scene = bpy.context.scene
scene.sequence_editor_create()
seq = scene.sequence_editor.sequences

# add movie strips
for i, fp in enumerate(files):
    frame_start = i * 12 # some offset
    name = os.path.basename(fp)
    ms = seq.new_movie(
            name=name,
            filepath=fp,
            channel=i,
            frame_start=frame_start
            )
    # print some details
    print("%s ch: %d fs: %3.1f len: %d" %
            (name, i, frame_start, ms.frame_final_duration)
            )

StackOverflow

Script in question had simple python errors, in that you were trying to print an undefined variable. How to view python error messages?

For python questions like finding all files in a folder, or sorting lists strongly recommend searching on StackOverflow via google.  Eg this search

site:stackoverflow.com python list all files in folder


Add color to shadow catcher Whatever I do, I can't figure out how to change the color of my shadows.

I am using the "shadow catcher" feature in v.2.79
and have my object and the shadow catcher on separate layers.

I tried adding an additional Sun with a blueish tint and HDRI images as Environment Maps but both only colored the object, not the shadow. Also, I tried to use a mix node with the shadow layer and a blueish color as inputs, but it looked weird. I am compositing the Render onto a Background video.

The final render looks like this:

(Also for some reason the shadow is much lighter than in the render preview).
Also here is my composite node graph:

http://imgur.com/F4qdlpir.

Hopefully this can be fixed, happy about your input :)

The Shadow Catcher shader is designed to return the whole appearance of the shader in the Alpha channel. You can see this when rendering a shadow catching object, and switching the display from RGBA to RGB (discarding the Alpha channel information):
normal RGBA display mode:

only RGB channels, entirely black:

only Alpha channel:

Now to add color to your shadows, You'll need to work on the RGB components, as the Alpha is just a blending factor between foreground and background. You can use a very simplified setup like this to get started:

So I'm feeding the Alpha Channel of my shadow catcher layer into a set alpha node, which allows me to define completely different RGB components there. In this setup, I went for a cheap and simple solid dark blue color, but it could also be your color corrected background image with a bluish tint in there.
further examination
For further explanation and the Render Layer setup, check out the .blend file here:

EDIT: Comping over a background image
The following setup should give a hint on how to tint the shadow, in case you need to comp it over an arbitrary background. I forgot that in the original answer, apologies here. Check the updated .blend file from here:

As troy_s suggests in the comments, to tint that shadow on the background, a multiplication has to happen first. Think of the Alpha channel as a constriction of light: It's like cutting out a FG image, and thus it merely defines a geometry rather than a transparency. That can be utilized here. The node setup basically multiplies the BG image with the desired tint color:

Multiplying is one way to treat that BG, but you can use other grade nodes if you like. In that first section you basically tint the whole background before assigning the Alpha channel to that resulting image. So in essence, you grade the BG, and then cut out the portion which is in shadow, and comp that over the original background. An additional Alpha Convert is needed here. If you mute it, you'll notice a lift of pixel values in areas where there should not be any change. The Alpha Convert fixes that.
The resulting image shows a comparison between the two (black and tinted). Please note that the tinted shadow will always get lighter than the black one. That's simply because nothing can become darker than (0.0, 0.0, 0.0). To achieve a different color (like blue), channels need to be lifted.


Blender Sculpt brushes don't function properly I have a really hard time explaining this, but I'll try.
My Brushes don't work flowy and soft like they did before, they just make really weird strokes. like multiple sharp edges or bumps instead of one single smooth line, and i really can't do anything like that. Every brush has the problem of not working precisely and just make the weird sharp stuff all over the place. The only thing still working is smooth. I already tried a lot with resolution, Dyntopo and stroke adjustments, but nothing helps.
The problem started pretty sudden, I noticed immediately when i started sculpting. I updated my blender version, but that doesn't help either.

I added a picture, where i tried to draw a single line with SculptDraw in the mouth area.

I'll hope someone can help or explain.

I was having this issue too. I don't know why this is occurring but I can confirm that Mr Zak's solution worked for me.

To clarify on his instruction:

Create a backup of your work
Switch to object mode
Select only the model you want to sculpt (you can only choose one at
a time)
Press Ctrl + A
Select Scale from the pop-up menu

The fix is complete and you may now switch back to sculpting if you wish.


Create procedural spiral pattern I'm trying to make a galaxy in blender. If I use an image of a galaxy to get the spiral shape it becomes a 2d image projected into the 3d volume. To avoid this I wanted to use a procedural method, but I can't figure our how to get a spiral shape. I've tried searching this and I don't get any results similar to what I'm looking for

Final result

One method is to create a volumetric cylinder and distort it by rotating it around the origin by an amount that varies based on the distance from the origin.

First, create a volumetric cylinder. This is achieved by calculating the distance from the origin in just two of the three dimensions (it's effectively a circle projected along the remaining axis). This can be achieved using the Dot Product vector maths node using the following arrangement (assuming the cylinder is to be produced along the 'y' axis) :

The Dot Product used in this way (with the same vector on both inputs) produces the square of the length of the vector. The following Power(0.5) node calculates the square root of the squared length - ie, the actual vector length. The Less Than node controls the radius of the cylinder.

NOTE : The Geometry Volume Sampling step size has been decreased to 0.010 in this example in order to improve the volumetric precision (at the expense of render time). Also, the Light Paths Volume Bounces has been increased from zero to 3 to allow multiple scatter bounces (see the properties panel at the right-hand side of the image).

In order to rotate the cylinder we need to use a rotation matrix similar to

X = x * cos(angle) + y * sin(angle)
Y = -x * sin(angle) + y * cos(angle)

Since we already know that the 'y' coordinate is irrelevant (since the cylinder is unchanged regardless of where along the y-axis it is viewed) we can simplify this by only actually needing to calculate in the X coordinate. This is therefore achieved with the following additional nodes :

NOTE : Varying the Value input node rotates the volumetric cylinder. The Multiply node multiplies the input value by 2*pi, converting the input value to radians - so 0.0 to 1.0 produces one whole rotation.

To produce a spiral we can simply vary the rotation based on the distance from the origin. This can be achieved with another Dot Product/Power node combination with the following additional nodes :

Increasing the Value input varies the number of turns of the spiral.

Note, however, that the spiral is stretched into a thin ribbon as it is rotated. To counteract this we can simply add additional nodes to vary the thickness of the original "cylinder" based on the distance from the origin :

Thickness controls how much the cylinder is scaled based on the distance and Bias controls the starting thickness at the centre of the spiral (prevents it collapsing down to a point).

Blend file included

Note that this is a very much "brute force" method of generating a spiral - and it can only produce a spiral with two "arms" (unless you were to truncate the spiral at y = 0 - in which case it would have a single "arm").

Another approach is to generate the spiral directly - rather than distorting a cylinder - by calculating for each 'sample point' the closest point that lies on the centreline of the spiral. Calculating the distance to the centreline of the spiral allows us to determine whether that point lies within the spiral. This produces more versatile results and does not require manual adjusting of the thickness. It can also generate spirals with any number of 'arms'.

To achieve this we need to be able to calculate the closest point on the centreline of the spiral. For any point in the volume we can determine a number of things about this 'closest point'

It lies on the 'plane' of the spiral - in our case we can use z = 0
The sample point in the volume is along the direction of the Normal of the centreline from the closest point - ie, it points away from or towards the origin.
The centreline distance from the origin varies based on the angle that the spiral centreline makes in the plane of the spiral (and, therefore, also its normal).

This allows us to calculate the closest point of the centreline for any point in the volume. Once we know the 'closest point' we can simply calculate the distance between it and the sample point to determine whether that point in the volume lies inside or outside the spiral (based on our desired "arm" radius).

Firstly, the angle to the origin - this can be calculated using standard trigonometry using the arctangent, since tan(angle) = x / y so atan(x / y) = angle. This will only give a result over half the rotation before repeating for the other half, so we need to include additional nodes to add 180 degrees (or 'pi' radians) for the second half of the rotation - ie, when the sign of the y-coordinate flips between positive and negative. This yeilds the following nodes to determine the angle from the coordinates :

The distance from the origin can be determined simply using the Dot Product and a Power(0.5) maths node (again, passing the same vector into both inputs of the Dot Product calculates the square of the distance, the power(0.5) takes the square root, resulting in the actual length of the vector) :

The modulo function is used to determine which rotation around the spiral arm is the closest to this point and this, adjusted based on the angle (calculated as above) gives us the point on the spiral that is closest to this sample point in the volume.

We can add in some nodes to allow the results to be adjusted (eg, varying the thickness based on the distance so that it thins out towards the ends of the arms) and this produces the following material :

To make it easier to reuse, we can create a node group that takes the vector in the volume, the desired properties of the spiral (number of "arms", "twistedness") :

This can be used as follows :

Now you have a configurable volumetric spiral, the only remaining challenge is to use this to produce a believable galaxy :

To make each galaxy different we can use the Object Info 'Random' property to generate the spiral properties to produce the following result :

Blend file included


Reflection of HDRI in Cycles not working? I added a HDRI as enviroment on cycles, but the model that i got here (an Eye) isnt reflecting good, at least, not a definite picture.

That's what i have:

But this is what i need:

Can someone help me with this? :( i'm a little lost on Cycles and materials..

It looks like you need to turn down the roughness on the glossy shader.  Roughness is how much the light scatters away from the perfect specular angle.  It makes for blurrier, less crisp reflections.

Here is a diagram:

The first three examples on the left are a ray hitting glossy surfaces with varying roughness (left to right no roughness to high roughness), the fourth example is a ray hitting a diffuse surface for comparison.


Shape keys and Drivers problem [

My drivers are not working correctly with my shape keys everytime i try to make a shape key work with an objects Z Axis i have to have it way beyond the mesh,I have already tried using the generator but that did not help.
how do i only have to make it so that i only have to move it up slightly.

I also have my shape keys needing the object to the go the opposite direction of where it was intended to go

To increase the effect of, and invert the direction that effects the shape key in your driver:

Go to File->User Preferences.
In the User Preferences window, select the File tab and check the box for "Auto Run Python Scripts".

Go to the graph editor in the Drivers tab and Change the type to "Scripted Expression".
In the expression box, type "-2 * var" (no quotes and with var being your variable name).

This expression will multiply the distance you target object travels by 2(or whatever you number you choose). So your target will have to move half as far. The higher the number, the shorter the distance. Making the number negative changes the direction it must travel.

EDIT

After looking at the blend, the target is upside down on the Z axis, making its local space z axis(and your variable) -6.69. Negate that by adding 6.69 to it. Then multiply that by -10 so you will only have to move up by 0.1 to reach the maximum of the driver. So the expression is: -10 * (var + 6.69) And make sure "Auto Run Python Scripts" is enabled.


Armature duplication causing problems I'm currently learning about rigging, skinning and animating, but I've run into a problem with a part of my armature. The scale, rotation and position of my mesh and armature on right side has been applied, I've duplicated the armature for the arm, hand and fingers, mirrored it to the left side on the X axis, but for some reason a part of the arm is twisted. I tried resetting the rotation, scale and position using Alt + G, R, and S, which has helped, but it's still not right. To begin with, the arm was twisted round like a sausage. This is what it looks like now:

You need to correct the IK Pole Angle value of your forearm:

First, select your armature and in the Properties panel > Data > Colors go back to Default Colors so that you can see where are the constraints. You can see that your forearms have an IK constraints (green bones).
In Pose mode, select its right forearm (the one on our left) and go in the Properties panel > Bone Constraints. Now play with the Pole Angle value to correct the rotation. You often needs to do this after giving an IK constraint so that Blender knows how the bone is supposed to be oriented.


Cycles texture on sphere to follow sun rotation I'm trying to make a cycles material for a planet in space, and I'm having trouble separating the dark-side of the planet from the light-side. I'm trying to relate it to the rotation of a sun lamp, such that I can mask it for daytime vs nighttime.

I've been trying drivers on the rotation fields of a vector mapping node, based on the rotation of my sun, but not having much luck.

I would do this by parenting an empty in line with the sun, then using the empty's coordinates as a vector in the node editor to get the sun's rotation.

First create an empty and parent it to the sun lamp.  The empty should be directly in line with the sun lamp, but not exactly on top of it.  To do this it helps to reset the sun's rotation (Alt+R) and put the empty somewhere directly underneath the lamp before parenting it, then re-position the lamp how you want it.

Next go to the node editor and add the following nodes.  The output on the right will be the desired gradient from facing sun's direction 1.0 to facing directly away from the sun 0.0.  The three Value nodes on the left are driven by the empty's X, Y, and Z positions respectively.

The position of the empty is converted to a vector using the Converter > Combine XYZ node, then normalized so that you don't have to worry about the distance from the lamp to the empty and scene units conversion to the node editor etc.  The desired output is created by taking the dot product of this value and the geometry's normals.

Note that since I am using the dot product, this output will be a quadratic gradient.  To get a linear gradient you will have to compute the vector similarity manually, or just use a color ramp or RGB curve node to create a satisfactory gradient.


Export Track Markers to csv I am trying to export markers from the Blender motion tracker and found the following script that will do exactly that:

for clip in D.movieclips:
    for track in clip.tracking.tracks:
        fn = 'data/tr_{0}_{1}.csv'.format(clip.name.split('.')[0], track.name)
        with open(fn, 'w') as f:
            frameno = 0
            while True:
                markerAtFrame = track.markers.find_frame(frameno)
                if not markerAtFrame:
                    break
                frameno += 1
                coords = markerAtFrame.co.xy
                f.write('{0} {1}\n'.format(coords[0], coords[1]))

It works but I have two questions:

How can I save the data on my Desktop rather than in folder in MacOS blender content where it saved right now. The following won't work:

fn = '/User/me/Desktop/data/tr_{0}_{1}.csv'.format(clip.name.split('.')[0], track.name)
The resulting values I get do not represent the more user friendly marker values in den Blender GUI. Instead of x/y coordinates in screen coordinates, I get a value between 0/1. How can I convert them to those screen coordinates ?

Thanks for your help

(modified from this Source)
The script outputs a csv file with the coordinates for each tracker.
from __future__ import print_function
import bpy
D = bpy.data

outputFolder= "/set/your/output/directory/here"

printFrameNums = False # include frame numbers in the csv file
relativeCoords = False # marker coords will be relative to the dimensions of the clip

f2=open('export-markers.log', 'w')
print('First line test', file=f2)
for clip in D.movieclips:
    print('clip {0} found\n'.format(clip.name), file=f2)
    width=clip.size[0]
    height=clip.size[1]
    for ob in clip.tracking.objects:
        print('object {0} found\n'.format(ob.name), file=f2)
        for track in ob.tracks:
            print('track {0} found\n'.format(track.name), file=f2)
            fn = outputFolder+'{0}_{1}_tr_{2}.csv'.format(clip.name.split('.')[0], ob.name, track.name)
            with open(fn, 'w') as f:
                framenum = 0
                while framenum < clip.frame_duration:
                    markerAtFrame = track.markers.find_frame(framenum)
                    if markerAtFrame:
                        coords = markerAtFrame.co.xy
                        if relativeCoords:
                            if printFrameNums:
                                print('{0},{1},{2}'.format(framenum, coords[0], coords[1]), file=f)
                            else:
                                print('{0},{1}'.format(coords[0], coords[1]), file=f)
                        else:
                            if printFrameNums:
                                print('{0},{1},{2}'.format(framenum, coords[0]*width, coords[1]*height), file=f)
                            else:
                                print('{0},{1}'.format(coords[0]*width, coords[1]*height), file=f)

                    framenum += 1
f2.close()

Pay attention to the units used.
The script will output coordinates in pixels, where 0,0 is at the bottom left of the frame.
To use a float values, where the frame has coordinates 0 to 1, change relativeCoords = True
To include the frame number as part of the set, use printFrameNums = True


Archipack window not showing anything I haven't tried Archipack previously but anyways, after going like this:
and when I click on Windows it shows up this black patch in middle of the viewport:
I tried Wall and it worked well as it added a wall type mesh, but in this case windows aren't showing up, that black patch covers my viewport..

Blender's official Archipack addon require additional setup steps in order to work.
Preferences -> Add-ons -> archipack -> Setup Actions -> Render Thumbs

From:
https://github.com/s-leger/archipack/issues/88


Blender file taking over an hour to load, is this normal? System spec: Threadripper 12 core, SSD, 32GB RAM, 2080ti

File details: 40MB .blend 10 million verts in a curve.

File creation details: Curve created via importing of a very large and complex SVG

Blender version: 2.8

System utilization at time of file read: CPU 5%, RAM slowly gets to about 2.5GB.

The initial SVG import took about 90 minutes but I expected that after it was imported and saved as a blend file, it would be much faster to load up, as no SVG import is needed. It still takes over an hour to load and doesn't seem to be using more than 2 cores.

Once I'm in the file it cannot be worked on as just doing something as basic as switching to edit leaves me sat there waiting for it to switch modes. After 15 minutes of waiting I gave up on it, as waiting more than 15m to switch modes would be just unusable. I do plan to split my curve into multiple pieces, but I can't until I can edit it. I can break it up within the SVG, but it save more time if I can just do this in Blender.

Any performance tips would be most appreciated. Thanks.

10m vertices in a curve are a lot, especially since a bezier is subdivided even more between its control points. With a 2D curve, the filled shapes have to be calculated; another unoptimized step.

Some ideas.

Simplify the svg before exporting (in the exporter application).
Separate the svg in object mode. F3 > "Separate" [search]
Reduce the Preview Resolution of the curves.


How can I create a water material in Cycles? I'm creating a scene with large amounts of water that will be readily visible, containing refraction and at various angles. The scene is an indoor long-course swimming pool, about 50 meters, all of which would be seen by a camera above 5 meters above the water's surface. This is being fluid-sim'd, but there are no quickly-moving objects or people, so any water movement is slower and in bulk. The "remove bubbles" option is enabled.

I've tried using a Mix Shader of Refraction BSDF and Reflection BSDF with the factor coming from a Fresnel node, but the results appear either too glossy or too transparent and overly colored. How can I make the water appear realistic? Changes to shaders (refraction to glass)? Or is tweaking colors sufficient?

It is very important to add some small scale displacement to the water surface. This small scale detail is present even in closed spaces due to minor drafts of air, especially in large pools of water. My personal experience is that for best results you can use a combination of animated voronoi textures, like perlin noise does.

This small detail makes it possible to have areas of water that are slightly more refractive or reflective than others. To separate the refraction and reflection parts, you use a standard fresnel factor connected to a mix shader node.

This is my example shader:

(play with index of refraction to achieve a different ratio of refraction to reflection depending on the angle of viewing)

And this is the resulting water:

Of course on indoor scenes you will need many samples or clever lighting to avoid too many fireflies.


Rotating local axis to 3D cursor When rotating an object, how do I snap one of its local axes to the 3D cursor? In other words, how do I make that axis point directly to the 3D cursor?

A practical example: I want to make the center line of a cylinder point exactly to the 3D cursor.

I'm afraid it isn't possible to set rotation directly to the 3D cursor but you can achieve a similar effect with a number of steps.

First, add an Empty to the scene - this will, by default, be added at the location of the 3D cursor.

Add a Track To constraint to the object you're trying to orient. Set the Target to the newly added Empty. Configure the constraint To and Up settings to set the required orientation.

In the 3D window press Ctrl+A to bring up the Apply menu. Select Visual Transform - this will set the object's rotation, location, etc. to the current 'visual' orientation (ie, that including any constraints).

You can now remove the constraint and delete the Empty and the object should retain its orientation, pointing at the location defined by the 3D cursor's location.


Does OSL work on the GPU? On openshading the FAQ says:

OSL only works on the CPU for now. It would be possible to port the system to GPU, but it would require a lot of work. There are no immediate plans for it.

What does this mean? Does this affect only OSL script nodes? I noticed that a a OSL script wave_rot.osl is compiled in wave_rot.oso which looks like assembly source code (but not for ia64 so I guess it is code for CUDA).

From the wiki:

  Users can now create their own nodes using the Open Shading Language (OSL). Note that these nodes will only work for CPU rendering; there is no support for running OSL code on the GPU.

Quote from Brecht:

  The main issue is to get OSL working on the GPU. It's almost as much work as building Cycles itself. It's not easy to do so we need more people to help us.

The oso file just contains the shader compiled bytecode.


How do I enable Mantaflow in Blender? I have been using the internal Blender fluid system for a while now and it has been very frustrating so I'm hoping it'll be better with Mantaflow.

How do I enable Mantaflow in Blender?

Mantaflow is not in Master yet so you have two options for now:

You can grab a build with Mantaflow here: http://graphicall.org/
You can build Mantaflow Branch by yourself from sources: https://wiki.blender.org/wiki/Building_Blender


How do I change the default blender controls to allow for left click drag/box select? Like in the maya preset controls When you use the maya preset controls scheme left click and dragging allows you to use a drag/box select but in the default blender control scheme left click and dragging edits the geometry of the mesh. How would I change the blender controls to allow for left click to be drag/box select?

Open Blender, go to the splash screen, click on interaction, then on the drop-down menu, press Maya.


Is there a way to use a point other than the origin as the center for "edit object" "add object"? I am making a simple gun that is rotated on it's base by the mouse (sort of like a cannon), and am not using rays for firing, but an object parented at the end of the barrel which uses "add object" to fire bullets. As such, the object's origin is the same as the barrel's, so that it stays at the end of the barrel when the barrel rotates. It's all fine and dandy, except for that the "add object" spawns the objects at the origin, far in the back of the barrel. This causes the bullets to come out of the side of the barrel when quickly swerving, as the bullets are not coming from the barrel's tip. So, is there a way to make the "add object" bullets come out of the tip of the barrel, where the object is placed, rather than the origin?

Is there a way to use a point other than the origin as the center for “edit object” “add object”?

No, there is not. But yes there is (but not i the way you imply with your question).

Background

How would you tell where this point is?

Your expectation is that the projectile is inside the barrel and it moves out of it. This is correct in real live and the audience (player) should think it is this way.

But this is a game. It's purpose is entertainment. Therefore you do not care things that are not even visible to the audience (projectile in a barrel is not visible).

As you noticed having a projectile inside the barrel is not something the physics engine really want to deal with.

You correctly try to achieve you place the projectile right at the end of the barrel and let it travel from there. The physical effects from the time inside the barrel are just applied (the initial velocity).

Where is the end of the barrel?

Who cares! Just place an emitter (empty) at that location and let it emit the projectile.

When you parent the emitter to the barrel it will follow any turns and motions.

The whole secret is: the barrel is not the emitter.


Python: Copied Object Not Showing in Outliner When I copy an object using bpy.context.active_object.copy() the new object doesn't show up in the Outliner even though it appears when I list() objects in the Python shell.
Questions:

Is there a second step to get the object to show in the Outliner?
Or perhaps it's only copying the object's data? (If so, to what purpose?)
Are there no companion functions, ie: paste() and/or cut()? (Command line completion yields nothing.)

Note: bpy.ops.object.duplicate() makes a copy that does show up in the Outliner, so these questions aren't about how to make a working copy/duplicate. I want to understand the purpose of copy().

Link it to a collection
Prior to 2.8 a copied object required linking to the scene's objects collection.  For 2.8+ link it to a collection.
It will show in the outliner when collection is linked to a scene, or is the base scene collection.
The duplicate operator links the dupe to the context collection.
import bpy
from bpy import context

ob = context.object.copy()
context.collection.objects.link(ob)

link new object to scene with python in 2.8


How to store Settings in txt-file? I'm trying to store render settings and other settings in a txt-file.
Sadly I was not able to find a proper solution on google.
Is there an accurate way get the settings, store them in a file
and put them back in an other file?
Example, store this:
bpy.context.scene.render.engine = 'BLENDER_EEVEE'

bpy.context.scene.eevee.taa_render_samples = 45

bpy.context.scene.eevee.use_motion_blur = False

And get it back in another file.

To set settings:
import bpy
import json

my_txt = '''
{
    "render": {
        "engine": "BLENDER_EEVEE"
    },
    "eevee": {
        "taa_render_samples": 45,
        "use_motion_blur": false
    }
}
'''

render_settings = json.loads(my_txt)

for section in render_settings.keys():
    for name, value in render_settings[section].items():
        setattr(getattr(bpy.context.scene, section), name, value)

To get primitive settings:
import bpy
import inspect

primitive_types = {int, str, float, bool}

section = bpy.context.scene.render

def is_valid(i):
    if i[0].startswith('_'):
        return False
    if not type(i[1]) in primitive_types:
        return False
    if section.is_property_readonly(i[0]):
        return False
    return True

settings = inspect.getmembers(section, lambda i: not(inspect.isroutine(i)))
settings = dict([i for i in settings if is_valid(i)])

for name, value in settings.items():
    print(name, value)


How to get thinner ends of hair particles? I'm trying to make the ends of the hairs I make thinner than the root of it, does anyone know how to do that? Cause at the moment it looks too straw like. Thanks.

As far as I know, you can only do it using Cycles.

So, once you've changed your render engine, head over to the Particle Properties tab and tweak the values under the Hair Shape section until you get satisfied with the result.

The first three inputs are pretty intuitive, just mess with them; the fourth one is simply a global scaling factor.


I created a Start File; When used, though, the materials are broken This program, I tell you...
So, I created a Start File so that I don't have to do a bunch of the same thing when I create a scene. The start file loads just fine when I open it and look around.
But Then I select: FILE - DEFAULTS - SAVE STARTUP FILE
And the very next project, when Blender loads: Pinksville. Most of my materials - which previously loaded with no problem - are now broken.
Any ideas? I could share the blend but it wouldn't really matter as it's the material connections that's the problem.
Also: I realize I can pack everything into the Blend. I've done that for the time being, but I'm just wondering if there's something obvious I'm missing. This was working with no problem, but now suddenly it doesn't.
Thanks for your attention.

Pink means that something was either moved, or is now missing.
The first thing to do is to run File>External Data>Report Missing Files* and File>External Data>Find Missing Files to report and locate the missing files.
Note from the manual:

Report Missing Files
This option is useful to check if there are links
to unpacked files that no longer exist. After selecting this option, a
warning message will appear in the Info editor’s header. If no warning
is shown, there are no missing external files.
Find Missing Files
In case you have broken links in a blend-file, this option will help you to fix the problem. A File Browser will show up. Select the
desired directory (or a file within that directory), and a search will
be performed in it, recursively in all contained directories. Every
missing file found in the search will be recovered. Those recoveries
will be done as absolute paths, so if you want to have relative paths
you will need to select Make All Paths Relative.

Once you have fixed your file paths, save your start-up file again with Ctrl+U


How to make a shade sail/Sun sail? I am trying to make a shade sail with two lower points (for water) for a client in blender, this is basically what i need to do.

I've tried proportional editing but it is ineffective and very unsmooth. A cloth simulation with pinned corners doesn't work either. I am relatively new to blender and would appreciate the help :)
Thank you!

The cloth solution referenced by @batFINGER works for me:

Starting with the two (nearly) straight edges, first, Bridge Edge Loops with settings something like these:

.. and you're nearly there. A bit of Vertex > Smooth-ing on the internal vertices might do. But if you want to, you can finish the stretch with a quick Cloth sim, as shown on the right, above, with settings very similar to those provided as 'Tent' in the referenced answer, and the straight edges pinned throughout, rather than just the corners.

(the sim runs to stability in about 30 frames, in the provided .blend)


How do I speed up Blender Game animation? I am using the Blender Game render for keyframing physics, but when I play it back, it is so slow (the keyframes are close to each other, the closest they can get, but it is still slow). Is there a way I can speed this up in the graph editor?

Also, and unrelated question:
After I keyframe with Blender Game, can I go back to Cycles Render without affecting the timeline?

You can speed up the playback of the animations by increasing the 'Animation Frame rate' speed in the Render properties editor.


Can I copy a video strip from one opened Blender into another? I have a project where I have a video, I added to that video some text and I sped it up. I want to re-use that project/video within several other projects.

At the moment I have 2 blenders opened. One with that project, and another one, an empty one where I want to copy it. I tried using the append feature, and appending the scene, but that only appends a cube, not the video.

I could render into a movie, and then reuse the movie, but wouldnt that lower the quality?

This works for me - pack the video into .blend using File -> External data -> Pack All into Blend.
Then from the other project select File -> Append, find the .blend with the packed videos and append the Scene datablock.
The video strips should be appended now.


Change the colors in the Graph Editor community this is my first question in the forum. Of course, I have been trying to find the answer for quite some time before posting, and nope, the setting I am looking for is not in the THEME tab from the settings menu in Blender.
By the way, I am using Blender 2.82a, and the problem is that I have a light blue color that interferes with the white letters in the graph editor's transform channels and it's hard to read(I have noticed most likely everyone has dark gray background), Please take look to the image.

In the view menu of the graph editor, uncheck "show group colors", and the default color should be back.

This light blue color you see is associated to the bone groups in the armature properties. It is very handy in the viewport, but make things less readable in the graph editor.


Black objects in cycles render I rendered a scene and an object was visible. Then I changed material's surface(maybe I accidentally changed something else) and an object became black. It's still fine in rendered viewport shading!

You may have unintentionally modified the mask layers of the Renderlayers tab, in properties panel :


Where is Blender version 2.79? i tried finding Blender 2.79, but only found 2.79b in the official Blender website. Can somebody please help me?

Main page of blender.org only shows the latest stable release.

For the previous versions of 2.79 check out this link http://download.blender.org/release/Blender2.79/

You can find more previous versions here

http://download.blender.org/release/


Why is rendered viewport faster than rendering individual frames? When I'm using rendered viewport it initially takes a while before rendering starts, but once it does, I can freely move around and rendering a new view happens almost instantaneously. When on the other hand I'm rendering a movie, for each frame Blender takes a significant amount of time before rendering even starts, usually doing the following:

Synchronizing object,
Updating images,
Updating meshes,
Updating Scene BVH,
Packing BVH,

Why does it do this? And is it possible to disable this to increase movie rendering speed?

It is possible to make the final render almost as fast as the viewport render, but you might not want to. The viewport render sacrifices a lot of features in order to make it update quickly. Firstly, it uses Direct Illumination only, which means that it basically only ever calculates 2 bounces. It also has a lot to do with whatever modifiers you're using. If you have a subsurf modifier that is set to 1 subdivisions for view and 4 subdivisions for render, then your final render has to deal with x^4 more polygons than the viewport does, which is obviously going to take longer.

There's also a little overhead in writing the frame to a file and then loading the next frame to start rendering, which the viewport doesn't have to do.

Lastly, the BVH acceleration structure (selected in the render settings) can make a critical difference in render speeds. IIRC, the viewport ONLY uses Dynamic BVH which spends a lot less time calculating the BVH (because things might move around), but each sample takes longer.

Details:
There are two parts to the render: setup and sampling. The right setup can make sampling faster, but if you have to do some complicated setup for every frame, that might actually take longer than the time you save on sampling. The part of the setup that matters is the Acceleration Structure, called a Bounding Volume Hierarchy (BVH). This is basically a way of organizing things so that they're easy to find. You can either have a Static BVH or a Dynamic BVH. A Static BVH takes longer to build, but makes sampling more efficient. The Dynamic BVH doesn't take as long to build, but it doesn't make sampling quite as efficient as Static. The other important difference is that with a Static BVH, nothing can move*. If anything moves, it has to be totally rebuilt. Whereas with a Dynamic BVH, if something moves from one frame to the next, the BVH can be updated much more quickly than with a Static BVH.

IIRC, there are also some features that aren't rendered at all for the viewport. I want to say that SSS, AO, and caustics aren't (or weren't) calculated at all for the viewport render. But I'm not sure what they are.

*To be honest, I'm not quite sure what "nothing can move" means, I just get this from the tooltip. You'd do well to do some research or experimentation. It's possible that a Static BVH can be reused even if objects translate, so long as the mesh doesn't deform. It's also possible that any change of any object from one frame to the next requires a complete Static BVH rebuild. I'm not sure.

I hope that helps!


Render result looks different than render view I managed to create a throne with a dragon egg on it. Now I am facing a problem:

When trying to render it, the shape of the egg, looks way different than in the render view. It seems like the texture doesn't apply. It looks quite good in the render view though.

Anyone who can help me here? I am using Cycles in Blender 2.8.

Here the file: https://drive.google.com/open?id=1vCU6KnPzfw1ZMjgM7lQ_nmOUs5Eap2V9 (too big for blend-exchange unfortunately)

Thanks!

Your egg's subdivision surface modifier has different settings for viewport and render. Usually, the viewport setting is lower for fast visualisation and higher for best quality renderings. It looks like your settings were inverted.


How to get those multicolored shadows? I see in a lot of WIP-images people rendering their models untextured, but with a nice looking light. It's like there is a multicolored spectrum in the shadows. How do they achieve this? I see it in almost everyones "clay renders" (or how you call it). When I just render my model with a standard light source everything is completely monochrome.

The only way for me to achieve something like this is to add a 360-image as world background and set the light and image details to reflect in the model. I don't think this is how they do it.

Here is a couple of example on what I mean:

https://blenderartists.org/forum/attachment.php?attachmentid=490894&d=1499709836

https://cdn.dribbble.com/users/24025/screenshots/972539/canon5d_clay_2013_shot.png

Those are not colored shadows, shadows don't have a color per-se, they are just e slightly colored light sources.

Just add a slight tint to your lamp objects so one has a warmer redish tone, and the other has a cooler tone towards blueish or green.

This is generally done using a Three Point Light system, which is a well know lighting technique in photography also.

Optionally if you want more realistic shadows or natural lighting use a sphericall environment map in your scene's World nodes, Ideally HDR based or as regular JPG image.


Problem creating mirror in X, Y axes I'm trying to create a mirror in X and Y axes with a circle like this:

But I can't fill all the circle, there are some edges that doesn't create. I've looked many manuals and it is supposed to work well as I'm doing. What am I doing wrong?

Mirror's axes are specified by the object, not by the world. So the transforms what you do in object mode don't count, only what you do in edit mode. You generated the circle in object mode, then rotated, then went to edit mode. You are supposed to go in edit mode, then rotate with 22,5°.
All the transforms must be 0. You can apply the transforms by hit CTRL-a and select rotate and scale.


how to modify blender to have real world particle physics? Its been discussed in the blender community that blender physics is not entirely accurate.

My question before I go into detail is: How to modify blender to have real world particle physics? I am a computer science major, so I am assuming I will need to build blender and modify the physics.

classic example how blender physics does not match real would physics is gravity on a box with a negative force above it.

The box picks up momentum the longer its under the influences. What should happen is eventually comes to a rest between the "force" and the force of gravity.

Also, if you have + charged particles in-between two - charged planes, it will not settle down to one point, it will zig zag continuously.

another thing, is that particles between a negative and positive charge plane, will move in one direction.

but in real life, particle accelerators have to keep oscillating the charges, or else the particle will come back to the opposite charge.

This is what should have happened in blender. Where the positive particles go past the negative plane and then come back. But for some reason, when a positive plane is added it ignores the negative plane.

lastly when trying to accelerate a particle:

it does not accelerate the particle, the example above has 4 objects oscillating their charges to make the particles go in a circular motion. It does this but not the way it should.

The particle should have a acceleration to it. This is the principle of cyclotrons, a particle accelerator that alternates its charges of two plates to accelerate the charged particles. Instead whats happening in blender is its stretching out the particles in a circular motion.

my hunch with the examples given is that there is something or multiple  things missing in blender physics. So how do I fix this? has anyone already done this? Its been bugging me for years that blender's physics is off.

Physics and particles are a tool to make movies. Not much else. They are intended to show how a steam engine works or a flock of birds in the distance. Force fields are meant to blow a smoke text away. Their job is to make stuff look good. They do not have the scope (yet) of being a physically accurate simulation of real world forces. 3D animation is the art of faking it.

When I was doing my little solar system I didn't even try the physics, I just coded a bit of python gravity myself. Also not physically accurate (no need) but I got some nice elliptical orbits. Managed some gravity slingshots, too.

So either you really need to work on the code or you might get away with python or python with C/C++ help, depending on the performance needs. Changing the source code of course means one of three outcomes: You need to merge your code every time a new version comes out, you get it committed and it becomes a part of the official release or you are stuck with a Blender version that slowly gets old.

At the last Blender Conference there was a talk about simulating quite a few million blood cells with a super computer. So there's some fancy stuff possible if you're determined.

If you want these features, start to make them happen.


Color all of my models using one texture First of all, I'm not very familiar with texturing.

So what I want to do is have one texture with a selection of colors as such:

And use that to color my (low poly) models to prevent having to use multiple materials.

If my question still remains unclear. This is what I want my models to look like, by only using one texture.

Is this possible?
Any help is appreciated :)

Just create a new material and assign it to all faces.
Make it uses the desired texture as diffuse or whatever channel suits you.

Then part by part select the faces of your mesh and unwrap them using any simple method with U > Unwrap

In the UV/Image Editor scale down the islands so they fit totally inside one of the nine color cells.

Repeat until you are done. You can readjust them easily by moving each island individually over a desired color.


Change Dimensions on Project can anyone quickly tell me, how can change the dimensions of my whole project. For example: If I am building a skyscraper and it is to big to navigate, it would be much easier to just put in the numbers for the cube at dimensions (20m20m100m) and still have a relativeley small object. But if its a bigger project, I wouldn't want to divide every dimension by 100. Is that understandable or do I need to elaborate? :)
Cheers

It is actually much easier to just adjust the clipping instead of messing around with dimensions. I also found it to be easier to use measureIt, a very convenient tool for architectural modelling...


Is it possible to load animated gif images? I have an animated gif and wanted to use it in the animation but I'm not sure how.

Short answer:
You can't.
Blender does not support the gif format.
Long answer:
You would need some other software to convert your gifs to a format that blender understands to be able to import them.
For a list of supported formats see here


Why when I render my 200 frame animation everything is the world color and not the animation? Please Help
Why when I render my 200 frame animation everything is the world color and not the animation?  I have fully created the models and environment and when I run the animation in the UI under material it works fine,  when I try to animate the animation is just gives me grey frames.
I cannot figure out why it wont render the actual animation.

http://youtu.be/A5J8y4uCtsU

be sure that all  layers that contains your objects are selected in the render_layer tab"


Tracking moving points on a reconstructed plane I would like to track animals moving on a plane from an aerial video. I'm very new to Blender, but believe that there is a way to do this. Up until now, I have managed to solve the camera motion from tracked points on the ground, and reconstructed the plane on which the animals are moving - this is set as the Floor of the scene, since it really is just a plane. Now I would like to track the animals - they are small in the footage, so every animal can be tracked by one marker.

My question is as follows: Can I tell somehow Blender that the animal object is located on the floor, and thus, can I solve its motion from only one track?

Information Download

When you have a point that you have tracked in the Movie Clip Editor, you generally use it to solve camera motion. Occasionally, like in a VFX scenario, one might deploy a style called Two-point Motion Tracking. This uses two tracked points, reconstructed as empties that will move on an X/Y Plane. In the linked video, the narrator goes on to show that if you have a dowel rod with sharpie at the top and bottom (points for tracking), and you track those points, you can stretch a glowing cylinder between them and make it look like the person is wielding a lightsaber.

Your Scenario

In your case, you will probably be looking at a type of One-point Motion Tracking, except with multiple one points for each scenario.

You will want to be happy with your camera track. After tracking the animals, re-solving the camera motion will be a pain to not possible.
Track an animal.
Go to Bottom toolbar > Reconstruction menu > Link Empty to Track. There should now be a Plain Axes Empty connected to the Camera by a dotted blue line.
In the 3D Viewport, switch to Local Transform Orientation.
Move the Empty as close or as far away from the camera as needed (probably along Local Z).
Parent your animal (I assume) to the Empty.

Hope this helps and happy Blending!


How to find out which modes (object, edit, weight paint, pose etc) is activated using Blender's Python API? There are buttons for switching to object mode, edit mode, pose mode and others. How to make sure which of these modes is active using Blender's Python API? Any information would help! Preferably with at least a small example of two simple buttons. For example, layers I managed to do on. off. But layers are not suitable. I will be very glad to your tips. Thank you very much!

You can get the current activated mode with the following:

bpy.context.active_object.mode

This will print things like OBJECT, EDIT, WEIGHT_PAINT, POSE etc


Why can I only texture paint some parts of the model I am only able to paint some parts of the model but it just doesn't add any color to some other parts or the color it got added is very faint. Please see the red circled area in the screenshot. I am really confused about this. Can someone please let me know what I did wrong here? Thanks.

I also checked the UV unwrapping and all the normals associated to that area which seem okay.

In your first photo the reason why your texture looks so strange is because the UV associated with that face is squished in a way that it can only take the colour of a single row of pixels. A way to fix this is to select some of your edges and right click, then create seams. Then select everything and press U, then smart unwrap. This should be able to make your UV map easier to work with.


How can I disable bpy.ops.convert objects sorting? I would like to iterate through all objects in my scene and change their type to Mesh using script. It works, however after every iteration blender sorts all objects on the map (I've got over 130 000 objects). It is realy slowing down the process.

Is there a way to disable it through some function or just modify convert function in Blender source code? (I've tried to look for it but I failed, do someone knows where is it exactly?)

Or maybe there is another way to convert curves to meshes or optimize it?

Thanks in advance for any help. Cheers

My convert function:

def to_mesh(obj):
    obj.select = True
    bpy.context.scene.objects.active = obj
    bpy.ops.object.convert(target = 'MESH')
    obj.select = False

Console output. I think that the process is so slow because convert sorts all objects after operation (ordered on the top), or am I wrong?

Run the operator once for all curves

I imagine you are getting poor performance because you are running the operator for each curve object, rather than once for all.  See Python performance with Blender operators

Suggest selecting all the curves in scene, and running the operator once, example test code.

import bpy

context = bpy.context

# select only curves
for o in context.scene.objects:
    o.select = o.type == 'CURVE'

curves = context.selected_objects
if curves:
    # just in case context object not a curve
    if not context.object.select:
        context.scene.objects.active = curves[0]
    # convert them all
    bpy.ops.object.convert(target='MESH')

As for the sorting, that's just what blender does in its background processing, and is I doubt responsible for slowing down your blender.

There is also the Object.to_mesh which can be used to convert the curve to mesh without using the operator. However in this case I think selecting all curves and converting with one operator call is sufficient.


Using Blender on a Computer in another room So the situation is that I have a PC in a room in my house and I would like to be able to use that PC whilst I'm in another room, bear with me, as I have just started a family and don't want to be spending my time separated from my wife and child.  The computer is a meaty thing and I want to be able to use that but from the comfort of my living room.

What kind of options are there?  One thing I'm looking at is using my old laptop with Remote Desktop to access the PC but it is and old clunky laptop, is this a good way of going?  Does Remote Desktop essentially allow me to use the power of my big PC via the screen of my laptop? (seems unlikely) I've looked into Wifi Monitors, massive cables etc but was looking for a way to keep it light.  I want to use Blender and Davinici Resolve, is this a nonsense or is it possible? Will the speed of the laptop effect the speed that Blender operates at or is it merely video feed?

Any ideas would be great.

Tom

There is an addon to render using another computer, it's called netrender and it should be already in blender. Here's the instructions and stuff: https://wiki.blender.org/index.php/Doc%3A2.6/Manual/Render/Performance/Netrender

I hope this helps you


Hiding inner faces of transparent object in render I have an animation of an object in Alembic format. The object is a tetrahedral mesh. Thus it has inner faces. I want to render it as half transparent object. However I want to hide the inner faces in render. How can I do it?

You can select all the outer faces and assign them a vertex group:

Then give your object a Mask modifier with the group as Vertex Group:


Rotate a Cube on a Plane Using Drivers This is a simplified example which I wish to apply to a more complicated animation situation.

I have a cube, that is 1x1x1 in size, origin at the centre and is located at (0,0,0). It sits atop a plane with the origin of (0,0,-0.5).

I want to use drivers to drive the cube's X and Z coordinates when I change its Y rotation so that the cube does not pass through the plane. Like so:

I know the X and Z locations can be calculated using cos and sine but I'm having trouble figuring out the equation for the drivers.

Thanks for your assistance.

This could be a math question, but since we are using Blender we could use drivers tools, f-curve tools and empties.
Analysis
Even though the objects center is at XZ (0, 0) the center of the first half rotation is at (1, -1).

We will need the trigonometric functions sinus and cosinus to get points on a circle.

Note that the object center and the center of revolution do not have a distance of 1. We will have to calculate the distance with the pythagorean formula.
Python
a**2 + b**2 = c**2

The are the relations of sinus cosinus and the angle. Since the values only apply to a circle with the radius of 1, we need to multiply if by the actual radius of the circle.

Setting up the drivers

Add an empty. (This is necessary, because of how Blender editing interface works. If the rotation drives the location, Blender 3D Viewport editing rotation control behaves unexpectedly.)

Add a driver to the Y rotation of the cube.Set the empty's Y rotation as the input. Use world space.

Add a driver to the X and Z rotation, use the same settings.

Add the basic trig functions as the expression.
X Loc:    cos(var)
Z Loc:    sin(var)

Our cube now move in a circle based on the empty's rotation.
Refining the expression.
Now we can work on the expressions. The Y rotation is negated (clockwise rotation results in positive values). Let's negate X Loc.
X Loc:    -cos(var)

Our cube revolves in the correct direction.
Next, offset the value to make our cube's center rotate around XZ (1, -1). The first center of revolution.
X Loc:    -cos(var) + 1
Z Loc:    sin(var) - 1

Currently, the cube revolves from 0° to -90°, with an input from 0° to 90°. (Marked red)We need to offset the rotation, resulting in -45° to -135°. That is an eighth of a circle. A circle measure 2 * pi.
1/8 * 2 * pi = pi / 4

Add this to the var in both trig functions.
X Loc:    -cos(var + pi/4) + 1
Z Loc:    sin(var + pi/4) - 1

Now adjust the radius of the circle. Our distance is calculated using the pythagorean formula.

1**2 + 1**2 = c**2
c = sqrt(2)

Multiply the trig calculated offset with the distance c.
X Loc:    -cos(var + pi/4)*sqrt(2) + 1
Z Loc:    sin(var + pi/4)*sqrt(2) - 1

The cube describes the desired rotation perfectly.

Adding a cyclic offset
For the X and Z Location it would be beneficial to have a cyclic input. The span of 0° to 90° from the empty should be repeated. I am going to use the modulo operator to do that.
var%2    ...    rest of var / 2, x in [0, 2[
var%(pi/2)     cyclic for every quarter of a circle, ranging from 0° - 90° (in radians)

The result is cyclic, albeit without an offset.
X Loc:    -cos(var%(pi/2) + pi/4)*sqrt(2) + 1
Z Loc:    sin(var%(pi/2) + pi/4)*sqrt(2) - 1

Finally, let's add the offset to the X Location. Every cycle of 90° we have to add 2 to all X Location values.
First, isolate the cycle of 90° (pi/2) using the floor() function. Then multiply the result by 2.
x = floor(var / (pi/2)) * 2   #
x = floor(2*var / pi)*2       # one step simpler/prettier

Add this to the existing X Loc expression.
X Loc:    -cos(var%(pi/2) + pi/4)*sqrt(2) + 1 + floor(2*var / pi)*2
Z Loc:    sin(var%(pi/2) + pi/4)*sqrt(2) - 1

Getting things more production ready
Add a floor plane on (0, 0, 0). Move plane (0, 0, -1) in edit mode and scale it accordingly.
Lock the X and Z rotations on the empty.
Parent the empty and the cube to the floor plane.
Looking good!


How can I use my Blender models in WebGL I would like to create WebGL applications and use Blender as a modelling tool. I don't necessarily need to translate game engine functionality to WebGL but I would like to retain as much of the UV mapping, vertex colors, materials, etc. info as possible.

I already know I should keep the polygon count low. What are the other things I should keep an eye on? (Such as don't use feature X because you won't be able to export it)

What tools do I need to learn? (WebGL framework specific plugins, generic tools like OBJ exporter)

The answer is somewhat dependent on what file format the WebGL viewer ingests. And how good the Blender exporter is. But the most common format is probably the ASCII Obj format, for which Blender has a pretty decent exporter for.

So, things to watch out for:

Geometry: Avoid Ngons, or at least, triangulate before exporting. The exporter might produce unexpected results. Also, make sure the face normals are all oriented correctly. Blender renders both side of a polygon by default, many other 3D viewers don't. You can recalculate normals with Ctrl + N.

Mesh Modifiers: Even though the exporter probably applies the modifiers. It's better to be explicit than implicit. Also, it is a good idea to apply the transforms (Ctrl + A).

Materials and Textures: Avoid the Blender material panel(except basic colors). Use UV-mapped textures. Blender-specific features like procedural textures are not going to migrate properly. Image textures dimensions should be power of 2 square. (1024x1024, 512x512, etc)


How do you turn off an objects interaction with others in the scene, but still show up in the render? I have several objects in a scene and my goal is to add a background image of some clouds and blue sky.  I downloaded a nice HDR and brought it in using add>image>background.  Looked nice but it did not show up in the render.  After some research I found I needed to import the image as a plane, which I did.
So I enlarged it and moved it to the back.  Its an outdoor scene so I am using the sun as a light source.  When I view it in material preview it looks fine.  When I go to rendered preview it acts like a large wall in the scene.  It casts a shadow and looks very dark, like a photo at night.
So is there a way to stop this plane from interacting with the scenes lighting but still be able to show the image in the final render?
I am using Blender 2.83

You don't need to put it as a plane, you can just import it as a background. You might have the background as alpha, if you do, turn it off.


Why am I still seeing a wireframe in rendered - and all views? In my scene, I have created another object. For some reason, regardless of the fact that I have disabled/adjusted the relevant checkboxes/drop-downs in the Viewport Display, I always see the wireframe for this object - but just vertices going in one way. In every single view mode.
Is there some additional view property I cannot find? Did I activate yet another thing without realizing it? And why is it just the horizontally aligned loops?

Here is the source. When I'm working on using this in a scene, it's really visually annoying. This has happened before so I am eager to figure out what this actually is.
Thanks for your attention.

In edit mode select all -> merge(m) -> By distance
Those edges are not part of that mesh. You can simply move them around by selecting those edges in edit mode


Armature mesh edit snaps back returning to Object mode In the attached blend file I am able to take a mesh modified by an armature and edit some vertices in Edit mode by disabling Shape Keys:

However, when I'm finished editing, the moved vertices snap back to their original position once I reapply Shape Keys or switch back from Edit to Object mode.
How do I make these edits persist?   FYI: The mesh and armature was imported from a DAZ file.
Blend file (too large for blend-exchange.giantcowfilms upload) is at amatureMeshEdit.blend

this post was helpful for a better understanding of Shape Keys and the purpose of the 'Basis" key:

select 'Basis' Shape Key
in object -> Edit mode, make my modifications to the mesh
exit object EDIT mode and the changes stick


Can displacement output be controlled by light? Top one is the texture with displacement output material inserted, bottom one is without. My problem is that on lower and top edges the effect is much harder then in the middle of the brick. I tried using a lot of math nodes before displacement output, but i figured out it isn't texture problem. I tried moving camera back and the effect is similar. It looks like it isnt camera angle either, when i lower the angle texture keeps flat in the middle and sharp at top and bottom edges.

Btw: It there some way of using material nodes controled by light or camera?

Blender file:

I tried adding mapping node but no matter how i manipulate coordinates it only moves/stretches texture. It doesnt change the places where displacement is seen better and worse.

I also tried changing displacement type to true (experimental feature). Doesnt help either.

My bricks are not perfectly shaped - example on picture.

What else can I do to manipulate this shadow dependency?

I tried adding mapping node but no matter how i manipulate coordinates it only moves/stretches texture. It doesnt change the places where displacement is seen better and worse.

I also tried changing displacement type to true (experimental feature). Doesnt help either.

My bricks are not perfectly shaped - example on picture.

What else can I do to manipulate this shadow dependency?

You have a problem with your texture coordinates, add a texture coordinate node and a mapping node as vector to your texture used for displace


how do i make a seven segment digit clock animation? I was modelling a sci-fi style digital clock, and when finished, I realized that I had no idea how to make the animation.
I made the numbers, but I cannot figure out a simple way to make it work.

I thought I could make all the ten numbers and then hide and unhide them every second, but takes too long.
Does someone have any idea? can someone suggest me a easier way to do it?
Thank you

Some python code can do that for you:D

Create two text objects and name them 'hour' and 'minute' respectively
Run scripts below.
Scraping the Timeline and you now have a digit clock animation. (Choose a digital font if you like.)

scripts:
import bpy

def update(self):
    frame = bpy.context.scene.frame_current

    minute = bpy.data.objects['minute']
    hour = bpy.data.objects['hour']

    hour.data.body = str(int(frame/60) % 24) + ' :'
    minute.data.body = str(frame % 60)

def register():
    bpy.app.handlers.frame_change_post.append(update)

def unregister():
    bpy.app.handlers.frame_change_post.remove(update)

register()


Upgrading from 2.79, objects listed in hierarchy, but nothing showing in 3d view I upgraded from 2.79, while some files load in just fine, some of my more recent ones load with no errors, but do not show anything in the 3D view? The items are listed in the hierarchy view, but I can't see or edit them in 3d view.

Looks like your collection is disabled in the viewport. Not sure if there is a shortcut to enable or not.


Bake a texture map with python I use Blender 2.83. For a addon (accessible from the 3D-View) I want to bake texture maps. I am perfectly able to do it without scripting. But with python I was not sucessful sofar.
To reduce my problem to the barest minumum I start with a selected object with valid UV. I then execute the following python script:
import bpy

obj = bpy.context.active_object

# Creating a texture node, linked with a new image
mat = obj.data.materials[0]
mat.use_nodes = True
texImage = mat.node_tree.nodes.new('ShaderNodeTexImage')
img = bpy.ops.image.new(name= obj.name + '_BakedTexture')
texImage = img

# !!! No image is linked to the texture node !!!

# Baking to the newly created image
# The following part works if I create the texture node and the assigning of the image by hand
bpy.context.view_layer.objects.active = obj
bpy.ops.object.bake(type='DIFFUSE', save_mode='EXTERNAL', filepath='C:\\TEMP\\baked.png', use_automatic_name=True, width=512, height=512)

I think what I am missing is the correct linking of the image to the texture node. I consulted similar questions such as
Set active image node with python
but their answers did not help (code for Blender 2.7 that is not compatible anymore, i guess).

I think I will give you some basic steps, that is, add a node of type "TEX_IMAGE", assign your image to it.
therefore:
obj = bpy.context.active_object
# You can choose your texture size (This will be the de bake image)
image_name = obj.name + '_BakedTexture'
img = bpy.data.images.new(image_name,1024,1024)

#Due to the presence of any multiple materials, it seems necessary to iterate on all the materials, and assign them a node + the image to bake.
for mat in obj.data.materials:

    mat.use_nodes = True #Here it is assumed that the materials have been created with nodes, otherwise it would not be possible to assign a node for the Bake, so this step is a bit useless
    nodes = mat.node_tree.nodes
    texture_node =nodes.new('ShaderNodeTexImage')
    texture_node.name = 'Bake_node'
    texture_node.select = True
    nodes.active = texture_node
    texture_node.image = img #Assign the image to the node

bpy.context.view_layer.objects.active = obj
bpy.ops.object.bake(type='DIFFUSE', save_mode='EXTERNAL')

img.save_render(filepath='C:\\TEMP\\baked.png')

#In the last step, we are going to delete the nodes we created earlier
for mat in obj.data.materials:
    for n in mat.node_tree.nodes:
        if n.name == 'Bake_node':
            mat.node_tree.nodes.remove(n)

Avoid as much as possible to use bpy.ops, in this case, as you can see, it is easy to create an image with the methods bpy.data.images.new ()
Any blender object can be created with that method.
bpy.data.objects.new()
bpy.data.materials.new()
bpy.data.scenes.new()
...
...

bpy.ops it is good to use it only when you have no alternatives, as in this case with the bpy.ops.object.bake()
this allows you to create something, and assign it directly to a variable, as in the example of img = bpy.data.images.new()
So you don't have to go crazy to have access to it.


How to model F-Holes of a violin I'm trying to figure out how this 3D artist modelled the F-holes in this violin model.
I have traced out the violin, and also the F-Hole Shape, I was curious to see how a Boolean operation would look, in case I can clean it up, merge it with vertices, but its very condensed. I tried to see some 3D violin modelling on YT, but they're all time lapse videos, and this particular section on the violin is not shown. So any suggestions seeing the 3D mesh, how the artists made the F-shape?

I would go the other way around, begin with the hole shapes, then draw the whole shape:


How to procedurally generate an infinite terrain using perlin noise For a game I'm making in the blender game engine, I need to generate an infinite terrain - preferably in chunks and unloading when they get too far away.
Perlin noise would probably be a good way to do it (I think) but I'd need to have it split into chunks and also not only infinitely generate but unload itself.

Rather than dynamically load and unload chunks of terrain just move displacement mapping of a fixed static subdivided plane.

The displacement should be made from mix of blender procedural textures (if you mix multiple clouds and musgrave textures you can get mountains, rivers, etc.)

The plane should be big enough so you can't see its borders.

And the character, camera and ground will be obviously static except of some local animations. The movement would be done with rotating and offsetting (the order is important) the displacement and texture of ground.

The resolution of the ground plane should be detailed around character and less divided to the borders. If the ground will be too low res you will see the geometry "float" over the displacement. You can see how that looks here.

If you know how normal mapping works you can generate procedural normal maps to accompany the procedural displacement and procedural textures of the terrain. This would minimize the floating.

So the ground is sorted.

Any objects the character would encounter on it's journey must be instanced and moved around. The height of such objects (to sit on terrain properly) can be rigged the similar way as a box floats on an ocean.

You could also make the displacement mapping use world coordinates and move the plane under a character, but if you will walk huge distances I would rather keep everything close to the scene origin.

Here is done dynamic loading and unloading of terrain tiles, but it uses heavy scripting and is totally out of scope of this site.

You might want to use a different engine than BGE for this kind of application. I would use BGE only for some basic arcade platformer, not for an open world project..


Rigid Body Chain and Pendant Breaking all,

I am trying to create a chain and drape it naturally over a mannequin rather than position each individual link. I have a pendant attached to the chain, and when I bake the scene the pendant breaks from the chain.

Both chain links and pendant are active rigid body types, and I have connected everything as points chained by distance. Everything weighs the same. The chain links stay together but the pendant falls off. Is it the shape of the pendant that's causing this to happen?

Any pointers would be appreciated. I have attached the blender file here: https://drive.google.com/open?id=1zY8HsxUqkCWdc1UAhz5zpmV4YiJ4LTnM

I managed to solve this problem by joining the pendant and the two closest links then connecting that object with the adjacent links.


How could I create a desert sandstorm? So I am new to blender and I am trying to make a animation based in mars. In the end I want to have a huge sand storm to roll through the scene. However I can't find how to do this online so I'm asking here!Also My computers not the best so are there any ways to optimize it? Thank in advance!

I guess the method depends on the level of realism you want, for realism you should probably try smoke (tutorials here by Iago Mota and here by Polyfjord).

I've tried to fake it with the Principled Volume node in 2.8:

You need to create a cube that you subdivide smooth. Give it a Subdivision Surface modifier. It's your first cloud.
Plug Principled Volume > Volume socket of the Material Output. Play with the Principled Density value to change its transparency.
Plug Noise > MixRGB > Color socket of the Principled so that the surface of the cloud is a bit textured.
Plug 2 Musgrave (or other textures) > Math (Add mode) > Displacement node > Displacement socket of the Material Output so that the cloud has 3D bumps.
Put some additional nodes like Texture Coordinate > Mapping at the beginning of the nodes chain.

Duplicate this cloud. Increase its size, rotate 180° on the Z axis. Decrease the Principled Volume Density value of this second cloud to make it more transparent. This second cloud will encompass the first one.

To make them "roll" on the X axis, play with the X location value of the Mapping that comes before the Musgrave nodes.

Also, for more realism, on the forefront you could generate some particles, with a Force Field to make them move the way you want.

Blend file:


Is there a spiral modifier? Is is there a modifier that rotates vertices according to their distance from an axis. If for example, it was applied on the z axis, then from the top the vertices would spiral around the center, with the furthest ones out rotating more and the inner ones rotating less. A bit like what you do when you stir a bowl of cake mixture. I've tried the twist modifier, but it rotates either end in opposite directions.

Edit
I worked out how to show what I want in Sverchok.

When given a cube as an input it produces this:

I hope that demonstrates what I want to do. Basically rotate all vertices according to their distance from the central axis. Seems like a simple type of thing, I wouldn't have thought you'd need an add-on like Sverchok to do it.

I may end up using Sverchok, but it's a whole 'nother learning curve on top of the Blender learning curve. And I want the effect to animate, I'm not sure is Sverchok can do that.

Vertices can be rotated around an axis into a "spiral" shape using the Screw modifier.

Here I start with just a plane and an empty object with plain axis:

Then, I add the Screw modifier and use the Empty object as the AxisObject (i.e. the object that the vertices will "spiral" around):

The iterations control how many revolutions the vertices will make, the screw parameter controls the distance between "rungs" of the spiral shall we say (I believe there is an engineering term for it), the steps and render steps act like a subdivision surface modifier, smoothing out the "spiral" and the angle parameter controls how many degrees in 1 iterations (i.e. with 180 degrees as the angle 2 iterations will be required to form a complete circle).

Here I have set the "spiral" to 6 iterations of angle 360 degrees with a screw measurement of 2.5 and a steps count of 256:

For this case i had to apply the modifier and then recalculate the normals so that the model now has lighter shading:

You can use this modifier with many different shapes to create various end results, I suggest experimentation to find the optimal shape for what you want to achieve.


Group materials together and make transparent? I have an object with multiple materials assigned to its various faces and want to adjust the global opacity of said object. So far I can only adjust the materials individually.
Can anyone help figure this out?
Cheers, Dan

Here are two solutions.
Make sure each material has a blend mode set to alpha Blend or Hashed (Or clip if you don't want the material to be semi transparent before going into full transparency). These settings will only appear if Eevee if set as your render engine.

First solution (with a driver)
Create a value node and put it into a node group with Node > Make Group (CTRL G).
Rename the group and plug it into the principled BSDF of each of your materials. (To add in a material, choose Add > Group > group name )

In your object properties, on the last foldout click "add" to add a new custom property.

Now for ease of use you can access it in the N panel on the right of the viewport.

Get back into your node group by clicking on the icon on its top right. Right click in the "prop" field and choose "Copy as new Driver". Right click in the "Value" node's field and choose "Paste Driver". The field should now be purple.

Tweak the new prop to change the opacity of all the materials at once.

Second method : With the object color
The method is the same as the previous one, but you have to replace the value node by an "Object info" node and plug its "Color" output into the group output.

Go into the object properties, viewport display, and adjust the value of its viewport color to modify the opacity.

Conclusion
Use the first method if you want to control the opacity of your materials across several objects, use the second one if you want to control the opacity of your materials on a specific object.


Baking procedural material So the problem i have is that when baking a procedural material, i get an inconsistent output for the image.
This the procedural material

This is the baked material:

Any ideas on how to resolve the issues would be much appreciated.

The quality of your bake depends on the number of render samples you have configured for your renders, the resolution of your target image and the size of your texture's features. If the 'lines' making up the crosses on your texture are very thin and/or the number of samples in your render are quite low then there is an increasing chance that the baking will miss those features. Also, there will be blurring resulting from the resolution of the image that you are baking to.
Try increasing the number of samples and/or increasing the resolution of the target image to see if that produces a cleaner bake.


Material to generate a mountain While trying to find some information about low-poly mountain, I end up finding this image explaining the material the person used to make his mountain and I thought it look really cool, but it was with 3DS Max:

I tried to replicate it with Blender with no success. Can anyone point out how to make something like that with Blender?

EDIT:
With the Ant Landscape, I got this :)

In fact, it's more like a question on how to use the Displace modifier, since your image shows the man was using a Displace modifier with a texture to generate that in 3DS Max.

Although different softwares got different steps and flow on getting the same result, Blender got it's way to do this, there is Displace modifier in Blender, too, and also, can be controlled with textures, vertex groups, and even more freely by using specific images. You can also use it several times to accumulate as a combined result. As shown below:


Render a "long" video (> 2 mins) in one step, without running out of memory I feel like I am missing something fundamental. Here is my problem: I am producing videos (10-30 minutes each), using the Video Sequence Editor – there is no 3D modeling involved here, just stitching together a few video clips (mp4 files).

If I try to render the complete video, Blender crashes. I could track the problem down by monitoring memory while rendering: After starting, memory usage increases slowly but steadily, eventually starts to swap and then Blender crashes.

As a workaround, I started to render only 3000 frames (2 minutes). I then stich the segments together with ffmpeg. This works, but requires a lot of clicking.

So my question: Am I missing something? How can I render more than 2 minutes of video in one step?

PS: I found some answers pointing to faulty plug-ins, but I am using stock Blender without any additions, on Linux (Mint). The machine has 12 GB memory.

System Details

Blender Version: 2.76b
Installation Source: Standard Repository (universe)
OS: Linux Mint 18 64 bit (4.4.0-64-generic)
System Memory: 12GB

The short answer is: I was using an old version of Blender with a memory leak (thanks @3pointedit for pointing me in the right direction!).

I just installed 2.78c, and this version does not have the problem any more.

Just a note that as of March 2017, 2.76b was the latest version in the Linux Mint repository (and probably also in the Ubuntu repository).


How to subdivide a mesh where it intersects another mesh I have a grid mesh and two arc meshes. The vertexes in the two arcs and the grid are not connected to each other, it is 3 different meshes in the same object.

I want to "merge" in the two arc meshes into the grid mesh, by adding vertexes where the arc and grid overlap, dividing each grid square face to the shape along the arcs.

Any ideas of how to do this?

One way is to use the Knife Project tool.

Make the arches one object and the square a separate one.
If necessary, scale up the arches so they are definitely crossing the border of the square object
In object mode, shift select the arches object and then the square object
Tab into edit mode (you should now be in edit mode for the square)
From the toolbar (T) choose Knife Project. The arches will be projected onto the square, sometimes creating n-gons (although by the appearance it looks like the objects have just been merged, the faces have in fact been subdivided)
You can now delete the original arches mesh in object mode.

Alternatively, another way you could do it would be to remove all but 2 sides of the original square resulting in 3 sets of edges, the edges of the square and the two arches:

With the arches and the square as a single object select them all and then press W> Bridge Edge Loops:

Both methods require some form of clean up afterwards, the bridge edges method needing slightly less. With the bridge method the clean up will also be less if the number of vertices in the arches are the same as the number of vertices in the square's sides.


Integrating edge loops in grid fill surface How can I "grid fill" this edge loop WITH the three interior edge loops smoothly integrated in the mesh surface? The idea is that the latter afterwards are not visible as edges (i.e. smooth). The interior edge loops have exactly the same number of vertices as the side edge loops, so that shouldn't give any problems.

As mentioned in the comments, one of way to create faces in that mesh is to use grid fill. There are other options, such as bridging them.

Using grid fill

Start by selecting two pairs of edge loops and the connecting edges, as shown in the picture below.

Press space and search for "grid f" and choose "Grid Fill".

Repeat that for each pair of ledge loops, and you will have a full mesh.

Using the bridge tool

Start by selecting all the loops except for the edges on the top and bottom.

Now simply press W and choose "Bridge Edge Loops". Change the number of cuts to match the number of vertices in between each selected edge loop (in your and my example mesh it is 3). You can find that in the operator half of the tool shelf.

Now you just have to fill the top and bottom parts. You can quickly do that with the F2 addon (that fastest way), or by any combination of bridging, and grid fill.

Here is an animated gif showing how I did it with bridging and the F2 addon.

Here is the final result:


DoF works only sometimes in blender render I'm trying to use blender render and the defocus node to shift focus over the course of a scene (by moving the empty around). This works fine.

The red bits in this image are out of focus, since the empty is way behind them:
(image removed)

In this next image, the red bits are only out of focus where they do not overlap with the structures in the background... why?

I'm stumped. Anyone have a suggestion?

Thanks!
Andrew

Edit: Here's my node editor view (had to remove one of the other images due to lack of "reputation"):
(image removed)

Edit2: 3D View
(image removed)

Edit3: Cycles renders

I'm not able to answer your question properly, but I would post some thought about it anyway...maybe they can help.

Z-depth is a pass that stores the height information about what the camera sees.

This pass can be used to fake a lens blur effect. What has the empty's same z-value is in focus, while the other object are blurred. I might be wrong, but I think that the defocus node does not consider wich face is in front of another, but set only the amount of blur by the face z-depth

In the image above, the grey grid is the background. It has no geometry, so it has no-z informations. When the red square is blurred onto, it has no issue, there is nothing behind.

When the red square is upon the white rectangle, which is a face, and has z-info, there is a conflict in the contended area. The border pixel of the square must be blurred, so they should go upon the white square, but at the same time, that pixel should be white and in-focus, so the blur is not visible anymore.

One way to avoid this difference on the border blur is to remove the background from the view by adding a plane behind the white rectangles. You could also achieva a similar result by tweaking z-depth channel with nodes... But while we have obtain a consistent behaviour, I think that is not probably the desired one.

What you probably want is a blurred image upon a not blurred one. One way could be to separate objects in different scene, apply the node only to the geometry you know above and than mix them with alpha over node. But this is not a good solution for an animation.

A second option could be to switch to Cycles render. With his path tracing abilities, you don't need to fake the lens effect, but you can obtain a physically belivable behaviour, at the cost of longer render times.