Blender linked Rigid body constrains for fractures

If you just want to fracture rigid bodies as they fall, then you can manually set up the vertex-groups, and modifiers to simulate this. Here's how to do it on a simple cube:
Step 1: Subdivide! If you want a good explosion simulation, then you must subdivide. About 25 subdivisions in edit mode works well. You may also want to add a subsurface mod later, if you want more jagged edges.

Next we need to set up the vertex groups. This would look most realistic starting with a small group at the bottom and then going up. This would be for the cube (with one edge facing the plane). Start selecting and assigning random small vertex-groups at that edge. FYI, also you should set select vertices, not faces anymore.
I set up 6 vertex-groups, which I will later use for a controlled explosion modifier for animating the edges while the rigid body falls.
Here are pictures of my selections for each vertex group:

Now to set up the modifiers. We might want to do that after we do the rigid body simulation. So keep the position of the objects, and go ahead and set that up. Active for the cube (set the cube to mesh collision), and nothing for the plane. The plane should be set to collision, for particles. Don't bake this yet, but run through the animation timeline a few times. Applying scale and rotation to both the cube and the plane will help with the simulation. Also, you might want to use collision margins, as my simulation was a little glitchy without it.
Now comes the setting up of the explosion:
We are using particle settings and the explosion modifier.
1) Make sure that the vertex-group weight is set to 0. (So that it will be affected.)
2) Go to the particles tab, and create a new particle system. (You will need one for each vertex group to sequence the series of the parts of the cube crashing.) For your particle settings, keep everything the same except for the lifespan (set to 250, or the length of your animation), and the emission start and end. Set both the start and end time to be the exact frame the cube touches the plane. Also set the density vertex group to your first vertex group. (In my case, shatter1.) One last thing for the particles: set both the collision group and the effector group to the rigidbodyworld. To get the faces to explode and not just emit particles, go to the modifier tab and add an explode mod. Set the vertex group to the same as in the particle settings.
Now repeat this step, and create a particle system and add an explosion mod for each vertex group. All of the settings should be the same, except for the time that the particles are emitted. This can be adjusted a frame ahead per particle system.
This is really much it, running through the animation will show you the final result. You can play around with the .blend here:

These are pictures of what the cube looks like exploding:

I added a quick smoke with higher resolution to achieve this:
It's a little messy, but it is just about the best result you can achieve in blender without any sort of add-on.
I hope this helps, and Happy Blending!


First, make sure you're in pose mode with your armature. Then, still in Pose mode:

Select both your eye's lattice objects (it will turn back on object mode, no worries)
Shift select the head's bone (it should switch automatically to pose mode, otherwise do it manually)
Hit CtrlP → Set parent to Bone

This way your lattices are following the head's bone.

The only remaining advice I would give you is to use a constraint Child Of on your C_look_target bone, to make it parented to the head's bone.
That way, the eyes, and their target will follow the head, as well as the lattices, which is usually more practical to use when posing.
When you will need to move the head while the eyes target stay still, simply animate the Child Of influence parameter from 1 to 0, and vice versa when you need the opposite behavior.


Merge two curves into new one like rhino

in sverchok, i use pink curve's z position and blue curve's xy position to create a new green curve.


Get usual right side toolbar in UV Editing mode

First to clarify the names used for each part of the window layout which is explained in the introduction page of blender's manual, each window contains one or more areas.

All of the areas combined are saved as a screen layout. Several default layouts are included with blender and you can create as many layouts as you want and easily switch between each one to make various tasks easier.

Each area in a screen layout contains an editor such as the 3DView, Properties Editor, UV/Image Editor, Graph Editor, Outliner ... This leads to editor being a better term to use than area for most users, area is a term used when using python so may be used if you are asking certain python questions.

Each editor has a header (which is often attached to the bottom of the editor) which contains the menus and several widgets specific to the editor, the menu on the left is used to change the editor type. Many editors also have one or two regions available that are attached to the left or right side, these are attached to the side of the editor not the entire blender window. The region on the left is normally the Toolshelf Region (T or ⎈ CtrlT in the text editor) and the one on the right is normally the Properties Region (N). With the mouse over either region or header, you can press F5 to flip it to the opposite side. You will also find a small + on the edge of the editor's area that can be used to view each of these regions when they are hidden.

The toolbar and properties regions, as well as the properties editor, then contains one or more panels that have a disclosure triangle to show/hide the contents. The toolbar region also has tabs to further group the panels.

The part you are thinking of as a properties toolbar is most likely the properties editor (4 above) and can be added to any layout by splitting an area and changing one area to properties, you may also want to split that new area and change one to be the outliner (3 above).

Instead of altering your layout you can also switch to a layout that has the properties and outliner. You can use ⎈ Ctrl← Left arrow/→ Right arrow to cycle through the screen layouts.

If you adjust your screen layouts and then save your startup file you can have the screen layouts available in each file you create. Note that enabling the Load UI option when opening a blend file will use layouts in the blend file your opening not your startup file.


Vertex Normals Not Facing Correct Directions

Credits to Rahul Chaudhary on https://developer.blender.org/ for the solution.
Turns out the issue is a result of the abnormal scaling I had originally placed on the object to scale a cylinder down to the approximate diameter and height (.078 in XY, 4.888 in Z). Applying the scale immediately fixed the issue.
To clarify, this would be the mesh Blender used to calculate all of the normals, after which it rescaled the mesh to look like the cylinder I had.

Before Applying Scale:

After Applying Scale:


First, you did the right thing by rendering into an image sequence. Never render animations directly as video.

Delete (or move to a different folder) the frames that need to be re-rendered. Then on the output settings uncheck the "overwrite option"

Then re-render as usual wiht CtrlF12. Blender will just render the missing frames and leave the others untouched.

If you have any strips on the VSE (video sequence editor) uncheck the Sequencer box of the postprocessing section of the properties window.


There were multiple problems with the mesh, but it all came down to materials being assigned to the wrong places. The shirt material was assigned to the head, mouth, and eyes. Create new material slots for these areas, select the already working-on-other-character materials from the list of options for each slot rather than creating new ones, and assign them to the right places. Since several duplicate vertices exist, I personally recommend selecting all and merging by distance first, then using Select Linked but limited to UV to easily select one-material areas.
For more information, see the Blender Manual on Material Assignment


The issue is caused by the PYTHONPATH. It seems that /usr/lib64/python/ points to the libraries of Python 2.7, which results in the aforementioned error. The PYTHONPATH environment variable can be temporarily removed for the current terminal with the command unset PYTHONPATH after which you should be able to run make update successfully.


Visualizing depth image after accessing render results

the line

depth[i,k] = pixels[i+k]

seems off to me, it seems as if you need to transform your indices between the 2d depth array and the flat 1d pixels array like:

depth[i,k] = pixels[i*int(round(ix/2))+k]

where the index i offsets multiples of the length a whole row into the array, and k additionally offsets into each element of it.


Look at your model.

The places where you can only see black are the densest, and that is where you want to focus on reducing the poly count. In your image that would be the front springs, and some of the pipes in the track assembly. All the rest of the model looks fairly low poly and balanced.

I am going to go in an manually reduce the poly count.  Don't worry about selecting all  the edges, it is quick and easy to reduce the poly count in a cylindrical object like a spring.

I will do the spring, but the exact same process works for the pipes.

Start by selecting every other edge loop around the spring.

Select the edge rings along the length of the spring. You can do that with CtrlAltRMB

Run Checker Deselect on that selection. From the 3D view header Select > Checker Deselect. If you have a very dense mesh increase the Skip amount in the operator properties section of the tool shelf.
From the 3D view header Select > Edge Loops.
Press X > Edge Loops to remove all those edges.

Now we must do the loops along the length of the spring. Select this in the exact same way as we did before.

An animated gif showing the whole process.


Render looks "brighter" than in viewport preview

Look at your outliner, you have (at least) 1 object (probably a light) set to render, but hidden in viewport (camera icon active, but eyeball icon greyed out) it's named BMWRim .  I'm guessing it's a rim light.


How to know if the 3d-view is in camera mode or not?

See context.space_data.region_3d.view_perspective which returns a string from an emum of PERSP, ORTHO and CAMERA.

thanks to kaio !


'Context is incorrect' error when using 'bpy.ops.object.mode_set(mode='OBJECT')' if I'm already in object mode

You can check which mode you're in with the following line:

mode = context.active_object.mode

And then do things correspondingly, such as switching to object mode when you're in pose mode for example.

Or you could use a try/except statement:

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

Hope this helps.


The Spin tool still exists in Blender 2.8, you can find it in the toolbar. It does not have a shortcut in the default keymap. You would have to add it yourself or use the 2.7x keymap.


How to modify vertex groups through script

Set the group weight on the vertex.

The VertexGroup.add(...) requires a list of indices, you have only given an int.  Neeed to grp.add([v.index], weight * 0.5, 'REPLACE')

To get all verts in a vertex group.

Different take on this, iterate thru the vertices, and if they have been assigned to group (I've used selected group, change code for any) its group weight is multiplied by the scale factor.

This needs to be done in object mode, included a mode toggle.

import bpy

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"
    bl_options = {'REGISTER', 'UNDO'}

    scale_factor = bpy.props.FloatProperty(
        name="scale_factor",
        default=1,
        min=0.001,
        options={'SKIP_SAVE'})

    @classmethod
    def poll(cls, context):
        obj = context.object
        return (obj is not None
                and hasattr(obj,"vertex_groups")
                and len(getattr(obj, "vertex_groups", [])))

    def execute(self, context):
        obj = context.object
        mode = obj.mode
        me = obj.data
        # all groups (using selected)
        # groups = [g.index for g in obj.vertex_groups]
        # active group

        groups = [obj.vertex_groups.active_index]
        bpy.ops.object.mode_set(mode='OBJECT')
        for v in me.vertices:
            for g in v.groups:
                if g.group in groups:
                    g.weight *= self.scale_factor

        me.update()
        bpy.ops.object.mode_set(mode=mode)
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

    bpy.ops.object.simple_operator(scale_factor=0.5) # test call


Artifacts in cycles clouds and volumetric atmosphere

Ok, after trying many different things, the problem is that my clouds and atmosphere were too far above the surface of the planet. The light would pass through one side of the icosphere, above the surface of the planet, and come out through another side of the icosphere. The weird caustic effect is caused by the normals of the icosphere, since it doesn't have thickness. This means that the normals were correct for the outer face and incorrect for the inner face, which meant the light came out weird.
The fix for this is can be found in this article: https://www.katsbits.com/codex/backface-culling/#rendered-cycles. The geometry node has a "backfacing" output, which means that putting that into the factor of a mix shader connected to the main texture and a transparent BSDF will make the light hitting the interior of the icosphere transparent, fixing the banding problem.


How to align vertices to another vertex per axis?

You can do this by setting the Pivot Point to Active Element, then selecting the vertex you want all other verts to align to, last (the active vert has a brighter color).

Change the pivot through the 3D view window's header at the bottom:

Then you can scale in each axis to 0, and all selected vertices will align to the active vertex.


Is it possible to save certain parts of a screenshot

This answer is given with assumption that you would like to save different windows screen shot only.

Here are the steps to take screenshots of specific windows in Blender e.g 3dView, UV Windows, Properties.

Hover your mouse over required window.
Press Ctrl + F3.
Before saving screen shot, Uncheck Full Screen box to save only specific windows shot. It is available in Save Screenshot Properties Box.


You can use Drivers to get "random" Seed in Particles settings.

  As @Crantisz pointed you can just paste #int( 99 * noise.random() )
  as a Seed value and Driver will be automatically added.

Long way:

Right click on Seed and Add Driver > Manually Create Later (Single).
Go to Graph Editor and switch to Drivers mode.
In Drivers tab paste this expression: int( 99 * noise.random() )
Update Dependencies.

Now every time you open Blender Seed value will be different.


Here's a way you can do this.

With a little extra work and the same basic tools it can be refined further.


How to get the Transform panel to show up again in Video Sequencer?

Press F9 to adjust last operation.

It was never implemented in the VSE to pop up automatically like in the 3D View, but it'll soon be: https://developer.blender.org/D6210


Find any node connected to a material's displacement input and replace it with a normal map node?

I have done some research on how to access Blender's material nodes via Python and ended up writing a solution which address my original issue, I will post the code to serve as a possible answer.

However I am not marking this as the best answer because as Rich Sedman pointed out, Blender 2.8 already fixes the node setups when opening a .blend file. So maybe in some future release of Blender it too will address the nodes when linking and appending from external .blend files.

In the time being I must use this script in my custom import and automation scripts to fix the shaders after all models have been appended.

FixDisplacementNodes.py

#!/usr/bin/env python
# -*- coding: utf-8 -*-

__author__ = "Grant Olsen (2019)"
__credits__ = ["Rich Sedman", "batFNGER"]
__version__ = "1.0.0"

import bpy

"""Given a material this will search for any RBG to BW nodes that are connected to a Material Output's Displacement input.
   If the RBG to BW node exists then this will create the proper Normalmap to Displacenment map node setup and replace the
   RGB to BW node with them by linking the nNode to the dNode, then from the Image texture to the nNode, and the dNode
   connects to the Material Output node. Finally it deletes the disconnected RGB to BW node.
"""

def FixDisplacementNodes(mat):
    """
    Explanation: this function takes one arguments: `mat`.
    `mat` is type bpy.types.Material and is the material for the object
    to be checked for any RBG to BW nodes connected to the Material Output node.
    Will replace with proper normal map node setup.

    The return type is `None`.

    """
    if mat is None:# an object can have an empty material slot where slot.material is None
        return #nothing to process

    for link in mat.node_tree.links: #loop over all node links for this material.
        if type(link.to_node) is bpy.types.ShaderNodeOutputMaterial: #check if this node is connected to the type: "Output Material" node
            if link.to_socket.identifier == 'Displacement': #check if this node is connected to the "Displacemnent" input
                if type(link.from_node) is bpy.types.ShaderNodeRGBToBW: #finally, is the child node an "RGB to BW" type node?

                    bwNode = link.from_node #store the RGB to BW node for deletion later

                    dNode = mat.node_tree.nodes.new('ShaderNodeDisplacement') #newly created Displacement Node
                    nNode = mat.node_tree.nodes.new('ShaderNodeNormalMap') #newly created NormalMap Node

                    mat.node_tree.links.new(nNode.inputs['Color'], link.from_node.inputs['Color'].links[0].from_socket) #connect the Image Texture node to the Normal Map node
                    mat.node_tree.links.new(dNode.inputs['Normal'], nNode.outputs['Normal']) #connect the Normal Map node to the Displacement node
                    mat.node_tree.links.new(link.to_socket, dNode.outputs['Displacement']) #connect the Displacement node to the Material Output node

                    mat.node_tree.nodes.remove(bwNode) #delete the unlinked RGB to BW node

"""Loop through all objects in the scene, and for each object's material slot, passing it to FixDisplacementNodes.
"""
if __name__ == '__main__':

    for mat in bpy.data.materials: #get list of materials, will save fixing same material for each object
        FixDisplacementNodes(mat)

    #for ob in bpy.data.objects: #get list of objects
    #   for slot in ob.material_slots:
    #       FixDisplacementNodes(slot.material)

Result:

[EDIT]

I am not sure which way is more preferred (if there is even much difference) but here is a variation which exactly replicates the way 2.8 converts the shaders when opening a .blend file (notice how it keeps the RGB to BW node):

FixDisplacementNodes.py (v2)

#!/usr/bin/env python
# -*- coding: utf-8 -*-

__author__ = "Grant Olsen (2019)"
__credits__ = ["Rich Sedman", "batFinger"]
__version__ = "2.0.0"

import bpy

"""Given a material this will search for any RBG to BW nodes that are connected to a Material Output's Displacement input.
   If the RBG to BW node exists then this will create the proper Displacenment map node setup and link it to the
   RGB to BW node.
"""
def FixDisplacementNodes(mat):
    """
    Explanation: this function takes one arguments: `mat`.
    `mat` is type bpy.types.Material and is the material for the object
    to be checked for any RBG to BW nodes connected to the Material Output node.
    Will replace with proper normal map node setup.

    The return type is `None`.

    """
    if mat is None:# an object can have an empty material slot where slot.material is None
        return #nothing to process

    for link in mat.node_tree.links: #loop over all node links for this material.
        if type(link.to_node) is bpy.types.ShaderNodeOutputMaterial: #check if this node is connected to the type: "Output Material" node
            if link.to_socket.identifier == 'Displacement': #check if this node is connected to the "Displacemnent" input
                if type(link.from_node) is bpy.types.ShaderNodeRGBToBW: #finally, is the child node an "RGB to BW" type node?

                    bwNode = link.from_node #the RGB to BW node

                    dNode = mat.node_tree.nodes.new('ShaderNodeDisplacement') #newly created Displacement Node

                    mat.node_tree.links.new(dNode.inputs['Height'], bwNode.outputs['Val']) #connect the RGB to BW node to the Displacement node
                    mat.node_tree.links.new(link.to_socket, dNode.outputs['Displacement']) #connect the Displacement node to the Material Output node

"""Loop through all objects in the scene, and for each object's material slot, passing it to Check_Material.
"""
if __name__ == '__main__':

    for mat in bpy.data.materials: #get list of materials, will save fixing same material for each object
        FixDisplacementNodes(mat)

    #for ob in bpy.data.objects: #get list of objects
    #   for slot in ob.material_slots:
    #       FixDisplacementNodes(slot.material)

Result:


How to make asset look more "3d" (sail of a sailboat)

You can use one of these 2 solutions:
The Sculpt solution:

Create your sail, curve it a bit:

In Sculpt mode, select the Mask brush (don't use a Subdivision Surface modifier for the moment if you want the mask to be visible), paint the 3 corners:

Select the Cloth Filter brush, keep the Type > Gravity, paint until you get this kind of result:

The Cloth solution:

Create your sail, select vertices on the 3 corners and make it a vertex group, give the object a Cloth physics with the group as Pin Group, give it a constraint > Copy Scale, here on the X axis and with the edge as Target:

Create an edge under the sail, create a Force Field > Wind with a Strength of, for example, 3000:

Play the animation, the wind will blow on the surface, scale down the edge so that it folds a bit the sail, scroll in the Timeline, when you're good, apply the Cloth modifier:


How do I use world properties in blender?

Most of these things would be in various tabs in the properties editor on the right hand side of the default UI, but as @Gorgious said, zenith and horizon are not currently in Blender. I checked, and these are from Blender Internal Render, which was discontinued in 2.80 release. I’ve included locations for Blender 2.79b, the last release with the Blender Internal Render engine.

Mist. Visual effect. Makes distant objects more and more transparent to the world background. It seems you are expected to composit this in yourself nowadays, and you can enable it for compositing in Properties editor -> View Layer Properties tab -> Passes panel -> Data sub panel. It will then show up as a Render Layer node output for this layer in the compositor. In Blender 2.79b with Blender Internal Render enabled, you can also enable readymade mist in Properties editor -> World tab -> Mist panel.
Horizon and Zenith. Archaic settings of the Blender Internal render engine, which was no longer used with the 2.80 release. In 2.79b with Blender Internal Render enabled, you can find these settings in Properties editor -> World tab -> World panel. Note that “Zenith color” will be unavailable unless “Blend sky” right above it is checked.
Cycles. A render engine. Comes packed with blender as an add-on and enabled by default, but not selected for use (you bought the screwdriver and it’s in your working tool bag, but it’s not in your hand yet). The render engine that is selected by default is EEVEE, which provides pretty decent fakes of physical accuracy for quick rendering. Cycles provides high-accuracy photorealistic ray-traced renders and hopes for an NVidia GPU to do its high-spec work. You can currently change the selected render engine in Properties editor -> Render Properties. It’s at the top. In Blender 2.79b, you can change the selected render engine in Info editor. In the default 2.79b UI, this is at the top of the window.


This can be usually done by checking the First/Last option.
But not here, because the Curve modifier takes effect after the Array modifier.
You can use the new (2.82+) Weld modifier to merge the vertices instead.

Array modifier to copy your objects
Curve modifier to bend the geometry
Weld modifier to merge the First/Last vertices


Unless you have good reasons to keep some meshes separate (like a modifier that must not affect the other meshes), it would be simpler to join them.

For the second question, it really depends on what you want, it will deform but it won't necessarily be a problem so you should try this solution, on this topic you can follow this very simple tutorial by AgenZasBrothers that explains how to create robot limbs with Array and Curve modifiers, maybe at the end parent the vertices to bones so that you can always come back to a Rest pose.

Also maybe this answer I gave on how to rig a cartoon-like limb may interest you.


Unexpected result setting a shear matrix as transform

Mesh.transform

Can transform mesh directly by a matrix with Mesh.transform(matrix)  The matrix must be a 4x4.  Use in object mode. Update the mesh to see result.

Python console code, C = bpy.context

>>> mat = Matrix.Shear('XY', 4, (3,3))
>>> mat
Matrix(((1.0, 0.0, 3.0, 0.0),
        (0.0, 1.0, 3.0, 0.0),
        (0.0, 0.0, 1.0, 0.0),
        (0.0, 0.0, 0.0, 1.0)))

>>> C.object.data.transform(mat)
>>> C.object.data.update()

  But this is transforms the vertices for good. In the modal operator, I
  need to apply it to the original positions of the sphere on each
  update. And the matrix is not necessarily invertable, so I can't just
  do the inverse beforehand, which makes it tricky

Shear matrix is not orthogonal, this is why it is not seen as an object matrix, and only in edit mode.

>>> mat.is_orthogonal
False

AFAIK will need to apply to verts to shear.

Some ways to copy mesh coords, swap out a mesh copy

>>> me = C.object.data
>>> me2 = C.object.data.copy()
>>> me2.transform(mat)
>>> C.object.data = me2 # see transform
>>> C.object.data = me # back to original
>>> bpy.data.meshes.remove(me2) # remove it when done

Foreach set and get

load the 3d vert coordinates into a ravelled array.  Have used numpy as the matrix algebra could be performed on it reshaped, although will find Mesh.transform is quick too.

>>> import numpy as np
>>> data = np.zeros(len(me.vertices) * 3)
>>> me.vertices.foreach_get("co", data)
>>> data
array([ 0.00000000e+00,  1.95090324e-01,  9.80785251e-01, ...,
        1.51397259e-08,  1.95089921e-01, -9.80785310e-01])

The data is ravelled, here it is reshaped to display the coordinates

>>> np.reshape(data, (-1, 3))
array([[ 0.00000000e+00,  1.95090324e-01,  9.80785251e-01],
       [ 0.00000000e+00,  3.82683456e-01,  9.23879504e-01],
       [ 0.00000000e+00,  5.55570245e-01,  8.31469595e-01],
       ...,
       [ 1.52975474e-07,  7.07106352e-01, -7.07106769e-01],
       [ 7.84696610e-08,  3.82682920e-01, -9.23879623e-01],
       [ 1.51397259e-08,  1.95089921e-01, -9.80785310e-01]])

Transform the data, update to see result

>>> me.transform(mat)
>>> me.update()

write back, update to see result.

>>> me.vertices.foreach_set("co", data)
>>> me.update()

Another OTT method would be to make a shape key and transform that.


This can easily be accomplished with a Copy Rotation constraint.

Create your first object, and Apply location and rotation. Then ALTD to make a linked duplicate. Then, in Object mode, rotate your second object on the Z axis.

Now, add a Copy Rotation constraint to the second object, targetting the first object. The trick is to map the World space of the first object to the Local space of the second object.


How can I make sure that simulated cloth doesn't go through other objects?

In order to keep the cloth from going through other objects you need to enable Cloth Collision.  Cloth collision allows other objects to influence the calculation of the cloth simulation.  (Adding the Collision physics type only allows other objects and particles to collide with the cloth, it does not influence the cloth simulation of the object on which it is enabled.)

When Cloth Collision is enabled, the cloth simulation will collide with all objects which have the Collision physics type enabled.  So in your case, you should enable Cloth Collision in the cloth sim settings and enable Collision physics on the character.

To get a decent looking simulation you will have to play around with the collision settings.  Here are a few key things to adjust:

Quality is basically the number of steps blender takes to simulate the cloth, higher quality = more steps = longer baking time = better looking simulation.  I rarely find the default quality of 2 to be decent, I often use between 3 and 5.
Distance is essentially the "thickness" of the cloth, the threshold of how far away from the cloth mesh a collision is registered.  This is important because, due to the geometric nature of a mesh, there will always be intersections between two colliding objects.  By increasing this you can move the collisions away from the actual geometry slightly, minimizing actual geometric intersections.
Friction is how "sticky" the cloth is, how much it resists being dragged against another surface.  If your cloth has too much friction it will stick to the character unnaturally as it deforms, too little friction and it will appear unrealistically silky.
Self Collision allows the cloth to collide with itself.  Enable this if the cloth mesh is intersecting and going through itself too much.  Self Collision has its own Quality and Distance values for better control.  This will drastically increase baking times too, so beware!


How to get started with Python Coding in Blender?

Many times as you know more about Blender you will need less Python.

In Blender use the Python console window and execute your python from a text window.  Note that tool tips show Python references.  See text output in the Blender console window. One small project suggestion is to print out the names of the Blender Objects in the console window.

Python.org site can be incrementally read and searched via the internet.  There are certainly free videos and texts on the internet, with and without Blender.

Here at Stack Exchange there is a Python group.

Note that in Blender the [info window] shows Python for many of your user actions so you can observe and customize.

If you want to reinvent the 3D Wheel and get Python experience, pick a small project such as one that has many scripts and solutions already, so one may refer to known solutions.  Here is one idea.  Write Python to change the content of a [text] object over time from a Python list of strings.

Know that Node programming exists for the Compositor and Materials et cetera.  There is also BAN  ... Blender Animation Nodes.  There is also the driver feature of Blender which use Python.  One small project might be to animate the visibility of two objects based on the visibility of a third object.

I am not addressing the Game Engine in particular.


You can add your own App Template by using the Operator Search F3 to find Install Template from File.... The underlying operator PREFERENCES_OT_app_template_install allows you to install a zipped App Template.

If you don't have a zip file you can copy and modify one of the existing templates. You can find the location of the template files by switching to the scripting workspace and typing the following code into the python console:

for x in bpy.utils.app_template_paths():
     print(x)

This will print the path(s) where the build in application templates are stored.

Each template consists of a folder containing a startup.blend and a init.py. The former is the default project that is loaded. The latter is a Python script that contains a callback function / handler that is executed once the startup.blend is loaded. This allows to perform additional configurations. The folder name is the name of the template. Below you see the basic structure of such an init.py.

import bpy
from bpy.app.handlers import persistent

@persistent
def load_handler(dummy):
    pass

def register():
    bpy.app.handlers.load_factory_startup_post.append(load_handler)

def unregister():
    bpy.app.handlers.load_factory_startup_post.remove(load_handler)

The load_handler() is the function that will be registered once you select the app template in Blender and then executed once the project is loaded. When you create your template you can add whatever additional Python code you like here. If you copy an existing template to create your own, you may want to edit this function or replace it's content with pass to make it do nothing.

Now in order to create your own template you need to do three things:

Either copy an existing template or create your own directory with a startup.blend and init.py
Open the startup.blend and adjust the UI to your liking
Open the init.py and modify the load_handler. (If you're unfamiliar with software development simply copy and past the example given above, which does nothing.)

Your new template should be available right away when you restart Blender, if you've created the files in the directory where the other templates are stored. Otherwise you will either have to copy it there or create a zip file of the directory and install it by using Install Template from File... as described at the beginning.


applying armature scale yield to change object location

As you can see your armature has a pose, it has been moved away from its origin and keyframed in Pose mode. If you apply the scale in Object mode, the bones will keep this distance from the origin but, as the armature has been scaled down, the distance will be scaled up as much. So what you need to do before applying the scale is go in Pose mode and reset the pose with an AltG.


How do you create an animated mask for an image to show underlying video for v2.82a?

In the movie clip editor (not the sequencer) you can create and animate masks.

In the VSE select the strip you want to overlay, add a "mask" strip modifier and select the mask you want to use. Then set the strip to use "alpha over" blend mode in the Adjust->Compositng settings for the strip.
The top strip will be overlayed on the bottom strip using the mask as alpha channel.

There is no need to create black and white images to be used as masks. The mask tools for blender are quite sophisticated.


AFAIK, a Dilate/Erode node is commonly used to fix such issue.

Becides, it seems that you set the robot Layer as Mask layer for the reflect RenderLayer, which caused part of the plane was masked as transparent. Try untoggle that in RenderLayer setting, or add a new RenderLayer to get an expected alpha.


object list is not iterable and save directly in stl files

I was able to save existing objects in separate stl files with this statement
my_filepath = bpy.path.abspath(' //my_directory/ ')
bpy.ops.export_mesh.stl(filepath = my_filepath, batch_mode = 'OBJECT')


Overlays; how to turn off grid display only?

You can hide grid floor and axis, using viewport overlay options:

The "grid" option is for "orthographic side view' (from the tooltip):


texture paint is making unwanted duplication

Thanks for the replies, it was the UV mapping. I projected from view. Once I'd put in some UV seams and re-mapped the mirroring stopped.


How to make Volumetric Scatter fade adjustable

There seems to be an error in my calculations. I think I will manage to review them later.
As Ibalazscs pointed out, you can control volume with the existing math nodes and procedural textures.
I will setup a mathematic procedural torus to use as density. This will not be affected by the geometry, sadly, but will work as a substitute solution.

To control the density of a volume, we can connect a texture or other value node to the density input of the Volume Scatter Node.

Starting with a two dimensional equation, let's control the volume of a cylinder with a colorramp or RGBcurve.

Here is the relatively simple mathematical basis. We need the equation of a circle.
x**2 + y**2 = radius**2
radius = (x**2 + y**2)**0.5

This will result in values from 0 to 1, starting from the center of the XY circle to any point on the circle.
Translated into a node setup, we have to use the Converter>Math nodes.

Connect the last node to a colorramp and we can see the effect on a 3D object in material or rendered mode.

The complete node setup looks like this.

I use a multiply node before the RGB curves to "scale" the circle. The RGB curves modify the density from the center of the circle to the rim. I have set them to the various examples in the beginning. The multiply node after the RGB curves raise the upper density limit. Close to zero (transparent) values will stay relatively unaffected, values close to 1 or higher will become more dense.
The position attribute of the Geometry node holds the XYZ coordinates. The separate RGB node extracts the three channels.
Important: The position attribute is in world coordinates. Use the Object Info > Location attribute if you move your object.
Creating the torus

Add a cube. This will function as the volume domain of the torus.
Use the existing node tree of the circle calculation nodes.
Add a subtract node to the chain. This will shift the value of zero along circles of different size. We will connect the Major Radius of the torus to the subtrahend. The add an absolute node. We want the values around 0 (our major radius) to fade out towards the center and towards infinity.

We want to control the density using values from 0 to 1 ranging from the major radius to the (major + minor) radius.
The value of the major radius in XY is currently 0.

We are going to use the circle node setup again with the existing XY circle output and the Z axis. After the last subtract node, paste the circle nodes (pow2, pow2, add, sqare root) and connect the subtract node to the first pow2. Connect the extracted Z value (B output of the separate RGB node) to the second pow2. The result is a circle with a major radius of 1. The values at the major radius are at 0. Values moving away from the major radius range to infinity, the distance from the major radius. We need it the other way around.
Negate the value (multiply with -1), now we have values from 0 to -infinity. Add a value with an add node. The second input of the add node is the minor radius. Clamp this value. We now have a range of 0 to 1 from the outer rim of the torus to the inner circle.
Connect this to the RGB curves.

Make sure your domain object is large enough.If you want to add a shader to the outer surface, add a torus with correspoing major and minor radius. In my case


Set various rotation points for multiple object

[child of] constraint and armature may be part of the answer you are looking for. You may need multiples of these.

Armatures and [child of] constraints are used below. In the images below the armature is black color in pose mode.  Some bones are are coincident (Same location ... different rotation) and thus not obvious from a casual inspection. 36 = 6 x by 6 different meshes.  Plane (very flat cube) thickness and near flat fold are for illustrative purposes.  I have not stated why I think the combination of the two is useful.

A Blender scene can have multiple [child of] constraints for optional control influence strength 00%, 50%, 100%.  Two [child of] constraints may be compounded fully via matrix multiplication ... or blended together. Each can have full strength at different times.
Please read the latest info in the manual.
Note that all rotation, scale, position boxes are checked intentionally.  The allows [moving] the origin of rotation for individual rectangular meshes  of the multiple mesh 3d-plane.  I believe you need this flexibility.  If you uncheck some boxes your rotation will use the original origin.  The multiple constraints will allow multiple fold simulations of a face.

The plane has a thickness which you might consider.

A Blender scene can have a hierarchy of parents, controls controlling other controls.

So parent of parent of parent .... grand parent concept may be useful to you.

Consider one or multiple armature modifiers. This is a mechanical hinged non organic animation.

I have not considered the video that carefully to suggest a (best if any) approach

You might consider more than one mesh.  I am only considering motion at this point.  Textures are a separate issue.
More to follow


This functionality was recently being worked on as part of GSOC 2014. You can view the results of the project here.

It has not yet been merged into master, but you can compile it yourself (the branch can be found here).


Noise in reflections on non-focused objects (cycles)

Multiuple Importance for Environment

I do not know how the pro-lighting skies addon works, but enabling Properties Panel / World / Settings / Multiple Importance and highly increasing the Map Resolution might reduce those noises, assuming the highlights are coming from the sky.

Composited Depth of Field

Instead of the real DOF you might try uing the Filter / Defocus node in the compositor.


how to copy and rotate already animated objects

Copy your object and parent it to an empty object, then transform the empty object.

If a copy already exists go to -> Dopesheet Editor, choose Action Editor, select the copy and choose the action from the original object.

To mirror the animation you can use negative scaling.


How can I permanently enable an addon in the userpref through Python?

Enabling the addon modifies the user preferences, those need to be saved before Blender shuts down or the changes are lost the next time Blender starts. You can use bpy.ops.wm.save_userpref() to do so:
import bpy, os
p = os.path.abspath('blenderneuron.zip')
bpy.ops.preferences.addon_install(filepath=p, overwrite=True)
bpy.ops.preferences.addon_enable(module='blenderneuron')
bpy.ops.wm.save_userpref()


How to achieve inward folding after extrude

I would go around it as to make it while Extrude you will need to place 3D Cursor in right place and Scale extrusion to it.

You can instead make it as such:

Add Solidify modifier with Even Thickness.
Apply it.
Go to Edit Mode.
Select needed faces.
I to Inset.
Delete created faces.


How to set specular intensity and hardness in Blender Internal nodes

Try this:

For the inputs on the Material node

Add >> Input >> RGB (String RGB Color Output to Color Input)
Add >> Input >> Value (String Value Output to Spec Input)
Add >> Input >> Value (String Value Output to DiffuseIntensity)

The combinations of these three can mimic and exceed the capabilities of the property sliders.

To Start with Set RGB to R:0.8,G:0.8, B:0.8

For Spec set the value to: 0.8

For DiffuseIntesity set the value to: 0.8

These values should get you pretty close (if not exact to the default material).

Specular Intensity

Without Nodes: Specular Intensity Controls the main "Light" bounce (Size/Intensity).

With Nodes: The Value of Spec correlates to "Specular Intensity"

To demonstrate this: with use nodes disabled, set Specular Intensity to 0.8.

Now toggle (enable / disable) use nodes to see the difference.

Now in the node editor change the Spec value to 1.5, now toggle again.

Hardness

With use node disabled set Hardness to 40.

With use nodes enabled in the node editor

Do the following:

Set color (R:0.55,G:0.55,B:0.55)
Set Spec: 1.8
Set DiffuseIntensity: 0.7

Now Toggle

This isn't perfect but it will be close.

The whole reason for going through the exercise is to show how NON-Intuituve these parameters are to set on their own.

You can get there, but there are parameters to consider that the property sliders just make way easy for the user.


Animating a bomb that explodes at a certain keyframe after cell fracture

Okay, so what I've figured out is that after creating my group, I had to set up the animated "Dynamic" box for when I wanted it inactive and when I wanted it active again.  After all animation had been set up, I hit ctrl+L > Animation Data and that did the trick!  Now the explosion takes place at the frame I wanted.

The key is to set all of the animations for the active member of the group BEFORE making the link to the Animation Data!

Maybe this will help others as well!


Creating Transparent Water Droplets in Cycles

Glass Shader

The Glass Shader (Glass BSDF) with it's default settings is a very good shader for water droplets in Cycles:

You will need to upload your blend file in order for me to determine exactly what is causing yours to be white. Uploading to PasteAll is very convenient and easy: http://www.pasteall.org/blend/


How to use Shader Nodetree in emissions rendering?

In bpy.data.node_groups you will find node groups that you have made, that is nodes that you have turned into a group that you can use in multiple materials.

The nodes for a light can be found in the lights data property.

light_nodes = bpy.data.objects['lamp1'].data.node_tree.nodes
light_nodes['Emission'].inputs['Strength'].default_value = 10000


cycles - different effects when order switched, even with opposite factor

Before giving you the solution, you need to understand somethings from Cycles..

When a ray from the camera is thrown to the scene, this ray will be tagged with 'is_camera_ray'!
As soon as the ray hits some object in the scene, a bunch of other rays are created, depending on the type of shader that object has (glossy rays, diffuse rays, etc).

Cycles first tries to check if the sample point on the hit object is illuminated by some light, so it throws a shadow ray directly to each light.

If this shadow ray hits another object before hitting the light, then you get a shadow of the second object in the first object.

The exception to this result is if the second object has a Transparent shader in it.

This will let the ray to continue its path to the light, and in return, the amount of light is multiplied by the transparent shader color.

This means that a transparent shader with a full white color will let all the incoming light to pass through the second object and the sample point in the first object will be fully illuminated.

Having a (0.5, 0.5, 0.5) color in the shader, will block half of the incoming light, and a transparent color of black, will block all the light in that path, which is the same behaviour of all other shaders.

Now, having a Transparent shader in the node_tree will also make it transparent to all other rays, inclusive the camera rays. To avoid this we make a switch from original material to a transparent shader only when the ray is shadow ray.

That's why we don't multiply the is a shadow ray by anything, as we want the transparent behaviour for shadows (1) and normal behaviour for everything else (0).

If you multiply the is shadow ray by 0.5, it just means that shadows rays will see 50% the top shader, and 50% the bottom shader, while all other rays will only see the top shader.

In this situation, any shadow ray will put a 1 in the is shadow ray output, which will make the Mix Shader node to output the Transparent shader instead of the Diffuse shader (which is the one visible to any other types of rays).

Since the Transparent shader has a color of white, the light will simply pass through and no shadow will be produced. Changing the transparent color will change the amount of light (and coloring it).

Solution:
Just animate the color of the Transparent shader.

read more in docs.blender.org


Those are pinned UV coordinates, they are not affected by future unwraps.

Select them and hit Alt+P to unpin. Unwrap afterwards.

https://docs.blender.org/manual/en/dev/editors/uv_image/uv_editing/layout_editing.html


While Cycles is pretty physically accurate, this is not possible, or at least not practical without workarounds, as far as I know.

Lens flares are caused by tiny imperfections in the surface of the lenses or photographic equipment, which digital 3D models don't typically have.

You can introduce them by means of bump maps, displacement or material roughness, but it will probably lead to very noisy images and require an unpractical amount of samples.

It also probably has a component of light dispersion, and since Cycles is not a spectral render it will probably require further workarounds, making the physical accuracy questionable.

You can get decent approximations using the traditional methods involving compositor nodes for glare and light aberration.

Also see Can blender be used for simple optical modeling?


Look at the rotation values for your object. Your object is rotated 180 degrees in X and 90 degrees in Z

It was rotated in object mode but the rotation has not been applied.

Apply transformations by pressing Ctrl+A and choose Apply Rotation (but you should really apply Rotation &Scale, so that the scale is applied as well)

Read: Why is it important to apply transformation to an objects data?


Check out NiMate, it's an addon that let's you motion capture with a Microsoft Kinnect and use the data in Blender.

http://www.ni-mate.com/use/blender/


It looks like you parent the door object to the Empty Sphere, am I right? Don't do it, don't parent the door to the Empty Sphere, otherwise it won't be parented to the Empty Plain Axe anymore. Only parent the door to the Empty Plain Axe and the Empty Plain Axe (and the front of the object) to the Empty Sphere. When the Empty Sphere moves, the door will follow as it is child of its child. Is it not your problem?

To make it simple, let say you deparent everything to start from scratch, now what you need to do is : 1) parent the door to the Empty Plain Axe 2) parent the front and the Empty Plain Axe to the Empty Sphere.


Your code performs infinite recursions. For every call to moveObj you're creating a thread that in itself calls moveObj again. A solution for your goal is to use a modal operator in combination with a timer to execute a function every x seconds. An example for this can be found in operator_modal_timer.py


You have to set the associated image editing program in User preferences > File first. Next, make sure that the image is saved to disk (you can use F3) and it should work.

When saving, use Save As Image and untick Save as Render and Copy but keep Relative Path.


Vertices—loop indices vs. unique indices

In Blender, Vertex Color maps don't assign a single color to each vertex but instead assign a color to each vertex of each polygon, as described in this answer by zeffii.

As you noted, loop indices are not unique. So if you want to assign a color the vertices by their unique index you would have to create a mapping of vertex indices to loop indices, i.e. for each polygon, map poly.vertices to poly.loop_indices:

import bpy
from collections import defaultdict

obj = bpy.data.objects['Cube']
col = obj.data.vertex_colors['Col']
polygons = obj.data.polygons

vertex_map = defaultdict(list)
for poly in polygons:
    for v_ix, l_ix in zip(poly.vertices, poly.loop_indices):
        vertex_map[v_ix].append(l_ix)

Once this is done, vertex_map will be a dictionary with the unique vertex indices as keys and lists of loop indices as the values. E.g. something like this for the default cube:

{ 0: [0, 8, 21],
  1: [1, 11, 12],
  2: [2, 15, 16], ... etc.
}

To assign the colors, you can now loop over the dictionary and set the color for each loop index of each vertex:

# color vertices 0 to 3 in red, all other vertices white
for v_ix, l_ixs in vertex_map.items():
    for l_ix in l_ixs:
        if v_ix in [0, 1, 2, 3]:
            col.data[l_ix].color = (1, 0, 0)
        else:
            col.data[l_ix].color = (1, 1, 1)


Accelerate and Decelerate linear Rotation

I managed to solve this with animation nodes and mapping an F-curve Value to a controller object and tying that to the rotation of the gear driver.
This the node set up I used to solve this incase anyone is wondering. Just needed to add together the total F-Curve values of each frame, this made the gears run a bit to fast so I divided them by 30 to get a better base speed. Now I can just paste the position of the sphere between to positions and the transition between Speeding up and slowing down no move slowly as expected.


Modal operator to: (A) Create surface (B) create vertex on surface

This was really complex for me, its a bit messy but i share it anyway.
Hope will help someonelse XD
Its just a script, you paste it in you script and run.
A tool and a panel will appear in your 3Dview, follow instruction for play .
https://mega.nz/file/wz4VCaaJ#7TxFvZqyeQZOFy7syu56As5RionvmfhYuTs0JvhZ8h8


Easiest way to create offset animation on a number of objects

There is the addon Animation Replicator with Offset that seems to do what you want.

I have used it before with success to create a series of objects that slowly rotate one by one in sequence.

While still relying on an add-on to create the objects, it is a tool type of addon, with a "use it once and discard" sort of workflow.

It doesn't need to be permanently installed for the animations to keep working, it just creates regular Blender animations using native features.

Once it has done its work, you can uninstall it, and things will keep working properly, afterwards, so you can freely share or reopen the file without losing your work.


Compositing video footage into a 3d scene?

It will depend on a number of things, not the least of which is your footage device. If your footage device can capture a log encoding, there’s a trivial way to get from the camera code value encoding to the reflectance level and colours that the camera saw.

In order, you will loosely need to consider the following:

Illumination of the scene. Any CGI will need to have the illumination / emissions of the scene pushed back into the CGI context. HDRIs or proper camera footage captured from the location can help with this, with further work.
Tracking. If the camera moves at all, it will require tracking.
Distortion. The camera will have a degree of lens distortion that will need to be removed, then reapplied.
Proxy geometry. For certain emission effects and shadows, a loose idea of the scene will be required in terms of geometry.
Proper footage. Log encodings that capture scene reflectance is more or less mandatory here.
Decent camera rendering transform. The CGI and the footage will need to be composited under a reasonable camera rendering transform to make the effect as seamless as possible within the limitations of your toolset.

Paul Chambers has done a fantastic series of blog posts that leads down this rabbit hole, and is well worth researching. From using loose proxy geometry to exploring how scene referred lighting ratios work, his posts are tremendously insightful. There is a wealth of information hidden away over there.


Blender crashing on one specific frame every time

In your case it is the usage of the experimental rendering that is causing the issue. The experimental feature implies possible bugs or crashes so don't worry about your scene not being set up accordingly.

Until the experimental features you are using are stable you can put the render engine back to supported. Then it renders just fine like it is supposed to.


I'm not sure I understand correctly what you mean, but I think the main problem in your walk is that your Hips bone is much too high at frame 40 and 60, which makes your walk not good at all: when the legs spread, it's like the low of the walk sinusoid, the hips are supposed to lower down much more, and thus make the knee bend more naturally, perhaps that's the problem you're talking about?


How do I get knife_project operator to use view settings within the operator?

To get this to work you need to do a few things:

To override the context of the knife_project operator (which is necessary for running it outside the 3D view UI).
To force the view to move to TOP without using the viewnumpad operator, which doesn't come into effect until your script is finished, even if you try to force redraw the scene.
So to do this, you can rotate the view directly using the 3D view's region object (this is how you set the projection vector).
Then you need to force redraw the scene in a way that's kind of risky and considered bad practice, but I know of no other way to do this (bpy.ops.wm.redraw_timer). If this is not used, the view angle isn't updated and the knife projects from the current camera view. EDIT: Well there is one slightly cumbersome way come to think of it, you can wrap this whole thing with a Modal Operator. Here's a nice example of this.

Here's how the code looks like (This code works only after you already have both objects selected, and the target object in edit mode):

import bpy
from mathutils import Euler

def view3d_find( return_area = False ):
    # returns first 3d view, normally we get from context
    for area in bpy.context.window.screen.areas:
        if area.type == 'VIEW_3D':
            v3d = area.spaces[0]
            rv3d = v3d.region_3d
            for region in area.regions:
                if region.type == 'WINDOW':
                    if return_area: return region, rv3d, v3d, area
                    return region, rv3d, v3d
    return None, None

region, rv3d, v3d, area = view3d_find(True)

# Define context override dictionary for overriding the knife_project operator's context
override = {
    'scene'            : bpy.context.scene,
    'region'           : region,
    'area'             : area,
    'space'            : v3d,
    'active_object'    : bpy.context.object,
    'window'           : bpy.context.window,
    'screen'           : bpy.context.screen,
    'selected_objects' : bpy.context.selected_objects,
    'edit_object'      : bpy.context.object
}

# Set view to TOP by directly rotating the 3D view region's view_rotation
rv3d.view_rotation = Euler( (0,0,0) ).to_quaternion()

# Force redraw the scene - this is considered unsavory but is necessary here
bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)

bpy.ops.mesh.knife_project(override)


Is it possible to change the far clip distance more than max value?

In 3D view, Object mode. Press N then change the Start and End of clip to whatever you want.


What is the best parent to use when weight painting?

The easiest, fastest method is parenting with automatic weights first and then adjusting it. It does the job fairly well, and cleaning up the weight paint should be pretty easy with your type of character.

Just make sure you apply the scale of the character mesh before applying the armature. That can definitely save some tweaking later on.


Why are my textures being applied to objects that aren’t selected?

I think all the objects have the same material, if yu add an object to the scene and instead of assigning new material sharing same material will result in this case
Or
Duplicating objects with ctrl + d instead of shift + d will also cause the same thing.


Kirbinator is on the right track. The "correct" way to do this is either to have them both in the same object, and deformed (animated) by the same armature, or to have two armatures that are both controlled by a third (you move one thing, and it moves both others).

You can just select both objects and press ctrlj to join them into one mesh, but that can be a little tricky. Experimenting with it wouldn't be hard.

Where you are now, though, it seems like the best solution would be a shrinkwrap modifier. You'll need to experiment with whether to shrinkwrap the lungs to the inside of the chest, or the chest to the outside of the lungs, but one of those should work.

The reason I mention this is that the shrinkwrap modifier has a setting for "Offset" which will shrinkwrap to a certain distance from the target, instead of to the target itself. So, for example, you could shrinkwrap the chest to the lungs, but with a 1cm gap.

IIRC, you said the lungs had the armature, in which case you'd want to shrinkwrap the chest to match the lungs. Either way, you'll want to shrinkwrap the one that is NOT rigged onto the one that is.

Hope that helps!


Can I set the default alignment for new objects to "view" (not "world")

Change "New objects" / "align to" in the preferences:


How do I change the Copyright information on a rendered file before rendering?

Looking at the Blender source code, the copyright seems to be hard-coded with the line:

  [qtexport->movie setAttribute:@"Made with Blender"

For this reason I don't think the copyright message is configurable via the interface nor via Blender's Python API, meaning the only option is to edit the copyright manually after rendering or see if you can write a Python script to do this (which would be a question for StackOverflow) and get it to execute automatically after rendering with an app.handler.


Use the technique by Nazar Noschenko in his Youtube Tutorials

Multiple Particle Systems for different parts of the scalp with few parents and many children to have maximum control.

Messy hair is the result of positional varation and well-placed hair strands (parents). I'd advise to use multiple systems for "types" of hair.
Messy realistic hair will have many additional properties (which can be easily researched on the internet and the manual):

varying length
varying thickness
varying clumps
varying positional color
varying color along the strand

I will only focus on the first positional variation. I would also limit the children to the simple method.

 Top: Interpolated, Bottom: Simple
If you require the strands to end neatly as if trimmed by scissors, you will have it easier using interpolated children. If you want to be able to part the hair or create individual strands with greater control, you should use simple children.

I have color coded the systems with different settings. Use at least seven segments for the hair to gain control when editing the strands shape in particle edit mode.

Base Layer
With only jittery (messy) hair, we will have difficulty covering all of the scalp. I added a base layer (scalpA and scalp B) to cover the scalp intially.

Use the Clump curve to clamp the ends of the hair together. This way, we can prevent stray hairs from penetrating the hairband. I also added a slight amount of roughness to randomize the hair. If you don't add roughness, the hair will be to uniform and quickly form bands around the parents, which almost look solid.
Ponytail
I added another particle system for the ponytail to have more control over it. The children for the ponytail have a larger Radius, since the hair at the ponytail is more loose. (The hair on the scalp is tightened by the hair band.) In particle edit mode, I varied the length of the parent strands. Using the clump curve, I clumped the particles together at the beginning to prevent the hair from intersecting the bands. This is the reverse of the scalp hair, which gets clumped at the end. I also increased the random value, but set the threshold to ~50%. This means, that only 50% of the hair will be randomly offset. The result are clear strands in the ponytail, with 50% of the hair jittered more randomly. This supports the notion of some hair beeing distributed when the ponytail is tightened due to friction and some hair straightened, because it gets pulled.
To move the roots, disable Preserve Roots temporarily.
Scalp Overlay
Moving on to the more messy jittered hair, let's overlay another system above the scalp systems. I used very few parents with very large children Radiuses. The clump curve decreases towards the end and a high random value is used. When combing the parents, I tried to introduce more variation in direction. Most strands conform with the scalp layers at the first segments, but go in other directions thereafter, which would come from the hand brushing against them and/or gravity pulling them downwards.

Strands
After the base layers, I would add more refined layers, which apply to the specifications of the character.
Hero Strands
Hero Strands stick out. Using the clump curve, they initially grow thinner, which increases the density and makes them more refined. You can use them to set accents. They have to be distributed manually and with care, as they are easy to distinguish. Use varying length and shapes and don't put to many hero strands next to each other.
Messy Strands
The messy strands aren't really strands, but rather parents which control a bunch of disconnected hair. Just like the hero strands, I would distribute them manually according to character specifications. They use high values for Random and for Endpoint. The endpoint property scatters the children at the ends. With this system, we can add singular hairs to multiple locations. I use it for short hairs or hair ends, where the hair did not fit into the hairband and is too disorganized.


In the Viewport Shading switch your settings back to default, and in the Render settings > Indirect lighting, delete the Lighting Cache.


How can I change the particles density and its direction in volume?

Use weight painting to create a vertex group which will control density of the particles or create new texture in the particle system settings.

Weight painting

Prepare mesh topology

Weight paint affects on vertices, so in order painting to be smoother you'll need a lot of vertices. The more of them, the smoother will be painting, and so distribution of particles.

Use loopcuts or Subdivision Surface modifier to make topology of the mesh more dense.

Use Weight painting to determine how to spread particles

Create new vertex group (or it will be added automatically), switch Object mode to Weight Paint and use brushes to paint areas where you'd like particles to be located more dense. Weight of 0 will make no particles in that area, weight of 1 will make to add maximum amount of particles (if the vertex group effect isn't inverted).
You can also use Weight tools, located in Tools panel (opened with T) to mirror, invert, normalize weights etc.

Set created vertex group to control density of particles

In Vertex Groups scroll locate Density field and choose created vertex group.

Note that you could also invert vertex group influence, to make particles being distributed in the top of the mesh instead of bottom (button just near the dropdown menu where you choose vertex group to affect).

Use texture to control particles' density

In the settings of the Particle system create new texture:

For simple setup Blend texture may be used. Moving control points of the ColorRamp will make density of the particles change.

The last thing is that by default this texture affects only time, not density. So in the Influence scroll check Density (you can leave Time if you need it).


If anybody runs into the same problem in Eevee where the cpu is overloaded while rendering check your Compositing mode and make sure you don't have a Denoise filter on. It doesn't create a problem when you render in Cycles but it does put stress on the cpu when rendering with Eevee.


Since you are modeling the hair and going for an anime style. The Solidify modifier should do this quite well. It might seem subtle but you will get the depth you want.

Flat mesh hair.

Mesh hair with solidify modifier.
After using the modifier, you can apply it and tweak the mesh even further to get better results. Using the modifier is better than just extruding and tweaking as it will do this evenly for your entire mesh.
You can get some unique styles as well if you smooth the hair with a subsurf modifier and play with the settings.


Why are my preview renders good and my actual renders totally black

Sorry... I'm an idiot.  In case there is anybody else out there who might benefit from this.  I decided not to render the window panes and so i didn't make them transparent and I clicked the little eye icon to hide it in the 3D view.  So when you do a preview render in cycles it gives you a preview of what is visible in the 3D view.  However hiding something in 3D view doesn't mean that it won't render.  So my non transparent windows that were hidden in the 3D view were blocking the sunlight from coming into the room.  Lesson of the story is hit the little camera icon next to an object in the Outliner to make it invisible to the rendering engine.

Thanks again for the responses.


One rough way could be to apply the pose as rest pose (CTRLA) and then export. Then undo if you wish to revert to the original rest pose.


python subprocess to ffmpeg/ffprobe errors

This works fine on my machine (Win10, Blender 2.79, ffmpeg 3.2):

import bpy
import json
import subprocess

def find_video_metadata(video_path: str) -> (int, int):
    """Find the resolution of the input video file."""

    ffpath = r"C:\cygwin64\home\Sybren\ffmpeg\bin\ffprobe.exe"

    args = [ffpath] + "-v quiet -print_format json -show_streams".split() + [video_path]

    # run the ffprobe process, decode stdout into utf-8 & convert to JSON
    ffout = subprocess.check_output(args).decode('utf-8')
    ffinfo = json.loads(ffout)

    # prints all the metadata available:
    import pprint
    pp = pprint.PrettyPrinter(indent=2)
    pp.pprint(ffinfo)

    # for example, find height and width
    height = ffinfo['streams'][0]['height']
    width = ffinfo['streams'][0]['width']

    print(height, width)
    return height, width

fname = r"A:\RIP\prooi\title03.mkv"
print(find_video_metadata(fname))

I've changed a few things:

Not used shlex to parse the string we construct ourselves. Since you didn't quote the filenames containing the space, my bet is that shlex couldn't split it properly. By avoiding this altogether and constructing the argument list explicitly, it just works.
Using 'raw' strings using the r"" prefix avoids having to double every backslash.
I like using different names for different things. I split the doubly-used ffprobeOutput name into ffout (which is a bytes object) and ffinfo (which is a dict).
Not overriding the built-in name file.
Using PEP8 for naming (so no camel case for function names and local variable names).
I added type declarations to the function.
Turned the comment into a docstring, and removed the "function to" bit of it; the "def" keyword already indicates that it's a function, so there is no need to repeat that.


You have to change the frame in your for-loop via Scene.frame_set():

bpy.context.scene.frame_set(f)

By the way, I would not use obj.location, rotation_euler etc. because they do not contain the final location, rotation and so on.
For example, parent your camera to an object, then rotate the object - the camera.rotation_euler will not change.

You should use obj.matrix_world instead (if you need it separated, decompose this matrix with to_location, to_euler etc.)


Driver variable prop (ID-block) : referencing the current object

In blender 2.78 (and maybe earlier) there is now the use_self option when setting up a driver.

And with a test script

import bpy

def x(self):
    print(self)
    print(getattr(self, "location", None))
    return 0.0

bpy.app.driver_namespace["x"] = x

After adding the driver expression x(self) to a driver on a cone mesh and a material's emit it prints the following to the system console

<bpy_struct, Material("Material")>
None
<bpy_struct, Object("Cone")>
<Vector (0.0000, 0.0000, 0.0000)>

and to return  custom prop value, or 0 if there is no custom prop of that name.

def x(self):
    prop = self.get("toggleRedWhite", 0.0)
    return prop

PS. the data_path of a custom property is '["toggleRedWhite"]' How can I add drivers for custom properties?


No, it's not possible to do this in Cycles, it will first evaluate the material nodes entirely, and then compute the lighting.

Supporting this would be incompatible with progressive rendering and bidirectional lighting algorithms, and so physically based render engines usually can't do this.

For the earth example, a workaround would be to use a Normal node Dot output, with the Geometry node Normal output plugged into the Normal input. If you then set the direction to match the sun light it will give you a factor than can be used for blending.


Anyone else having wrongly named boolean settings?

This can't be normal right?

Funny, it is because of normal(s). Recalculate surface normals with Ctrl+N in editmode. Also make sure the scale of the object is not negative (apply scale Ctrl+A)

Normals specify what is considered outside and what is considered inside of mesh. Booleans take this into account.


Help! Transparency and refraction not showing up in viewport like tutorial

I figured it out. I had to turn OFF Screen Space Refraction for my apple. Multiple layers of refraction don't work in the viewport it seems. Hopefully this helps someone! :)


Double clicking to do the 'edge ring' or 'edge loop' selection in Blender 2.8

Enable "Emulate 3 Button Mouse" in Preferences > Input to get double-click loop selection back. There's a discussion on the dev forum about it. Basically, double-click broke two features – Selection Cycling and Select All Boundaries – according to the developers, which is why they disabled it without having 3 Button Mouse emulation enabled.


The 'ghosting' is caused by mixing glass with transparency.
Use a simple Glass BSDF shader instead, and it should work.


How to transfer an animation from a tree of empties onto an armature (space conversion)?

Now I got it!

Bones are calculated using this code. Then the rotations are corrected locally, and finally the bones are rotated into the desired spot as if you rotated the whole skeleton in object mode and applied the rotation.

Overview:

#first create the matrices to correct the transformations
matrix_swap = mathutils.Euler((math.radians(90), 0, math.radians(90))).to_matrix().to_4x4()
rotateback = mathutils.Euler((math.radians(-90), math.radians(-90), 0)).to_matrix().to_4x4()

#create and pose the bone
bind = matrix_swap * bind * matrix_swap.inverted()
tail, roll = mat3_to_vec_roll(bind.to_3x3())
bone.head = bind.to_translation()
bone.tail = tail + bone.head
bone.roll = roll
bone.transform(rotateback)

#bring the keyframe into the right space
#we must make this matrix relative to the rest pose to conform with how blender bones work
key_matrix = fallback_matrix[bone_name].inverted() * key_matrix
key_matrix =  matrix_swap * key_matrix *matrix_swap.inverted()

The complete importer code is available on github.

Below is my original answer:

Not really an ideal solution, but at least progress.

This brings the keyframe from relative to the parent space into relative to the bone's own rest pose space:

key_mat = node_rest_mat.inverted() * key_mat

The keyframe would then work on the bone if the bone was oriented like the empty.

So I tried to orient the bones like the empties, ie. give them the same local orientation. I could not get it to work with the following 'reliable' bone creation code that I'd like to use:

 bone.head = mathutils.Vector((0,0,0))
 bone.tail = mathutils.Vector((1,0,0))
 bone.transform(node_bind_matrix_worldspace)

Probably I was doing wrong matrix math with the bones... Instead I had to resort to this answer. I have used that in previous scripts but discarded it in favor of the above code, as manually calculating head, tail and roll tends to mess up the roll on some bones.

I will keep at it and see if I can do it with a nicely aligned skeleton...


How to import model along with embed texture in blender?

first: Activate the node add ons
Second: In shader editor: click in principled bsdf, after press shift + ctrl + t, and select all texture


I have solved the problem by myself. What you need to do is to set the Rotation mode of the bones to be Quaternion, instead of Euler.


Smoke physics interacting with particles?

Yes, this is what the "smoke flow" force field is for. Add one, point it at your smoke domain, and make sure hair dynamics is enabled on your particle emitter. If you don't want your hair to fall down due to dynamics being enabled, set the "gravity" field weight in the particles tab to 0. Note that all objects involved need to be on a single layer or else it won't work.


How to convert SpaceView3d.lens to field-of-view?

To convert focal length to field of view you need to know the sensor size. The formula is as follows:

FOV = 2 * arctan(half_the_diagonal_of_sensor / focal_length)

See this in Blender's code.

So that means your field of view is dependent on the size and aspect ratio of the 3d View window.

Best way how you could approach this is to cast a ray into the scene from one 3d window corner and measure the angle to the ray that is in center of screen (basically to the local Z axis of viewport).

you get the 3d rays like this (snippet from a modal operator - you will have to overwrite context for your application):

import bpy
from bpy_extras import view3d_utils

region = bpy.context.region
rv3d = bpy.context.region_data
pixel_coords = (0,0)

ray_vector = view3d_utils.region_2d_to_vector_3d(region, rv3d, pixel_coords)

view_camera_loc = rv3d.view_matrix.inverted().translation
look_at = rv3d.view_location
view_local_z = look_at - view_camera_loc

you measure the angle between the ray_vector and view_local_z


How can i hide the references lines on a bezier curve?

You can hide the path normal markings by pressing N and then finding the Curve Display section. Under that un-tick Normals. If you were referring to the handles (the red line), then that option is the next checkbox.


Blender's particle system is.. weird. It's a more little old and probably could do with a refactor. Among other things, the axis are wrong.

However, that doesn't mean it can't be made to work:

Switch to emission particles
Enable rotation

Rotate your emitter polygons so that their surface normals are aligned with the +Y axis of the instance:


Render objects to separate files using python

Wrote my first lines of Python to answer this.

It is pretty straight forward.  The assumptions for this script to work is that
1) all you objects are on the first (0th) layer
2) you have selected the objects you want rendered.

import bpy

selected = bpy.context.selected_objects

for obj in selected:
    obj.layers[19]=True
    obj.layers[0]=False
index = 0
for obj2 in selected:
    obj2.layers[0]=True
    obj2.layers[19]=False
    print(index);
    bpy.data.scenes["Scene"].render.filepath = '/ur/path/here/render_%d.jpg' % index
    bpy.ops.render.render( write_still=True )
    obj2.layers[19]=True
    obj2.layers[0]=False
    index+=1
for obj in selected:
    obj.layers[0]=True
    obj.layers[19]=False

This code simply first moves all the selected objects from the first to the last layer. Then, one by one, moves each object back to first layer, renders it into a unique file, then moves back to last layer.  Lastly, moves all objects back to the original layer.

Note: on OS X to render into your Documents folder the path would look something like '/Users/username/Documents/render_%d.jpg'.


How to build a website to upload and download file from blender by python?

Start with downloading

It's a lot easier to get content from the web than it is to post to the net.  So we'll start there.

For more info than you can poke a stick at search google et al with

download files with python

Simple example uses python requests to download this question's page source into blenders text editor.  Any file that can be browsed  can be downloaded in this way.  For this can choose any web hosting.

import bpy
import requests

url = 'https://blender.stackexchange.com/questions/160565/how-to-build-a-website-to-upload-and-download-file-from-blender-by-python'
r = requests.get(url, allow_redirects=True)

t = bpy.data.texts.new("Question")
t.write(r.text)
bpy.context.space_data.text = t

Uploading is trickier, generally requires passwords etc, and is probably outside the scope of BSE.


Prevent texture deformation when mesh deforms

So I took Todd McIntosh's advice on messing with the mesh to try to prevent it from deforming, and I have (IMO) good results:

This image has the top and bottom of the mouth not closed at all, but the sides "fully" (only partially due to how my texture will work) closed using shapekeys.

Basically loop cut and slide a ring around the edge, then from the loop extrude and scale in.  Make sure to only scale in on the X and Y axes, or whatever two axes you want to prevent the surface from bowing in.

I have the shapekeys set up so that the sides of the mouth can't come more than halfway to the center, but the top and bottom can go all the way.  There is a little bit of intersection if you have the top mostly closed, and the sides all the way in, but for my purposes, I can work around that.

And here is a blend file with some shapekeys and vertex groups if you want to test.


Color grading/matching strips in the VSE

There are 2 ways to do this:

You could stack the strips above each other and make a new preview window for each strip. At the bottom of the preview window is a channel number, simply set this for the strip you want to see.

Or you can make 2 preview windows and turn on the Ghost offset function in the preview window. Simply turn on the ghost button and enter the frame offset so the black line lands on the shot you want to compare. Then toggle down the Overlay menu next to the offset and select "reference". The other preview window should show "Current", this will display whatever the green play indicator is stopped on.


How to find the pixels of a texture for a certain face

By the sounds of it, you just need to optimize what you have.

Some suggestions.

Don't check every pixel, at the very least calculate a bounding box around the face's UV's and only check those pixels.
Rather then do a point-in-polygon test for each pixel. Use a scan-line method. See:  Darel Rex Finley's Efficient Polygon Fill, Or Blenders version of it fill_poly_v2i_n

Note that being a scripting language Python isn't ideal for these tasks - but it can likely be sped up enough to be usable as long as you don't need real-time feedback.

Update, made a more efficient version of Darel Rex's algorithm, see link.(avoids looping over all coordinates for each y-pixel).


Mirror modifier - the mirrored half is darker

I found the solution: the issue was caused by the plane's rotation.

It seems like the Mirror Modifier doesn't work when the mirror object is rotated, so I needed to apply the rotation of the plane to make it work


Rotation and Scale have suddenly stopped working?

The cause is the manipulate object centers only button (Alt,):

When it is selected, scale and rotate no longer function normally.

Instead, of or rotating the mesh with the object origin, only the origin moves:


As Timaroberts mentioned in the comments, the entire graph is little more than shown in the image. Here it is with the most basic setup - note the blend modes I have highlighted on the right - these are necessary for transparency:

EDIT - This is the proper connections for the image you posted in the comments:


How to create a "Airbrush-like" Shading Material

EEVEE only answer!

As it's hard to create such material in Cycles as you posted above, it's fairly easy to achieve it in EEVEE (for now only in Blender 2.8 Alpha 2).

For Cycles answer you can check here: Is there really a way to make a true toon shader material in Cycles? Many nice examples provided.

Node setup and overview.

We are using here Specular BSDF to get simple shading and convert it to colour through Shader to RGB. From it we are making two "channels" for separated highlights and shadow using Color Ramps.

After that we are combining those "channels" with Noise and then mixing them to get final "mask".

At the end we have Color Ramp with our colours. From left: shadow, main and highlight. And connect it to Emission shader.

Optionally you can add some Contrast or Saturation, or anything to improve result.


Noise issue when baking ambient occlusion to texture on spherical UV map

I figured it out. This effect occurs because these areas are "overhanging" from the point of view of a spherical projection. Pixels that would be on dark faces from inside the hole and light faces from the surface are all getting mixed up together because they share the same space on the UV map.

So, the solution is to choose a UV mapping where the projections of the faces do not overlap.


.blend Files won't open but it asks me how i want to

You could open this file by going into Blender and clicking "file" And "open". You can then navigate to the file where you can click it and then "open". This should open the file.
Hope this helps!


Apply or inherit view settings of parent object

Holding Shift while clicking the view icons in the outliner does exactly what I was looking for.
Sometimes you can look for so long, and right after you ask for help you find the answer immediately :D


Set the profile

basically your issue was using the default value of 0.0 for the profile property of the bevel operator. I have set it to 0.5 below. Might be a contender for another operator property.

Test code including, what I believe are simpler, routines for finding parallel edges and the vertices they contain. also added some notes re upgrading to 2.8

import bpy
import bmesh
from mathutils import Vector

from bpy.props import (
        BoolProperty,
        BoolVectorProperty,
        FloatProperty,
        FloatVectorProperty,
        IntProperty,
        )

#Test if edge e parallel to vector v:
def parallel(e, v, eps=1e-6):
    # normalized edge direction vector
    d = (e.verts[1].co - e.verts[0].co).normalized()
    return abs(v.normalized().dot(d)) >= 1 - eps

class MESH_OT_primitive_bev_cube_add(bpy.types.Operator):
    '''Add Beveled Cube'''
    bl_idname = "mesh.primitive_bev_cube_add"
    bl_label = "Add Beveled Cube"
    bl_options = {'REGISTER', 'UNDO'}

    length = FloatProperty(
            name="Length",
            description="Box Length",
            min=0.01, max=100.0,
            default=4.0,
            )
    width = FloatProperty(
            name="Width",
            description="Box Width",
            min=0.01, max=100.0,
            default=3.0,
            )
    height = FloatProperty(
            name="Height",
            description="Box Height",
            min=0.01, max=100.0,
            default=2.0,
            )
    bev_seg = IntProperty(
            name="Segments",
            description="Bevel Segments",
            min=1, max=100,
            default=3,
            )
    bev_offset = FloatProperty(
            name="Offset",
            description="Bevel Offset",
            min=0.01, max=100.0,
            default=0.125,
            )

    def execute(self, context):

        #Make the cube object stuff:
        mesh = bpy.data.meshes.new("cube")
        cube_obj = bpy.data.objects.new("Cube_Obj", mesh)

        scene = context.scene
        scene.objects.link(cube_obj)
        #scene.collection.objects.link(cube_obj)
        bm = bmesh.new()

        #Add the cube:
        bmesh.ops.create_cube(bm, size=0.5)
        #Apply size:
        bmesh.ops.scale(bm,
                verts=bm.verts,
                vec=(self.length, self.width, self.height))

        #First, get the verts and edges:
        x_axis = Vector((1, 0, 0))
        e_geom = [e for e in bm.edges if parallel(e, x_axis)]
        v_geom = set(v for e in e_geom for v in e.verts)
        #Now bevel:
        bmesh.ops.bevel(bm,
                        geom=list(v_geom) + e_geom[:],
                        offset=self.bev_offset,
                        offset_type=0,
                        # offset_type='OFFSET',
                        profile=0.5,
                        segments=self.bev_seg,
                        clamp_overlap=True)

        bm.to_mesh(mesh)
        mesh.update()

        return {'FINISHED'}

def menu_func(self, context):
    self.layout.operator(MESH_OT_primitive_bev_cube_add.bl_idname, icon='MESH_CUBE')

def register():
    bpy.utils.register_class(MESH_OT_primitive_bev_cube_add)
    bpy.types.INFO_MT_mesh_add.append(menu_func)
    #bpy.types.VIEw3D_MT_mesh_add.append(menu_func)

def unregister():
    bpy.utils.unregister_class(MESH_OT_primitive_bev_cube_add)
    bpy.types.INFO_MT_mesh_add.remove(menu_func)
    #bpy.types.VIEw3D_MT_mesh_add.remove(menu_func)

if __name__ == "__main__":
    register()

Please note it is standard practice to set the newly created object to active and selected, as well as selecting the new geometry created.

2.7x https://blender.stackexchange.com/a/102239/15543

2.8 https://blender.stackexchange.com/a/133880/15543


Choosing a video file format when rendering doesn't work

My other answer explains how to render a video (with Sound) in general. You need to make sure in your case that in your Properties Editor > Render tab in the Output Panel your filename is set properly. Most likely it is set to something like file.dvd right now which results in your described behaviour. Change it to //file.mp4 (to get it rendered out next to your blend-file) for example:


Cycles Error: Cuda failed to find version number

Run nvcc on the command-line with option --version. It should show some version information similar to:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2012 NVIDIA Corporation
Built on Tue_Sep_25_09:18:50_PDT_2012
Cuda compilation tools, release 5.0, V0.2.1221

The most important part is the last line Cuda compilation tools, release 5.0, V0.2.1221. Cycles looks for the first part Cuda compilation tools, release. If this cannot be found, then Cycles gives up with the error you pasted.

If it is different (and based on your output the entire version string is even empty), then you need to contact the package creator to report a bug.


Placing mesh in the scene renders it white

Problem was in composting nodes, modifying the default nodes that are created after setting up tracking scene solved the problem.


Blender Game Engine toggle FullScreen with script

I test it and yeah it enter 'FullScreen' and then deactivates.

I assume that you was using a always sensor wich will trigger twice combined with a mouse click sensor.

To make it work the logic:

The script:

from bge import logic, render

left_click = logic.getCurrentController().sensors['MouseLC']
mouse_over = logic.getCurrentController().sensors['MouseOver']

if mouse_over.hitObject and left_click.positive:
    if render.getFullScreen():
        render.setFullScreen(False)
    else:
        render.setFullScreen(True)

If you want bge in front all instuctions.

import bge

left_click = bge.logic.getCurrentController().sensors['MouseLC']
mouse_over = bge.logic.getCurrentController().sensors['MouseOver']

if mouse_over.hitObject and left_click.positive:
    if bge.render.getFullScreen():
        bge.render.setFullScreen(False)
    else:
        bge.render.setFullScreen(True)

if you dont want left_clikc and mouse_over

import bge

if bge.logic.getCurrentController().sensors['MouseOver'].hitObject and bge.logic.getCurrentController().sensors['MouseLC'].positive:
    if bge.render.getFullScreen():
        bge.render.setFullScreen(False)
    else:
        bge.render.setFullScreen(True)


Probably the easiest way to do this is to manually cut it out. In edit mode, press K to bring up the knife tool. Cut along where you want and press Enter when you're done. You can then delete the face you want.

To get straight lines, press C while in Knife mode for constrained angles.

If you want a cleaner mesh with only quads, use the knife tool again and connect the vertices from where you cut to the edge of the plane. Repeat this with each vertex to create quads.


Is there a way to get the exterior surface of a complex model in Blender?

There are at least three ways to do this. One is to select the whole object, and apply the decimate modifier; another is to create a pair of planes, one above and one below, and apply to the planes a shrinkwrap modifier. The third method is to use the retopology idea offered by @poor. However, while any of these might yield suitable results, they each require a certain level of mastery of Blender to be able to do. In my view, you'd be well served to spend some time mastering Blender, before you attempt what you are trying to do.


Mesh in object mode shows up with 0 vertices, help?

For some reason there was only 1 layer in the scene selected in the render layers tab which caused this issue. I've selected them all again and the issue fixed itself.


How to use the outset option from the inset command?

The Outset option is when you want a new region of faces to appear outside the selection instead of inside. At first I start doing a normal inset on the face and then press O to toggle Outset:

You can see at first new faces are appearing inside until I press O and then new faces appear outside the selection.

Presumably, this simply doesn't work at the minute when there is no geometry outside the selection to outset into.


Ortho Viewport is rendering some hidden/covert Edges in Edit Mode

The problem is the clipping. I'm not sure whether it's a bug or not but lowering the end value solves the issue. Your clip value

lower clip value


How to animate folding a paper plane in blender 2.8

You could try assign the model with shape keys. You can assign some bones to the shape keys and with some drivers that could fold up each section, with out going through each side one at a time, and key frame it later.


2.7 -- Rigging model and not seeing "Deform" section in Armature >> Object Data >> Skeleton

The deform section is one icon over from where you are in that picture, on the properties panel.  Click on the 'bone' icon, the deform will be there.  By the way, that tutorial is out of date, and you might just want to uncheck the VG group in your armature modifier settings to get full deformations going.


You can scale to uniform scale by pressing ctrl + A in Object mode. Select apply scale and unwrap again.


Is there a way to split a hollow mesh by faces?

You can:

AltE then "individual faces"
Don't move the extrusion just validate it
Invert the selection CtrlI to select the base vertices
X delete vertices
A to select
E to extrude
Again don't move the extrusion just validate it
S to scale
P to separate by loose parts


Unwrap shortcut U in UV Editor works only if any UV Map already exists.
If in Properties Editor > Data > UV Maps is not listed any, it does nothing.

By default new objects are unwrapped, so if you modeled them and then just updated UV Map it works from UV Editor as well.


How to force creases into a cloth object?

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

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

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


How to Fix Axis of Armature Without Wrecking Mesh?

You should just be able to correct bone roll in edit mode, which won't deform the mesh. This may still cause issues if you have some constraints specified in world space, but should otherwise be fine. In python this would be changing the EditBone, not the PoseBone.


That really depends on how the value is stored internally.

Blender already have operator for toggling Boolean values, like bpy.ops.wm.context_toggle. This operator alone is applicable to modify lots of properties, like active 3D view space's Only Render (space_data.show_only_render) or scene's Simplify (scene.render.use_simplify).

Some other settings may look like binary values of some property, but in fact not. Face shading is actually only accessible as two operators: faces_shade_flat and faces_shade_smooth. To toggle between both states, you'd have to write a new operator that toggles which of the two operators to execute based on another property, like a custom BoolProperty inserted to a Mesh object.


How to get Mirrored-Repeat texture extension / UV in 2.8

At its simplest, with a UV map like this:

.. which I think is equivalent to yours?
Then all you have to do is put a Math > Ping-Pong node in the way of the X and Y outputs of the UV texture space, on the way into the image:

If you find you need to tweak offsets, scales of the repeat, you may find it easier to wrap Ping-Pong up with something like the 'Triangle Wave' group you can download from this answer.
If you have several different UV maps, then instead of the Texture Coordinate input node, you would use a UV Map input node, to select the right one.


How to create a distorted reflection glass?

I don't know about the physics of such glass, But it can be created using standard bump mapping.

The light path is not necessary here, but just to be cautious ...


My lowest panel is changing from the editor window to the rendered view

It turns out the problem was that I had a combination of two issues.

Firstly, I have about 3 minutes of blank video so rather than showing black the preview window shows the gray background that is throughout Blender. This made me assume it wasn't working because it was not black, but really it was just transparent.

Secondly, I set it again, then left to make dinner. Turns out it takes a long time to start up (I guess). I've watching it right now and it is creating the video at about 2/3 speed of original footage in the preview. This is largest video in blender by about double in time and also my first 1080 rather than 720. I guess I was just too impatient.

The important thing is I learned some stuff today. :)


Animating rocking horse with a spring base

Can be done with one spiral curve and a few modifiers, order is important

add Extra curve (addon) > Spiral
search Convert to Mesh
deform by Simple Deform modifier > Bend
add Skin modifier (after deform so spring is not squized/stretched)
add Subdivision Surface modifier is needed to smooth shape

Animate Deform Angle in Simple Deform modifier properties. For nicer result you can use Elastic keyframe interpolation T on animation curve in Curve Editor.

For a bit more advanced spring shaping you can try also this similar technique here.

Or for easy animating things like spiral cabel I highly suggest Armature, generated by aawesome addon Armature from Edge Loops, that generates armature inside of spring, but I'm not sure if ported to 2.8x version
Tutorial with blend can be found here
https://blenderartists.org/t/phone-cable-with-armature-in-3-min/520741