Recreating Mandelbulbs with math nodes I'm trying to recreate a Mandelbulb using Volume and math nodes in blender.
I have been able to create a Mandelbrot with math nodes but I am having problems making it 3d.

I tried translating this formula to math nodes:

$$\mathbf v^n := r^n \langle \sin(n\theta)\cos(n\phi), \sin(n\theta)\sin(n\phi),\cos(n\theta) \rangle$$

where

$r = \sqrt{x^2 + y^2 + z^2}$,
$\phi = \arctan(y/x) = \arg(x + yi)$, and
$\theta = \arctan\left(\sqrt{x^2 + y^2}/z\right) = \arccos(z/r)$.

https://en.wikipedia.org/wiki/Mandelbulb

the results should look something like this:

but it ends up looking like this:

I hope someone knows what I'm doing wrong.

It's impossible to tell what's going wrong in your particular case as there just isn't enough information in your question - you've only partially shown the 'internal' node tree (many of the nodes are hidden, meaning it's impossible to verify that they aren't marked as 'Clamped' and left assuming that, say, 'Root' is raising to the power of 0.5) and you don't show any detail of how the group is actually being used (it's hinted at behind your 'group' nodes but nothing explicit) - which is quite critical.

However, it is possible to produce such a result as shown below (assuming I've got my maths correct). The example image you provided must have been produced with a large number of iterations of the calculation - which would take a considerable amount of time to render. For my example I have limited it to a relatively small number of iterations to demonstrate the concept.

Firstly, rather than manually generate the node structures for the calculation I have created an add-on to generate the nodes directly from an entered expression (it's something I've been meaning to do for quite some time - building on the answer Cycles Materials Math node with more than two inputs). This add-on parses the entered expression and automatically generates the required nodes in a node group - this allows different expressions to be more easily tested since the expression can simply be edited. The add-on can be downloaded from https://github.com/baldingwizard/Blender-Addons - simply download the ZIP file and use Blender's User Preferences/Add-ons/Install Add-on from File to install, enable it, and Save User Settings. You should now have a new Custom Nodes menu in the Node Editor 'Add' menu that lets you add a Dynamic Maths Expression node. Entering an expression into the Expression field will automatically build the required maths nodes in a corresponding node Group. Since the expression is built from standard nodes it is fully GPU compatible (unlike an OSL solution). Note that the add-on is currently a work in progress and may contain rough edges (and I have some ideas for future improvements) - I'll tidy it up and file off any rough edges in due course but for now it shoul dbe reasonably functional.

With the new Dynamic Maths Expression node you can create the node trees for each of the functions by simply entering the relevant expression. For example,

'r' :
    (x**2+y**2+z**2)**0.5

This automatically creates the following nodes behind the scenes :

Similarly, 'theta' :atan(((x**2+y**2)**0.5)/z)

And 'phi':atan(y/x)

We can then use a similar technique to create expressions for 'newx', 'newy', and 'newz' :

newx = (r**n)*sin(n*theta)*cos(n*phi)
newy = (r**n)*sin(n*theta)*sin(n*phi)
newz = (r**n)*cos(n*theta)

These can then be linked together to form the following node group for the calculation of one 'iteration' :

Note that some of the inputs are fed directly out to the outputs - this is to assist with linking mulitple iterations together. Also the 'Valid' input/output is modified based on the condition that the result of this node is detected as 'outside range'. This is to detect the termination of the series at the specific iteration - if any iteration is out of range then we need to detect it rather than taking acount of any subsequent iteration. Only those 'points' in the volume that successfully pass through all stages of the iteration are rendered as 'solid' (ie, part of the 'bulb'). The more iterations applied the more complicated the final surface (but the more complicated the calculation - so considerably longer render times).

The individual stages are linked together as follows :

Note that one group node is required for each iteration of the calculation (the more iterations, the more complicated the resultant surface). The 'n' setting dictates the 'order' of the mandelbulb (in this case '3').

In order to render as a well defined volume you will need to multiply-up the result to generate a reasonable Density (eg, 100) and use this in a Volume material similar to how you would for smoke. You will also need to significantly decrease the Volume Sampling Step Size parameter in the Render properties from it's default of 0.1 to, say, 0.005 or lower (this defines the resolution of the volumetric) - this will produce a more detailed result but will significantly affect render times.

This can produce the following results :

Blend file included (you'll need to install the add-on to activate the Dynamic Maths Nodes)

Here is a further example - this time an 8th order mandelbulb (by setting 'n' to 8) with additional Iteration nodes in the chain to add detail (I used 16 iterations for this - ideally you'd use many more). This took approximately 3 hours to render on my system - it would fare a lot better on a system with GPU support (which I don't have).


Putting the Metaball panels in the Properties sidebar - object has no attribute meta_ball I want to display some content from the Properties Editor in the Properties Sidebar in the 3D view. Currently the Metaball panels.

As a first test i have grabbed the whole properties_data_metaball.py file for that, and simply changed the DataButtonsPanel class to show the stuff in the sidebar. Which is the only change at the file.

class DataButtonsPanel:
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_context = "data"

The panels shows in the sidebar, but the content is missing. And i get a AttributeError in the console. What do i overlook here?

Some context properties are only available to the 'PROPERTIES' space, particularly the data types context.mesh, context.speaker context.meta_ball to name a few.... Another would be be context.world.

Simply use

metaball = context.active_object.data

and in poll check that

context.active_object and context.active_object.type == 'META'


Opposite of extrude (removing) I created a phone stand, but I would like to cut the top.
Is there a way to do the opposite of extrude ?

Tried to select the face and delete but that don't do only delete this part.

Try to created a new mesh and adding a modifier / Boolean in order to remove this part, but don't seems to work neither

There are several ways to do this.  The two that I think are most straightforward are:

Subdivide the 4 edges that are coaxial with the direction you want to "shrink" the mesh in.  Slide the verts along the existing edges to where you want them to be and connect them by subdividing (knife tool) the existing faces.  You can then delete the faces that stick out (there should be 5 of them) and create a new face using the new vertices.
Boolean operations.  I'm not exactly sure why this isn't working for you, but I have a few guesses.  First, both objects you're using have boolean operations configured, but not applied.  You may need to apply the boolean to the first object ('stand') before it can be used on another object ('Astand').  Second, it looks like the faces of your objects are coplanar, causing a well known problem commonly known as Z-fighting.  This should be resolved before applying any boolean operations.  Finally, it can be hard to tell if a boolean operation applied successfully when all the objects are still visible.  I'd turn off the visibility of the object you're subtracting ('stand') while leaving the object you're subtracting it from ('Astand') visible.


Can you switch between different material versions? So I have a model that has two different shading versions. The usual principle bsdf and emission for a shadeless render. Using mixer nodes makes it easier to switch between the shaders in nodes but I still have to go through each material to update the mix node. Is there an easier way to switch shaders?

A bit dirty but you could use a node group:
Select the Mix Shader that you use as a shutter, press CtrlG to create a group. Once done, press Tab to go into the group and unplug the factor socket that will be created by default. If you play with the factor value it will switch from a shader to another:

Press Tab again to go out. In all your other materials create the group you've created with ShiftA and plug the shaders:

Now select one of these groups and play with the Mix Shader factor value, it will switch all the other material Mix Shaders as well.


Attempting to Extrude Imported SVG Curve I am attempting to extrude a logo that has been imported from an SVG file. The SVG file was made in Adobe Illustrator. I deleted many extraneous layers (at this point, curves) upon import to have just a few main layers.

However, I then desired to extrude this, either through a solidify modifier, or the extrude option in the curves panel. Whichever I try, the result is the same: even if the thickness is 0.1, the shape will go off into infinity for the extrusion.

It appears that the vertices are fine and there are no duplicate/overlapping ones (but please check me), and so I have no idea what could be causing this! This is the first time I've ever tried importing an SVG like this to use, so any pointers are welcomed!

showing extrusion off to infinity with settings
 http://imgur.com/CNc66lt

File: https://drive.google.com/file/d/0B7ijsxQTdUhXQnFqYXNGN1VlRnM/view?usp=sharing

Thanks,
Nathan

Your object is very very small and has a very large scale.

Select all your imported curves and apply scale with Ctrl + A > Scale
Join them all together with Ctrl + J (select them all and then make sure you click-select at least one last curve to make it the active object, so it will act as receiving curve other curves will be appended to)
Now enter edit mode in the new curve
Select all vertex and press Space Bar
Search for Set Curve Radius
Enter a value of 1.0and press enter

You should now be able to extrude successfully
You can now separate all curves again into their original parts by entering edit mode, selecting each spline individually and pressing P Separate

Just a side note, when using curves always prefer the builtin extrusion method over solidify, it is more reliable and has better features like allowing non destructive beveling


Zone of darkness surrounding view camera in eevee render preview I've encountered an issue with the render preview in eevee.
In my scene, close objects are cast in darkness, whereas objects further away are lit up.

It seems that this zone of darkness follows my view camera.

I can move far away and see the previously darkened objects lit up.

I thought it might have to do with clipping, but changing the values for a camera in the scene didn't affect it, and neither did changing viewport clipping.

Okay, I just figured it out. I'm using a sun-lamp casting rays in a certain direction, but I also have three large objects in the distance that don't have materials set up and seem to be casting shadows.

If I hide them from view, the zone of darkness goes away.

This blend file is originally from blender internal, and I've been setting up the now blank materials in the scene to similar versions of the originals in eevee. The three distant objects are meant to represent features of a night sky; stars, the moon, the moon's glare. That's why they're there.


Creating mesh between edges What is the cleanest way of creating mesh between the edges of two different objects, as shown? The closest tool I can think of is the Bridge Edge Loops tool but I am not trying to connect the whole edge loop, just the edges selected. I tried extruding one side and merging vertices but this did not work.

Thanks in advance.

You say .. 'mesh between the edges of two different objects'...

Since 2.8, it's possible to put 2 objects into Edit Mode simultaneously, which is very useful for snapping, common deformation, etc. But they are still 2 objects - their meshes are separate.

Your problem is not that you're trying to connect partial loops:

.. but that you're trying to merge meshes which belong to separate objects.

CtrlJ join the objects, or ShiftD duplicate parts of their meshes, P temporarily separate them off into their own objects, and join those, to make the bridge within one mesh.


Uneven lighting on some faces after a normal map is applied Some faces of my mesh become weirdly lit after I apply a normal map. I have checked face normals, averaged normals, cleared custom split normals, tried deleting and recreating the affected faces, checked UVs, changed shading model, also tried normal maps from different materials - nothing works. The problem is consistent and shows up in LookDev view, rendered view in Blender and after export to UE4. In the example below I have just normal map applied in the shader and have deliberately cranked up normal strength to 2 in order to make the issue more visible. Blend file is attached (with embedded normal texture). Probably, has to do something with tangents, but for the life of me I can't figure out what. Will be most grateful for any help!

Some of your UV islands / individual faces are flipped in U.

With an eye on the mirror axis, in the Mirror modifier for each object, check 'Flip U' so the texture matches on each side: both 'wrong', or both 'right'.

With the pivot set to something that suits, maybe 'Individul Origins' if you're doing a few at once, Select Islands/Faces that are 'wrong' and in the UV editor, Header: UV menu > Mirror > X axis.
It's probably worth right-clicking and setting a Quick Menu item for that. SX-1 would also do it.

Following commentary, there are one or two things I've noticed in samples of your model..
You would want regions meeting across a mirror plane to be exactly planar, and at exactly right-angles to the mirror. Occasionally, they are not, quite... and there are still the odd stray vertices around, extra hidden faces. One approach to solving that would be ShiftG select similar > coplanar, with a high tolerance, and scale the region to 0 about its median, along X, or its normal if it's at an angle.
It's hard to tell without running tests, but at first sight, it seems the normal map might have a slight tilt: an overall rotation in U.  That means, (irrespective of pattern) it would be  tileable in translation, but not in reflection.
Maybe you have to apply the Mirror modifier before tweaking to perfection.


How to get sharp edges with subsurf and concave Ngons Yes, I know, this is frequently asked. Edge loops and creases solve most issues with this modifier. My problem, though, I can't seem to find anything on. I want the corners within this open rectangle to be sharp. According to blender's online manual (v2.79 is what I'm looking at), it's something to do with concave Ngons (which I know nothing about). Also, this is for 3D printing (hence the solidify modifier) if that opens or closes any options.

I know that my topology isn't the most even, I intend to fix that right after posting this. I have tried adding vertices and moving them towards the corners, as I have done in this section:

But that doesn't give me desirable results (plus messy topology to get it to look even halfway decent), and it's even worse in the area I'm trying to fix currently.

Any ideas? I apologize if there is a similar question that I'm just failing to find. Thanks in advance

I also struggle with this. I have two tricks that might help:

You can make the corner of a hole sharp by creasing an additional one of its connected edges:

But if your surface is curved, this might create an ugly sharp discontinuity.

So instead you might try the crease options on the solidify modifier:

Again, it can get weird when the surface is curved, but I find it helpful in most situations. If you don't want your surface to be made solid, you can set the modifier to only generate a rim, and make the rim vanishingly small.

Hope this is helpful. If you find anything useful, please share it!


rendering problems in blender whenever i try to render this image i get the pixie dust kind of thing near the glass cup, can anyone explain why this is happening?

i have tried changing the roughness of the glass cup but it has no effect i didn't have this problem when i rendered only the plate

This is a common issue, it's called "Fireflies" by the community and there are a lot of ways of dealing with them.

Here's one good article, but before you dive into it let's discuss where they come from in the first place.

Cycles is a PathTracer. For each pixel it sends out a bunch of light rays from the camera, bounces them around and then sees where they end up to determine the color of the pixel. This works because physics doesn't really care if times is going forwards of backwards in this case.

You can determine how often a light ray bounces around by adjusting the "Samples" option in the render tab. Try 100, 200, 300 and so on - more samples means more calculations means more render time, but also less fireflies and noise in the image.

An alternative to that is the "Denoiser", which you can find in the "Render Layers" tab on the right. It's a tradoff between quality and performance, give it a shot if your render times are too long.


How to remove UV information from an object I'm having an issue importing models in to Unity.

When I started modelling I was using UV unwrap to texture the objects.
After a bit of testing I decided to rather use flat materials.

Below you can see the issue. any object that was previously unwrapped keeps this Unwrap info. I cleared the seams, reset UVs and removed the texture from the object.
But still, models such as this rock keep the UV info and remain attached to the original texture material every time I try import to Unity.
The material rock_01 in blender, seems to import but is renamed in Unity to New Material.

Compare to the trees, which were made later and never unwrapped, they work fine.
Where is this UV information being stored and how can I get rid of it?

Many thanks.

The '-' button in the mesh tab may be what you are after:


Opacity of an object in 2.8 I am trying to change the opacity or alpha of an object so its see-through in 2.8.  How do I do this?  I can't seem to get to figure out how in 2.8.   Example of what I am trying to do is below.

The setup is very basic. One thing to note is that I've used Wireframe modifier with second material.
Material
Just a mix between Transparent and Emission which is added for colorization and "nicer" visibility.

Material setup
First slot is above material for transparent object, second is for wireframe.
Most important thing here is to set Blend Mode Type as Alpha Blend.

Modifier
In Wireframe modifier set Material offset to 1 to be able to use material from second slot. Also set wireframe Offset to -1. It will hide wireframe object in main object.
Don't forget to uncheck "Replace Original", or else the low transparency would be replaced by wireframe. We want the mesh to have wireframe with the transparency, not just the wireframe.


Compositor: Get the average value of an input fac I want to take an input factor, such as a mask or pass, and get the average value of the pixels within it. How can this be done?

Blender has a levels node that return:

Mean (Average).
Standard Deviation.


Fluid Sim not reacting at all I have created a simple scene of a lollipop bouncing thru a puddle. It worked once but I wanted to increase the resolution and tweak some settings. So I started with a new domain and water object.

But, there is no interaction after baking. I have tried changing the size of the domain and resetting things, but it still won't create the fluid interaction object.

I tried to see what other people were doing and followed Blender Guru and Sardi Pax's videos but nothing works.

What am I doing wrong? (also how do I upload the darned blend file?)

https://www.dropbox.com/s/dzbpekym81ummu1/fluid%20test.blend?dl=0

Your fluid film is too thin so that no fluid particles are created. Make it a bit thicker and it works.


Problems with Using Substance Designer Height Maps I realize this question also deals with software other than Blender, but it's mostly a blender focused problem.
I am trying to figure out how to correctly set up displacement / height maps exported from Substance to Blender. Here is my node setup:

As you can see, the displacement is horrible. It's coming apart at the seams (black spots) and just generally looks horrible. This is what the material should look like:

So my question is the following:
What is the proper way to import and set up substance designer maps in Blender?
Is there an add-on that handles this automatically?
Is my node setup the proper way to do this?

Go to User Preferences > Addons, search for and enable "Node Wrangler".

Once you have it enabled, when you are in the shading tab, with the Principled BSDF selected, press Ctrl + Shift + T. This will allow you to load a whole PBR set at once (navigate to the folder and select multiple files). It works fine with Substance Designer's default naming scheme, except I think it has trouble connecting the BaseColor. You can do this by pressing Ctrl + T with the BSDF selected to load a single image texture connected to the basecolor and then choose your image that way, or you can Shift + D duplicate one of the other image textures, load it that way.

This shortcut method sets up the displacement for you, however how much of an effect it has in EEVEE is somewhat a topic of debate (as far as I know, it's not supposed to do something, but it does - but not always the best result). Instead, I sometimes prefer to run my displacement through a Bump Node. Either way you choose, also note that the default strength of 1 (on any of the bump/displacement/normal nodes) is often too high and gives undesirable results. I've sometimes needed to go as low as 0.1 before it looks right.

As a side note, make sure to make use of the Scale values of the Mapping node - I find many textures exported from Substance are scaled too large (1/4 tiled or so) and benefit by scaling by at least 2 or 4 on the X and Y.


How to add an object? I can't find the option to add a new object then new texture and image. I am trying to create a 3D map from a heightmap image.
I have watched a few tutorials but the one that shows how to add a new object is for a different version with a different layout.

To add a new object, you can

Press ShiftA in the 3D view and then select the object you want to add.

Press Add at the bottom of the 3D view and then select the object you want to add.


How do I merge multiple rows of vertices together? Is there a way to merge multiple rows of vertices together like in the example below?

To looks like this (I manually connected each vertex).
PS: I'm sure there is a better way to model it, but I'm just asking as a hypothetical question which would be good to know.

Just to illustrate @moonboots' point

In Edge Mode CtrlAlt select the edge ring
X > Edge Collapse


Smoke Simulation - Bake Offset before Frame 0 Helo, i am wondering how to offset smoke simulation, treat it as if keyframes.

ie. you simulated 250 frames of smoke, you want the animation to start on frame 125

(ex. fluid simulations have "offset" slider )

I am answering myself, it is a workaround

set frame Start: -125 frame End: 125
click "Bake" the sim should bake, but not move in preview
"Free Bake" and go to frame 0
Let the smoke simulate in viewport from frame 0(do not click Bake)
Click "Current cache to bake"

Voilá


Insert properties keyframe for multiple objects? I know it's possible to keyframe UI properties, and it's possible to animate many objects at once for Location, Rotation, and Scale.

But is it possible to insert a keyframe for a UI property for many objects at once?

e.g. Animating rigid body properties for shards of a cell-fractured object

How can I achieve this?

So the easy solution would be to write a script that creates keyframes for every selected object.

While the Rigid Body Tools will copy attributes from the active object to all selected, it doesn't copy keyframes. Copying keyframes could be something to add to the Rigid Body Tools. I would think that the animated checkbox is probably the only Rigid Body option that would normally be keyframed.

Within the 3DView, Insert Keyframes will keyframe the same properties for every selected object. Creating a keyingset with an interface property doesn't allow the property to be keyframed for all selected objects. Sounds like a deficiency in the create interface value keyframe operator.

EDIT: There are some options that can help under some circumstances -

CtrlL -> Animation data - can create keyframes for every object to match keyframes for the active object. This creates keyframes for the same properties in each object - it doesn't make the properties the same as the active object.

For rigid body options you can set and keyframe the active object, use rigid body tools to copy settings from active, re-do calculate mass, then CtrlL -> Animation data to create keyframes for each object.

This doesn't apply to non-rigid body values. The following script can easily be modified to set and keyframe a specific value on every selected object, adjusting to work on multiple values is also easy. I used rigid_body.kinematic as an example as I see this as the most likely value to be used in this scenario.

import bpy

set_kinematic = bpy.context.active_object.rigid_body.kinematic

for object in bpy.context.selected_objects:
    object.rigid_body.kinematic = set_kinematic
    object.keyframe_insert(data_path="rigid_body.kinematic")


Seams are correctly marked, UV's are messed up I have retopologized a shotgun and marked all the seams where they are supposed to, and then Unwrapped it, and instead of getting nice UV's, i get this:

Here are the seams:

I have tried Applying the scale, Averaging Island Scale, Packing Islands, and minimizing stretch, and Smart UV Project, and Lightmap pack, all of which slightly helped, but not enough. What is wrong?

Those lines stretching from an island to another could be caused by a single missing edge mark, or that after doing the UV Map you picked up a couple of tris and turned them into quads and those triangles where from different sets of islands.


Mantaflow bake fluid from command line, "NameError" : not defined When trying to bake fluid from command line using:

import bpy
bpy.ops.fluid.bake_all()

I receive the following errors:

NameError: name 'fluid_adapt_time_step_2' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'bake_fluid_data_2' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'fluid_save_data_2' is not defined

...etc...

The names given can be found in:
https://github.com/blender/blender/blob/master/intern/mantaflow/intern/strings/fluid_script.h

I'm guessing baking can't find the settings to bake domain outside of the GUI. Is there code to import such information?

I'm aware of Brecht's answer: Bake Fluid Simulation via CLI or Python?,
which didn't work.

Moreover, recent Brecht's interaction concerning Mantaflow baking: https://devtalk.blender.org/t/feature-request-mantaflow-bake-command/11105

Update from https://github.com/ichlubna/blenderScripts/issues/1 : probably is a bug: https://developer.blender.org/T75889

terminate called after throwing an instance of 'Manta::Error'
  what():  can't clean grid cache, some grids are still in use
Error raised in /home/sources/buildbot-x86_64-slave/linux_glibc217_x86_64_cmake/blender.git/extern/mantaflow/preprocessed/fluidsolver.cpp:33

Baking Mantaflow (fluid) from command line works now. However, thus far, only with Blender 2.83+.

https://developer.blender.org/rBa50c131a0d71d04915cc39c5a412f4f16c6f706b :

"The issue was the usage of the global __ main __ Python module.
When running scripts in the text editor, Blender would overwrite
the __ main __ module."

Thanks to Ichlubna! ..and the many kind devs.


How to curve a texture in blender? I'm having trouble framing this question, but I'm trying to take this flowing river texture and curve it, so that it looks like it's flowing around a river bend.
Here are the pictures of the texture and the texture nodes. The river is animated by key-framing the x location in the mapping node. I think it would work by key-framing the location and scale values in the mapping node in a certain way. But I don't know how to change the scale based on where the texture is located on the plane. Is there a way to do this?

The answer to this was much less complicated than I thought! No need for messing around with the texture nodes.
I just set the origin of the plane to one of the corners, then applied the Simple Deform modifier with bend around the z axis. Here is the output... S/o @JachymMichal for the suggestion


Convert selected edges to bones? I've run into a strange project where I have to build multiple spline IKs' for a less-than-optimally posed mesh. An edges-to-bones addon or script would be ideal if such a thing exists.

I'm familiar with the basics of python in Blender but haven't gone deep enough to do it myself. How easy would it be to write a (hopefully short) script that would do something like this?

I expect the skin modifier can a create the armature that you are after.

If you only want a rig for a portion of your mesh, duplicate the mesh an delete the excess parts.

Add a skin modifier. You may want to use Mark Root in edit mode with one vertex selected at the end of your mesh, this can prevent extra bones and keep the bones facing in the same direction.

Click the Create Armature button in the skin modifier.

You can then delete the skin modifier, or the duplicate mesh if you duplicated it to start with and you are left with an armature matching the edges of your mesh. The new armature has the display set to stick which you can change to octahedral in the armature settings.


Vertices disappeared on some but not all Objects Vertices disappeared on some objects (not all). I'm trying to merge 2 vertices at center, but nothing happens when I select 2 vertices, and select that option. I'm very new to Blender editing. I've searched YouTube, and all Stack Exchanges, only old references come up, nothing about this issue. Please help.
In my image, you can see, there are no vertices on the 2 right objects. Even for the left two, I cannot merge any of those vertices together. All 4 objects will eventually be merged, but I can't merge if there are no vertices to do so with.

I think you must try going to the object mode and select your 4 objects and press Ctrl +J to join them and try , If you can't use the at center option try snaping cursor on the 2 vertices and then merge them


How do I recover missing polygons using a UV MAP How do I recover missing polygons ( every 5th poly is gone) but I have the .PNG UV Map that has all polys in the right places? How do I import the UV MAP?

AFAIK it's not possible to reconstruct missing polygons with only the help of a UV map. The UV map contains not all necessary information about the vertices' location within the 3D coordinate system.

You might be able to close holes in a mesh with Blender's "fill holes" function, but that most possibly requires you to reconstruct the UV map as well.


Create animated textures in time with the music in blender 2.81 Is it possible to create an animated texture to the rhythm of music, whether they are animations of lights or texture evolutions, which follow the musical rhythm?
I have seen several tutorials on this, but I would like to adopt this method to be able to visually animate part or all of the texture, following for example the bass of a song. the texture and not the 3d object

Check HERE or HERE Animation Nodes Scripter


Material is not translucid anymore Following the coffee tutorial, managed to get it working, but now, all of the sudden it seems that part of the liquid is not behaving the right way, anyone know what might be the issue here?
Old Version

Current (not properly rendered, but you can see the liquid problem)

Blender File: https://drive.google.com/file/d/1hXLEOCWLCKjAbXKdkr0q7BzOxh2g480f/view?usp=sharing

The normals on your cup object are flipped inside out. You can see this by selecting the “Face Orientation” viewport overlay, which displays the front side of faces in blue and the back side in red:

To fix this, in Edit Mode, select all your cup’s faces, then press ShiftN to recalculate the normals so they point outside the mesh. This fixes the rendering issue.


How to drive shape keys based on the angle between two bones? My character rig needs shape key correctives when it makes certain poses (eg. lifting the arms, the shoulders need to be corrected with a shape key so they don't lose volume).

I know you use a driver for that, but the way I find it in books and tutorials is to use a "Rotational Difference" driver between two bones (like between an arm bone and a reference bone pointing in the direction that should activate the shape key, so the driver is 1.0 - rotDifference), and use that driver on the shape key. Like this:

The problem is that this driver doesn't work well for this, because when the bones roll around their aim vectors (without changing their actual directions), it still triggers the shape key:

How else can I activate shape key correctives based on the rotation between two bones (and only their directions)?

For an ultra-fast driver for corrective shape keys based on the angle between two bones, you can use this one:

The driver type is Scripted Expression, with this line (depending on your Blender version):

Blender 2.7x:

poseBones[A].matrix.col[1] * poseBones[B].matrix.col[1]

Blender 2.8x:

(Same line as above, but replace * with @)

(In order for this expression to work you need to enable the Auto Run Python Scripts setting in Blender. On 2.80 it's in Preferences -> Save & Load -> Auto Run Python Scripts and on 2.79 it's in User Preferences -> File -> Auto Run Python Scripts.)

This expression uses the dot product of the bones' aim vectors, a mechanism known as a "pose reader", used with pose space deformation (PSD).
As the bones rotate during animation or posing, the driver will output a value in the range [-1, +1], going from -1 when the bones point in opposite directions, up to 0 when they become perpendicular, up to +1 when they point in the same direction.

Replace A and B in that expression with the indices of the two bones involved. The indices are from the bones list of the armature, and the only way to find them is by using Python. But it's simple:

Select your armature object;
Change the editor to Python Console;
Type the next line in the console and hit Enter:

C.object.pose.bones.find("My Bone")

Instead of "My Bone", use the name of the bone whose index you want to find, then press Enter to see the result. Do this once for each bone so you'll have two numbers, like 12 and 103 for example. Put them in the expression (in any order), inside the poseBones brackets:

poseBones[103].matrix.col[1] * poseBones[12].matrix.col[1]

Next, the other driver variables are:

A Single Property type variable named 'poseBones', used in that expression. The ID type is set to Object, and the object itself is the armature that has the two bones involved. The actual path to the property in the object is pose.bones, write this in that field. See more details in the Notes section below.
(Blender 2.79 only, not needed for 2.80+):
A dummy Transform Channel type variable, it needs to point to any bone in that armature (any indeed, like the root bone). This variable is unused but is an essential piece, it's a way to force Blender 2.79 to evaluate the driver every time a bone in your armature moves from animation or posing.  Set the channel type and space to Location X and World Space, respectively, which makes this very fast to evaluate.
Again, this variable is not used in the expression and is only needed when on Blender 2.7x.

Your driver is ready to be used, with no roll changes or sudden flips.

Notes:

The two bones used in the expression should not be animated in scale (be it their own or inherited scale from their parents), they should only be animated in position and rotation. This means that they need to have a scale of exactly 1 in all axes, for the entire animation, otherwise this will mess with the speed of the driver because it affects the length of the matrix.col[1] vector.

If you need to animate them in scale, simply add a child bone to them and animate the scale of the child and deform the mesh with that child bone, not the parent.

You can adjust the timing and speed of this driver by playing with the driver graph curve, like using easing or bezier handles.

For example, when used with shape keys, you can make the graph minimum be zero and maximum be 1 (click to enlarge):

The natural rate of change of this driver is senoidal because of the dot product that it uses in the expression. If you happen to need linear speed, adjust the bézier handles of the curve in this way to keep the rate of change constant (click to enlarge):

The poseBones variable in the driver is referencing the .pose.bones property of the armature object (like bpy.data.objects("Armature")) and not the armature data (like bpy.data.armatures("Armature")). That .pose property exists in objects only.


How to completely delete an object through python? How to completely delete an object without using:

bpy.ops.object.delete()

bpy.ops methods are too slow for my script, so far I am able to delete an object with a simple:

del obj

But Blender does not reset/delete names of the deleted objects with this method, so I end up with Cube.344, Cube.599, etc..

Also, deleted objects are not linked to the scene.

You are looking for the remove function.
import bpy
objs = bpy.data.objects
objs.remove(objs["Cube"], do_unlink=True)

The code above deletes an object named "Cube." The first parameter of the remove function is the object to remove, the second is a boolean about first unlinking the object (you want it set to True.)


Blender Video Editing: How to create custom effect strip? I would like to create a custom effect strip for the VSE (Video Sequence Editor) and add it into the Add->Effect Strip menu. In my case I want to create a copy of the Transform effect, except with certain default values (ie. Blend=Over Drop, Scale X=0.75, ...).

How can I go about adding this custom effect?

I understand that blender is scriptable, but I have not found any resources that mention this particular topic. Any pertinent links or advice would be appreciated.

I don't know how to code an effect and I believe that it is a bit of a challenge. You could use python to code adding a transform effect with those parameters already defined, or you could append this metastrip plus effect fro another "master" blend file scene.

Here I have created a metastrip by adding a color effect (red) then pressing Ctrl-G. To this metastrip I added a transform effect and set the scale and x,y values. I also changed the blend type to "overdrop"

Next I selected the metastrip and its transform effect and duplicated them with Shift-D. I can place this duplicate metastrip anywhere on the timeline. Press the TAB key to step nside the metastrip and change the media.

Press the TAB key to get back out to the master sequence timeline, then you can drag the end handle of the metastrip to the correct new length.

Then you could split your screen to make a little FX bin on the side.

This is at timeline -0. In other words, you place a bunch of stuff outside the rendered timeline. Then you can select them no matter where you are in the edited timeline. They wont zoom or move unless you change it. I have also altered the color of that red strip in the other effect so that you can identify the one that you want to use, it may have different x,y offset values or scale etc.

Also you could enable the Addon Extra Sequencer Actions, then use it to copy the transform and blend type properties from your original effect to the others. It is a bit fiddly to select correctly. Make sure the master effect is the last one that you select.


MakeHuman Inverse Kinematics I have a makehuman model that I want to use for animating. However, with the current forward kinematics, it's very difficult to animate each bone one by one. So after messing around, I figured out how to use inverse kinematics. However I'm having trouble making the legs calculate their rotation realistically.

The legs when I did the IK looked like this:

The problem is the legs aren't turning on the Z axis so that the foot faces the direction it is at. It only really utilises the X and Y axis. How am I able to make it so that it can only move on its own local Y axis (which is based on its own rotation) with that rotation controlled by the Z axis?

The end result should look something like this.

This is what it currently looks like:

Note how from the top-down view, the foot is not facing in the same direction from the leg bone. Its angle is very off.

It looks like you have too many IK constraints on your legs and arms. You should have just on per leg or arm (on the shin or forearm bones) and then set the targets to the foot or hand, and the chain length to the number of bones in the leg arm. To avoid bending on the twist bones at the top of each arm/leg, you will need to adjust the settings to lock particular axes on the bone ik panel in pose mode.

See https://www.blender.org/manual/rigging/armatures/posing/bone_constraints/inverse_kinematics/introduction.html


Why is proportional editing only effecting one side of my mesh? I'm currently working on facial expressions and using Shape Keys and I've just run into this weird problem...

Whenever I manipulate one side using Proportional Editing, the other side won't follow or match, no matter the size of the fall-off. It's like the other side just stays where it is. I'm not sure what's happened. There are no modifiers active or waiting to be applied, such as the Mirror.

I can't figure out what's wrong. Any ideas?

You probably have to disable the X Mirror option in the Tools Options panel


Is it possible to use local and nonlocal forces simultaneously using bge? I'm working on a space simulator and I am currently using the .applyForce() method to move objects. Is it possible to set both a local force (thust) and a global force (3d gravity) to act on an object at the same time? If so, is there a built in function for converting the orientation of a given force?

You can do multiple applyForce() calls per frame, some local, some global and blender works everything out - summing them together to apply a correct total amount of force in the correct direction.

Example:

obj = cont.owner
obj.applyForce([0, 0, -9.8], False)  # Global gravity
obj.applyForce([0, 10, 0], True) # Accelearte locally

Or you can do the coordinate conversions manually using the worldOrientation matrix.


Video editing. Audio and Video strip have different length When I import a video in blender, I get audio and video on two separate channels.

And beside the name displayed on the channel I get some number:

video name: path | number I am talking about

The numbers in both the audio and video channel, do they have to match? The guy in a youtube video tries to match them by changing fps, and they match for him. But I can't get them to match.

So, do they have to match? How can I do it? Would there be any problem if they don't?

The number at the end of the name of the strip indicates the length of the strip in frames. If those numbers are not the same it means that the frame rate of your project and that of the video don't match. So video and audio will not be synchronized.

In other words, the audio will always play at the correct speed a second of audio will play in a second regardless of frame rate. But the video is not altered, it is not interpolated to accommodate for the desired frame rate. For example 300 frames will play in 10 seconds at a frame rate of 30fps, but will play in 12.5 seconds if the frame rate is 24fps.

To fix, open a Properties Window, and in the Dimensions section, set the frame rate of your project to match that of the video.

If you look at the following example you'll see that the final length of the video and audio are different The audio strip is 57 frames long and the video only 45.

In this case the video was shot at 23.98 fps and the project was set to 29.97fps.

Once you set the framerate, the length of the strips should change automatically. At the correct frame rate audio and video will have the same length, and play in sync.


How do I unhide all objects just on my current active collection? How do I unhide all objects just on my current active collection? Alt-h unhides stuff even on hidden collections which I find totally bonkers...

In the collections panel, there is an icon that looks like a funnel. This is the Filter drop-down. Click that and activate the eye and the screen icon if either are unseen. Provided both are visible now, shift-click the eye icon twice and the screen icon twice, corresponding to the top level of your collection. This will ensure that everything contained in that selection will be shown.


EEVEE and Cycles render lighting differences I get different lightning render with the same scene camera setup.

Cycles render (both experimental and supported feature set) gets weaker lightning and needs more energy.

How can I get the same lightning and reflection setup with EEVEE and Cycles?

TL,DR
EEVEE and Cycles are two completely separate render engines with very different approaches to produce an image.
You can't possibly expect to even remotely match a real time OpenGL based rasterizer with an unbiased path tracer image.
The long explanation
While they are very compatible to a certain degree, share most material and shader definitions; and the lamps and workflow are mostly interchangeable, they are very different under the hood, and quite opposite in very fundamental ways.
Both are aimed towards producing rendered images from a 3D model with varying degrees of realism, and both use a physically based approach to the definition of materials, but that is where the similarities end.
Cycles is a raytracer, a physically based unbiased path tracer, whose aim is to approach as closely as possible the real word physical phenomenon of light dispersion and interreflections through tracing of photon rays.
On the other hand EEVEE is rasterizer, a realtime OpenGL based render engine, compatible with PBR material creation. It has support for baked indirect lighting, screen space reflections, screen space ambient occlusion, and other modern commodities provided by current generation graphics hardware. While it is quite advanced and has extensive features to increase photo-realism it is easy to forget that at the end of the day it is still at its base a rasterizer (the most basic form of rendering computer graphics), with main purpose being speed and responsiveness over realism.
With this in mind it is virtually impossible to make a render made in EEVEE match one made in Cycles. Renders made with different engines would be very hard to match even for slightly different implementations of the same algorithm, let alone for two so fundamentally different rendering approaches.
You can't possibly expect a real time OpenGL based rasterizer to even remotely match a unbiased path tracer.
EEVEE

Cycles

This is easy to forget because both are deeply integrated into Blender, with a lot of common settings, having a similar workflow, sharing most material definitions and texture settings while using the same node tree based shader definitions. These similarities are very superficial, mostly at UI level however, under the hood very different calculations are happening and a whole lot of work has been put to make them work so well in tandem, and make their outputs match so closely.
Work is constantly being done to make the transition between the two as smooth as possible. Results are tweaked so that light intensity and material properties match as close as possible. Don't expect miracles however, there will always be differences between the two.
If EEVEE was ever able to produce the same results as Cycles at a fraction of the time we wouldn't really need raytracing at all, and Cycles would quickly become obsolete.
Here a few current limitations or real time rendering. EEVEE can´t really handle environment shader occlusion, HDRI world maps can't generate shadows and reflections are always visible regardless of occlusion, without baking. Most reflection types require baking for correct results, and don't handle interreflections too well. Transparent objects often can't be seen through other transparent objects and consecutive refraction effects don't carry over.
Solutions
Luckily, as user L0Lock mentions EEVEE and Cycles shader trees support multiple material outputs, and each can specify different target render engines within the same material, meaning you can tweak shaders to compensate for each render engine without having to make separate materials or fully rewrite your node trees.
Just add two Material Output Nodes to your shader tree, pick the render engine from the dropdown menu, and adjust your shader tree accordingly for each, diverging only where adjustments are required.

For lights, nodes are not yet supported in EEVEE, so if your lamp uses a node tree then EEVEE currently ignores it, virtually allowing you to tweak Cycles result from the node tree, while EEVEE will always display the direct result of the lamp at Object Data level properties, meaning you can independently tweak viewport results from the Properties Window parameters while Cycles uses the nodes one.
Otherwise if the results don't match well enough I'd advise creating two separate scenes, link all objects and data, then make unique users on a case-by-case basis for each single lamp or material that needs individual tweaking.


Small Logic Editor Text While I was working on a game my logic editor tab got very tiny and I can barely see it! How do I undo or fix this? I am new to blender so I didn't want to really mess with anything yet until I know what it all does. So if someone could explain it to me that would be great. I also have join.me if anyone needs to check my screen for it. Thank you.

Hold Ctrl+MMB  and drag left or right, or up and down to increase or decrease the size of the interface.

This works on many (but not all) of the 'areas' in blender, like the Graph Editor, Image Editor or the Properties area. It also works in the 3D view Toolbar (T) and the Properties toolbar (N).


Can't apply modifiers with shapekeys on blender 2.8 i have a model with some modifiers on (subdivision surfaces and solidify) and i'm not able to apply those modifiers with the shapekeys on, but i want to keep them, is there any solution beside doing the entire thing again?

Lets say we have a mesh with 2 shapekeys: 1 basis and 2nd Big Ears.

Create a copy of the mesh, select the copy and delete the basis shape key, then the big ears shape key.

Select the original and delete the big ears shape key, then the basis; you'll end up with two different meshes, one original and one deformed.

Apply your modifiers in both the objects (starting from the upper in the stack).

Then create a basis shape key for the original mesh, select the deformed, shift select the original and use the "Join as shapes" function.


Why does the object move when clearing its parent? When the parent-child binding is canceled, the geometry of the group of objects is broken. How can this be avoided or if this is not possible, corrected?

As stated in my comment, I'm pretty sure you can fix this by using Alt+P and selecting "Clear and keep transformation". This way it should clear the parent and keep its location.

What happens in your example is that when you remove the parent like that, your object jumps back to the original location/rotation it was in before it was parented to something.


Bone won't move in rigify I have a rigify armature where the hip bones are locked in place. I'm trying to select all the bones and move them, and all of them do move, except for the very top hip bones. I made another rig from scratch and works perfectly but using rigify causes this problem.

Oh dear, I think there might have been a misunderstanding. When you add a Rigify Armature, what you get at first is only the Meta-Rig. Its purpose is to give you the possibility to fit the bones to your character in Edit Mode. You're not supposed to add constraints to it yet, and some edits to the armature are also unsupported. Once you're done editing the bones (and not deleting them), you'd generate the 'real' rig using an operator.

I've added a second Rigify Meta-Rig to illustrate that somewhere down the road, you might have accidentally edited the Meta-Rig in Edit Mode:

The armature on the left is yours, the one on the right a fresh rigify one. As you can see, there's relationship lines missing on your hip bones pointing to the spine. That's why the bones do not follow any longer the spine.

Retry creating a Rigify Armature, reposition the bones in Edit Mode to fit your character, and then locate the 'Generate' button in the Armature Tab of the Meta-Rig:

After you click it, you should get this:

This doesn't work on your Blend file any more, because some vital bones have been deleted unfortunately.

More details can be found for instance in this video https://www.youtube.com/watch?v=dYiAd_08-0k and many many other resources on the web on how to use it.


How to change individual textures using an array modifier I have made a road out of a plane and used the array modifier, so the road follow a path.

What I would like to do is to change the road texture on some of the planes, so the road don't look so repeated. Some talk about the modifier UV Project but I don't understand how that is going to help me changing the textures on some of the planes.

Please help

The blender native array modifier unfortunately does not allow for different materials per array object, therefore to get the effect that you want there are only 3 ways:

Option 1:

Apply the array modifier and separate the resulting object by lose parts in mesh options and apply separate materials. This will obviously mean you also have to apply the curve modifier and place it where you want it first, etc

Option 2:

The UVProject modifier will allow you to uv project a picture to the entire object from an projector object (like an empty). In this case you would have to have one road texture that has all the variations in it already and project it using the UVProject modifier onto the array object. However this means that you cant add random variations automatically, and you have to plan the texture ahead of time to the length of the entire road object.

Option 3:

Use the Advanced Array Modifier build:
https://developer.blender.org/T26662

(Option 4)

(I do not have an Animation Nodes build available to me for testing right now so take this with a grain of salt, but i am pretty certain that you could offset a texture/material per object segment with Animation Nodes)


How to emit many colors at once? Is it possible to have "multi-color" emission?
For instance if I was modeling an iPhone, I would want the phone's screen to emit light - but not just one color. I'd want the light emitted to exactly match the colors of the screen that's emitting:

Unfortunately I can't seem to find any possible way to accomplish this.
Any suggestions would be greatly appreciated.

Just to illustrate my comment :-).
Simply run an image texture through the Emission node.


Is it possible to have Smooth Shading on by default? Is it possible to have Smooth Shading on by default for every object created? I can't seem to find a way to do this in the User Preferences. Turning on Smooth Shading is an action I need to perform 95% of the time, it would be nice if I could skip it. Apologies if this is more a "feature request" but I think I may have just missed the option in Preferences.

It is kind of possible to write an add-on for this with Python. There does not seem to be a nice way to trigger an operator(what smooth shading is in Blender apparently) every time an object is created, but it is possible to check the count of objects in the file every time scene is updated. Scene gets updated all the time so that is a whole lot of unnecessary checks, but it seems there is no nice or elegant way to do this. I am not entirely sure I can honestly recommend using it but this hack seems to work and it's the only way to do it I can think of. It shades anything new to the scene smooth. Pasting and duplicating will trigger it as well. You can save it to a .py file and install it as an add-on if you really need this functionality. You may also want to do something about ugly shading with sharp edges so you may want to uncomment the line enabling auto smooth.

bl_info = {
    "name": "Smooth shade new objects",
    "author": "-",
    "version": (1, 0),
    "blender": (2, 79, 0),
    "location": "Works every time new objects are added",
    "description": "Shades everything added to the scene smooth",
    "warning": "",
    "wiki_url": "",
    "category": "Mesh",
    }

import bpy
from bpy.app.handlers import persistent

bpy.last_count = 0

@persistent
def smooth_handler(dummy):

    if len(bpy.data.objects) < bpy.last_count:
        bpy.last_count = len(bpy.data.objects)
    elif len(bpy.data.objects) > bpy.last_count:
        bpy.last_count = len(bpy.data.objects)
        if bpy.context.object != None:
            #bpy.context.object.data.use_auto_smooth = True
            bpy.ops.object.shade_smooth()

def register():
    bpy.app.handlers.scene_update_post.clear()
    bpy.app.handlers.scene_update_post.append(smooth_handler)

def unregister():
    bpy.app.handlers.scene_update_post.clear()

if __name__ == "__main__":
    register()


How to add a mesh to each vertex (30k vertices) so can import into UE4 I want to import a set of vertices into UE4 but am unable to do so since it lacks any mesh data. Is it possible to convert the 30k vertices into having meshes at each vertex so they are visible and can be imported? e.g. adding a small sphere or cube for each vertex.

Use a Skin Modifier

I created some vertices to test:

Then I added a skin modifier from the modifiers tab:

I then got this result, which I think is what you want:

When you are happy with the result, you should be sure to apply the modifier using the apply button in the modifiers tab to actually create the mesh data.

If the squares are the wrong size, go into edit mode, select all the vertices, and press Ctrl + A to resize the cubes.

I hope that helps!


Object alignment/Pattern Object/Smart Guides in Blender Now I started with blender it's been a couple of days and I haven't found a way to do this, tried searching on google and youtube but couldn't find something that satisfies what I'm talking about.

Here's a problem: I have 2 objects (whether they're different or equal, doesn't really matter, although this can be more useful when we're talking about 2 different objects), and I need to put them side by side, or front to front, or any type of alignment, perfectly with no overlapping or gaps between them, for an example, Photoshop has something called Smart Guides (Check it out if you don't know what it is)and besides the question of how to actually do it, is there any tool similar to smart guides?

Here's pictures of two example objects:

And here's what I'm trying to do:

BUT, I want to do with accuracy, being sure that it is exactly at the side or in the front, with no overlaps or gaps between them.

One of the things that makes me want to do this is to be able to do a pattern object, one that I can repeat it eternally to all sides and it will fit, but to fit, I need this precision, but that's just one of the things. If you know any way on how to do something similar to this, i'd be very grateful.

I'm using Blender 2.8 beta (hash: a1ae04d15a9f)

Thank you all.

If you just need to snap one object to another one by vertices, then:

Set Snapping to Vertex, let target to Closest
Enable Snapping or hold Ctrl while grabbing to enable it temporarily
Grab an object to a vertex of the object you want to snap to


Why is the texture appearing different, and then not rendering? That doesn't look right at all.

Also,

Why is his face all black?

To use any image with transparency (alpha channel) in cycles you need three nodes. Typically a Transparent BSDF, a Diffuse BSDF (or some other color shader) and a Mix Shader.

Here is the most basic node setup for a transparent image texture in cycles.

However that is not what you want, if you use that setup you will end up with you guy's head being see through.

Now the principal is simple, you treat the color data and alpha data differently.
The color data gets displayed, but the alpha gets used as a mask. What it is masking is totaly up to you and your specific nodes.
In my nodes, in the image above, I'm making the alpha completely transparent, with the Transparent BSDF.
However for you, you can use your base color instead of a transparent node.

Here is an example showing the difference between using a diffuse node (left side) and a transparent node (right side) as the base under the image texture.


Script to get the type (hold, breakdown, extreme) of active key I need a python script to check if the current keyframe in the timeline is of the 'Extreme' type. How do I go about this?

There doesn't seem to be a direct way to determine the keyframe by frame number. However you can iterate through the keyframes of a given object and check if the x-coordinate of the keyframe matches the current frame. Once you have retrieved the keyframe you can access the type.

  type

  Type of keyframe (for visual purposes only)

  KEYFRAME Keyframe, Normal keyframe - e.g. for key poses.
  BREAKDOWN Breakdown, A breakdown pose - e.g. for transitions between key poses.
  MOVING_HOLD Moving Hold, A keyframe that is part of a moving hold.
  EXTREME Extreme, An ‘extreme’ pose, or some other purpose as needed.
  JITTER Jitter, A filler or baked keyframe for keying on ones, or some
  other purpose as needed.

import bpy

obj = bpy.data.objects["Cube"]
fcurves = obj.animation_data.action.fcurves
current_frame = bpy.context.scene.frame_current + bpy.context.scene.frame_subframe

for fcurve in fcurves:
    for keyframe in fcurve.keyframe_points:
        if keyframe.co[0] == current_frame:
            print(f"{keyframe.co}: {keyframe.type}")


Wrong shape of the inserted face the insert in circle When I insert in this circle I get not matching shape of the face. That is wrong with it? The circle inside should be matching the external circle. Extrusion was done with I (insert) function. The initial circle had one N-gon and 32 vertices.

Try to go to object mode and hit Ctrl + A  and select To All Transforms and now try to insert face.


smoke to use gradient from red to violet through rainbow How can i get my smoke to change from red to violet through the rainbow as a gradient throughout my animation?

I am trying to create smoke that will have a gradient from red to violet through the rainbow.

I have the smoke, i am not able to make it change colors throughout my animation though.

I would love to use nodes to do this, because i am trying to learn nodes right now. I have not been able to find a good tutorial on how to change smoke colors with nodes though.

Thanks

Here's a variant of the 'Quick Smoke' material (as created by selecting the default cube, pressing Space and typing 'Quick Smoke' Enter).

The differences are the addition of the Emission shader to make the smoke glow (this would normally be the 'flames') and the additional of a Color Ramp set to vary based on the Generated 'Z' coordinate (adjust the color ramp colors to get the desired 'rainbow').

Note that setting the smoke domain objects to be 'Smoke Adaptive Domain' the smoke rainbow will dynamically span the height of the extent of the smoke.


Is there any way to measure angle between edges/faces, or change the angle so that the mesh changes according to the angle we input? These features are available in some CAD software packages. I haven't come across these features in Blender. Are they available as built-in features or add-ons?

I want to be able to build a model, return later on and edit an Edge or a Face such that it makes a certain angle with some reference.

As well as the ruler and protractor option that was added in blender 2.67, you can also display edge length and angles while you are editing.

In 2.80+ you can find the length and angle options in the viewport overlay options menu.

For v2.7x, you can turn on these options under the Mesh Display panel of the properties region - N


How can I make an NLA strip longer to fit more keyframes? I made an animation and dropped it as an NLA strip - now I'd like to tweak that strip to add more keyframes and make the strip longer.

I thought that the Extend (E key) function does that - but no it only stretches the strip. I don't want to scale the strip, because then I'd have to scale down the keyframes to actually fit more of them in my strip - and I can easily break the animation timing while attempting this.

How can I make an NLA strip longer to fit the extra keyframes?

Open the NLA editor
Select the strip you want to make longer
Open the properties panel with the N key
Go to the Action Strip tab
Enable the Sync Length checkbox - this will make the strip longer if you tweak it, making the underlying action longer.


Is it possible to copy a certain property of a certain material to other materials? Assume that I have materials "Foo_1", "Foo_2", and "Foo_3".

Let's just say, that material "Foo_1" with a alpha transparency value of 0.4 or something. Would it be possible for me to copy this property of "alpha transparency 0.4" to materials "Foo_2" and "Foo_3" (and possibly more)?

While you can copy many object values to all other selected objects, we can only select one material at a time, leaving us with two options -

Copy an individual value CtrlC (CMDC on osx) and Paste it into the other materials CtrlV (CMDV on osx). Both of these actions work while the cursor is over the value for number, text and colour. Items like checkboxes and popup menus don't copy.
Use python (either a small script or type straight into the python console) to change the value of all or a subset of materials - this question can help with ways to define a list of materials.

While 1 is ok for a small number of materials 2 becomes necessary for larger changes.


Is there a photogrammetry addon or setup that works similar to FaceBuilder addon for NUKE? Is there an arrangement that allows similar pinning of a generic (initially)  mirrored mesh/facemesh ?

KeenTools FaceBuilder Demo 2018

I'm fairly sure Blender can come close to this with existing tools.

There is now !

The addon by KeenTools

Here's a tutorial by CGMatter


How do I do a video glitch with wrap around edges? I want to make a horizontal video glitch that shifts the image across but wraps around on itself. The Translate node can do this to the whole image but won't allow me to do per pixel distortion.

You can achieve this effect with the Displace node (for distortion) and the Translate node (for wrap around).

Create a texture for the desired skew or offset effect, then send this to the X value of the Displace Node.

Use a Combine RGB node to send a large Value to the Red or Vector X input. The Combine RGB node doesn't allow you to enter a value over 1 unless you type it in. I have added a Value node (the Green node) to make this easier. You animate the amount of distortion with this node.

The Red curve node allows you to modify the nature of the distortion, by modifying the contrast of the texture you can make a pointy effect or a rounded effect.

In this image you can see that the right edge the image is wrapping around to fill the gap left by the distortion. I have piped the Value node into the x axis of a translate node, then combined it with an Alpha Over onto the distorted offset image.

If I invert the texture then the distortion will affect less of the image.


Rendered image different than render preview I am having this issue when everything looks good and ready to render the image, but once it is rendered the material is discolored. I changed the settings in the viewport shading. I unclicked the Scene Lights, Scene world, enabling the metallic color and world reflection to be visible on the rendered outcome. The light seems to be the same in both views. What could cause that?

Viewport shading is only preview, that means the HDRI when you uncheck the world lighting will not be used in real render. So if you want to use HDRI, the correct way is to use real HDRI from World properties, change the color to Environment, select HDRI that you have (you can download from HDRIhaven.com  or use the one included in Blender (I think they are lower resolution) from Blender folder \2.82\2.82\Datafiles\Studiolights\World (change the path according to version).

but actually you can just render from the viewport in View > Viewport Render Image/Animation, it's just you may want to disable Gizmos, change viewport samples per pixel, etc
but I recommend you go the usual path of rendering until you know what you're doing


How to create a PyDriver in blender 2.7 I've heard of PyDrivers where you can put python code into a driver, & I'm wondering, how would you do that in blender 2.7x without resorting to a lower blender version?

Here's what I'd like to put in the driver:

(ob(‘Armature’).getPose().bones[‘Bone.001’].head - ob(‘Armature’).getPose().bones[‘Bone’].head).length/250

your example can be implemented as in the following driver :

but for more complex drivers refer to this DOC page , the important part is that you can define your function and add it to driver namespace as in this example :

import bpy

def driverFunc(val):

    return val * val    # return val squared

bpy.app.driver_namespace['driverFunc'] = driverFunc    # add function to driver_namespace

now you can use it the driver scripted expression


Is it possible to make an optically functional camera lens in cycles? I am interested and intrigued at the idea of designing a camera lens (or camera lenses) in Blender, that would function optically like "normal" camera lenses and project an image on a plane.

By "optically functional camera lens", I mean something like this, where the image of the scene comes into the lens and out the other end onto a plane (image courtesy of this site):

This is not a tutorial request, I am just asking before I get into this time-consuming project if someone knows whether or not this would technically work or if it wouldn't, because of the current limitations of Blender's caustics simulator (and yes, I understand that the rendering could take a very long time...). I am not extremely knowledgeable about optics and cannot tell if the two are related.

Oddly (or maybe just because people aren't masochists), I can't find much on the subject, besides from this old post with broken links.

I already tried things like this, but on a much smaller scale. If you want to be sure that your project works, you should try Luxrender because it is based on a physical simulation.


How can I make objects transparent but thick at the same time I am making my own james bond gunbarrel sequence, and when the blood droops down, it needs to look thick but transparent at the same time. I am wondering how to achieve this affect. To understand what I mean entirely, please check out the casino royale gunbarrel sequence on youtube. Thanks

"Transparent but thick" would sometimes mean "translucent", I suppose. However, the casino royale gunbarrel sequence effect on YouTube seems not. I think you are trying to make things like this:

Or something more controllable:


creating a dry fountain I am trying to create a dry fountain in Blender (see the reference image). However, I have no luck so far. I've added a small circle to my scene, which I made the inflow for the fluid simulation. I then created a fluid domain and pressed 'bake'. The result is very poor: no water is created at all. Can anyone please suggest a more effective way to create a dry fountain?

Make sure your fluid inflow has a velocity in the correct direction, and your fluid inflow object is filled (try using a sphere rather than a circle if it doesn't work) Check out one of the basic fluid tutorials on YouTube, as the majority of the techniques you need for this kind of simulation are covered there.


Send Object To Origin What is the shortest way (or a shortcut key if there is any) to move the object to the origin?

To reset the location of a moved object, press AltG.
However, if you want to move a part of an object to the objects origin, select this part in edit mode and set the Median Values in the right toolbar to 0.


How to control a short "animation" with a single bone? I've never really rigged something before (not counting automatic weights ;).

I've made a simple rig of a landing gear, and I'd like to have a single control bone control the whole unfolding sequence.

I've made a simple animation mostly showing what I want to bone to do by moving it along the Z axis:

I tried to setup various transform constraints to rotate the various bones according to the Z location of the control bone, but I must be doing something
wrong, as they don't work as I expect.

Blendfile

Is this even a good approach to rigging something like this?

Blend file
I took your blend, made a copy of the landing gear and rig and deleted the animation.
I then added Transformation Bone constraints to four of your bones; arm1, arm1.001, pad, and pad_backflip. Notice the different values of the Min and Max for the Source Z axis on the Transformation constraints. That is how I timed the different parts to happen at different times. Your Control_bone drives all of the Transformation constraints.


Saving and loading object name location and rotation of a selection I would like to know how I can save selected object names, location and rotation using Python in Blender 2.8 in a CSV.

And then using the same CSV apply this information to another blend file with the same objects in different locations in a new frame.

(it's not about bones it's about normal meshes).

Beeing new to Blender Python scripting, I hope for some coding hints here.

so far i got this (works in console but not in script file)

import bpy
import os
ob_active = bpy.context.selected_objects
for obj in ob_active:
    print(obj.name,obj.location,obj.rotation_euler)

Surely this has been asked before?

Rather than spending any more time searching for the elusive dupe, to the export part, I'm sure it's out there

Here is an example using f-string formatting.

import bpy
context = bpy.context

def sfmt(s):
    return f"{s :10s}"

def vfmt(vec):
    return ", ".join(f"{v : 10.4f}" for v in vec)

for obj in sorted(context.selected_objects, key=lambda o: o.name):
    output = ",".join((
            sfmt(obj.name),
            vfmt(obj.location),
            vfmt(obj.rotation_euler),
            ))
    print(output)

Output of default scene, remember rotations are in radians.

Camera    ,    7.4811,    -6.5076,     5.3437,    1.1093,     0.0000,     0.8149
Cube      ,    0.0000,     0.0000,     0.0000,    0.0000,    -0.0000,     0.0000
Lamp      ,    4.0762,     1.0055,     5.9039,    0.6503,     0.0552,     1.8664

A number of other csv related questions.

How to read a csv file and use the values as x and y points in blender?

Massive import with CSV file

Moving and rotating using CSV

Generate and edit csv-file to reimport and use it with blender

How do I move an object using a csv file?

How to import a 3d object by csv file

csv file reading

Exporting coordinates of vertices to CSV

Import coordinates from CSV and create sphere at each position


why shrinkwrap making the tube flat I have a basic sphere and with freehand addon i have created and arc and bevel that with the circle. To the arc its been bevel like a tube shape.

Tube shape

Adding shrinkwrap modifier the tube shape became flat

Tube flat

Whats wrong why the tube gone flat after adding shrinkwrap modifier. Any suggestion or help thanks.

There is a button “apply modifier on splines' points” that you have to enable.

With the function deactivated the curve will get beveled and the resulting surface will receive the shrinkwrap modification. With the function activated all of the curve's control points will be shrinkwrapped. The bevel will then be applied to the shrinkwrapped curve.


Blender is seeing my GPU but it doesn't seem to kick on when I render I have an AMD RX 480 8gb GPU in my machine. Blender doesn't seam to recognize the card, instead, under OpenCL, it says Ellesmere. I can select GPU when I render, but my GPU doesn't kick on. Is this a known issue with AMD cards? My AMD drivers are up to date.

My Radeon R5 M330 had the same problem, except it listed "Hanian" as the GPU available. I asked a question about how to make it work, and I got answered: Rendering with AMD Radeon R5 M330 gives an error that I can't understand!
The GPU name doesn't seem to do any effect.


Changing node connections to be straight? As is typical in this kind of thing I have a node tree filled with tangled curvy node connections going every which way. Even using reroutes it is somewhat difficult to read.

I've seen a number of people who have the node connections appear far more like a straight line than a bezier curve...how would I replicate this feature?

Open the User Preferences > Themes > Node Editor > Noodle Curving


Is there a way to grab both keyframes and markers in blender? I have lots of camera animation binded to markers to switch between the cameras.
I can grab and scale keyframes, and the same goes for markers, but I cannot grab them together. Every time I need to move keyframes and markers I have to do it separately and this is annoying.
Is there a way to move them together?


Can't figure out why one of my assets is shiny? Hello, I'm new to modelling and have been making a few small tiles to snap together in unity. As you can see, Tile A has sides of the same color, with no strange lighting going on. Tile B's sides, however, appear to have different lighting. I've looked around and cant figure out how to make tile B look like tile A. Both of these files use the exact same options; B is a copy of A which I reconfigured into a bend.

The easiest way while you are in Object Mode is to switch to flat shading in the Tools panel. Alternatively you can add an Edge Split Modifier in the Properties Editor.


Change the font in the Sequencer Text Effect with Python code I need to change the font in the Sequencer Text Effect with Python code if it's possible ?!

First, you' have to know where the font-files are located in your system. You can find this location by changing manually a font. On my Windows machine, this is: C:\WINDOWS\Fonts\ARIAL.TTF for the Arial font. Then paste and run run the followig code in the Text Editor of the Scripting workspace to assign the Arial font to the active (selected) strip.
import bpy
strip  = bpy.context.scene.sequence_editor.active_strip
new_font = 'C:\WINDOWS\Fonts\ARIAL.TTF'
strip.font = bpy.data.fonts.load(new_font)

See also Select text object by name and change font via script


How to create poly cylinders on all edges easily? I have a low poly model that I am trying to modify to have a constructed look to it.

The look I am going for is similar to this where all edges are cylinders connecting the spherical vertices: (With the faces filled)

I have managed to get the spheres at all vertices of my low poly model using duplicate but I need to get the cylindrical parts on all edges between the spheres to complete the look.

Is there a way to make this happen programatically/using functionality? I really don't want to have to do this manually.

This will be used in a game engine so needs to be geometry that can be imported so no magic rendering tricks unfortunately.

Youd could clone your mesh with Alt + D and add a wireframe modifier to it, that way the meshed are kept linked and in sync so modifications propagate.
Or as suggested by Samoth add the wireframe modifier without the option Replace Original so the underlaying mesh is kept visible

The Wireframe modifier does add a flat shaded grid with square section, so you may want to add a bevel modifier on top of it to make it smooth and cylindrical


What units does the rotation argument expect when creating objects? I want to create a lamp in blender using python. I want to give the lamp some rotation. As per the documentation I can set the initial rotation using a tuple of numbers in the function call like this rotation=(0.0, 0.0, 0.0)
this is the specifc documentation for the rotation parameter:

rotation: (float array of 3 items in [-inf, inf], (optional)) – Rotation, Rotation for the newly added object

What units is this parameter specified with? It does not seem to be in degrees or radian.

When I try with my example code here where I use rotation=(0, 1, 0) to get 1 degree on the y axis. I end up getting 57.296 degrees after running the code.

import bpy

bpy.ops.object.lamp_add(type='AREA', view_align=False, location=(0, 0, 0), rotation=(0, 1, 0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))

It is using radians. 1 radian = 57.2957795 degrees. Without the need to import another module you can use a degree value with (3.14159 * degrees / 180) or just quickly import pi from math if you don't want to define it or you could alternatively use round(math.radians(degrees)).

import bpy
from math import pi

bpy.ops.object.lamp_add(type='AREA', ... ,  rotation=(0, (pi * degrees / 180), 0))


What is the equivalent of sweep on a rail in Rhino? Bevel is not working for me I'm a jewelry designer and fairly new to Blender... This is my first time asking a question on the stack exchange.

I was trained in Rhino a few years ago and I remember the function "sweep on a rail" which is where you could take a shape / multiple shapes and apply them to your curve (for us jewelry designers, it was a cuff, wire collar, etc.)

I'm having trouble finding the equivalent to that function now. I feel like what I'm trying to do is pretty simple. I want to make an open metal collar (that opens on the front side of neck) that is a half circle tube where the flat side of circle touches your neck at one end then naturally twist 90 degrees to touch your collar bone on other end of necklace (see pic).

So far I've tried the bevel tool in the geometry section as well as a combo of array and curve but I can't seem to get it right.

Any help would be appreciated. I'm happy to share the file as well.

Thanks,
Jessie

I tried Craig's advice, but this is what's happening now. For some reason the circle the wrong way so it's flat instead of a tube around the curve (collar). Here are some pics.

Final:

Steps:

Bevel object.

This will be our shape (profile) needed for beveling main neckles.

You can create it from Add > Curve > Circle and:

Rotate it on X axis by 90 degrees.
Go to Front Ortho view.
Select half of it.
Press V and select Vector.
Move middle point to be even with top/bottom ones (you can use Snap to Vertices).
Go to Object Mode.
Scale it down a little.

  Note: It's important to have this shape properly rotated before
  Beveling another Curve.

Main object.

Create another Curve > Circle.
Go to Object Data tab.
Choose Bevel Object we have created earlier.
Check Fill Caps.
Uncheck Cyclic.
Position Bezier Points as you need.


What are purple lines in edit mode? I know the red lines are seams. What are the purple lines?

It's the Edge Crease to control the sharpness of the edges when you use a Subdivision Modifier. you can control it in edge mode by pressing Shift + E

Hope that helps.

Good Luck


Why does object grab attach to another object I am creating a cup and a plate in blender 2.8, and I have such an issue. While I'm grabbing a face of a vertex of the plate it immediately attaches to the closest part of the cup from my vewpoint. The same happens when I'm moving the whole olate in Edit Mode. While being in Object mode, those two objects move together, although I triend to Unparent them and to separate from relation. I tried to demonstrate the issue below, thank you for help in advance!

You have snapping turned on in the screenshot. How does it act when you turn it off? It is the horseshoe magnet at the top of the screen if you don't know


Render using way too much memory no matter how much I lower settings I am trying to get my render time much lower. It's taking about 10 minutes a frame. which is obviously way too long considering that I need to do over 800 frames maybe even over 1200 by the time the whole project is finished. I tried doing the following things:

turning Render Properties > Sampling > Render from 128 to 64
turning Render Properties > Light Paths > Max Bounces to 3 for every single option
turning Render Properties > Clamping > Direct Light and Indirect Light to 0.00
unchecking Render Properties > Caustics > Reflective and Refractive Caustics

The most confusing thing is that changing these setting has actually made rendering take LONGER??!
Right now my peak memory use is over 21 GB??! I have no idea what's going on.
P.S. I am using a de-noising node in the compositing tab. Also, I'm using Blender 2.91 with the Cycles Render Engine and Windows 10.

Every step you listed except for clamping probably helped out.
Turning clamping to 0 actually unclamps them completely.  You need some value in there, I think indirect is clamped at 10 by default and unclamping it increases render times pretty significantly.  It probably wiped out all the gains made by the other methods.
As for the memory usage, check your materials for duplicate image textures.  If you're using high-resolution textures and you think you could get away with a lower resolution, that will take less memory.
You can go this menu -

and lower your viewport settings and maybe cut down on the geometry that blender has to keep track of outside of the rendering process.
Consider adaptive subdivision if you have any highly subdivided meshes.


Why is tracking getting less accurate after going past cached frames? I'm trying to track a video clip I filmed, and when I open it in Blender, I am able to cache 519 frames of the video. When I then track the markers I place in the movie, everything works fine, until it goes past frame 519 (i.e. past the part already cached), when the tracking on the start of the clip starts to get inaccurate. How can I prevent this?

From the information you have provided it sounds like you are attempting to perform your tracking on your actual movie file.

If that is the case you should export the entire movie to a series of image frames, then import that image sequence into the movie clip editor and perform your tracking on the image sequence.

Most movie file formats store their data, not as a sequence of fixed images, but as a description of the changes in the image since the last frame, and depending on the compression level used will discard some of that information.
For an insight into how complex this issue can become you may like to look at the story of the recovery of the lost video from the first ocean landing of SpaceX's recoverable Falcon 9 Stage 1.

Skipping backwards and forwards through movie files can produce decoding differences in the frames being viewed, and can result in inconsistent output, which in turn is compounded in this case as the movie file is continually being re-read from disk.

To break your movie file into an image sequence:

Open a new instance of Blender
Set the render properties for the project (frame size, # of frames, frame rate etc. to match the movie file)
Set the output format to an image format (.png is usually OK)
Set the output directory to a new directory to store these files
Switch to the video editing screen layout
With your mouse over the Video Sequence Editor window
Press Shift+A and select Movie to add a movie file (Navigate to it and select your movie file)
Make sure the strip is placed with the start frame on frame 1.
Render the animation (switch back to the default view, or press Ctrl+F12).

The image sequence produced can be used in place of the movie file in your tracking scene in exactly the same way - simply select all the frames in the directory, in place of the movie file.

Hopefully this solves your problem.


How to link the adjust last operation menu to object? Blender 2.80 - 2.81 What am I missing or doing wrong?
I made this script to add a cylinder ( just to learn ) but the adjust last operation menu does not work all.
What do i need to do to get this linked to the cylinder?
In the end I want to add some functions same as current add cylinder but also other funtions.

I guess there is no link between the bl-idname and the cylinder

This is my code

    bl_info = {
    "name": "New Object",
    "author": "Your Name Here",
    "version": (1, 0),
    "blender": (2, 80, 1),
    "location": "View3D > Add > Mesh > New Object",
    "description": "Adds a new Mesh Object",
    "warning": "",
    "wiki_url": "",
    "category": "Add Mesh",
}

import bpy
from bpy.types import Operator
from bpy.props import FloatVectorProperty
from bpy_extras.object_utils import AddObjectHelper, object_data_add
from mathutils import Vector

radius = 1
depth = 2
location = (0, 0, 0)
rotation = (0, 0, 0)

class OBJECT_OT_add_object(Operator, AddObjectHelper):
    """Create a new Mesh Object"""
    bl_idname = "cylinder.add_object"
    bl_label = "Add Mesh Object"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):

        bpy.ops.mesh.primitive_cylinder_add(radius=radius, depth=depth, location=location, rotation=rotation)

        return {'FINISHED'}

# Registration
def add_object_button(self, context):
    self.layout.operator(
        OBJECT_OT_add_object.bl_idname,
        text="Add Object123",
        icon='PLUGIN')

# This allows you to right click on a button and link to documentation
def add_object_manual_map():
    url_manual_prefix = "https://docs.blender.org/manual/en/latest/"
    url_manual_mapping = (
        ("bpy.ops.mesh.add_object", "scene_layout/object/types.html"),
    )
    return url_manual_prefix, url_manual_mapping

def register():
    bpy.utils.register_class(OBJECT_OT_add_object)
    bpy.utils.register_manual_map(add_object_manual_map)
    bpy.types.VIEW3D_MT_mesh_add.append(add_object_button)

def unregister():
    bpy.utils.unregister_class(OBJECT_OT_add_object)
    bpy.utils.unregister_manual_map(add_object_manual_map)
    bpy.types.VIEW3D_MT_mesh_add.remove(add_object_button)

if __name__ == "__main__":
    register()

That's pretty close. Just add real properties to the operator class. Minimal example:

import bpy
from bpy.types import Operator
from bpy.props import IntProperty, FloatProperty, FloatVectorProperty

class OBJECT_OT_add_object(Operator):
    """Create a new Mesh Object"""
    bl_idname = "your_category.add_object"
    bl_label = "Add Mesh Object"
    bl_options = {'REGISTER', 'UNDO'}

    my_radius : FloatProperty()
    my_depth : IntProperty()
    my_location : FloatVectorProperty()
    my_rotation : FloatVectorProperty()

    def execute(self, context):
        # Call primitve_add
        bpy.ops.mesh.primitive_cylinder_add(
            radius = self.my_radius,
            depth = self.my_depth,
            location = self.my_location,
            rotation = self.my_rotation)

        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

Further reading: https://docs.blender.org/api/current/bpy.props.html


Run an edit-mode operator on every object in the scene I want to untriangulate every object in my scene with this script:

import bpy

for ob in bpy.data.objects:
    bpy.ops.mesh.tris_convert_to_quads(limit=0.9, uvs=False, vcols=False, sharp=False, materials=False)

But it doesn't work in object mode, any ideas on how I can get it working?

There are 2 ways you can do this:

Standard API (bpy) - the most straightforward is to set each object in editmode and run the tool.

Notice I'm not using bpy.data.objects, This will operate on all objects in your blend file, not just your scene, instead use bpy.context.scene.objects.

import bpy

scene = bpy.context.scene
for ob in scene.objects:
    if ob.type == 'MESH':
        scene.objects.active = ob
        bpy.ops.object.mode_set(mode='EDIT', toggle=False)

        bpy.ops.mesh.reveal()
        bpy.ops.mesh.select_all(action='SELECT')

        # execute any editmode tool
        bpy.ops.mesh.tris_convert_to_quads(limit=0.9,
                                           uvs=False,
                                           vcols=False,
                                           sharp=False,
                                           materials=False)

        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

Note:
You need to be careful trying to edit all objects, some may be hidden, not on a visible layer, or linked in from an external file (and can't be edited). For this reason its often better to use context.selected_editable_objects

bmesh module (Docs) - bypass bpy.ops modes and edit the mesh directly.
In this case using the bmesh api. Note that this is specific to meshes, curves, metaballs etc will need to use bpy.ops still since they don't have an equivalent to bmesh.

import bpy
import bmesh

scene = bpy.context.scene
for ob in scene.objects:
    if ob.type == 'MESH':
        me = ob.data
        bm = bmesh.new()
        bm.from_mesh(me)

        # execute any bmesh operator
        bmesh.ops.join_triangles(bm, faces=bm.faces,
                                 limit=0.9,
                                 cmp_sharp=False,
                                 cmp_uvs=False,
                                 cmp_vcols=False,
                                 cmp_materials=False)
        bm.to_mesh(me)
        bm.free()

Note:
The examples above may touch the same mesh multiple times since many objects can share the mesh, You almost never want this, at worst it gives invalid results because the tool runs many times, at best the script just runs slowly and does a lot of useless calculation.

Here is an example which ensures meshes are only edited once.

import bpy
import bmesh

scene = bpy.context.scene
unique_meshes = set([ob.data for ob in scene.objects if ob.type == 'MESH'])

for me in unique_meshes:
    bm = bmesh.new()
    bm.from_mesh(me)

    # execute any bmesh operator
    bmesh.ops.join_triangles(bm, faces=bm.faces,
                             limit=0.9,
                             cmp_sharp=False,
                             cmp_uvs=False,
                             cmp_vcols=False,
                             cmp_materials=False)
    bm.to_mesh(me)
    bm.free()


Fill Mesh Components with Random Vertex Color I find myself spending a tremendous amount of time preparing my models for export into substance painter. It seems like a macro and or script would be able to do this no problem. Unfortunately my Python skills are non existent, but I would love to learn. My process is fairly straight forward.

I select an object / mesh that has multiple components in Object
Mode. Then switch to Edit Mode.
Select a pieces verts using L.
Switch to Vertex Paint Mode making sure Face selection masking for painting
is on.
Select a random color and hit Shift + K to fill selection with color.

I usually end up with something like this..

This allows me to generate an ID map within substance painter. It is the quickest way I've found to generate these maps for texturing.

My searches have brought up random vert colorization, but nothing like what I'm describing. Maybe I'm using the wrong terminology?

Any help with this would be greatly appreciated!

Thank you @Mr Zak, you got me pointed in the right direction. Going through the first links github, I found this... https://github.com/varkenvarken/blenderaddons/blob/master/connectedvertexcolors%20.py … It adds an option to fill each piece of the object with a random color while in vertex paint mode. Thanks!


Making a completely transparent object a light source? Down below is a rendered image of what I'm modelling (please excuse the fire flies). There is actually a RED spot light shining into the cube, and the refracted light shining into the cube is shined onto a jellyfish. The problem is that the light refracted by the cube and onto the jellyfish is WHITE not RED.

What I want to do is make a transparent material, like the the glass cube in the rendered image, that refracts so much light and color, in this case the red light, from its environment that is basically acts as a light source while still being completely transparent.

How would I go about doing this?

Here are the nodes that I used.

You can just add an object as an emission and disable it's view in the render;


What does the 'light path' node do? I want to understand what the light path node does in blender. For example, here http://www.pasteall.org/blend/35401 I am doing a simple rendering of person. I used a point lamp as a light and the node associated to the lamp is mentioned below:

When I did not use the light path node, I obtained a scene like this (in render settings, I used limited global illumination in the light path)

When I used the light path like this:

I obtain this image which is more realistic.

The Light path node allows you to make shaders do different things based on where the incoming light ray was before. When thinking about where "before" is, keep in mind that cycles is a backwards path-tracer.

The Ray Depth output of the light path node gives the number of bounces the ray went through before hitting the lamp (or whatever is using the shader).
So when tracing backwards from the camera to the lamp, surfaces which are directly illuminated (1 bounce away) will hit a lamp with a corresponding strength of 1:

Surfaces illuminated by indirect lighting (2 or more bounces before hitting a light source) will "see" a correspondingly stronger light source:

To see it in action:

As to why it appears "more realistic", I think this really just an artifact of the lamp being way too bright in the first example (it looks fine when the strength in the light falloff node is then set to 1). In fact the setup with the ray depth is less technically realistic, as explained above.

Normally the light falloff node is plugged into the strength, not the color. Then with the default strength of 100 it looks just fine: