text:
Change active collection
Is there a way to change the "active" collection?
I can check witch collection is currently selected with this code:
>>> bpy.context.collection
bpy.data.collections['My Collection']

But I can't change it using this property because is read-only. Is there a way to do that?

EDIT
After some research I found out part of the solution. I can use this code to get and set the active layer collection.
# Get the current active layer collection and store it in x
x = bpy.context.view_layer.active_layer_collection
# Select another layer collection from the outliner,
# then use this code to restore x as active
bpy.context.view_layer.active_layer_collection = x

the new problem is that x is not a Collection object, is a LayerCollection and we can't pass any collection created with the method:
myColl = bpy.data.collections.new('My Collection')
bpy.context.scene.collection.children.link(myColl)

So the refined question is:
How to obtain a LayerCollection for a particular Collection to change the Active Collection?

The only way I could find to obtain the LayerCollection for a particular Collection is to transverse bpy.context.layer_collection looking for the name I want
#Recursivly transverse layer_collection for a particular name
def recurLayerCollection(layerColl, collName):
    found = None
    if (layerColl.name == collName):
        return layerColl
    for layer in layerColl.children:
        found = recurLayerCollection(layer, collName)
        if found:
            return found

#Create one collection
myColl = bpy.data.collections.new('My Collection')
bpy.context.scene.collection.children.link(myColl)

#Create another collection
myColl = bpy.data.collections.new('Another Collection')
bpy.context.scene.collection.children.link(myColl)

#Change the Active LayerCollection to 'My Collection'
layer_collection = bpy.context.view_layer.layer_collection
layerColl = recurLayerCollection(layer_collection, 'My Collection')
bpy.context.view_layer.active_layer_collection = layerColl

#Change the Active LayerCollection to 'Another Collection'
layer_collection = bpy.context.view_layer.layer_collection
layerColl = recurLayerCollection(layer_collection, 'Another Collection')
bpy.context.view_layer.active_layer_collection = layerColl

It's weird to have to iterate over all collections to get or set the exclusion state of a particular one...

@Gorgious but that is the only way currently to also capture nested collections? but it does not solve this problem https://blender.stackexchange.com/questions/302094/how-can-i-fully-select-a-collection-using-python-with-blue-highlight

@HarryMcKenzie yes, it also doesn't take into account that a collection can be linked in several layer collections in a single view layer. This solution only selects the first one it found. You might be interested in my discussion over on devtalk

In Blender 2.80, I've had some success with something simpler that previous @johnzero7's solution :
collection = bpy.data.collections.new('My Collection')
bpy.context.scene.collection.children.link(collection)

# NOTE the use of 'collection.name' to account for potential automatic renaming
layer_collection = bpy.context.view_layer.layer_collection.children[collection.name]
bpy.context.view_layer.active_layer_collection = layer_collection

It doesn't work for collection that is inside another collection, does it?

That's possible, this answer does not indeed fit a generic "change active collection" solution, it assumes that you created/linked the collection so there's no need for a full search in all layer tree.

OK, thanks for clarifying.


text:
glass shader not working with normal map in cycles

1.-I am making some low poly objects with normal maps in cycles. All of them are working correctly but when I plug a normal map in a object with a glass shader it becomes opaque with some reflections on the surface.
Is there an additional step to make normal maps work with a glass shader?
2.-I discover something weird. The fact is that I am using a tangent space normal map(purple map), but if I change the setting in the normal node from tangent to object space(blue and yellow map) it seems to work fine.
I uploaded a zip folder with the blend file and the normal map here:
https://copy.com/ADi3bvAGpR9o

You need to show a screenshot of your nodes and a render, preferably a simple blend file as well.

Your problem is probably that you need to use a Normal Map node, and connect it to the displacement of the materail

I SOLVED IT !!! I did another object and again I ran into the same problem. But this time the mesh looked fine from above but completely black from below. I switched from object space to tangent space and after a few hours I decided to play around with the normal map strength and it seems that glass shader doesn´t like normal map values greater than 0.4 and After 0.46 the mesh starts looking completely black.
this values are for my particular project.

This doesn't sound like the real solution but like a workaround...

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Texture mapped incorrectly in render?
When rendering my mesh, I noticed that not all the textures for the body are the same as they are in the 3D view. In my body mesh, there are two textures- one for the head, and one for the rest of the body. The head texture shows up fine during rendering, but the body texture appears to have its UVs somehow warped.

Blend file
As you can see from the body texture on render, the body texture IS being used to texture the body since the blue on the arm is present (not found in the face). However, it would appear that the UVs are different on render than in the 3D view. Any ideas?

@ideasman42 I suggested that the OP ask this as a separate question, since it isn't really related to the lighting issues from the previous post..

This is happening because the head texture is overriding the body texture, so head texture is being used to texture the body.

It's actually overlayed, and as the head texture is transparent where the arm UVs are, the body texture shows through. You can fix this by removing or disabling the textures in Properties > Textures, then enabling face textures in Properties > Materials > Options. See this comment.

It is necesary to have two materials and assign the respective faces to them according to texture they should be using. One material for the head and one for the body. Each using it's own texture.
How it's done:
Add new material to the object in Properties by pressing the light grey button on the right with a white + in it.
Name the old material "Head" and disable the Body texture in the Texture tab.
Name the new material "Body".
Select the "Head" material and press the dark grey button with the black arrow pointing down and choose "Copy Material" and then select the Body material and click this arrow again and press "Paste Mateiral".
Then go into edit mode, select one face which should be using the body texture and press Shift+G and choose "Image". This selects all faces that have the same texture mapped.
Now while having the faces selected click on the Body material and press the "Assign" button to assign selected faces to the material.
Then go into the Texture tab and uncheck the Head texture.
It should work now!
One tip: always name your materials, naming objects is also good, but materials are more important because they get reused often.
Fixed blend file: http://www.pasteall.org/blend/29840

Once you have the materials properly sorted out; you can temporarily join them as 1 mesh then create a new UV set and bake the whole thing to one texture if that's what you want.  Now you can separate the mesh as you like and just use 1 material and texture for both.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
On Ubuntu 20.04 LTS, which CUDA is required by the Cycles - CUDA XX.xx from nvidia's website or the cuda-toolkit available in official repo
I am using Ubuntu 20.04.03 LTS on my desktop as well as my laptop and I wish to use Cycles rendering engine in Blender.
For desktop:
I installed the nvidia drivers with the usual command -
ubuntu-drivers autoinstall
Then I downloaded the CUDA 11.6 local package from Nvidia's official website
Then I followed the instructions given on the page and installed CUDA on my desktop.
Result: Cycles renders fantastic!
For laptop:
I installed Nvidia drivers in the same way as I had with the desktop.
But when I tried installing CUDA in the same way, I am faced with a problem.
Ubuntu has an official package cuda-toolkit and I have a .deb package downloaded from Nvidia's official site.

The question now is: WHICH ONE DO I INSTALL FOR CYCLES RENDERING?

Is the official cuda-toolkit package sufficient or is the CUDA 11.6 .deb file downloaded from Nvidia's website needs to be installed.
NOTE: The .deb file downloaded from Nvidia's website seems to cause dependency problems on laptop. So I'm wary of installing it.
My Nvidia graphic card's info is as shown in the image below -

I just installed the nvidia drivers and not a separate Cuda install. It seems to be Cuda 11.4, but it works fine with Cycles.

@Dale Cieslak Good to know. Yes, Cycles does work with just drivers. But I've noticed that Cycles renders very fast with CUDA 11.4 on my desktop. Without it, Cycle wasn't this fast. I suspect there might be some connection between Cycles and CUDA software after all.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
AttributeError: __exit__ error on custom operator
I'm new to both python and scripting in Blender, so I am sure this is just my misunderstanding of how python and the Blender API work. I have no idea what this error means.
This is the full traceback for my error:
Traceback (most recent call last):
  File "/clipImporter.py", line 103, in execute
  File "/clipImporter.py", line 78, in scan_files
AttributeError: __exit__

location: <unknown location>:-1

location: <unknown location>:-1

So as the file name suggests, I am just making an importer to bring in clips, objects from libraries or whatever. I have a similar script working for .blend objects, but trying to do it with movie clips is giving me this error. So I have a suspicion that it is my misuse of datablocks. Here's some more relevant code:
The Function
def scan_files(folderpath, datablock):
    exec("bpy.context.scene." + datablock + "_directory_list.clear()")
    exec("bpy.context.scene." + datablock + "_directory_index = 0")

    folderpath = bpy.path.abspath(folderpath)

    for file in os.listdir(folderpath):
        filepath = folderpath + "\\" + file
        with bpy.data.movieclips.load(filepath) as (data_from, data_to):  # this is line 78...I have a feeling it's movieclips.load
            for name in eval("data_from" + datablock):
                my_item = eval("bpy.context.scene" + datablock + "_directory_list.add()")
                my_item.name = name  # these two correspond to custom props group
                my_item.file = file

The Class
def execute(self, context):
        if bpy.context.scene.dir_clip:
            if context.scene.folderpath_clip:
                scan_files(context.scene.folderpath_clip, "clip")  #this is line 103

        return{'FINISHED'}

I've been hacking and slashing this guy's script to do what I want if you want to see his logic behind his importing. The scan files function is scanning a directory and loading available options to import.
If you need the whole script let me know and I'll do a pasteall, though I'm sure I could probably solve the error if I even knew what AttributeError: __exit__ actually meant. I do come from a bit of a C# background, so an explanation paralleled to that would be fabulous.
Thanks lovely people!

see this and this

focus on the code around the error:
import bpy

files = ['/home/zeffii/GL_fillet.mpeg', '/home/zeffii/GL_fillet2.mpeg']

for filepath in files:
    with bpy.data.movieclips.load(filepath) as (data_from, data_to):
        print(data_from, data_to)

Even from that snippet I get AttributeError: __exit__
I may be wrong, but this suggests to me that there is no context manager (in the python sense, not in the bpy.context sense) to use with x.y.z as (a, b) on the bpy.data.movieclips.load() operator. Hence that error. The documentation confirms this. movieclips.load() does return an object though!
If you just want to get stuff done, rewrite it so it doesn't use the with x.y.z as (a,b) context, instead assign to the left.
import bpy

files = ['/home/zeffii/GL_fillet.mpeg', '/home/zeffii/GL_fillet2.mpeg']

for filepath in files:
    clip = bpy.data.movieclips.load(filepath)
    # you know what you need here.
    print(clip.name)
    print(clip.size[:])
    print(clip.source)

>>> GL_fillet.mpeg
>>> (1280, 720)
>>> MOVIE
>>> GL_fillet2.mpeg
>>> (1280, 720)
>>> MOVIE

Additionally, there's also a typo I think. The original code has
for name in eval("data_from." + datablock):
    # blah..

and you omit a necessary . after data_from..
Your scan_files function for movie_clips might start to look something like:
def scan_files(folderpath, datablock):
    exec("bpy.context.scene." + datablock + "_directory_list.clear()")
    exec("bpy.context.scene." + datablock + "_directory_index = 0")

    folderpath = bpy.path.abspath(folderpath)

    for _file in os.listdir(folderpath):
        filepath = folderpath + "\\" + file
        clip = bpy.data.movieclips.load(filepath)

        data_from = ...  # clip.name ?
        data_to = ... # clip.source ?

        for name in eval("data_from." + datablock):
            my_item = eval("bpy.context.scene" + datablock + "_directory_list.add()")
            my_item.name = name  # these two correspond to custom props group
            my_item.file = _file

Without seeing more of your code (got a github repository?) I'm not able to say more. Looks like an interesting project though.

Ah, thank you so much! You are absolutely right, don't know how I missed that in the documentation. You are a star, thank you for your very thorough answer. Makes total sense.

The less travelled paths of the documentation are often quite terse, it means you're one of the few people to try stuff with that section of the API.


text:
Disable translation for rigid body?
I have a rigid body with translations and rotations. I want to disable any translations completely. How can I achieve that?

As mentioned by eromod, you can lock the transformations in the (n) properties shelf.
Another (Less good) idea: You can set the Translation Damping under Rigid Body Dynamics to 1, but this still allows the object move a little bit.

make it a type: passive rigid body, instead of type: active.

Doesn't this also disable rotation on the rigid body?

oh maybe adding a rigid body constraint will help then? Like hinge maybe?

looks like locking the transformations in the (n) properties shelf works too


text:
Export of PNG sequence does not match video framerate
I have an image sequence (PNG) of a motion capture session, that I export from Blender that should match the video.
For some reason however the sequence won't match the video - I double-checked - I export (and import into Premiere) at the same FPS as the original video.

Does the export Frame Rate you can find in the Render tab in the Dimensions panel match the original video framerate? Could you post some values?

@Carlo : Yes - it's 25fps export in blender & 25fps in premiere


text:
Adjust certain frames in BVH file
How can I adjust some frames in BVH file?
Basically clean up the BVH from some noise.


text:
Blender will not render audio visualizer
So when I had windows 7 I had no problem with this but since I upgraded to windows 10 every time I render the project which is just an image with an audio visualizer it only renders the image and the sound. I set it to render with CPU and GPU and both doesn't work. I searched on google for answers and can't find anything. Anyone knows why it's doing this?
Here's a gif of how its supposed to render:
https://gyazo.com/7f639435f906ad07bedde9689198896a
And this is how it actually renders it:
https://gyazo.com/280c6e34ae37a12ecba6a58854fdb99d
just the image...
As I said when I had Windows 7 I never had this issue.

share the blend file. http://blend-exchange.giantcowfilms.com/

Did you update your version of blender when you updated to Windows 10?


text:
How would I animate vertices randomly up and down (+looping)
I've got a plane which is displaced by a voronoi texture like this.
And know I want to give each vertex a looping animation where the vertex slides up and down on his Z-axis (looping). I want each vertex to have a random animation offset. What's my approach? Python scripting?
Thanks in advance!

There are multiple ways to do it, the simplest I can come up is to set an empty as object in the displace modifier, animate the empty and make the first and last frame the same, then make "cyclic" extrapolation of the animation
If you need add randomness, you can consider the noise f-curve modifier
First example with 3 keyframes and the noise modifier

The second example use Make Cyclic f-modifier and only two keyframe

Not sure why in the second example the loop works only twice if someone knows please advice, either it's a bug or it's a matter of mapping (I'm to tired now to debug)

discard the double frame in the animated  gif it is cyclic!

If you wish to add more of a random effect, animate your empty in a circular motion, and rotate/scale it about it own axis during that loop to add more variation. The only thing lacking in this example is that it looks like a fast-forward/rewind loop where the circular animation would solve the rewind effect. just make sure that it starts and stops in the same Location/Rotation/Scale and Cyclic works very well. I will post a supporting answer w/ a supporting Blend.

I'm using a voronoi texture instead of a noise texture but when I animate my empty the interpolation of the vertices is very jagged and not smooth like yours.

note that I've use a subdivision surface after the displacement. Play also with the strength and ramp color values

Please don't mark this as the answer - If this helped you, please give diramazioni the credit, and please see my comment as to what is going on here as a response to his post.
This is just to support his initial concept.

The way I would do it is apply the displace modifier, then hook each vertex to an empty and use a Noise f-curve modifier to displace each empty by a random amount.  With a lot of vertices that would take a lot of setting up so maybe someone has a more automatic approach as a solution.

that's what the object option it's for in the displace modifier, no need to use a hook for each vertex, one empty will do the trick

I think OP wants each vertex to have its own random movement.  How would that work with your method?

see the example provided below

The best way is to use Animation Nodes. You have to copy that mesh to a new object, and iterate trought the different vertex adding the result of a vector wiggle, with a different seed according to the index of each vertex.

Can you provide a working example?

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Make a rotations-only parent BGE
There is a way to make an object parented to another object, but only for the rotations, not for the location.
If i move the parent, the child may dont move.
If i rotate the parent, the child must rotate exactly same than the parent.
All this must work in real time in the BGE.

You could use the ChildOf constraint.  Just add a ChildOf constraint, under the Object Constraint panel, to the child and set the target to the parent, and then uncheck all of the boxes except rotation.  The child will rotate on its own axis, not the parents.

This method is not exactly what i looking for, but it do his work:
import bge

def main():

    cont = bge.logic.getCurrentController()
    own = cont.owner
    scene = bge.logic.getCurrentScene()

    rot = scene.objects ["Rotation"]

    own.worldOrientation = rot.worldOrientation

This script get the rotation from Object "rot" an set it to "own".
Location doesnt affect "own".
You can also replace this line:
own.worldOrientation = rot.worldOrientation

With this:
own.worldPosition = rot.worldPosition

for doing the same, but with the Location.
Both two works in real time in the BGE.


text:
MouseLook script Cap problem
I working on a MouseLook script, but the Cap system doesnt work great (When i move too rapidly to the Cap, the camera does ugly jumps).
I explain, my cap upper is set at 160 degree, my camera start at 90 degree, when i move rapidly my mouse up, the camera goes over 160 degrees (more speed, more excessive angle)and rapidly after, the script set the angle at 160 degree, its verry ugly, i dont want the angle goes over my cap value.
i will give you my script for better details.
Maybe the rotation system i used is not correct...
Does someone know how exactly work the cap/rotation system of the MouseMove script by Riyuzakisan?
Here is my faulty script:
import bge, math
from bge import render
from mathutils import Vector

def main():

    cont = bge.logic.getCurrentController()
    own = cont.owner

    # Inclure l'objet "Camera" dans le script.
    camera = own.children['Camera']

    # Props
    cap = True
    capBas = 20
    capHaut = 160

    # Prendre le sensor "Mouse".
    mouse = cont.sensors ["Mouse"]

    # sensib = Propriété "Sensibilite".
    sensib = own['Sensibilite']

    # Recuperer la taille de l'ecran.
    x = render.getWindowWidth()//2
    y = render.getWindowHeight()//2

    # Definir le centre de l'ecran.
    centre_ecran = (x,y)

    # centre = Centre de l'ecran.
    centre = Vector(centre_ecran)

    # Definir la position de la souris.
    position_souris = Vector(mouse.position)

    # Définir la rotation a effectuer.
    offset = (position_souris-centre)*-sensib*0.0002

    if mouse.positive:
        # Récupérer la rotation de la camera.
        Camrot = camera.localOrientation.to_euler()
        Camrotx = int(math.degrees(Camrot[0]))
        print(Camrotx)

        # Appliquer rotation verticale camera.
        camera.applyRotation(( offset.y, 0, 0), True)

        if Camrotx > capHaut and cap == True:
            Camrot[0] = math.radians(capHaut+0.99)
            camera.localOrientation = Camrot.to_matrix()

        if Camrotx < capBas and cap == True:
            Camrot[0] = math.radians(capBas+0.01)
            camera.localOrientation = Camrot.to_matrix()

    # Appliquer rotation horizontale joueur.
    own.applyRotation((0, 0, offset.x), True)

    # Garder le curseur au centre de l'ecran.
    render.setMousePosition(x,y)

main()

I dont want to use the Mouse Actuator for MouseLook.
Thanks.

Just curious, is this different from the mouse look in Camera Fly Mode?

Cap stop the rotation of the camera at a certain angle.

I have edited your script just a bit and now it seems to work fine. The main problem with your script was that you applied the rotation first, then checked for the cap and, if the rotation was too big, applied another rotation. I think that this led to the shaking.
The better aproach is to first calculate if the rotation would get too big when adding the offset, and if so just apply as much rotation as needed
import bge, math
from bge import render
from mathutils import Vector

def main():

cont = bge.logic.getCurrentController()
own = cont.owner

# Get the child object named "Camera"
camera = own.children['Camera']

# Props
cap = True
capLow = 20
capHigh = 120

# Get the sensor "Mouse"
mouse = cont.sensors ["Mouse"]

# sensib = Property on this object named "Sensibilite"
sensib = own['Sensibilite']

# Get the center of the screen
x = render.getWindowWidth()//2
y = render.getWindowHeight()//2

screen_mid = (x,y)

# center = Center of the screen
center = Vector(screen_mid)

# Get the position of the mouse
mouse_position = Vector(mouse.position)

# Define the rotation that should be made
offset = (mouse_position-center)*-sensib*0.0002

if mouse.positive: #This part has changed!
    # Get the rotation of the camera
    Camrot = camera.localOrientation.to_euler()
    Camrotx = math.degrees(Camrot[0])
    print(Camrotx)

    # Check if new rotation value would be too high
    if Camrotx + offset.y > capHigh and cap == True:
        # Choose offset.y so that: Camrotx + offset.y = capHigh
        offset.y = math.radians(capHigh - Camrotx)

    # Check if new rotation value would be too low
    elif Camrotx + offset.y < capLow and cap == True:
        offset.y = math.radians(capLow - Camrotx)

    # Apply the rotation the the camera
    camera.applyRotation(( offset.y, 0, 0), True)

# Apply the horizontal rotation to the player/parent object
own.applyRotation((0, 0, offset.x), True)

# Reset the mouse position
render.setMousePosition(x,y)

main()

Can you put the code in English please. I don't know the language this code was made in (no offence to nationality or country). I would like to see how to correct it. I am still new to Python, but love to learn all I can. Thanks.

@TimIamKra'Z'Shelhorse Ok, I translated all the comments. But it's basically really just a simple difference: The original script changes the rotation of the camera multiple times while mine writes those things to a variable and just applies it at the end. Let me know if you need more explanation :)

thanks, that will help.


text:
Change the type of my script from Module to Script
I have this MouseLook script, and i want use it as a normal script, not Module.
Here the script:
from bge import render
from mathutils import Vector
from math import pi

CAP = (pi/2)-0.1

def get_window():
    return (render.getWindowWidth(), render.getWindowHeight())

def get_window_center():
    window = get_window()
    return (window[0]//2, window[1]//2)

def center_mouse():
    center = get_window_center()
    render.setMousePosition(center[0],center[1])

def look(cont):
    own = cont.owner
    m = cont.sensors['Mouse']
    head = own.children['Tete']

    sensitivity = own['Sensibilite']*0.001
    smooth = own['Smooth']

    if 'oldX' not in own:
        center = get_window_center()
        own['oldX'] = center[0]
        own['oldY'] = center[1]
        render.setMousePosition(center[0],center[1])
    else:
        source = Vector(get_window_center())
        mpos = Vector(m.position)

        x = source.x - mpos.x
        y = source.y - mpos.y

        own['oldX'] = own['oldX'] * smooth + x * (1.0-smooth)
        own['oldY'] = own['oldY'] * smooth + y * (1.0-smooth)

        x = own['oldX'] * sensitivity
        y = own['oldY'] * sensitivity*(render.getWindowHeight() / render.getWindowWidth())

        own.applyRotation([0,0,x], False)
        head.applyRotation([y,0,0], True)

        ori = head.localOrientation.to_euler()
        if ori.x <= -CAP:
            ori.x = -CAP
        elif ori.x >= CAP:
            ori.x = CAP
        head.localOrientation = ori

        center_mouse()

I actually use a Module python controller (Mouselook.look).

I solved my answer


text:
How to bake shadows into an OBJ that already has an MTL? And then re-export it as OBJ
I have an .OBJ with .MTL exported from https://ephtracy.github.io/
I import it into Blender. What are the steps to bake shadows onto the existing material and export it again as an .OBJ + .MTL (baked)?
I have attempted to follow various tutorials and forum posts. So far, I've tried Smart UV Unwrap and then bake. I think I've gotten baking working, but without the colors/material (it was all gray). Thanks!


text:
Interchanging characters within the same scene
Will I be able to create an image with a static setting(a playground for example) and then be able to interchange different characters into the picture without having to recreate the entire setting?
Also will I be able to change features on a character (e.g. hair) without having to recreate the entire character?

Yes, you will be able to.

Yes. You can control these sorts of things in many ways. You can use layers, showing and hiding objects, combining meshes into different objects, and of course Linking models from different files. It is a very broad area.


text:
What is the best workflow to import entire complex scenes from Cinema 4D to blender?
I'm new here and somewhat new to exporting my scenes.
I would like to utilize the cycles render engine to speed up my render time, but still use Cinema 4D as my primary workspace.  What are the best methods to achieve this?  I'm working on a specific project that involves animation, animated textures, all sorts of reflective materials, plenty of geometry, switching cameras, and global illumination (including emission-based textures for most of the lighting).
I know this is a tall order, but I'd like to see if there's a way to get this into Blender purely for cycles GPU rendering.  I also understand that Cinema 4D will be getting cycles sometime in the "near" future, but this project can't wait that long.  Thanks in advance!
I'll be posting a similar thread within the C4D forums, but figured I'd try the blender community first as it seems you guys really know your stuff.

You can try fbx, but I'd wait for alembic support. Also interesting: Cycles & C4D integration: http://www.3dartistonline.com/news/2016/08/cinema-4d-to-get-cycles/

FBX or Alembic will provide you with similar level of support - Static geometry import is the only thing that will be fully OK.
Animation would be supported on a rather simple and limited level (for FBX, objects and rigs animations, and shapekeys; Alembic features a fully baked animation on both object and geometry levels).
Shading support would at best be very basic (FBX supports basic shading/texturing, similar to fixed pipeline of old OpenGL e.g., afaik Alembic does not handle shaders at all?).
More scene-level things (like world) would be totally lost.
So in a word, think you should either wait for Cycles to be supported by C4D, or use whatever renderer you have currently with C4D.
A complete accurate scene export between 3D apps is (and probably will remain) pretty much impossible, unless you have the means to develop your own tools (as big studios do for their own production pipeline) - and even then, they usually only convert a subset of data betweens their apps…

authors: עמית רוזנפלד


text:
Cycles Render Equivalent of "X-Ray" Function
Thanks for taking the time to hear out my predicament.
So I'm trying to recreate some vg items, nbd, but I'm having trouble finding an answer (let alone a proper title for the question..) as to how you would make materials to jump ahead/in front of other materials like seen with the viewport's "X-ray" feature.

Cycles Viewport w/ X-ray on
Here's what I need: a material/object that fazes through another. I've been experimenting and backfacing comes close, but causes unsightly shadows and doesn't really work along the neck of the bottle. Really I'm just wanting the equivalent of what's seen on screen without ruining the basic diffuse, or the red material fazing though other objects besides the bottle.
(Bottle and Liquid are separate meshes)
Thanks again, any help is appreciated.

You can move liguid to second layer and create second render layer. After merge them in compositor.

In this case you can't use Material ID or Object ID, because liquid is in other object, or suzanne in cube in my case. But is good to know there is this possibility.
Workflow: use "Pass Index" (material or object) for create mask and after use this mask to separate object in compositor.

Won't this also create overlaps to everything else in the scene?
Honestly I don't think there is a working solution to my problem, but I thought'd be worth asking.

Here's a better example of what I'm trying to achieve. https://i.sstatic.net/0HKsV.png Again, backfacing comes close, but it ruins the look of the diffuse; you have to disable shadows and diffuse in (the object's) cycles settings in order to see it at all. I'm looking to find an effect that works just the same as described: allows one material/object's visibility to through another without doing the same to any other material/object in the scene.

@lk321 Yes of course, this overlap all in scene, and that's the point of x-ray. :-)  You can play with factor in "Alpha over" node and also you can let liquid/suzanne in both of the render layers. But you must be careful about IOR. Another option is mix transparent shader with glass material. To be honest, now I'm not sure what you need exactly. I know only two possibilities: let liquid "as is" and use glass (or other transparent) material - realistic render, or use method on my image - unrealistic render for show what's inside the bottle.

Maybe you need add another objects, that overlapping liquid. Look what I wrote under attached image - use Material or Object ID for mask, or you can make 3rd layer with objects which overlapping liquid and merge them in compositor.


text:
One curve into two or three
I have a straight curve that's hooked with hooks at both ends to two objects. I'm creating the curve in python and applying the following to make it look like a cylinder in a python Bond-class (for a chemical bond between two atoms):
obj.data.dimensions = '3D'
obj.data.fill_mode = 'FULL'
obj.data.bevel_depth = self.bevel_depth
obj.data.bevel_resolution = self.bevel_resolution

This works fine. Now I would need to be able make these into two or three "cylinders" to represent double and triple bonds as needed. These should stretch lengthwise as the atoms move closer or further apart, but they should stay otherwise unmodified. Any ideas how to do this as simply as possible in python?
Could I use a bevel object on the curve, say a curve-object consisting of two circles? If yes, how do you control which point on the bevel object follows the curve?


text:
Cycles displacement with Volume scatter
I'm not sure if it's a bug, but when I apply a volumetric shader in an object with adaptive subdivision+displacement, the final render on Cycles ignores the displacement.
Render with surface shader (diffuse):

Render with volumetric shader (scatter+absorption):

Mesh in viewport:

Is there a way that I could use cycles displacement with volumetrics?

I suspect that's more a limitation than a bug. Also, the experimental displacement is just that at the moment - experimental - and I believe it's subject to change in the near future (can't remember where I read that - a recent question possibly). For now if you want to use volumetrics you'll need to actually apply the displacement to the mesh rather than using dynamic displacement.

yes, I thought that could be the issue too. unfortunately it's very hard to get the desired level of detail (my main goal is something even higher than that) in the mesh using regular subdivision, not to mention that I wouldn't be able to use node based textures :/ maybe someone comes up with a workaround to achieve it

what texture coordinate is the displace node using ? I've issue with the 'generated' coordinate, while 'Object' seem fine

@Hacketo it was exactly that! I would never imagine... do you know why this happens? Anyway, you should post as an answer, so I can accept it!

Using cycles displacement combined with volumetrics seem to work only if you are using the 'Object' texture coordinate.
I tested the following : Generated - UV - Object

I don't know if it's a bug, but we can see the displacement in the rendered viewport if we add a surface and remove it

So if you want to use other coordinate than Object, you have to use the displace modifier

The difference between your viewport mesh and the render with the diffuse shader is certainly not due to a subdivision modifier. The volumetric render is corresponding to your viewport mesh.
It looks like you have a displacement (or perhaps bump/normal) added in your diffuse render, which is absent in your volumetric render (I cannot add any displacement or normals to volumetric absorption or scatter...).
When I try to reproduce what you see, I indeed lose the relief when it's applied as a bump map to the surface texture and I disconnect that surface texture. When I use the same bump map on the displacement input of the material output (and not on the normal input of the surface texture), it works as expected iff I select "experimental" in the render tab.

I'm using cycle's displacement, because I'm using procedural textures for it. The thing is: it's connected to both diffuse and volume shaders, but it only seems to work on the diffuse one.

OK, but that's a different matter. You were asking about the subdivision modifier being ignored...

ok, ill add my node setup to make this clearer

oh, now I see what you mean, I meant the displacement gets ignored. I'l change the wording


text:
Show decimal point digits on Dimensions tool
I'm trying to work with precise values in Blender and I found this weird thing where the Dimensions tool only shows the full decimal point value when selected.
Now I know I could change the unit scale on the scene properties, but what if I want to work in meters, but in a given object I want to be able to check dimensions more precisely (in millimeters for instance)

Why does it happen? Is there an option to change this?
Thanks.

Related: How to show more digits in blender when working at a small scale


text:
Lost all my custom keyboard shortcuts
So I think I accidentally deleted my shortcut presets by a mis click and can't get them back.
I believe I had a custom preset name and I accidentally clicked '-', which immediately deleted my custom presets and set them back to default.
All the keyboard shortcuts I carefully set over the months / years are gone.
I thought I had been saving the shortcuts when I clicked "Save User Settings" in the user preferences file. Unfortunately this does not appear to be the case. I backed up both that file and the startup.blend file. Unfortunately loading startup does not have the shortcuts either.
Am I fated to go through and redefine all the shortcuts again? I suppose everything is a learning experience..

Did you try saving with Ctrl-U?

@Lukasz-40sth -- I have been using th Ctrl-U option lately, Blender 2.9, and it does not save the shortcuts (e.g. Mesh, Edges, rotate CW -> shortcut: Ctrl+A). I have to add shortcut every startup.

My guess is that you just upgraded Blender, and didn't click 'Copy Previous Settings' in the splash screen. This would copy your settings of 2.78 to 2.79; without this, Blender uses the defaults after an upgrade.
If you haven't saved new settings yet, the 'Copy Previous Settings' button will still be available in the splash screen. If you want to remove your 2.79 settings, you have to visit a platform-dependent path. These paths are documented in the Blender Manual.

Care to complete this answer by explaining how to do it? (On a Mac the files to modify are in ~/Library/Application Support/Blender/ then there's a version folder... forgot what it is on Windows, and I've never tried it on Linux.)

I've expanded my answer a bit. The "Copy Previous Settings" button can always be clicked as long as you haven't saved new settings yet. Those paths are in the Blender manual, and have been pasted in many Stack Exchange answers already so I won't paste them here again.

Thanks for the info, though I did not upgrade Blender. This is something that definitely happened after a mis-click on the keyboard shortcuts screen. I guess I'm asking, is the current (or rather, previous) keyboard shortcut file saved anywhere internally?
Update: I was able to recover most of the shortcuts from a keyboard-shortcut.py file I exported and copied to another machine. So I'm good to go. In the future I will manually export the keyboard shortcut files using the "Export Key Configuration" button at the bottom.

You can always sync your settings to Blender Cloud, even without paying for a subscription that feature is available.

I have the latest, 2.9 version, and this is still a mystery. On Quit, the shortcuts vanish.


text:
Set keyboard shortcuts for accessing specific render slots?
I want to press '1' to go to 1st Render Slot, '2' to go to the 2nd, and so on.

I did this before but my keyboard shortcut file got corrupted. I don't recall how I had set it up in the past.
I'm looking at the Image Generic shortcuts and see no such listings. I am clueless as to what shortcut code to type in. Help?

Strange, I KNOW I've done this before, but it doesn't appear in the Image Operators API. Maybe it's undocumented?
https://docs.blender.org/api/blender_python_api_2_78_release/bpy.ops.image.html

That is the default behavior, no need to reinvent the wheel

Hmm, it does not happen in my file. Perhaps it got corrupted too.. Would you mind sharing the API shortcut code?

Found it.
API to enter for the shortcut is:
wm.context_set_int
Make sure Value is set to the slot number minus 1.
Context Attributes must be: space_data.image.render_slots.active_index
That's how you get the render slot numpad shortcuts back, if they disappeared like mine did and you don't want to reset everything.

This is not default behaviour. By default Numpad 1 and Numpad 2 are Zoom 1:1 and 1:2 respectively, so maybe you reset your custom shortcuts somehow.


text:
Bone IK Warping Mesh?
I'm following this tutorial: How to Create Realistic Trees
When I set up the IK Bone and move it, the branch stretches and moves, but the end bends sharply:

The steps:

Select the tree with the Skin Modifier.
In the Skin Modifier Panel, click "Create Armature."
Select the Armature
Enter Edit Mode
Open Data Panel -> Display Group -> click "B-Bone" display.
Select the end bone.
Shift-D to duplicate the bone. Alt-F to switch direction.
Open Properties Panel. Scroll to Item -> Bone Name, rename it by putting an ".IK" at the end.
Select the (original) bone you made a copy of earlier (not the one with the IK in the name).
Enter Pose Mode
Bone Constraints Panel -> Add Bone Constraint -> Inverse Kinematics. Target: Armature | Bone: Find the one with the ".IK" at the end | Length: set to the number of segments to the tree base (e.g. 4)
Move the IK bone and watch the rest of the branch move.

Problem: Warping.
Any suggestions?

go to edit mode with Bone.065.IK selected and disable Deform in Properties panel in Bone tab. This bone is contributing to deformation and it shouldn't, it should only drive the IK chain.

Perfect, thanks!


text:
Making Vertical Gradient, then make top half transparent
So, I would like to make this texture to where I have the gradient going from top to bottom, instead of side to side like in the picture. After that, I would like to make the top half, lets just say, the purple, transparent. I am using cycles renderer in blender v2.76.

Thanks in advance!
Danny


text:
Seeing through but not inside a cube
I want to be able to see through a cube, but not what is inside it. I would use this for text that seems to be being created from nowhere, but it is actually coming out of the bottom of the cube. 1: is this possible? 2:is there a better way to do it?

Are you using Cycles or Blender Internal?

If you are using Cycles and there is nothing else in the Background you could try a Holdout-Shader. Transparency must be enabled of course. A backround image could then be composited in.


text:
Is there a way to merge multiple identical materials
Models I am provided with often have tons of tons of materials which tends to hang my host app. I used to go around this via Select > Select all by type > Mesh and clicking "Join" in the Tools tab.
Unfortunately this doesn't work for my latest model: "No mesh data to join".
I've opened the MTL file in a text editor and noticed over 3400 "newmtl" definitions and most of these are duplicates, for example there are 1852 instances of:
Ks 0.000000 0.000000 0.000000
Tf 0.000000 0.000000 0.000000
map_Kd ff_644.png
All starting with a different name after "newmtl ".
I could theoretically remove the duplicate material definitions in .MTL and then re-assign the different material names in the .OBJ to match the one that's been left as a source but the whole method is a damn hassle and not a real solution to be honest.
Is there any decent way to clean this mess up?
Thanks in advance!

Welcome to Blender SE, @jokeUsa! It's a bit hard for us to figure out what's your problem here. What is your final purpose? Where does the MTL file comes from? What model is that OBJ file? Adding some informations should really be useful to help us help you. Thanks.

Hello Polosson and thanks for replying.
Well, going through my old models that i was able to "fix" i now see that they consisted a lot of meshes but their MTL files were about 5kb so i guess that my first example was unrelated?
Unfortunately I can't post the model itself but the issue is as follows: the model has a 350kb MTL file and from what i was able to see, it contains a lot of material definitions out of which many, even though differently named, were exactly the same (see 1852 example above). Because of that, my host software (mObject which is a Motion/FCPX plugin) has issues opening it

Here's a screen shot of the problematic materials list:
http://postimg.org/image/m609e68rj/
So the question is: is there any simple way to merge the identical materials?

Have you tried this ...

Create a box object and apply a materials to it.
Select all the other mesh object that has multiple materials you don't want in your scene.
Select the newly created box object last. (Important select the box last)
Hit CtrlL, select material from the drop down list.
All your meshes should have the newly created box's material.
Save your file, Close it and reopen it to refresh the data cache.
Export the file to any appropriate format you may need.


text:
Convex Hull compare options
If I transform triangles into quads, options Compare UV, VCol, Sharp... trying to preserve the original structure of edges or materials (as far as I understand). Below is an example of work Compare options:

But I can not achieve any change in mesh with options Compare UV, VCol, Sharp... with the instrument Convex Hull.
Explain, please, what do these options in the context of the Convex Hull tool (preferably with pictures)


text:
Modeling with reference image
I want to create a model of a human using "Blue Prints" as reference.So when i start modeling the form of the Head i start with the Front view of the face and match the points to positions where i think they are fine.When i switch the view port to the left/right side , to give the head like the 3d form and shape the points look good on the side but back in front view they look like they're on other positions so i ajust them in front view , switch to side and yet again they're on other positions.i hope my question is understandable ^^.do you guys have any advise ? i'm a beginner , i know the basic stuff but have problems with that.

You possibly have a misalignment between front and side image. See http://blender.stackexchange.com/questions/42157/match-the-size-of-multiple-background-images if it can help

Good Reference Images and Alignment
The biggest problem about modeling 3D models from 2D reference images is the alignment of your reference images - especially when you start modeling faces.
My advice for a beginner is to start with a "best as possible" aligned reference image. As you can see in the set of images below (from www.3d.sk) I used lines to align the prominent facial features, mainly the eyes, the nose and the mouth (The alignment is still not perfect for various reasons regarding the reference images).

Modeling Process
Although some tutorials on the internet mention that it's best to start with a base mesh for the head, I strongly suggest that you start with a simple plane at the eyes and a mirror modifier, then model the base shape of the face in front view with the least amount of vertices possible. Switch then to side view and start aligning the outer verts to the side reference.
During the modeling process you are then going to add loop cuts and constantly switch between front and side view to align the vertices.
The best and most in-depth tutorial for beginners on this topic is this one made by Joshua Alger.
Oh, and also do not expect to get a perfectly recognizable 3D representation of the reference images the first time you do this. It'll take some time, but with enough determination you will get there.


text:
Subdividing face doesn't automatically subdivide adjacent face
very new to Blender (as of about 3 hours ago), so hopefully this will be an easy one. I'm going through video tutorials and I've noticed a discrepancy between the outcome of subdividing on the videos, and on my laptop.
Firstly, I create a new plane. Next, I select the top and the bottom vertices and subdivide them. This causes a new edge to be created between them, with a face on either side of it. Perfect.

Finally, I select the right face and subdivide it. This causes it to break up into 4 smaller faces (brilliant), but the left face doesn't automatically break into 3 triangular faces. I'm pretty sure it should break up automatically to deal with the extra vertex that has now been added in the middle of the central edge. All that seems to happen is that the 'centre point' of the left face moves slightly to the right.

I know that I can hit Ctrl+T to break it up into triangles manually, but I really don't want to have to do this every single time I subdivide an adjacent face.
If it's at all relevant, I'm running Blender v2.76 with Ubuntu 16.04.

What is the aim to have these triangles automatically ?

So...It is, but it isn't.
I'm betting you are watching some older tutorial videos (circa 2013) because that was old Blender subdivide behavior (circa v2.53).  Subdividing or otherwise changing the edge-count of a polygon ran the risk of an edge explosion to keep all polygons on a mesh either quads(4 edges) or triangles (3 edges).
Blender, as of around version 2.56, recieved N-Gon support.  N-Gons is the colloquialism that refers to polygons with 5+ edges, and Blender then began to hold them more or less as-is.  This allows for more or less non-destructive polygon slicing, which is what you are experiencing.
Under the hood, it is tracking just a bunch of triangles though.  If you want to see and manipulate those triangles, triangulate is ctrlt while the faces in question are selected.
You might want to find more recent tutorials, as well.

@TinyDancer I would add that if you want the original behaviour shown in the tutorials you saw you just have to enable Quad/Tri Mode, shown in the bottom left of your screenshot.


text:
How can align vertices using a curve?
i have a mesh and a bezier curve, and i want align individual vertices to curve, it is possible?

You can convert the curve to a mesh (best if you keep the original as well, there is a setting for that), and then snap to the edges of that mesh. The mesh resolution of the converted result depends on the Preview U value in the curve shape tab:

Once that is set high enough, you can select the curve and hit Alt + C to get the convert to popup. Select Mesh from it. Then, set the Blender snapping mode to Edge and snap your vertex to the curve. See this animation for clarity:

@aliasguru Much smarter method than mine! +1 from me.

If you have the equal number of vertices and curve segments you may snap one to another using snap tool. Click the magnet icon and set the snap element type to Vertex. Enter Edit Mode of the mesh and align vertices with curve's points.


text:
how to mix procedural textures for a natural waves of sand displacement effect?
I want to achieve a nice wave procedural texture in order to get a realistic sand displacement effect. here is my current set up

but I want to waves mix more randomly in order to give brunchy like look as shown below

I made two slightly different located wave texture and tried to mix them with a suitable mixRGB node, however I couldn't manage to find a correct solution, all I cannot get a good result but only like below

EDIT: I have played around a little bit more with the mixing option, I still couldn't figure out branching though

(thanks to for the video which made me started work on it )

Maybe use an RGB curves node to get the pointy peaks.

To be a little bit more clear, where abouts you mean should it be added to?

Between the wave texture and the multiply node in the first image.  I am trying to get that bunchy look you are talking about, it's harder than I originally thought it would be.

Thank you, i tried many things but could figure out, perhaps another texture to plug in to fac at the mix node, but dont know yet, hope you can discover a way


text:
how can I fix this generated coordinated texture wrap?
I just want to use a simple brick texture as generated and wrapped a mesh object seamlessly, however it looks like below, I don't want to use UV map as I will be working with all different types of meshes, how can I fix this please? thanks

blend file is http://www.pasteall.org/blend/42548

Can you upload your .blend file?

ok, i've added the blend file @ShadyPuck

The base problem here is that the bricks texture is 2d by nature. You can fix this with some clever node work. Basically you need to mask your faces by normal, so you can map them using different UVs depending on the direction they are facing.

ok... this is not simple or there is something I really ignore about brick texture.
So here is some nodes which aim to determine which direction (X, Y, Z) has the most influence on a face.
After that, the idea is to fake the brick texture giving it a false Z direction depending on the axis which has the most influence on the face.

Here are the full nodes:

The top part is a comparison based on the dot product of the face normals respectively with (1, 0, 0), (0, 1, 0) and (0, 0, 1) vectors.
Then it tests which is the bigger value (X, Y or Z).
The bottom part, recombine X, Y, and Z into "fake Z direction" and this fake Z direction is driven by the mix RGB (applied as vectors) with a factor determined by the calculation above.
Here is the blend file :
(probably, I will be ridiculous when someone will answer "hey ! there is this simple option here ! ...)
edit : for the smooth shading meshes, replace the "normal" from texture coordinate, with "true normal" from geometry, like this :

The result is better :

I actually develop a node setup with more flexibility but full copying your setup to discover normals. Is there any channel (chat/website) i can message you to show you my node setup and to get your consent to release it for free?

@JoãoSantos you have my consent! no problem for that.

thanks friend. Im still working out some kinks 'cus i wanted to be fool proof and super easy to apply on any geometry. Using the generated of course. :)

If you are willing to automatically generate UV maps, you might be interested in the python script at http://web.purplefrog.com/~thoth/blender/python-cookbook/uv-from-geometry-cubic.html .  It assigns a UV map automatically by guessing which axis a polygon is facing.
import bpy
import bmesh
from math import *
from mathutils import *

def set_uvs_for_face(bm, fi, uv_layer):
    face = bm.faces[fi]
    normal = face.normal
    dx=abs(normal[0])
    dy=abs(normal[1])
    dz=abs(normal[2])

    if (dz > dx):
        u = Vector([1,0,0])
        if (dz>dy):
            v = Vector([0,1,0])
        else:
            v = Vector([0,0,1])
    else:
        v = Vector([0,0,1])
        if dx>dy:
            u = Vector([0,1,0])
        else:
            u = Vector([1,0,0])
    for i in range(len(face.loops)):
        l = face.loops[i]
        l[uv_layer].uv = [ u.dot(l.vert.co),
                           v.dot(l.vert.co)]

def set_uvs(mesh, name=None):

    if name is None:
        if 0<len(mesh.uv_textures):
            uv = mesh.uv_textures[0]
        else:
            uv = mesh.uv_textures.new("cubic")
    else:
        uv = mesh.uv_textures.get(name)
        if uv is None:
            uv = mesh.uv_textures.new(name)

    bm = bmesh.new()
    bm.from_mesh(mesh)
    bm.faces.ensure_lookup_table()

    uv_layer = bm.loops.layers.uv[uv.name]

    for fi in range(len(bm.faces)):
        set_uvs_for_face(bm, fi, uv_layer)

    bm.to_mesh(mesh)

#
#
#

mode = bpy.context.mode
if 'OBJECT' != mode:
    bpy.ops.object.mode_set(mode='OBJECT')

obj = bpy.context.active_object
set_uvs(obj.data)

if 'OBJECT' != mode:
    bpy.ops.object.mode_set(mode = mode)


text:
What causes this reflection/refractions on the water surface and how can I get rid of it?
I am working on a procedural water material with volumetrics, and having some problems,these reflections/refrections appearing -like doubling the check patter. I don't know why they occur , whether it is natural to have in such scene.
How can I avoid them?
thanks

Material output has a glass shader with volume node and displacement node applied.

Hello ideorium, have you figured out why the double reflections in your scene? I'm having the same issue probably in my scene, looking for a solution..

@Booth no I haven't really, didn't received any answer here either. I think it was causing because of the shader node set-up which i got it from chocofur, so i changed the glass/water shader to another one, I wish I found it out though

In my node set-up I use a Layer Weight node with a blend value and I found out this much: if I take out the layer weight node the unwanted reflection isn't there.. unfortunately however I need the layer weight node to get the glass I want..

@Booth i'll try it on mine too then, see how it works, but glass without glossiness doesn't look realistic , i believe you are using layer weight for reflection, right?

I'm using layer weight to make the glass more transparent head-on and more reflective when seen from an angle. Layer weight blends between a transparent and a glass shader in my case. When I change the blend setting, the unwanted reflection changes too.


text:
why does world background appear very dark when rendered?
I was getting a perfectly blue and white cloudy colourful background but somehow it seems all darkened, I must've change some settings unintentionally, but I can't figure our how to put it back normal. can you please help me?
here is a screen shot from my render
dark background

normal background which I want it back :)

blender file
I'm using cycles with pro skies add-on

Could you post your World Shader node setup? It may be something related with the Strenght, or the Environment map's colors, or a wrong socket connection.

Are your clamp settings set to 0 in Render settings > Sampling?

ok i 've added the blend file

@gandalf3 yes, clamp direct was 0.03, i put it back to 0. but the reason I was using it was to avoid fire flies I wasn't aware of it'd be causing background go darker. is there anyway to avoid it get darker while clamp values non-zero?

@ideorium It causes the render to go darker because it limits the maximum value a sample can return. If you set to to something greater than 1 (e.g. 1 or 2, depending on how much you can afford to let highlights to be clamped), it should still mitigate fireflies while still keeping the render normal looking.

It looks like you might have set the clamp settings set too low.
Try increasing them until you find a good balance between highlights and fireflies (I typically use something like 2, but you might be able to get away with 1).
You can probably leave Clamp Direct at 0, since direct bounces typically don't result in fireflies.

I came across this question searching for why my sky nodes were not working.  With help from IRC we figured out the Use Environment checkbox in my render layers was unchecked:

So my problem wasn't a dark texture, it was just blackness.


text:
Is it normal to have these reflections when full global illumination on?
Please see the both renders below with limited and full global illumination, I like the way full global illumination brighten up the things and details, but I am having weird reflections on the glass surfaces? is this behaviour normal and correct realistic result or i am doing something wrong? thanks for the help

Blender file here,
I am using cycles, Subsurface modifier at 3 for the glass objects to render

Sorry, I wasn't able to reproduce such reflections in my test file. Could you upload your blendfile (or a part of it) to inspect it? I never saw a similar effect in real life, usually you see max 1 reflex per interface...but there is always a first time. Anyway it seems to me that you are not dealing with interfaces in a stictly physical based way (http://adaptivesamples.com/2013/10/19/fluid-in-a-glass/) as there seems to be a gap between the glass and the mousse http://3.bp.blogspot.com/-1RBiOPezZHs/T1Ld5mEr71I/AAAAAAAACjA/k3UPZgwFV0M/s1600/instant+mousse+%2810%29.JPG

@Carlo thanks for your reply, i have added blender file. the surface of chocolate filling is slightly away from the inner surface of glass, i suppose thats may be the reason, I will make it between the glass surface and share the result asap, meanwhile you can download the link above, thanks

Yes

Where are that reflections coming from?
Not from the chocolate material. While in your modeling there is actually a small gap between the mousse and the glass cup (this mess up IOR calculation, but that's another story...) that would surely create additional reflections, those are not caused by that.
If you make the chocolate object completely diffusive (or delete it), you'll se that the effect is still there.

Let's erase the object, leaving only the cup and put a small red ring near the base of the cup.

We see that on each stripe (reflectons) is coloured by the red ring. This means that the light travel through the glass object with the path (more or less, I'm not an expert of optics) that is highlited in the image below.

Notice how cutting away the half of the ring that is behind the glass make the red stripes disappear. This is because the reflex is just what the faces (opposite to the camera) of the glass cup base are pointing to.
Let's put a small object:

On the right, inside the black circles there is a small green spot. By maginifing the image we'll see...

...Suzanne!
I'm quite sure it is upside down, as when you look yourself in a spoon... we can run another test by pushing the lower faces of the base behind the plane surface. So the ray will hit a diffuse shader and should reflect nothing:

Why there are so many?
Because for each camera ray the light path is slightely different due to the different incident starting angle. At the end of the path they are probably "diverging", so in a small portion you'll be able to see (distorted) the whole surrounding.

Is this a physically based effect?
Yes it is. You can see it in glasses with a thick base.
Here's a comparison between two different angles.

Why choosing "Limited Global illumination" instead of "Full Global Illumination" don't show them?
Because Limited Global Illumination has lower number of "Max" & "Glossy" samples. That factor is ruling after of many light bounces the simulation is stopped. If they are set to a value lower than the noumber of bounces that the light need to travel to get out of the glass, you'll not see any full reflex from that ray. There would maybe some light path that would be able to get out of the glass even with few bounces, but increasing the values, would give higher chances, so it is more likely to se lot of reflexs.

Conclusion:
The effect is phisically based. Full Global Illumination's setting  as espected helps in making the scene to look more  realistic, as it takes in account more bounces.

Suggestions:
There are some materials who use the "Add Shader" node that isn't energy conservative, so it can lead to non stichtly-physically based behaviours.
When a fluid is stiched to the walls of a glass container, it is better to deal with interfaces as the link in my comment shows to get a "true" IOR effect. Notice that with that method, you'll also will get rid of the reflections, as the light is reflected (as in real life) towards the mousse, instead of bouncing all around trought the glass volume:

OK, GJ me. This would make sense. Kudos for being super clear.

Wow what a great answer, thanks a lot @Carlo I m away from my computer now, but will study it properly asap.. I guess leaving gab between the chocolate filling and glass inner surface wasn't a good thing at all .. Thanks a lot for this detailed explanation

Feel free to argue my point of view. Despite I wrote many lines, I just know a little about Blender's optics capability... I'm still running some tests to clarify myself some points (one above all is "why are there so many?"). @user277143

Afaik. This is normal. What is happening is that the chocolate filling reflects the glass' internal surfaces multiple times. One way to avoid this would be to use the light path node to limit the glossy component of the chocolate to only non-glossy rays, effectively elliminating the problem. ANother way around the problem would be to remove the faces of the cup that are in direct contact with th chocolate.

thanks @user277143, Light patch node is actually confusing me at the moment, i don't know how to include it in the node system :( , can you explain a bit more please? thanks

Your problem lies with the use of full white color. Use close to white so that those reflections will diminish with each iteration.


text:
Can't append in Blender
I have a problem and I don't know why. The append option for my file is gray and doesn't work, but, this problem is only for my file. The append button works for all my other files.
This the file blend file.

I have downloaded your file and I can append without any problem - using Blender v 2.78a.
Are you sure you are in Object mode when trying to Append?

You need to make sure you are not in edit mode. I had this problem, but then I switched to object mode and it was fine.


text:
Material diffuse colour bake into texture
So I am very new to blender but I have been using it to create basic models for my game. Up until now I have been painting images but my friends are using material diffuse colours instead so they can create low poly design models. My game engine only supports textures so it would be great if the diffuse colours for the model could be baked into a texture. If there is a script that can do this or a function in blender itself to do this that would be great to know. Thanks for any help.

Hi, you can find answer here: http://blender.stackexchange.com/questions/60511/get-correct-texture-from-object/60521#60521

You can do this within blender. There are tons of comprehensible beginner tutorials about texturing objects in Blender including UV unwrapping allover the internet. They do a better job than we could do on BlenderSE.


text:
Seamless animation loop for flags
I am working on flag which i am going to use in my game
I am stuck on the animation part. I can't get the animation to be seamless
I have seen many tutorials but i can't follow
I need a detailed tutorial on it with pictures (if possible)
P.S: Please keep in mind, i am new to Blender

how are you making the flag, are you using a cloth sim?

I used cloth modifier or whatever it is, I followed a tutorial
But it didn't taught how to make animation loop seamless

Thank you, Ray Mairlot but like i said "I am new to Blender"
I need a detailed tutorial or if you can share a link (video would be better) that would be great


text:
What is the simplest way to remove objects from a group inside of an Animation Nodes Node tree?
I am attempting to create an animated particle that is an instance of a group that is created with nodes. I have been able to successfully add instanced objects to a group. While this is working fine, it is removing the objects from the group once the instance count has been reduced seems to be the only sticking point. I have tried unlinking every object in the group, from it that is beyond the index value of the instances, how ever i can not get it to remove all objects from the group or i can not get it to add all instances too the group. Can any one point me to a method that can add all objects and remove them all as well as simply as possible?

There is a node called Object Group Operations. It can link/unlink objects from Object Groups. By using this in a loop you can link them all to the group.
There is no node to remove all objects from a group.

Thank you for the response, i am already using that node. the issue i believe is that when passing a parameter through a loop node, once the parameter exceeds 0, it can not return to 0. it will remain 1 in case of an integer and 1.something in case of a float.

@vailreth just wonder if the problem solved. (if so, please consider to choose this one as the best answer) And what parameter exactly you are talking about.


text:
GPU load (far) bigger than memory peak
I am working on a scene that is about 500Mb memory peak on GPU rendering (Cycles Render). However the GPU load is about 2Go just for blender (and it's about 30mB when I don't render), as you can see on the picture below. So where does this vram leak come from ?

If I go in CPU rendering, my RAM consumption increases of about 600Mb, which is quite normal I think. Thus there seems to be a problem with GPU rendering.
It becomes even worse if I enable the experimental feature set (I need to render SSS): I get an "out of memory" error because blender fills all my 4Gb vram.
Does anyone have an idea of the origin of this problem, and how to solve it, that is to say how to have about 600Mb GPU load ?
Regards.
PS 1: I don't think this is a texture size problem since I only have a peak of 500Mb. The memory used for the textures is included in those 500Mb, or am I wrong ?
PS 2: I have all latest proprietary drivers installed
--
Setup:
Intel® Core™ i7-6700K CPU @ 4.00GHz × 8
GeForce GTX 980/PCIe/SSE2
RAM 15,6 Gio
Ubuntu 16.04.1 LTS 64 bits

The GTX 970 and GTX 980 seem to have massive VRAM leaks in Blender 2.77.
The problem is greatly reduced in the 2.78 Test Build.
https://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.78

Ok thanks. I'll wait for the release and I'll post here if I see any improvement.


text:
accessing Blender objects from external Python IDEs
I would like to manipulate Blender objects from Spyder (not using the internal Python editor). Basically I would like to have Blender running and Spyder running as well, and then interactively access objects in Blender. Examples which allow access to the Python API from external scripts is QGIS and ArcGIS.
A typical user journey would be:

Open Spyder, Rodeo, etc.
import relevant Blender libraries
get list of available objects in scene
get data on one the objects
edit object
write object back to Blender

I found this Blender module:
https://wiki.blender.org/index.php/User%3aIdeasman42/BlenderAsPyModule
... but I'm not sure if this is what I need.
I'm not looking for using Python modules within Blender as described here:
Using Anaconda Python 3 in Blender Winx64


text:
Get the ViewLayer of a Mesh
If you wished to cull meshes/lights/cameras for export, based on the value of exclude value of the view layer of the collection that the object was in, how would you find the view layer?
While the names of the collection & view layer are the same, this much more complicated due view layers being able to be inside of view layers.
The tree of view layers starts at
bpy.context.window.view_layer.layer_collection for the master collection, the top level view layers are in .children, but each of those can also have .children.
Kind of seems like I would just need to resort to checking .visible_get() on the object.  Was already using that to indicate in the export whether the object should be visible on import though.

I do not know that a mesh can have more than one item for users_collection.  Assuming not then this works.
def shouldBeCulled(self, object):
    collectionName = object.users_collection[0].name
    return self.collectionExcluded(bpy.context.window.view_layer.layer_collection, collectionName)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def collectionExcluded(self, viewLayer, collectionName):
    print('looking for ' + collectionName + ' in ' + viewLayer.name)
    if collectionName == viewLayer.name:
        return viewLayer.exclude

    for childViewLayers in viewLayer.children:
        result = self.collectionExcluded(childViewLayers, collectionName)
        if result is not None:
            print('result for ' + collectionName + ' is ' + str(result))
            return result

    return None


text:
Working with meshes in meter scale?
I am now trying to do all my modeling in meter scale.  The reason is that a new standard is in development called WebXR.  When using this in mixed reality mode, on high end devices like Microsoft HoloLens, or Magic Leap One, as you move or rotate the scene camera also does.  This camera movement is in meters.
The small default 2 x 2 x 2 cube is the size of a closet.  I can scale anything down, but an object the size of your finger (scaled in meters), is really difficult to model.  It can disappear with ease as you move about it.
I am using a 64 bit version of Blender 2.80.  Is there some setting which makes this easier?

linking my possible solution to this problem: https://blender.stackexchange.com/a/129396/67675 The same technic should fix your viewport issues when displaying this small models. It's essential for working on small things in large scenes. You can also work in your regular scale, and before exporting adjust it.

That would almost work,except I am exporting.  The exporter sends raw vertex #'s as well the meshes scale.  Scale is applied at load.  I wrote the BabylonJS exporter, so maybe a custom property to always export scale as 1:1:1.  Bump up the scale, so can easily be worked on.

Changing the viewport, so close!  Problem is the Transform Panel does not have a display section in Blender 2.80.  Am looking for equivalent somewhere else, but none in Preferences AFIK

For Blender 2.80, you need to adjust The clip start down.  This is found in the View section of the transform panel.


text:
Add MULTIPLE actions to an armature
I have made a direct interface with a Kinect2 sensor, via DLL, for MakeHuman. While recording, sensor data is buffered in an array.  Once recording has stopped, and an armature is made the active object, a button operation can transfer / re-target the data to the armature.
The problem is I cannot manage to get a single action, meaning there is one named armatureNameAction and another my name (with code & no keyframes) like this:
import bpy
from mathutils import Vector

action = bpy.data.actions.new(name = 'my name')

ob = bpy.context.object
bone = ob.pose.bones['K2-Root']
value = Vector((1, 1, 2))
bone.location = value
bone.keyframe_insert('location', frame = 1)

This can be fixed by not even creating an action & just assigning the name of armature the action like this:
import bpy
from mathutils import Vector

ob = bpy.context.object
bone = ob.pose.bones['K2-Root']
value = Vector((1, 1, 2))
bone.location = value
bone.keyframe_insert('location', frame = 1)

ob.animation_data.action.name = 'my name'

With this way, how does the person make another sensor session & add a 2nd action?

If calling key_frame_insert directly from a bone, the easy way, and it always writes to an existing action unless it needs to create it, then the answer is to just manipulate the facts on the ground.
In the simple 2nd example, you can simply assign the armature's current action to None, ob.animation_data.action = None.  These examples only have just one bone & frame though.  When I place that in the real code, there is also an empty my name.001 created. If I try adding ob.animation_data.action = actionto the first example, the same empty action is also created in real code.
Though that empty action would get removed on save / reload, it looks half-assed.  With some help from here, if you un-link the action, and rename after the new keyframes are added, you get one action every time.
import bpy
from mathutils import Vector

ob = bpy.context.object
if ob.animation_data and ob.animation_data.action:
    # save last action, so it does not get removed without user doing something
    ob.animation_data.action.use_fake_user = True

    priorAreaType = bpy.context.area.type
    bpy.context.area.type = 'DOPESHEET_EDITOR'
    bpy.context.space_data.mode = 'ACTION'
    bpy.ops.action.unlink()
    bpy.context.area.type = priorAreaType

bone = ob.pose.bones['K2-Root']
value = Vector((1, 1, 2))
bone.location = value
bone.keyframe_insert('location', frame = 1)

ob.animation_data.action.name = 'my name'

This does not change the answer, but my implementation of re-targeting is done by duplicating a temporary armature, which gets a .001 name.  It gets a rest pose of the first frame of the sensor data.  Local space copy_rotation constraints to original then do the re-targeting.  This is probably causing the empty .001 actions, and why the simple examples work.


text:
recalculate keyframe position after moving an animation
is there an option to move and scale an animated group of objects?
for example i have a group of three animated objects. i want to move all that animation across the screen till it fits my needs without harm the animation and the relations between the animated objects.I can for instance delete all the y positions' to be able to move it on the y axis, but i can't find a way to scale it or to move in another directions without harming the entire animation.
any help will be appreciated.

Hi solution is very easy - add empty "Shift+A" -> "Empty" - choose one. And make this empty as parent of this objects: select all objects (with shift) and as last select empty (empty must be active object). Press "CTRL+P" -> "Object (Keep transform)". Now you ca move/scale empty and all object will follow it. Works also for animation.

Thnx very much!


text:
automate keyframes group to non-linear position
Can't find any information about very useful feature for animation and specially motion graphics, I will very appreciate any help (before i'm starting asking my friends to write a plugin...):

Like bezier curves in the graph editor?

Hello, thanx for being interested in my question. no, bezier curves controls what happening in between of two keyframes - i want to control a group of keyframes. for example - to automate a bouncing ball animation.

Here I've added a dummy action to give me 10 equally spaced keyframes, frames 1 to 10.
import bpy

obj = bpy.context.object
for x in range(10):
    obj.keyframe_insert('location', frame=x+1)

Now running this script gives me the result you are after
import bpy
obj = bpy.context.object
action = obj.animation_data.action

x, y = action.frame_range
for fcurve in action.fcurves:
    i = 1
    L = (y - x)
    # preserve the first and last kfps
    print(fcurve.data_path, fcurve.array_index)
    while i < len(fcurve.keyframe_points) - 1:
        p = fcurve.keyframe_points[i-1].co.x
        fcurve.keyframe_points[i].co.x = p + L / 2
        print(i, p + L / 2)
        L /= 2
        i += 1

Thnks very much! I thought I wont get an answer so I started sort of wring my own script, with some issues - link. Tell me please - can I use this script to make this kind of think link?

Yes can do most anything.  In JS example link 0 gives us end result above, 50, starting point above, not sure where you've gone with 100.  Maybe ask another q?  There are some quick methods to set all keyframe coords at once from a flat list.

Use the interpolation mode found here in the graph editor:

You should also be able to do something like this with f-curve modifiers:
https://www.blender.org/manual/editors/graph_editor/fcurves/fmodifiers.html

maybe i didn't explained well the issue... what your are proposing is concern only ONE keyframe, what i'am trying to do is to manipulate a group of existing keyframes. For example in blender there is no possibility to offset a keyframes of different objects, there is a plugin for this - https://github.com/mrachinskiy/commotion

authors: Ντίνος Τσακαλάκης


text:
Outliner - show only hidden
Little things in Blender that could drive someone crazy. I have a lot of objects in the scene, some of them marked as restricted visibility. Before the render I want to "unhide" them all - not to search them one by one...
Is it possible? It should be much more intuitive this kind of most obvious things...

Press A until everything is selected. If you have anything selected before pressing A you will have to press it twice, otherwise only once. (This will select the hidden objects as well so don't worry about them for now.)
Edit: As Mr. Zak pointed out in the comments section, it is unnecessary to select everything.
Press Alt-H to unhide everything.
You can also navigate to the Object menu at the bottom of the View3D window, select Show / Hide and select Show Hidden. This may be helpful if, like OP, you have issues with the Alt key combination. Practically everything in Blender has a button somewhere.

Selecting all objects isn't needed to unhide hidden ones.

Doesn't work for me. Ubuntu/Unity. Maybe a problem due to the "alt" problem in unity...

@LDCO You can also go to the Object menu at the bottom of the View3D window > Show / Hide > Show Hidden. Practically everything in Blender has a button.

thanx.... sometimes it's so not intuitive, and I working in Blender for 5 years...

@LDCO It is sometimes difficult to find. Glad I could help.

It's not exactly "find"... It's find a workaround... It's not possible to do it from the outline although it's so logic from the UI point of view...


text:
Convert bones to meshes
I want to use the blender built-in skeleton as a character - is there a way to convert the bones to concretes meshes?

I don't think so, but I believe a script could be created to represent the armature structure as a mesh...

I was not able to find an addon for that and as it is very close from another question. Here is an operator to do that (nearly, as the bone shape is not exactly the same).

The code is commented below. To use it, copy the code in a text view and run the script.
Then in the 3D view, select your armature, hit space and type "MeshFromArmature" and validate.
The result is a rigged mesh mimicking the armature shape.
If you want to enhance the bone shape, the code is isolated in one function 'boneGeometry' with the needed parameters.
If the comments in the code are not clear enough, please tell.
2.79 Version
import bpy
import mathutils
from mathutils import Vector
from math import *

def CreateMesh():

    obj = bpy.context.active_object

    if obj == None:
        print( "No selection" )
    elif obj.type != 'ARMATURE':
        print( "Armature expected" )
    else:
        processArmature( bpy.context, obj )

#Create the base object from the armature
def meshFromArmature( arm ):
    name = arm.name + "_mesh"
    meshData = bpy.data.meshes.new( name + "Data" )
    meshObj = bpy.data.objects.new( name, meshData )
    meshObj.matrix_world = arm.matrix_world.copy()
    return meshObj

#Create the bone geometry (vertices and faces)
def boneGeometry( l1, l2, x, z, baseSize, l1Size, l2Size, base ):
    x1 = x * baseSize * l1Size
    z1 = z * baseSize * l1Size

#    x2 = x * baseSize * l2Size
#    z2 = z * baseSize * l2Size

    x2 = Vector( (0, 0, 0) )
    z2 = Vector( (0, 0, 0) )

    verts = [
        l1 - x1 + z1,
        l1 + x1 + z1,
        l1 - x1 - z1,
        l1 + x1 - z1,
        l2 - x2 + z2,
        l2 + x2 + z2,
        l2 - x2 - z2,
        l2 + x2 - z2
        ]

    faces = [
        (base+3, base+1, base+0, base+2),
        (base+6, base+4, base+5, base+7),
        (base+4, base+0, base+1, base+5),
        (base+7, base+3, base+2, base+6),
        (base+5, base+1, base+3, base+7),
        (base+6, base+2, base+0, base+4)
        ]

    return verts, faces

#Process the armature, goes through its bones and creates the mesh
def processArmature(context, arm, genVertexGroups = True):
    print("processing armature {0}".format(arm.name))

    #Creates the mesh object
    meshObj = meshFromArmature( arm )
    context.scene.objects.link( meshObj )

    verts = []
    edges = []
    faces = []
    vertexGroups = {}

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

    try:
        #Goes through each bone
        for editBone in [b for b in arm.data.edit_bones if b.use_deform]:
            boneName = editBone.name
            print( boneName )
            poseBone = arm.pose.bones[boneName]

            #Gets edit bone informations
            editBoneHead = editBone.head
            editBoneTail = editBone.tail
            editBoneVector = editBoneTail - editBoneHead
            editBoneSize = editBoneVector.dot( editBoneVector )
            editBoneRoll = editBone.roll
            editBoneX = editBone.x_axis
            editBoneZ = editBone.z_axis
            editBoneHeadRadius = editBone.head_radius
            editBoneTailRadius = editBone.tail_radius

            #Creates the mesh data for the bone
            baseIndex = len(verts)
            baseSize = sqrt( editBoneSize )
            newVerts, newFaces = boneGeometry( editBoneHead, editBoneTail, editBoneX, editBoneZ, baseSize, editBoneHeadRadius, editBoneTailRadius, baseIndex )

            verts.extend( newVerts )
            faces.extend( newFaces )

            #Creates the weights for the vertex groups
            vertexGroups[boneName] = [(x, 1.0) for x in range(baseIndex, len(verts))]

        #Assigns the geometry to the mesh
        meshObj.data.from_pydata(verts, edges, faces)

    except:
        bpy.ops.object.mode_set(mode='OBJECT')
    else:
        bpy.ops.object.mode_set(mode='OBJECT')

    #Assigns the vertex groups
    if genVertexGroups:
        for name, vertexGroup in vertexGroups.items():
            groupObject = meshObj.vertex_groups.new(name)
            for (index, weight) in vertexGroup:
                groupObject.add([index], weight, 'REPLACE')

    #Creates the armature modifier
    modifier = meshObj.modifiers.new('ArmatureMod', 'ARMATURE')
    modifier.object = arm
    modifier.use_bone_envelopes = False
    modifier.use_vertex_groups = True

    meshObj.data.update()

    return meshObj

class MeshFromArmatureOperator(bpy.types.Operator):
    bl_idname = "wm.hello_world"
    bl_label = "MeshFromArmatureOperator"

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

bpy.utils.register_class( MeshFromArmatureOperator )

2.8 Version
import bpy
import mathutils
from mathutils import Vector
from math import *

def CreateMesh():

    obj = bpy.context.active_object

    if obj == None:
        print( "No selection" )
    elif obj.type != 'ARMATURE':
        print( "Armature expected" )
    else:
        processArmature( bpy.context, obj )

#Create the base object from the armature
def meshFromArmature( arm ):
    name = arm.name + "_mesh"
    meshData = bpy.data.meshes.new( name + "Data" )
    meshObj = bpy.data.objects.new( name, meshData )
    meshObj.matrix_world = arm.matrix_world.copy()
    return meshObj

#Create the bone geometry (vertices and faces)
def boneGeometry( l1, l2, x, z, baseSize, l1Size, l2Size, base ):
    x1 = x * baseSize * l1Size
    z1 = z * baseSize * l1Size

#    x2 = x * baseSize * l2Size
#    z2 = z * baseSize * l2Size

    x2 = Vector( (0, 0, 0) )
    z2 = Vector( (0, 0, 0) )

    verts = [
        l1 - x1 + z1,
        l1 + x1 + z1,
        l1 - x1 - z1,
        l1 + x1 - z1,
        l2 - x2 + z2,
        l2 + x2 + z2,
        l2 - x2 - z2,
        l2 + x2 - z2
        ]

    faces = [
        (base+3, base+1, base+0, base+2),
        (base+6, base+4, base+5, base+7),
        (base+4, base+0, base+1, base+5),
        (base+7, base+3, base+2, base+6),
        (base+5, base+1, base+3, base+7),
        (base+6, base+2, base+0, base+4)
        ]

    return verts, faces

#Process the armature, goes through its bones and creates the mesh
def processArmature(context, arm, genVertexGroups = True):
    print("processing armature {0}".format(arm.name))

    #Creates the mesh object
    meshObj = meshFromArmature( arm )
    context.collection.objects.link( meshObj )

    verts = []
    edges = []
    faces = []
    vertexGroups = {}

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

    try:
        #Goes through each bone
        for editBone in [b for b in arm.data.edit_bones if b.use_deform]:
            boneName = editBone.name
            print( boneName )
            poseBone = arm.pose.bones[boneName]

            #Gets edit bone informations
            editBoneHead = editBone.head
            editBoneTail = editBone.tail
            editBoneVector = editBoneTail - editBoneHead
            editBoneSize = editBoneVector.dot( editBoneVector )
            editBoneRoll = editBone.roll
            editBoneX = editBone.x_axis
            editBoneZ = editBone.z_axis
            editBoneHeadRadius = editBone.head_radius
            editBoneTailRadius = editBone.tail_radius

            #Creates the mesh data for the bone
            baseIndex = len(verts)
            baseSize = sqrt( editBoneSize )
            newVerts, newFaces = boneGeometry( editBoneHead, editBoneTail, editBoneX, editBoneZ, baseSize, editBoneHeadRadius, editBoneTailRadius, baseIndex )

            verts.extend( newVerts )
            faces.extend( newFaces )

            #Creates the weights for the vertex groups
            vertexGroups[boneName] = [(x, 1.0) for x in range(baseIndex, len(verts))]

        #Assigns the geometry to the mesh
        meshObj.data.from_pydata(verts, edges, faces)

    except:
        bpy.ops.object.mode_set(mode='OBJECT')
    else:
        bpy.ops.object.mode_set(mode='OBJECT')

    #Assigns the vertex groups
    if genVertexGroups:
        for name, vertexGroup in vertexGroups.items():
            groupObject = meshObj.vertex_groups.new(name=name)
            for (index, weight) in vertexGroup:
                groupObject.add([index], weight, 'REPLACE')

    #Creates the armature modifier
    modifier = meshObj.modifiers.new('ArmatureMod', 'ARMATURE')
    modifier.object = arm
    modifier.use_bone_envelopes = False
    modifier.use_vertex_groups = True

    meshObj.data.update()

    return meshObj

class MeshFromArmatureOperator(bpy.types.Operator):
    bl_idname = "wm.hello_world"
    bl_label = "MeshFromArmatureOperator"

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

bpy.utils.register_class( MeshFromArmatureOperator )

Link to the blend file

Would you be interested to submit this an official blender addon?

@Fire, currently I'm a bit out of all these. But if you think that's a good idea, feel free to do it (the code above is totally free to reuse ;)

For Blender 2.90 you must enable Developer Extras (User Preferences > Interface) so that "MeshFromArmature" will be searchable in the F3 menu.


text:
Clean up video in VSE
Can't find an relatively easy way to make some very basic post-production clean some unwanted things from my final render video. I can re-render the video from the compositor with mask' and then re-re-render from VSE with sound' but that's not the way I'm looking for (finally I can take the rendered png's and edit them one by one in gimp...)
I'm trying to find a reasonable process for fixing some little errors in video. Example on the screenshot - from the left side there is some part of text that should not be there' for a couple of seconds.

In the VSE add a color strip
[
The sample the source frame to change color of effect strip

Press F12 key to render a frame inot UV Image editor window then change to mask mode and add a mask.

Select the color strip and add mask modifier

change the effect strip's blend type to over drop

thanx, very much, it's an option but is a very dirty method - the background i'ts not 100% white, so it's just makes a spot over, instead of really erase this. I know that in AE it's a metter of less than one minute to do this, I'm trying to prove for all the world that Blender can be used as a tool for motion graphic as well...

I've made changes to videos such as this and did it all in the 3D window, using planes to "screen" the video and place another over the affected area only during the frames required,  The material and colour is usually easily matched to the original video in plain colour cases like this.  Some part of the original video can also be used to mask something but matching those up is more demanding. .

You could of course use the Border render command in render properties to just rerender that little portion, then alpha it over the rest.

3pointedit: this is a veeeeery dirty method. of course it's possible to find some crazy workarounds, but the issue is to find solutions that approaching for maximum a professional work-line.

Can you explain the work flow from After Effects? Would you use a gradient object with sampled colors from the source image?

The best solution I find is to render the frame before the problematic frame and mask with it, not with color strip, like this it's match the background.
I'm using the "movie editor" for masking, not the compositor. Actually I don't know if there is a difference between using the two.


text:
How to use correctly the "Scene" actuator
I've read in an answer here that in order to suspend-resume a scene correctly you need an overlay scene.
In my case I have a main scene and an overlay scene. I use the overlay scene to pause-unpause the main scene.
Now I wish to change from the main scene to other secondary scenes and back(resume). So I send a message to my overlay_scene_camera_obj to suspend the main scene and set a new scene(secondary scene). My problem is that when I want to go back, I send again a message from an object in my secondary scene to my overlay_scene_camera_obj but nothing happens.
At first I thought I would need to add the "overlay" scene to the secondary scene too, but it did not work. But still I suspect the "overlay" scene goes off during the change from my main(+overlay) to secondary, so any messages sent to overlay from secondary don't get through.
So is there a useful documentation/thread or can someone tell me what I might be missing.
p.s. I thought someone had posted here or in blenderartists couple of years back regarding this actuator and its "problems". But I couldn't find the thread.

Your overlay scene sets the secondary scene?

Yes. An event happens in the main scene, and a message gets sent to the camera in the overlay scene, and the logic bricks in the overlay camera set the secondary scene.

As far as I understand your setup you would either get three scenes (first, overlay + second as background), or your get two scenes (first and second as replacement of overlay). I suggest to do "set scene" on the first scene that it gets replaced by the second scene. The overlay scene needs to resume both scenes.

If I did not lose you, this is what I do. I "set" the seconday scene. My current setup is : mainScene+OverlayScene --> "set" secondaryScene and "suspend" mainScene --> "resume" mainScene.  All events happen in main/secondary scene and messages are sent to OverlayScene and that OverlayScene handles all scene actuators.

Overall, your question sounds pretty much a similar question from the same day: https://blender.stackexchange.com/questions/78968/bge-switching-between-scenes. Your question is more focused on how to use the scene managing, but the issue might still be the "return to scene". Nevertheless the answer might help you a bit.

You were right. I got what I needed in the first paragraph. Thanks and I ll try to mark this as duplicate or something similar.


text:
Copying logic bricks causes acts strange in the logic editor
I copied some logic bricks from object 1 to object 2.
Now everytime I pick only object 1 or only object 2, both their SCAs appear on the logic brick menu. It is exhausting since they are many. Why is this happening and how do I stop it?

Without knowing your setup I can't investigate.

Here is the blend flie : http://www.pasteall.org/blend/37603
Try to paste the flashlight's logic bricks to the "nightvision googles" and then just select 1 of them.  P.S. some models used are not mine, but share by dewhead24 and Wayward art company.

When you copy inter-object connections, they will be preserved.

The result is (when enabled) that you see indirectly connected objects too, not just direct connected objects.

You can switch of indirect links:

ok got it. But if I don't copy them, and redo all the SCAs from scatch, even with link activated I won't be able to see them right?

If you do it exactly as the other, you would still need to create the inter-object connection. The result would be the same. -> the question is: do you really want the exact copy?