Python to Replace Skechup Material to Cycles Material

Every object has a list of materials it uses in it's material_slots property, this is shown in the material properties, each slot contains the material used. By looping through this list you can change the material assigned to each slot.

I would setup a dictionary of old-to-new names to use for the conversion process.

import bpy

matnames = {
    'OldMaterial.01': 'NewMaterial.01',
    'OldMaterial.02': 'NewMaterial.02',
    'OldMaterial.03': 'NewMaterial.03',
    'OldMaterial.04': 'NewMaterial.04',
    'OldMaterial.05': 'NewMaterial.05',
    'OldMaterial.06': 'NewMaterial.06',
}

for obj in bpy.data.objects:
    for slot in obj.material_slots:
        slot.material = bpy.data.materials[matnames[slot.material.name]]


How do I remove world lighting for a certain object?

I'm not sure if this is possible, but a workaround would be to render that object without the world background (transparent, etc), and then add it onto the world background and whatever other objects you have in your scene in the compositor.

Someone else may have a better answer that actually solves what you're asking for, but this is a solution that would work.


To animate the puddle jumper coming through the stargate you could use a boolean modifier to hide it behind the event horizon.

Create a cylinder big enough to enclose the puddle jumper and place it behind the stargate.
Add a boolean modifier to the puddle jumper and select the previous cylinder as the object and set the operation to difference.

Disable the renderability of the cylinder so that it isn't seen when rendering, or you could give it a transparent texture.

Edit:
The easy way doesn't always work. As the boolean modifier doesn't always give a good result with some meshes, it can be better to do it in compositing. By giving the hideout mesh an object index you can use it to create a mask in the compositor. This answer explains using an object ID to composite multiple objects together.

First you want the background to be transparent, by enabling transparent in the film settings (part of the render settings).

Enable Object Index in the render layers.

Then give the object an index number.

Now in the compositor you can add an ID Mask node and connect that to the IndexOB and set the index number to match the number you set for the hideout object. The little box in the mix node will combine the alpha from the render and the mask.


How do I create a 10-sided die as one object?

Fastest manual method for me so far, can be done under a minute with ease (faster if the settings in operators have been pre-saved):

Add a Cone with such settings:

Select the base vertices (Z for wireframe mode), move them 1.0 units up in Z, hit . for 3D cursor Pivot center, duplicate all with CtrlD and rotate with R 180°. Remove doubles with W5. This is what you should have:

Select every other vertex on the perimeter and the bottom vertex. Move 0.19 units up in Z.

Select all faces, hit AltJ to merge to quads. For Max Shape Angle input 50°:

Center the thing in object mode with CtrlShiftAltC Origin To Geometry and AltG. You are done with the dice:


I found the following code to create a ellipsoid by using sin and cos.
But i need to define the ellipsoids surface by using the formular:
z(x,y) = abs(p/w)*sqrt(w^2 - 4x^2 - 4y^2)
while p is the projection in z-direction and p is the diameter from the ellipsoid.

This ist the code I found:

import bpy
import bmesh
from math import degrees, radians, sin, cos, tan
from mathutils import Vector

class CoordsPoints:
    @property
    def xyz(self):
        theta = self.theta
        phi = self.phi
        x = sin(theta) * sin(phi)
        y = cos(theta) * sin(phi)
        z = cos(phi)
        R = self.R
        return R * Vector((x,y,z))

    def __init__(self, R, theta, phi):
        self.R = R
        self.theta = theta
        self.phi = phi
        #self.xyz = self.point(theta, phi)

    def __repr__(self):
        return "Coords(%.4f, %.4f)" % (degrees(self.theta),
                                               degrees(self.phi))
# define the ellipsoid method.
def ellipsoid(a, b, c):
    def ellipsoid(v):
        x = a * (v.x)
        y = b * (v.y)
        z = c * (v.z)
        return Vector((x, y, z))
    return ellipsoid

# make the ellipsoid bmesh
bm = bmesh.new()

# TODO come up with a nicer way to do this.
rings = [[CoordsPoints(1, radians(theta), radians(phi))
                 for theta in range (0, 360, 2)]
                 for phi in range(0, 180, 2)]

h = ellipsoid(1.0, 1.0, 1.5)

verts_mesh = [bm.verts.new(h(p.xyz)) for p in rings[0]]
verts_mesh.append(verts_mesh[0])
for ring in range(1, len(rings)):

    verts_mesh_face = [bm.verts.new(h(p.xyz)) for p in rings[ring]]
    verts_mesh_face.append(verts_mesh_face[0])

    faces = [
        bm.faces.new((
            verts_mesh[i], verts_mesh_face[i],
            verts_mesh_face[i+1], verts_mesh[i+1]
        ))
        for i in range(len(verts_mesh) - 1)
    ]
    verts_mesh = verts_mesh_face

# create mesh link it to scene
mesh = bpy.data.meshes.new("ellipsoid")
bm.to_mesh(mesh)
obj = bpy.data.objects.new("ellipsoid", mesh)
scene = bpy.context.scene
scene.objects.link(obj)
scene.objects.active = obj
obj.select = True
obj.location = scene.cursor_location


Can you make particles affect a rigid body?

Normally, no - particles do not impart any force on a Rigid Body. However, I'm currently working on a patch to Blender to do just this. It's only experimental at the moment but I've made some good progress. Also trying to get interaction with Soft Body and Cloth and looking to improve the collision between Rigid Body and Soft Body/Cloth as that's also currently lacking. I'll add more when I've anything to add but for now here's a little teaser :


Create duplicates of objects and give them different rotation

For those who find this page and need an answer
I figured out that the best way to solve my problem
was to AltD copy elements.
When you do this, if you change one of the elements all the others change as well.

You can then easily add another mesh to any of the meshes.
And it will then add them across all of the other ones! :)

This makes use of the "Object Data"

Which you can also copy from others just like materials and modifiers.

Hope that helps! :)


Every aspect of the time that a render takes is highly dependent on the setup of your scene, your render settings, and the hardware that you are rendering it with.

Are you rendering with Blender Internal, or Cycles? Blender Internal takes a long time to compute things like reflected light and ambient occlusion, and is limited to being able to render only on the CPU - and only on a single thread of the CPU for certain calculations. Cycles on the other hand, is much faster for computing reflected light and ambient occlusion, and can take advantage of a hardware acceleration on modern video cards to get hundreds of time better performance than rendering on the CPU.

The complexity of your meshes will effect the number of bounces a light path takes, and the complexity of your materials will effect the work that needs to be completed for each bounce. Try working through some tutorials on optimizing your renders.

For Blender Internal:
http://www.blenderguru.com/articles/13-ways-to-reduce-render-times/

For Cycles:
http://www.blenderguru.com/articles/4-easy-ways-to-speed-up-cycles/

You may also be giving each CPU thread or GPU too much or too little work to do with your render tile sizes. For CPU rendering, smaller is better - Something like 32x32 or 64x64 may work well. For GPU with Cycles, I have had good luck with 240x240 on my 780Ti's, and 240x120 on my 980's, and generally decent performance at 120x160 on all of my cards. You may need to explore which tile size works best for your scene setup. Here is what some other people have learned about tile sizes:

Best Tile Size for Blender Internal Renderer and Cycles

Even with computers thousands of times faster than what was available years ago, patience is still a virtue. I run a render farm at home with 4 machines with 3 modern video cards each, but due to the complexity in my scenes, I have to set my renders to run on all of my boxes overnight to render about 5 seconds of full HD video.

You will also get answers closer to what your looking for if you can be more descriptive of your scenario, of your scene setup, your render settings, and possibly even provide some screenshots of the scene in your blend file when you ask questions moving forward. Good luck!


You can plug a map into the Scale input of the Displacement node.  You may want to do some math on the values as they go in.
I don't think weight paint is available through cycles nodes, but you should be able to use Dynamic Paint a la this answer.


set a property via its data path stored in a string

To set a property you only have as a string, you can use Python's setattr()

import bpy
obj = bpy.context.object

# regular method
obj.location = 1, 2, 3

# using setattr
setattr(obj, "location", (1, 2, 3))

Notice setattr takes a string, so this can come from anywhere you like.

For simple properties, this works fine, however, if you want to set a path with multiple elements this becomes more complicated.

eg: modifiers["Subsurf"].levels

In this case there isn't such a clean solution.

There is a blender specific function called bpy_struct.path_resolve. Internally this uses the same method which is used to resolve FCurve and driver paths.

You could define a function for setting the attribute that combines path_resolve and setattr:

def value_set(obj, path, value):

    if "." in path:
        # gives us: ('modifiers["Subsurf"]', 'levels')
        path_prop, path_attr = path.rsplit(".", 1)

        # same as: prop = obj.modifiers["Subsurf"]
        prop = obj.path_resolve(path_prop)
    else:
        prop = obj
        # single attribute such as name, location... etc
        path_attr = path

    # same as: prop.levels = value
    setattr(prop, path_attr, value)

# example usage (requires path_resolve)
value_set(bpy.context.object, 'modifiers["Subsurf"].levels', 2)

# example usage (uses simple setattr)
value_set(bpy.context.object, 'location', (1, 2, 3))

However this is a bit involved, you could just do...

exec("obj" + path + " = value")

Though using exec is not ideal, especially if you don't know where the inputs come from. (security considerations)

Note: even though the example uses bpy.context.object you could use a Scene, Group, Mesh, Modifier... any Blender data really.


Black hair material instead of selected material

I did some poking around and it turns out you can't use subsurface shading or normal mapping for hair particles. So I added a new texture called "Shantae_Particle", deleted the Fresnel subsurface input, and used tangent mapping instead of normal mapping and it works now.

Also note that the Principled BSDF has Fresnel built in so there is usually no need to add it in other ways.

Here is the screenshot and below it is the fixed blend file.


Instead of instancing a single object, create a number of empty objects using the Object Instancer Node with the Copy From Source option disabled. Then get a list of all objects that has the meshes you want, generate a random list from them using the Random List Node and copy the data from the objects in this list to the empty objects you created using the Copy Object Data Node.


Why won't Smart UV Project automatically unwrap a simple chair?

The image editor is currently showing the 'render result' as shown in the header. When the render result is set to display, the uv unwrapping will not be visible (it doesn't stop it being unwrapped, it just stops you from seeing it). Press the 'x' button to remove it and the uv unwrapping should appear:


What are the limits on the number of vertex groups that can be assigned in an object?

I assigned 513 different vertex group slots to a single cube. If there is a limit (other than the size of the available memory), this suggests at least 66536 separate groups.


There is a menu option and keystroke Ctrl-g to create a Meta strip that groups multiple strips.

It sounds like you want to undo the splitting of a strip, but that same operation also has to have a defined behavior if the two strips selected were not originally split from the same source.

The logic to detect that two strips were originally split from the same source would be non-trivial and have a fairly long set of test cases for a QA team to perform.


You can use two Child of constraint with an animated influences:

In the above gif, there are two animated empties. The cube follows Empty first, then switches to Empty.001.


EEVEE Glass shader doesn't show through itself

Try something like this for your "glass" shader. As Nathan mentioned, rasterized transparency will always be lacking compared to Raytracing, and though EEVEE really doesn't like transparency through transparency, this shader attempts to strike a happy medium. Try it and see for yourself. Pay attention to the Blend Modes on the right, including the backface culling and show backface checkboxes (I just noticed Show backface is covered in my image, but it is un-checked):

However, glass is very much assisted (both in eevee and Cycles) by the use of an HDRI environment map. Switch to your World shading tab and add an Environment Texture (not Image Texture) with your HDRI. Blender's built in HDRI's are in the blender folder at .../2.93/datafiles/studiolights/world and many more can be found online for free. One of the most popular places is HDRI Haven (https://hdrihaven.com/hdris/).

If you want the effect from the lighting, but don't want the image in your background, you can separate them by using a Mix Shader, using the Is Camera Ray output of a Light Path node as the mix factor:


Is it possible to change the active bl_category with python?

Search registered classes.

To get all the classes in bpy.types that are a subclass of bpy.types.Panel and bl_space_type == 'VIEW_3D'

>>> for p in dir(bpy.types):
...     cls = getattr(bpy.types, p)
...     if (issubclass(cls, bpy.types.Panel)
...         and getattr(cls, "bl_space_type", "") == 'VIEW_3D'):
...             p, getattr(cls, "bl_category", "No Category")
...
('CYCLES_VIEW3D_PT_shading_lighting', 'No Category')
('CYCLES_VIEW3D_PT_shading_render_pass', 'No Category')
('TOPBAR_PT_annotation_layers', 'No Category')
('TOPBAR_PT_gpencil_layers', 'No Category')
('TOPBAR_PT_gpencil_materials', 'No Category')
('TOPBAR_PT_gpencil_primitive', 'No Category')
('TOPBAR_PT_tool_fallback', 'No Category')
('VIEW3D_PT_active_tool', 'Tool')
('VIEW3D_PT_active_tool_duplicate', 'Tool')
('VIEW3D_PT_annotation_onion', 'View')
('VIEW3D_PT_collections', 'View')
('VIEW3D_PT_context_properties', 'Item')
('VIEW3D_PT_gizmo_display', 'No Category')
('VIEW3D_PT_gpencil_draw_context_menu', 'No Category')

... and lots more

Ok, lets recategorize  bpy.types.VIEW3D_PT_grease_pencil   from "View" to "Foo"

Check if it's registered (should be since it is in bpy.types, unregister it, change the category, re-register.

>>> cls = getattr(bpy.types, "VIEW3D_PT_grease_pencil")
>>> if cls.is_registered:
...     cls.bl_category
...     bpy.utils.unregister_class(cls)
...     cls.bl_category = "Foo"
...     bpy.utils.register_class(cls)
...
'View'

Note this "trick" is used in some addons as an update on an addon preferences string property to recategorize panels

Inspect the module.

Similarly, since a lot of these are from bl_ui.space_view3d can inspect the module

>>> import importlib, inspect

>>> for name, cls in inspect.getmembers(importlib.import_module("bl_ui.space_view3d"), inspect.isclass):
...     if name.startswith('VIEW3D_PT'):
...         name, getattr(cls, "bl_category", "No Category")
...
('VIEW3D_PT_active_tool', 'Tool')
('VIEW3D_PT_active_tool_duplicate', 'Tool')
('VIEW3D_PT_annotation_onion', 'View')
('VIEW3D_PT_collections', 'View')
('VIEW3D_PT_context_properties', 'Item')
('VIEW3D_PT_gizmo_display', 'No Category')
('VIEW3D_PT_gpencil_draw_context_menu', 'No Category')
... and many more

be remiss not to mention, most blender modules that register classes, have a classes list or tuple

from bl_ui.space_view3d import classes

for cls in classes:
     ... as above

or for every addon ... addon_utils.modules() provides a list of addon modules, that can be inspected as above to look for more, that may not even be enabled / registered.

AFAIK it's not possible to set the active panel / category (tab)


Resolution Settings when Rendering Animation

In the render panel go to Dimensions. There is a dropdown menu with some preset dimensions to choose from. In your case HDTV 720p. You can also manually set your X & Y dimensions in the resolution boxes. As cegaton mentioned make sure the resolution is also set to 100%.


Look for the Curve Display settings on the 3D viewport (accessible by pressing N)

There you can disable the handles, or change how the normals are displayed


You can use the Bake function in the Cycles Render properties panel to achieve this by effectively rendering the scene from the point of view of a surface wrapped around your object.

The 'Bake' option is usually used to capture the visual appearance or properties of a surface in the scene where those properties are unlikely to significantly change (eg, its Ambient Occlusion, the lighting of a diffuse surface, shadows, etc.). This way, that surface's appearance can be quickly determined at render time without having to repeatedly re-trace those rays over and over again for each frame.

When baking an image, blender projects the camera rays directly towards the surface along its surface normal - rather than projecting them from the camera towards the surface - and this can be used to effectively turn any surface into a camera.

The key is to use a Glossy surface to bounce the ray back towards the surface being imaged. This way the baked image isn't how the surface appears but is, instead, what the surface sees when looking along its Normal - ie, it acts as a distorted camera that can take on any shape.

Blender projects camera rays to the surface along the surface normal.

The glossy surface bounces those rays back along the surface normal.

The rays hit the target, imaging it from the point of view of the surface.

To create such an "inverse panorama" create a new mesh surrounding the object - eg, a sphere for a spherical projection or a cylinder for a cylindrical projection. The mesh should be Smooth shaded rather than Flat shaded.

Flip the Normals so that they point inwards towards the target object.

Unwrap it using a suitable projection method (eg, Sphere Projection for a sphere, Cylinder Projection for a Cylinder)

Setup the material (note the unconnected Image Texture for the bake)

Note that the above material is a mix of 100% Glossy and 100% Transparent - reflective to all rays except those used to determine shadows. This way the surface reflects all incoming rays coming from the direction of the target object back to the target, but any rays from lamps placed outside the baked mesh are allowed to pass through. This allows lights to be placed around the target mesh outside the surface used to image it.

Select the surrounding surface (sphere) and click on the Image Texture node in the material to select it (this sets the 'destination' for the bake) and click 'Bake'.

This produces results such as the following :

The oringial object :

"Inverse Panorama"

Blend file attached


Some vertices moving farther than the armature in pose mode/weight paint

The rigging is not good, several bones are controlling the tails so their influence are conflicting.

You can see it if you select your armature, go in Pose mode, then select your mesh and go in Weight Paint mode. Select each bone: the color of the mesh is the influence this bone has on this part of the mesh. The more it's red the more it influences. Blue is zero influence.

You can correct this with the brush (Add or Substract option depending if you want to add or substract weight, and don't forget to enable the vertex selection masking for painting in the bottom horizontal menu).

You can also correct in Edit mode, go in the Properties > Data > Vertex Groups menu and decide, with the vertex group selected and the Assign and Remove buttons, what part of the mesh is supposed to be influence by what bone.

Also, I don't think that the topology of your mesh is good, it is supposed to fit the movements you could make with the bones. For example you can't properly parent each bone of your tail to each segment of your
mesh as there are no edge loops separating each segments of the mesh.

The best thing for your tail would be to let it as one piece and to parent it to the first bone of your tail: it would control the whole tail and the other bones would be useless, but even this solution is not easy as the tail mesh sticks to the body mesh and the bone would also affect the body. For example it would be easier it the tail was in the same object but a separated mesh.


You can add a input->image node and open the video file with it.
In the node controls you can set how many frames of your video file you want to use (frames), when to start in your composition (start frame), and the offset value is the one that will allow you to choose the exact frame to be used.
In this example the original quicktime file has 1600 frames but only 1 frame (797) will be displayed, as freeze frame, starting at frame 1 and for the entire length of the composition.


To create a still image or screen grab of the interface you can press CtrlF3 and save the image.

You will be presented with the option to save to save the whole screen or just the active window.

To record a sequence of steps into a Gif file you need external sotfware.

Please read the link on meta: What is the process for creating gifs for questions and answers?

Note that when recording video you can only post a file that is under 2MB in size.


How do I create a reflective white material?

The floor is actually more reflective near the horizon. This effect is called Fresnel and it adds a lot of realism into the scene.

Your shader should look like this:

Instead of controlling the amount of reflection with the Mix Shader Fac input, you control the amount with the value of color of the Glossy node. Black will be no reflection.

As the roughness is 0, this is a PBR dielectric shader. If the roughness would be more than 0, the Fresnel node would have to be upgraded to account for the roughness.

To keep it physically correct, keep the color of the Glossy node white. You adjust the color of the floor with the Diffuse shader.

Here is a comparison between this setup with Fresnel (left) and not physically correct setup with just mixed diffuse and glossy (right):

The right ball should feel un-natural.


Convert sequence of 3D points into a BVH file

Retarget animation

of one rig to another which differs only by rest pose

Given your two example bvh files produced rigs, toy_example_source and toy_example_target It looks like you want to do same as this qanda

Since your two rigs only differ by rest pose can snap target to source using a global copy transforms constraint. The new transforms of the snapped bone can be grabbed from the pose bones matrix. The local coordinates of the new transform using Object.convert_space(...)

Edit the name of source and target rigs to suit.

import bpy
from bpy import context

remove_constraints = True
scene = context.scene
rig1 = scene.objects["toy_example_source"]

rig2 = scene.objects["toy_example_target"]
if not rig2.animation_data:
    rig2.animation_data_create()
rig2.animation_data.action = None

# add copy transform constraint to each bone
for pb in rig2.pose.bones:
    ct = pb.constraints.get(pb.name)
    if ct is not None:
        ct.influence = 1
        continue
    ct = pb.constraints.new('COPY_TRANSFORMS')
    ct.name = pb.name
    ct.target = rig1
    ct.subtarget = pb.name

action = rig1.animation_data.action

f = action.frame_range.x
# add a keyframe to each frame of new rig
while f < action.frame_range.y:
    scene.frame_set(f)
    for pb in rig2.pose.bones:
        #pb2 = rig1.pose.bones.get(pb.name)
        m = rig2.convert_space(pb, pb.matrix, to_space='LOCAL')
        if pb.rotation_mode == 'QUATERNION':
            pb.rotation_quaternion = m.to_quaternion()
            pb.keyframe_insert("rotation_quaternion", frame=f)
        else:

        # add rot mode checking
            pb.rotation_euler = m.to_euler(pb.rotation_mode)
            pb.keyframe_insert("rotation_euler", frame=f)
        pb.location = m.to_translation()

        pb.keyframe_insert("location", frame=f)
    f += 1

# set constraints to zero or remove entirely.
for pb in rig2.pose.bones:
    ct = pb.constraints.get(pb.name)
    if ct is not None:
        if remove_constraints:
            pb.constraints.remove(ct)
        else:
            ct.influence = 0


You can snap elements to the nearest grid intersection with ⇧ ShiftS Snap to Grid:

Note that while in an aligned view (Top, Left, etc.) the subdivision level of the grid to which the mesh snaps will depend on the zoom. In an other view the mesh will snap to the displayed grid size.

The Snap to Increment mode of transform snapping will snap to grid increments. In other words, if your object/vertex is offset from the grid initially then it will stay offset.

By default the grid elements are 1 BU by 1 BU (Blender Unit), and the default plane is 2 BU by 2 BU. So to scale and position it to the grid, you can:

Scale it down to half it's size (S .5)
Move it half a BU on the X (GX .5)
Move it half a BU on the Y (GY .5):


It is in the right hand tool bar, under View tab. You can open it with N in Blender shortcuts or Ctrl + ] in Industry Standard shortcuts.


Is it possible to color-code the tabs on the toolshelf?

In blender's preferences for the 3DView theme settings, almost at the bottom, you will find the colours used for drawing the tabs.

This is a global property that is used by every tab and the only way blender offers to alter the tab panel colouring. You could adjust your theme so that the Tab Active and Tab Inactive colours are lighter so that there is more contrast with the text to make them easier to read.

In general blender doesn't offer ways to adjust the UI as far as colours go, almost every colour used is defined within a theme so that the UI stays consistant.


Actuator sensor never has positive pulse

There are no positive pulses on sensors. This term is a leftover from an incorrect documentation.

A sensor has two outputs:

an evaluation result (sensor.positive) witch is either positive or not positive and gets calculated once at each single frame
a trigger which marks all connected controllers to be executed on sensor execution (which happens after sensor evaluation)

The actuator sensor senses a specific actuator of the same object. It evaluates positive when the actuator is active and it evaluates not positive when the actuator is not active.

Be aware there are sensors that deactivate themselves within the same frame they got activated (such as property actuator, action actuator in property mode, motion actuator and state actuator).

Processing

t

The sensor detects the actuator is not active. As it was not active before it will evaluate not positive.

The actuator gets activated by a controller

The actuator runs and deactivates itself

t+1

The sensor detects the actuator is not active. As it was not active before (see t) it will evaluate not positive.

...

Conclusion

You can't measure that an actuator that immediately deactivates was running. You need other ways to detect this situation (e.g. by activating a property sensor that actually changes a property).


Are billboard particles with animated textures possible?

There are two parts to this question: making the particles face the camera, and then making the particles animated. I will address each separately.

Billboard Particles

This functionality is currently not supported in Cycles. That is not to say, however, that it is impossible.

One simple approach is to parent a plane to the center of mass of the object, set a tracking constraint to the camera, set the particle system to dupli-object, and enable parent rotation to the particles:

With this method, not all of the particles are technically facing the camera perfectly. But I have found that the camera has to be pretty close to the object for it to be noticeable, so unless you are using a fish-eye lens or are trying to get macro shots, this should be acceptable for 99% of cases. The distortion also adds a bit of randomness to the size which can sometimes be desirable.

The other approach is to create another scene which renders using the internal engine, wherein billboard particles are supported, and then link the two objects. For this to work, you will have to configure a camera in Blender internal which functions the same as the one you have in cycles. This can take some time, because each engine deals with camera settings differently. Here's a Reddit post going into more details if you wish to do this.

You could also probably develop a script or a add-on which adds functionality. Unfortunately I don't know enough about Blender add-ons to detail this approach any further.

Animated Particles

tl;dr: there's a node in Blender called Particle Info which can be used in conjunction with a sprite-sheet to animate particles using some Math.

I'm surprised that people have deemed this "impossible." It just takes a (complicated) node setup. I'm going to assume you know some basic discrete mathematics to set this up. You will need a custom mapping node, which you can either download or make yourself from this post. You will also need a Math.floor node which you can, again, either make yourself or download in this pack.

The first step is to convert your image sequence into a sprite-sheet. You can either manually do this in Photoshop or write a simple script to do this for you. This tutorial will detail how to do this with just 1 row, as seen in my example:

Note that it is perfectly possible to have more than one row, but it just takes some extra effort in the node editor.

Next, create a plane set it as a dupli-object for the emitter. This will be the master particle. UV unwrap the plane and configure it to be exactly the size of the first particle as shown here:

The only thing left is the material. As it turns out, there's a node in Blender that gives all the information necessary to create animated particles like this called the Particle Info node. I was surprised I hadn't known about this already, since it seems so useful. The two values we want are Lifetime and Age.

The approach will be different depending on how you made your sprite-sheet, so a basic knowledge of math functions will be useful. You can find many guides to dealing with spreadsheets in game design online, but I don't think its necessary.

The basic approach is to translate the uv mapping of the plane depending on how long the particle has been alive. So, for instance, right as the particle is spawned, it is on frame 1 (and has been translated 0 pixels to the right). Halfway through, it will be on whatever the middle frame is. So, if there are 16 frames in the animation, it will be on frame 8, and will have been pushed 7 tiles over.

The node gives us lifetime and age. Dividing age by lifetimes gives a ratio from 0 to 1 that corresponds to how long the particle has been alive. Multiplying by the amount of frames in the particle animation gives a number that corresponds to the amount of tiles the uv needs to be shifted to the right, plus some extra decimal information that isn't necessary (since you never want to translate the uv, say, half of a tile). You can cut this off with a Math.floor node, giving all the information necessary to make it work.

Hopefully that all makes sense. Here's my node setup (applied to the plane) for the example sparkle animation with 16 frames shown earlier:

This divides the age of the particle by the lifetime, giving a percentage of how complete the animation should be (as detailed earlier)
This multiplication corresponds to how many frames there are in the particle's animation
You have to floor this so that, for instance, you don't shift over by half of a tile
This is the amount to slide over for each tile. For me it is always the reciprocal of the amount of frames, because a value of 1 will wrap around an entire time. I recommend using the Node Wrangler add-on to mess with this node directly to figure out the right value
Simply plugging everything into the custom mapping node in the x category, because there is one row

This will ultimately give you a vector which you can use on the sprite sheet as an image texture, which you can then use in your material as normal.

My final result (with some custom scaling and some other changes in the emitter) looks like this:

Note: I sometimes worry that I'm being patronizing to those that do know math, but I also understand that a lot of artists do not know much math, so I'd like to explain the node setup rather than just handing it out and not explaining it. Please tell me if my explanation is confusing and I will be happy to clear it up!


You need Cycles rendering engine for the displacement setting.

From your properties panel: Select Scene > Render Engine >> Cycles

After you select the right engine, the displacement properties will be visible and changeable.


Weird problems when I extrude or try to shape vertices

It doesn't look like a bug to me. There are 3 types of selection modes in blender; Vertex, Edge and Face. You have to select them according to your requirements. If you select any of them and press 'E' to extrude, it extrudes along the normals by default. If you want, you can constrain your extrusion to a specific axis by pressing 'E' to extrude and then X, Y or Z for x, y and z axis respectively.

The second problem you mentioned is shading problem according to me. After you've finished your extrusion and modelling, select the whole mesh in edit mode by pressing 'A' key and then recalculate the normals.


How to evenly unwrap / texture long extruded objects with folds and uneven segments?

First step:

See the different values under "Scale" on the right side?
Your model is stretched in different directions.

for unwrapping to work correctly, apply the scale (the numbers for x,y and z should all be 1).
select your object -> ctrl+a -> Apply Scale

Next

As you don't care about the blue backside, create a seam on the outside of the blue Part.
alt+shift+rmb might help a lot in edge select mode (shift+tab).

If you unwrap now, the image will still be distorted. so we need to add one more little step:

We need to create seems in every corner. You don't need to go all the way to the bottom though – only as long as the tilted faces on the top go. This way your texture is continuous all the way through (you might or might not want that – if you don't, extend the seams to the bottom).

now select everything -> u -> unwrap

depending on the project i often get better results if I change the unwrapping method to "conformal" on the left panel.

The final UV in the Image Editor (The blue backsides on the bottom aren't 100% straight, but you don't care, right?):

And the Object in Material View:

Let me know, if you have any questions.


Mesh with weird inverted light direction

The obj file has bad normal data for some reason, which gets imported into Blender. The way to fix it is to delete any custom normal data using the 'Clear Custom Split Normal' button from the object data panel.


python - how to select a vertex in a circle

Have to select in object mode

To select mesh vertices using me.vertices[i].select need to set in object mode, and toggle into edit mode.

When a new primitive is added all the geometry is selected by default.

Here the mesh is added in object mode (without toggling into edit mode)  all geometry is deselected (brute force) , vertex index 0 selected, and then toggle into edit mode.

import bpy
context = bpy.context

bpy.ops.mesh.primitive_circle_add(vertices=7, radius=1, enter_editmode=False, location=(0, 0, 0))
ob = context.object
me = ob.data
for g in me.vertices[:] + me.edges[:] + me.polygons[:]:
    g.select = False

me.vertices[0].select = True

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

Please note. When an object is created with an operator the object and mesh are given default names, "Circle" in this case. If another is added then the names may or may not be "Circle" if there is another with same name.

The newly created object will always be ob = context.object and its data part, mesh in this case ob.data.  (suppose I'm saying, pays to get out of the habit of bpy.data.objects["What the first one's name is"])

or use bmesh, and load in the edit mesh and fix. (as answered by Leander while writing this), however this uses bmesh in conjunction with the add primitive operator.

import bpy
context = bpy.context
import bmesh
bpy.ops.mesh.primitive_circle_add(vertices=7, radius=1, enter_editmode=True, location=(0, 0, 0))
ob = context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)
bm.select_flush(False)
for v in bm.verts:
    v.select = not v.index
bmesh.update_edit_mesh(me)


Someone will probably come up with a better way than this...

If you have a lot of work to do in 4-way symmetry, it's probably worth working under a Mirror modifier in X and Y, or an object-offset Array modifier, based on a target rotated by 90 degrees.

For a one-off, though..

If necessary, create a Custom Orientation from the face the edges have in common
Set Pivot to Median, or 3D Cursor snapped to the appropriate point
SShiftZ Scale  the edges outward
CtrlC copy the scale from the Adjust Last Operation panel
Reset Orientation to Normal, and Pivot to Individual Origins
S scale, and in the Adjust Last Operation panel, swipe to select X,Yand Z fields together and type in to one of them:  1/CtrlV


You just need to disable the compositor in Output Properties > Post Processing > Pipeline > Compositing. Basically if compositing is enabled only the Image pass gets forwarded to the composite node (even if Nodes weren't enabled) and the Depth defaults to Z=1.000

If you do need to use the compositor, make sure you also link Depth to the composite node to get an exr file with a correct Z channel:


Bezier masks for use with groups of shapes?

One thing that could work, or at least give you inspiration, is adding control points hooks, perhaps, I tried this setup:

Here I created two stacked bezier shapes, the upper "Holed" similar to yours.

Then I selected each upper shape control point, and created a hooks to a new empty.

After that I hooked also lower shape control points, one by one, to the nearest empty created before.

Note: here the lower shape control points had same x/y position than the upper "hole" ones, so it was easy, you may need to arrange things differently (more "safely") to allow different setups to work...

See how it works:

And, from the top view:

Here is my example .blend  (sorry, had to edit your question and remove accented char from the title to get the url accepted by the hosting service)

Hth.


Matcap & smooth shading in Blender 2.71 very blocky v. 2.69

In your case this is caused by having Auto Smooth enabled.

From the wiki:

  Angles on the model that are smaller than the angle specified in the Angle button will be smoothed

The Angle slider is used to control how rounded a surface may be before it is split by a hard edge. Edges with an angle greater than this value have their vertex normals split, causing it to appear as a sharp edge instead of a smooth one.

From top-left to bottom-right: Auto Smooth off; On with 180 degree angle; 20 degrees; 10 degrees.

Note that Auto Smooth has no effect on flat-shaded geometry.

Another cause for this could have been the Edge Split modifier. It works similarly to Auto Smooth, except that it does not modify the vertex normals, instead it physically splits the sharp edges into two separate edges.

There is no visual difference between Auto Smooth and the Edge Split modifier, but the modifier affects the rest of the modifier stack and also may be applied.

In your case this is an undesired effect, but if you did want to use this function it's worth noting that Auto Smooth will give you much faster viewport and render performance, since the modifier is physically changing geometry and working with the rest of the stack as opposed to simply adjusting the vertex normals.


With the part of the UV map selected that you want to rotate, hit R to enter rotation mode, then type the number of degrees with the numpad, for example 90 to rotate it 90°. Then hit Enter or Return to apply it, or just left click.

You can also scale the selection with S and then entering a numerical value, for example 2 to make it twice as large, or .5 to make it half the size.

You can also move the selection along the X or Y axis by hitting G to grab it, then constraining it to the X or Y axis with X or Y, then entering the number of units you want it to move.

This also works in the 3D viewport. If you look at the bottom of the current viewport while doing a resize, scale, or movement operation, you can see the values you have entered in the bar beneath the viewport.


How would I take the average color of a material (lighting included) and turn that into a flat color?

The only way I can think of achieving this would be to have each mesh assigned its own 1x1 image and use the UVs to Bake the image from the surface.
Since the image is just a 1x1 single pixel, the whole bake will be merged into that single pixel. The image can then be used to shade the surface.
Note that this would be Cycles only (for the baking - you can use the image in Eevee, just can't bake it there since Eevee doesn't (yet) support baking) and that there would be a great deal of setting up to create and bake an image for each material.
It would be feasible to use scripting to automate the creation and baking of the images to apply to a whole scene/frame.


Select your armature and export in either BVH or FBX. This will export the animation of your armature in a commonly known format.

If you want to export parts of your animation separately then BVH is the way to go as you can specify to export a specific frame range as shown below:


how can I select Animation in Action Editor (Blender Python)

The action editor displays the action of the currently selected object. Each object can only have one active action.

To alter the action used by an object, which is then displayed in the action editor, set the objects action property. The action is found in the objects animation_data

bpy.context.object.animation_data.action = bpy.data.action['Idle_Stand']


How can I get Blender to render the 3D view instead of the what's in the VSE?

In the Properties panel > Output > Post Processing, disable the Sequencer option.


particles sit above collision object when "size deflect" is active

I found a workaround which was just playing with a combination of particle render scale (0.009 turned out to work here) and object scale until something sat at the right level. This really doesn't seem like the right way to solve this though...


I did miss something obvious, thanks to Carlos comment I solved what was wrong with my scene.

The problem was not with the node setup itself, but with the object data. Light type must be an Area Light, not a Spot Lamp.

Using the correct area light type now yields expected results.


Duplicate materials - to create another similar yet modified one

You can use the plus sign on the right of the material name to copy and replace your current material.
As you can see below, the former material is still available.

This plus sign is available for many Blender objects, like textures, particle systems or others...
But you may notice that it does not work properly in the node editor :

So, use it in the properties panel...


In Blender the selected/active object are outlined in edit mode by varous  coloured lines which by default are highlite only on the meshes's boundaries, aka the edges who are shared by less than two faces

Notice that this behaviour make clearly visible those objects who behave like paths or profiles, who have edges not connecting any faces and fall in the category explained above.

In your case you probably have both cases in the same mesh, overlayed.

If you want to get rid of the edges not connecting any faces, you can take advantage of the Delete Loose tool:


Texture flips when sphere is UV-unwrapping

I'm not sure there's any good way to do this unwrap with seams, your stripes will hardly join and they will be distorted. You should try another mode like for example Sphere Projection (or Follow Active Quads). Make sure that your sphere has a very small pole face, and that you're in front view when you'll do the unwrap. Then it should give something like that:


BGE: How to set the Constraint Axis to an object coordinate

Does the object need to be parented? I will make an example that presumes it doesn't. If you explicitly need parented objects, this script will not work as it is.

If you transform the orientation matrix of the source object into an euler and then pass it on to the target object's world orientation as a matrix, you should get what you are looking for.

In a nutshell: get matrix -> change to euler -> modify euler -> change to matrix -> give to the object you want

Hook this up to a TRUE level pulse triggering sensor with a frequency of your choice.

import bge
import mathutils

sce = bge.logic.getCurrentScene()
face = sce.objects['Facer']
facY = face.worldOrientation.to_euler()[1] #Now we have the Y-axis rotation
facTar = sce.objects['Facingtarget']       #This is the target object we modify
newRotList = [facTar.worldOrientation.to_euler()[0],facY,facTar.worldOrientation.to_euler()[2]] #Now we have a list
newRot = mathutils.Euler(newRotList).to_matrix()   #Now we have the matrix we need
facTar.worldOrientation = newRot    #The orientation has been modified


How to get the final volume & area of all selected objects (ignoring some faces)?

This can be done using the Python API to get the mesh with modifiers applied, then applying the transform matrix.
The following script applies to all selected objects, showing a popup with the final volume. Not that it does not use units or scene scale.
See is_face_volume for the method of checking if a face should be included in volume calculations.
import bpy
from bpy import context

# Quick way to test with/without hidden faces
USE_FILTER_FACES = True

def report_info(title="", message=""):
    # show in console
    print(title, message)
    # show in popup
    def draw_cb(self, context):
        self.layout.label(text=message)
    context.window_manager.popup_menu(draw_func=draw_cb, title=title, icon='INFO')

def is_face_skip(f):
    """Ignore faces that pass this test!"""
    return f.hide is False
    # You may want to filter based on material.
    # return f.material_index == 0

def bmesh_from_object_final(ob):
    import bmesh
    matrix = ob.matrix_world
    me = ob.to_mesh()
    me.transform(matrix)
    bm = bmesh.new()
    bm.from_mesh(me)
    if USE_FILTER_FACES:
        faces_remove = [f for f in bm.faces if not is_face_skip(f)]
        for f in faces_remove:
            bm.faces.remove(f)
    return (bm, matrix.is_negative)

def volume_and_area_from_object(ob):
    bm, is_negative = bmesh_from_object_final(ob)
    volume = bm.calc_volume(signed=True)
    area = sum(f.calc_area() for f in bm.faces)
    bm.free()
    if is_negative:
        volume = -volume
    return volume, area

def main():
    volume = 0.0
    area = 0.0
    object_count = 0
    for ob in context.selected_objects:
        if ob.type != 'MESH':
            continue
        volume_single, area_single = volume_and_area_from_object(ob)
        volume += volume_single
        area += area_single
        object_count += 1
    volume = abs(volume)

    report_info(
        title="From %d object(s)" % object_count,
        message="Volume: %.4f, Area: %.4f" % (volume, area),
    )

if __name__ == "__main__":
    main()


FBX Blender Export to Unity - Textures will not stay with model (using blender render or cycles render)

Figured it out - The link from above got me about 75% of the way there. For some reason the texture was never showing after baking. Through a lot of trial and error, I found out I had to adjust the 'Shading' settings under the 'Material' property. For some reason, by clicking the box for 'Shadeless', the texture appeared. I exported using the steps explained in attempt #1 above, and then the 'Extract Textures' button was no longer greyed out in Unity! –


Can I sculpt a mesh with another mesh in Blender?

Done!
The BoolTool Addon fulfills all the use cases presented above and more.
Youtube tutorial: https://www.youtube.com/watch?v=Vf2M1bxZYk0


Capture object properties to use in a Cycles material

To achieve this you essentially need to be able to do two things :

Capture the location of each object at a point in time and store it
Access the stored data efficiently from within the Cycles material

The first task is relatively straight forward using a Python script to capture the object's location as follows :

import bpy

num_objects = len(bpy.data.objects)

for x in range(0,num_objects):
    object = bpy.data.objects[x]
    object["initial_location"] = [object.location[0], object.location[1], object.location[2]]

This script runs through each object in turn, determines its location, and stores it in a Custom Property on each object.

While this is useful to demonstrate the capture of a property of each object, the Custom Properties aren't the best place to store the details since Cycles materials cannot (easily or efficiently) access the contents of the properties. Future Cycles enhancements may well provide a mechanism for reading object properties but for now we need a different method - we can use an Image Texture.

Cycles can very efficiently read the value of a pixel within an image using the Image Texture node and this provides an ideal method of passing the data into the material - encoded as the color of each pixel within an image. A normal 8-bit RGB image will not be sufficient - so we need to use a format that allows full 32-bit floating point values to allow it to hold the location vectors.

The following script will take the location of each object (as in the previous script) and will create an image 1 pixel high and wide enough to hold one pixel per object. Each pixel will be set with its RGB values set to the XYZ vector of the location of the corresponding object.

import bpy

width = len(bpy.data.objects)
height = 1

# Create the image
image = bpy.data.images.new("object_locations_"+str(width), width=width, height=height,float_buffer=True)

# Create an empty array of pixel data (each will hold R, G, B, A values as floats)
pixels = [None] * width * height

for x in range(0,width):
    y = 0
    object = bpy.data.objects[x]
    pixels[(y*width)+x] = [object.location[0], object.location[1], object.location[2],1.0]
    object.pass_index = x

# 'flatten' the array - so [R1,G1,B1,A1], [R2,G2,B2,A2], [R3,G3,B3,A3],.... becomes R1,B1,G1,A1,R2,G2,B2,A2,R3,G3,B3,A3,....
pixels = [chan for px in pixels for chan in px]

# Store the pixels in the image
image.pixels = pixels
image.update()

The script runs through each object and captures the location in a pixel in the image. Note that it also sets the object's 'pass_index' to the 'slot' corresponding to that object's pixel in the image - this will be used in the material to retrieve the correct pixel for each object. Running the script on my test scene produced the following image. Dragging the mouse over the pixels shows that each pixel relates to the XYZ location of each object in the scene.

The image needs to be saved - either as an image file or 'packed' into the blend file. However, this causes a potential problem. 'Normal' images are stored as a set of R, G, B, A values in the range 0.0 to 1.0 but our object locations will likely be well outside that range. To prevent this corrupting our stored values we need to ensure it is saved in a format that can store full float values (rather than a PNG). Saving and packing the image as a 32-bit float image is covered in this question. This produces the following final script to capture all object locations into a 32-bit float packed image :

import bpy
import os

width = len(bpy.data.objects)
height = 1

# Create the image
image = bpy.data.images.new("object_locations_"+str(width), width=width, height=height,float_buffer=True)

# Create an empty array of pixel data (each will hold R, G, B, A values as floats)
pixels = [None] * width * height

for x in range(0,width):
    y = 0
    object = bpy.data.objects[x]
    pixels[(y*width)+x] = [object.location[0], object.location[1], object.location[2],1.0]
    object.pass_index = x

# 'flatten' the array - so [R1,G1,B1,A1], [R2,G2,B2,A2], [R3,G3,B3,A3],.... becomes R1,B1,G1,A1,R2,G2,B2,A2,R3,G3,B3,A3,....
pixels = [chan for px in pixels for chan in px]

# Store the pixels in the image
image.pixels = pixels
image.update()

# Save image to temporary file and pack it (from answer by @sambler)
scn = bpy.data.scenes.new('img_settings')
scn.render.image_settings.file_format = 'OPEN_EXR'
scn.render.image_settings.color_mode = 'RGBA'
scn.render.image_settings.color_depth = '32'
img_path = bpy.path.abspath('//')
img_file = image.name+'.exr'
image.save_render(img_path+img_file, scene=scn)
try:
    # Remove the scene (pre-2.78)
    bpy.data.scenes.remove(scn)
except:
    # Remove the scene, (Blender 2.78+)
    bpy.data.scenes.remove(scn, do_unlink=True)

bpy.data.images.remove(image)
bpy.ops.image.open(filepath=img_path+img_file)
image = bpy.data.images[img_file]
image.pack()

os.remove(img_path+img_file)

# Add a fake user to ensure the image is retained
image.use_fake_user = True

Once we have the stored 'initial' locations of the objects, we can use an Image Texture node and some simple maths to use the Object ID to calculate the location of the associated pixel to extract the color (to use as a vector) from the image as follows :

To convert the Object ID into a pixel location we need to add 0.5 (so that we sample the middle of a pixel) and then divide by the total number of pixels across the image. This will result in a value between 0.0 and 1.0 corresponding to the middle of the relevant pixel. Passing this into a Combine XYZ node with Y set to 0.5 produces the required vector. The Image Texture node should be set to 'Non-color Data' to prevent any color conversion (by default Blender will convert from sRGB colorspace into Linear colorspace).

To demonstrate this in action, here's an animation moving the blocks and using the 'current' location to generate the color (ie, not using the stored 'initial' location) - notice the blocks changing color as they move.

And here using the captured 'initial' location extracted from the generated image using the above script and material.


Can't select Pose under Scene Collection to Enter Pose Mode

This behavior was intentionally removed in September 2020. At least one person filed a bug, see T80757. Quoting from there:

This was a conscious decision. The outliner only allowed entering edit and pose mode. The new mode column does not allow entering modes, but allows switching the active within all modes. [...] Entering the mode must be done from the viewport.


Blender crashes when assigning materials from script - is it a bug?

From the code snippets given, it's difficult to reproduce the error.

Here's my guess:

If the object with the name 'Material_Holder' does not have the material referenced by the variable changeable_material, that material will get removed (in block with the comment #removes all unused materials). There would be problem if later this (removed) material is appended to any object (base_object.data.materials.append (changeable_material)). The crash could be related to this.

So if the changeable_material is needed later in the code, the condition should be if (not (material.users)) and material is not changeable_material before calling remove.


After using a Knife Project tool check the Cut Trough checkbox in the Tool Shelf (T).

If you place the cutting object on the 'clean' face it'll make the hole. If the cutting object is placed so it's overlaping the edges of the cuted object it'll create a geometry (edges) on it (as @lemon mentioned in his comment).


Blender link external scene in the existing scene

We will use the link function (not the "append", which creates a full copy of your data and don't do any sync from the source file).

From your "master file", separate your assets into groups ;
Save each group alone in a separate "slave" file ;
In your master file, delete everything, then use the menu File → Link and link every group you need from your slaves files.

That way, your master file contains only linked groups. And your other slaves .blend files each contain one group, which you can edit. The master file will receive the changes. If you ever create a new object in a slave file, don't forget to assign it to the group so he will be synced.


How to fix viewport being tilted on startup?

The 3d view's view_rotation
This is purely an arbitrary choice in the default startup file. Edit and save the startup file if any are not to your liking.
Instead of aligning a camera to view, can get the view matrix of the 3d view.
For example, looking at the 3d view rotation of the 3d viewport in General Workspace.
>>> s = D.workspaces['General'].screens[0].areas[3].spaces.active

>>> list(map(degrees, s.region_3d.view_rotation.to_euler()))
[63.52429048891948, 0.7600397052594825, 65.79110050085248]

showing the 0.76 degrees result for y Euler rotation.  Like a camera the view looks down its local Z axis.
Test script to change all 3d views in all workspaces to have a zero euler rotation y component.
import bpy

context = bpy.context

for ws in bpy.data.workspaces:
    for screen in ws.screens:
        for area in screen.areas:
            if area.type == 'VIEW_3D':
                r3d = area.spaces.active.region_3d
                eul = r3d.view_rotation.to_euler()
                eul.y = 0
                r3d.view_rotation = eul.to_quaternion()

Result of above after running script
>>> list(map(degrees, s.region_3d.view_rotation.to_euler()))
[63.52429048891948, -9.830594791652178e-07, 65.79110050085248]

(y rot value is -0.000000983 which can be considered zero within blenders tolerance limit)
To make these permanent, open new file, paste script in text editor, run script, (unlink after running to not save script) then save startup file. File > Defaults > Save Startup File Now any new file will reflect this change.
For other templates would need to open and edit the blend file associated with the template [look for link].


you can change to emit at vertices and make the vertex exactly at your needed point, by changing the seed value.
the other possibility: just add a single vertex at the point where you want the emitter to be and add on that vertex your particle system -> done


Now it's exactly the inverse problem from before. You used to have to prevent edges from being sharp, now you need to mark some sharp edges so they don't appear smooth.

You can do this the same way before, selection the edges supposed to be sharp, CtrlE → Mark sharp. The issue with this method is that you need to do this everywhere needed; It's quite long to do.

Fortunately, you can let the software do most of the work for you; Since the idea is to mark sharp when some faces do a certain angle, you can go to the Data tab of your object, and find the Auto Smooth option in the Normals tab :

The way it works is simple. Once enable it smoothes the whole mesh, but mark as sharp every edge forming at least the angle specified below. I use 66 usually, it's a nice value; You can adapt this to your need.

(Also, all the sharp marked edges only work with auto smooth enabled).


How do I adjust bone rotation_mode when freshly created armature has pose = None (python)

LucaRood in IRC was the first one to suggest using scn.update() after the link().  batFINGER and my testing agree with that solution.  So the proper code would be

import bpy

scn = bpy.context.scene
obj = bpy.data.objects.new('garbage', bpy.data.armatures['lids_armature.007'])
scn.objects.link(obj)

scn.update()
obj.pose.bones[0].rotation_mode = 'XYZ'


Texture doesn't fully cover my selected mesh

All you need to do is add a couple of edge loops and drag them down as shown in the image below.


Set keyboard shortcuts for accessing specific render slots?

Found it.
API to enter for the shortcut is:
wm.context_set_int
Make sure Value is set to the slot number minus 1.
Context Attributes must be: space_data.image.render_slots.active_index

That's how you get the render slot numpad shortcuts back, if they disappeared like mine did and you don't want to reset everything.


Blender allows you to save your preferred setup as a default, just turn off what you don't want to see and go to File > Save Startup File


How do I scale a video clip down without creating a border?

A quick fix for this is to plug the Image value of your Keying node into the Fac input of a ColorRamp, and also into the top Image input of an Alpha Over node. Then plug the Image output of the ColorRamp node into the Fac input of the Alpha Over node. Now plug your background image into the bottom Image input of the Alpha Over node. At this point, everything should look relatively the same as before. Now in order to make the black box transparent, drag the right handle of the ColorRamp node all the way to the left. At this point, your black box should be gone, if it is not just add an Invert node directly after your ColorRamp node, and now the black box should be gone.

Before:

After:

I hope this helped.

-Tom


Blender Mesh: Which UV Unwrapping Approach

Normally I wouldn't use it, because I mostly do organic modeling, but I'm thinking for what you are doing, Smart UV Project might work very well. It's under the UV Mapping menu (press U in Edit Mode to bring it up). It tries to automatically unwrap your mesh without you creating any seams first. One nice thing about it is that even if you ignore all the settings and just press OK, the settings menu remains active afterwards, so you can keep tweaking the values in the fields and see updated changes to the UV map. This is great because some of those settings would be hard to understand exactly what they do based only on their descriptions.


Posting solution here, so that this is marked as Answered:

bpy.context.scene.cursor.location = 0,0,0


You could get a script writer to make a add strip effect option. The Transform Addon currently creates a transform strip upon key press. So it is possible.

Currently over at the BA forum, user "snu" is actively developing a VSE script that might add this function for you. http://blenderartists.org/forum/showthread.php?338598-Addon-WIP-VSE-Quick-functions-Snaps-Fades-Zoom-Parenting-Titling-Play-speed


Theory of calculating randomness for damping factor

I figured it out.
public Vector3f damping(Vector3f vector)
{
    float random = (float) (this.randomDamp*(Math.random()*2-1));
    float clampedValue = Math.max(0, Math.min(1, (1-damp)+random)); //clamp between 0 and 1
    vector.scale(clampedValue);
    return vector;
}

With a factor of 0.5 and a random factor of 1, the final factor will vary between -0.5 (0) and 1.5 (1)


Try adding bevel and taper to the spiral curve like this (of course smooth shading and subsurf will help).

starting with a setup like this:

you can get something like that shape using bevel, bevel object and taper to the shown curve circle:


Blender OBJ export properties panel missing

I think you have dragged down all the way. you will see a small + icon in bottom of properties panel press it, it will come back.


Blender 2.73 Objects do not respond to script, but do to Python console

All credit to @Chebhou.

From above:

"Anyway, the moral of the story is you can't command things which are defined with keyframes from scripts, but you can with the Python console."


Can I rotate part of the mesh while reserving topology?

Its actually simple :)

First select the edge loop you need to seperate with Alt+RMB as shown in the picture below.

Then select the other remaining edges by right clicking on them....

When you're done selecting just the plate press P
Then choose Separate by Selection

Now rotate it as you like....

Now is the tricky part....

I'm not sure how others do this, but I do it in this way...

suppose the uppermost cube is your plate and the lower one as your main ship...

Now we've separated these two in the previous step...
Now make them a single object by  Shift+RMB selecting each object, and then pressing  Ctrl+J .....

Now go to edit mode and go to vertex select mode...
and press  B  to box select the plate from Orthographic View (Num 5) or a comfortable angle...

For yours it may be right side (Num 3)
then select all the edges to be joined....

In your case it's just two edge loops (Shift+Alt+RMB)....

Then press F to make faces between them...

Now, it mightn't be the best technique but I found it works for me...
Hope it helps :)


Help on how to create a hologram with particles

You want the particles to travel upwards. Set the particles Field Weight for gravity to 0.0. Add a force field at the location of suzanne with a negative strength, or you could assign the force field settings to the model itself. Setting the shape to plane seems to worked best.
To make them move slower, increase the mass for the particles.
To make them disappear as they pass suzanne. You can enable collision for the object with kill particles enabled. Also adjust the lifetime so that the longest lived particles finish just above the object.
You want the particles to emit from a small area. Here you have a couple of options, one is to add a small object at the point to emit the particles. Another option that I used, is to assign some vertices (or a single vertex) from the object at the location of emission to a vertex group that you then select in the particles vertex groups for density. I also shaped the verts into a small pyramid to get the particles to spread outwards a bit more, a little random velocity also helped with that.

Here is a sample file


How to adjust texture coordinates with a distortion texture?

No need for OSL, just use a Converter > Vector Math node.

The above node setup uses the image texture on the left to offset the UV (or any other) texture coordinates by adding the distortion map pixel values to the mapping vectors (RGB is automatically converted to XYZ).

If you want a little more control over the distortion strength  and directionn you can add a Separate RGB and Combine XYZ node and use some math nodes in-between.

With the above node setup you can adjust the strength for each direction independantly, if you want the same strength in all directions and don't want to have to play with 3 different values you can plug an Input > Value node into all 3 math nodes.


Can't access OpenCL for AMD Radeon R9 270

I think you need to go into user preferences>system> and in the bottom left corner there is Cycles Compute device. Turn this to open CL. Then back to main interface go to render > device and you will see a drop down says cpu. Use drop down and it will give you the option of gpu. Hope this helps!


Press N  on your keyboard to open the Properties Panel, then go to the area marked with red.

Then increase the Clip End to fit your work


OSL component names for points, colors? (x, y, z, r, g, b)

The syntax was introduced in version 1.11 of the Open Shading Language (OSL) specification.

  OSL Language and oslc compiler:

  New syntax to reference color and point/vector/normal components as named struct components, such as C.r, C.g, C.b, or P.x, P.y, P.z. #1049 (1.11.0)

Blender 2.83 is using OSL 1.10.9 and thus doesn't support this syntax yet.


You can take 6 rectangle cameras with 90° FOV, which head to East, West, North, South, Up, Down. Then you get faces of a cubebox.
You can map the cubebox into equirectangular in a simple fragment shader or use it directly.


Out of ideas - Is there a way to roll a string on a spool?

I will warn you. If you are attempting to make a very long string and have it be a self colliding object, you will need a very strong computer. I would start with a "noodle." By this I mean just one curve straight curve and then slowly add more and more vertices.
To start setting up your scene just add a plane and scale it up 10. This is just a preference for the size, but you should have something that it can fall on. Next, you will need the "spool" but you could easily just use a cylinder to test how your computer runs it. Next is adding your actual string. Add a curve path and put it above so that it can fall on your cylinder. I would subdivide this curve at least twice.
Make the plane and cylinder to collision in the physics body editor. Set the curve to "soft body" and uncheck "Goal." You might want to increase the thickness of the curve, go to the  "Object data properties" panel and under the geometry tab, increase the bevel depth to something like".01" or ".02". You can play around and see what you like
If all of this has worked for you so far, you can start to increase the complexity of your scene and the complexity of your path. Subdivide stretch and shape your string. And that should be enough to get you going in the right direction.


Blender 2.77 - how to have my default workspace always with top, left, right, perspective like 3D studio max?

Press Ctrl+Alt+Q while your mouse cursor is over the 3D Viewport to Toggle Quad View. Press Ctrl+U to save the current blend file as the default one whenever you start Blender.

The Toggle Quad View function is also accessible from Blender's Python interface with the operator bpy.ops.screen.region_quadview() or from the Display Panel on the Tool Shelf:

Please note that after pressing Ctrl+U whatever changes you have made (no matter how small) to the current blend file will become startup defaults.


How To Prevent a mesh from overlapping into another?

As was pointed out by Duarte Farrajota Ramos , you want to keep the pages separated to avoid Z fighting.

If this causes problems because there are so many pages the separation causes them to have a painfully thick stack, then you might want to start animating the hide_render property (the camera icon in the outliner) so that pages which are obscured don't even get rendered until it's time for them to be visible.

Depending on what fraction of the book you will flip through, you might even have a box-ish mesh representing the bulk of the pages, and then 2-3 flippable pages renderable at any one instant.


I suggest you name your mesh with the suffix .l since it is the left side which is modelled (even if there is a subdivision modifier).

Here are some manual steps.

Duplicate objects. ⇧ ShiftD
With the duplicates selected, mirror them ⎈ CtrlM, X.
Export as fbx but deselect apply modifiers.

Or use a short python script. (Paste this in Blender's text editor and click Run Script with the objects selected. The script will automatically remove the modifiers and create a duplicated mirror, even if the mirror axis isn't x.

If you're using a different naming scheme than .l/.r, change this line
    new_obj.name = re.sub(r'\.l\.\d\d\d', '.r', new_obj.name).

new_obj.name = re.sub('left', 'right', obj .name) would replace left with right. (You would name everything with the left prefix beforehand (e.g. "leftHand".)

import bpy
import mathutils

for obj in bpy.context.selected_objects:
    # Check if a mirror modifier exists.
    for mod in obj.modifiers:
        if mod.type != "MIRROR":
            continue

        mirror_name = obj.name.replace("Left", "Right")
        if mirror_name == obj.name:
            mirror_name = obj.name + "_mirrored"

        # Reference the mirrored object. Create it if it doesn't exist.
        mirror_obj = bpy.data.objects.get(mirror_name)
        if mirror_obj == None:
            mirror_obj = bpy.data.objects.new(mirror_name, obj.data.copy())
            mirror_obj.name = mirror_name
            bpy.context.scene.objects.link(mirror_obj)
        else:
            mirror_obj.data = obj.data.copy()

        axes = [mod.use_x, mod.use_y, mod.use_z]
        dir = [(1,0,0), (0,1,0), (0,0,1)]
        for axis, direction in zip(axes, dir):
            if axis:
                mirror_obj.data.transform(mathutils.Matrix.Scale(-1, 4, direction))
                mirror_obj.data.flip_normals()

        mod.show_render = mod.show_viewport = False
        break

To remove the duplicates created by the script and re-show the mirror modifier simply undo the actions of the script with a single undo step. ⎈ CtrlZ

For 2.8x, this script can be changed to:

import bpy
import re
import mathutils

scn = bpy.context.scene
objs = bpy.context.selected_objects

for obj in objs:
    new_obj = obj.copy ()
    new_obj.data = obj.data.copy ()
    if len(obj.users_collection):
        obj.users_collection[0].objects.link(new_obj)
    else:
        scn.collection.objects.link(new_obj)
    new_obj.name = re.sub(r'\.l\.\d\d\d', '.r', new_obj.name)

    for m, n in zip (new_obj.modifiers, obj.modifiers):
        if m.type == "MIRROR":
            axes = [m.use_axis[0], m.use_axis[1], m.use_axis[2]]
            dir = [(1,0,0), (0,1,0), (0,0,1)]
            for axis, direction in zip (axes, dir):
                if axis:
                    new_obj.data.transform (mathutils.Matrix.Scale (-1, 4, direction))
                    new_obj.data.flip_normals ()
            obj.modifiers.remove (n)
            new_obj.modifiers.remove (m)

scene.objects is change to collections system
mirror modifier used axis are now accessible as a vector


Rotation throws object out of collision box blender game engine

Mostlikely you have an inhomogene scaling at one of the parent objects.

I suggest to apply ctrl+a Scale to ensure it is (1,1,1) at all parents.


No.

This is because the procedural texture is actually calculated by the render engine. The closest you can get is by "caching" the texture to a conventional raster image via texture baking, then using that as you would any other image texture.


How to check if Node connected to another node input in Python

To answer comment

  What I want is to test if any node is connected to the alpha channel
  of the Principled Shader. If not, I would create a White RGB node and
  connect it.

import bpy
context = bpy.context
ob = context.object
# all node based materials on object
mats = set(s.material for s in ob.material_slots
       if s.material and s.material.use_nodes)
for m in mats:
    nodes = m.node_tree.nodes
    bsdfnodes = [n for n in nodes
            if isinstance(n, bpy.types.ShaderNodeBsdfPrincipled)]
    for n in bsdfnodes:
        if not n.inputs[18].links:
            rgb = nodes.new("ShaderNodeRGB")
            rgb.outputs[0].default_value = (1, 1, 1, 1)
            m.node_tree.links.new(n.inputs[18], rgb.outputs[0])


Compositing is a form of what is known as post processing.  As the name implies, post processing is something that is done after the image is rendered.  The way Blender works, first your image is rendered, then the rendered image is sent through the compositor.  So you won't be able to see your compositing applied until Cycles is finished rendering the image.

Cycles tells you what is going on at the top of the render window, in your screenshot it says "Path Tracing" (which means rendering), when it finishes rendering it will start applying your compositing nodes and will say "Compositing" at the top.

Once the entire rendering process is completed (including the compositing), you can change what is displayed with the dropdown menu at the bottom of the UV/Image Editor.


The easiest way (without rigging or armatures) is to displace the origin of the object on the edge you want to use as hinge.

Go to Edit mode and select the edge. Then press ShiftS to use the snap menu. Snap the cursor to selected.

In Object mode use Object->transform->Origin to 3D cursor. The origin of the object will be now on the edge of the door.

Rotate the object (in this case on the local Z axis).

For more complex objects or movements beyond local axis it's better to use bones and a rig.


Why is my Cycles scene so bright even with no lights?

Most likely Ambient Occlusion is enabled. Go to Properties > World and just turn it off:

From the manual:

  Ambient occlusion is a lighting method based on how much a point on a surface is occluded by nearby surfaces. It simulates soft global illumination shadows by faking darkness perceived in corners and at mesh intersections, creases, and cracks, where ambient light is occluded, or blocked. This is a trick that is not physically accurate, but it is useful to emphasize the shapes of surfaces, or as a cheap way to get an effect that looks a bit like indirect lighting.


If I select a single vertex and drag, the whole object stretches out instead of just the vertex selected

You can subdivide and It'll add another geometry and then when u select the object from the subdivision you can drag it and it'll stretch out from the subdivision only.
You can add subdivision by pressing "R" and you can scroll up or down in order to increase the no. of subdivision.And then right click if u want it to stay on center.
Thank you hope it'll help


How do I move a parented object hierarchy to world origin

Select the parent of all the hierarchy, and in the object panel, manually set its location to 0,0,0. The shortcut is Alt+G.

It should keep the position of the children relative to the parent.


Create a shortcut to pause Preview viewport Cycles rendering?

If you use scene.cycles.preview_pause then it'll work. However it seems the GUI doesn't update. So when you resume the render you'll need to move the viewport momentarily before it will start rendering again. I'm not sure why this is, though.


Yes. You can run a dynamic hair simulation. In the Particle Systems tab in the Properties panel, check Hair dynamics.

Key Alt + A to play. The hair should fall. You can adjust the settings shown above to differ how it falls.

Further Reading

I learned my stuff from here. You can also look into the Blender Reference Manual and YouTube videos like this one.


Add and configure the particle simulation to a mesh
set this mesh as "flow", under "flow source" choose "particle system" instead of the default choice that is "mesh"
cache the simulation in the domain
you did it!


how do i get the hair particles to stand up straight

While selecting the particle emitter mesh, go to the properties tab to the particle settings and under "render", check the box which says rotation.  Now you can go over to the wheat object and rotate it (in object mode) until the hair particles on the other object are standing straight up.  You will probably be rotating it by a 90 degree angle.

Let it be known, that in order for this to work correctly, the wheat has to have its origin at the bottom of its stem.


For those who also get stuck here --- after trying a week, I get a way to workaround.

Use the Xcode debug window to set command like 'b func' instead of using the GUI breakpoint (blue arrow) is working.

Obviously it is Xcode to be blamed for.


I have managed to do it via the
bpy.ops.wm.redraw_timer(type='DRAW_WIN', iterations=1) hack.

import bpy

class TEST_OT_poll():
    @classmethod
    def poll(cls, context):
        if context.space_data.type == 'NODE_EDITOR' and context.space_data.tree_type == 'CompositorNodeTree':
            return True
        else:
            return False

class COPY_SCENE_NODE_TREE_OT_copy_to_others(bpy.types.Operator, TEST_OT_poll):
    bl_idname = "node.csnt_test_temp"
    bl_label = "TEMPT TEST"
    bl_description = ""
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):

        initial_scene = bpy.context.scene

        scenes = bpy.data.scenes.values()
        scenes.remove(initial_scene)

        bpy.ops.node.select_all(action='SELECT')
        bpy.ops.node.clipboard_copy()

        for scene in scenes:
            print(scene)
            bpy.context.window.scene = scene
            bpy.ops.wm.redraw_timer(type='DRAW_WIN', iterations=1)
            bpy.context.scene.node_tree.nodes.clear()
            bpy.ops.node.clipboard_paste()
            bpy.ops.node.select_all(action='DESELECT')

        bpy.context.window.scene = initial_scene
        bpy.ops.wm.redraw_timer(type='DRAW_WIN', iterations=1)
        bpy.ops.node.select_all(action='DESELECT')

        return {'FINISHED'}

class COPY_SCENE_NODE_TREE_PT_panel(bpy.types.Panel):
    bl_idname = "COPY_SCENE_NODE_PT_panel"
    bl_label = "Copy scene node tree"
    bl_space_type = 'NODE_EDITOR'
    bl_region_type = "UI"
    bl_category = "Tool"

    @classmethod
    def poll(cls, context):
        if context.space_data.tree_type == 'CompositorNodeTree':
            return True
        else:
            return False

    def draw(self, context):

        layout = self.layout
        column = layout.column()
        column.operator("node.csnt_test_temp", text = "Copy And Paste")

classes = (
    COPY_SCENE_NODE_TREE_PT_panel,
    COPY_SCENE_NODE_TREE_OT_copy_to_others,
)

def register():
    for c in classes:
        bpy.utils.register_class(c)

def unregister():
    for c in classes:
        bpy.utils.unregister_class(c)

if __name__ == "__main__":
    register()


How to switch between UV maps on multiple objects?

That's acutally pretty close. You just have to assign a MeshUVLoopLayer reference to MeshUVLoopLayer.active according to the API. Also I'd suggest exclude the active object from the loop and test whether there is an active layer within the poll method:

import bpy

class OBJECT_OT_set_active_uv(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.set_active_uv_selection"
    bl_label = "Set UV Layer on all Objects in Selection"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):
        obj = context.active_object
        return obj is not None and obj.type == 'MESH' and obj.data.uv_layers.active

    def execute(self, context):
        target_uv = context.active_object.data.uv_layers.active
        for obj in context.selected_objects:
            if obj.type == 'MESH' and obj != context.active_object:
                if target_uv.name in obj.data.uv_layers.keys():
                    # Active UV Layer = Target Layer
                    obj.data.uv_layers.active = obj.data.uv_layers[target_uv.name]
                    obj.data.uv_layers[target_uv.name].active_render = True

        return {'FINISHED'}

def draw_set_active_uv(self, context):
    layout = self.layout
    layout.operator(OBJECT_OT_set_active_uv.bl_idname)

def register():
    bpy.utils.register_class(OBJECT_OT_set_active_uv)
    bpy.types.DATA_PT_uv_texture.append(draw_set_active_uv)

def unregister():
    bpy.utils.unregister_class(OBJECT_OT_set_active_uv)
    bpy.types.DATA_PT_uv_texture.remove(draw_set_active_uv)

if __name__ == "__main__":
    register()
    # Test call
    #bpy.ops.object.set_active_uv_selection()


Shape of the brush is oval not a circle. why?

Your image texture is square but the UV mapping is not, it is wider than the actual mesh so the mapping has an opposite effect of narrowing the circles in the texture. You should check with a simple uv color grid to see what the mapping is first - but if you fix your uv mapping to be equal for the texture, then you should see the projection line up correctly.

This isn't a problem with your paint brush settings, but a texture UV mapping issue.


There are a few things you can do. First would be to adjust the "Roll" of bones in edit mode, then they will have the same starting rotation. You can also restrict rotation on the axis of weird twisting or in Copy Rotation Constraint properties set copy only to those axis that work properly, or if the rotation of bones on the twisting axis is exactly opposite, select Invert in Copy Rotation Constraint properties for this axis, but if you want to have easy life with the rig, use the first option.


How do I "unlink" or "make local" a created proxy?

As a workaround, one could save the proxy's associated data(Animation,Materials,etc) through fake users, then delete the associated linked library in the outliner, append the original object or armature the proxy came from, if the file is still available, and then reassociate the data.


Help accessing code from addons without making the user enable the addon themselves

Addons are modules
In blender the addons folders are added to the system path.  Addons are imported as modules.
The preferences displays the path, hence for "Bool Tools"

its the name of the py file object_boolean_tools  and for Add Mesh Extra Objects,

the name of the folder containing the __init__.py file. (add_mesh_extra_objects) Standard python module "stuff".
To import the bool tools module:
>>> import object_boolean_tools
>>> object_boolean_tools.
                         AddonPreferences(
                         ApplyAll(
                         ApplyThisBrush(
                         Auto_Boolean(
                         BT_ObjectByName(
                         BToolSetup(
                         BTool_AllBrushToMesh(
                         BTool_BrushToMesh(
                         ...
                         shortcut_list
                         unregister(
                         update_BoolHide(
                         update_panels(

to import a method from it, etc
from object_boolean_tools import update_panels

Enable the addon
To enable an addon without the user having to do it manually, recommend usage of the Addon Utilities module.  Consult the docs. eg there is an option in the enable method to pass an error handler.  A simple example of usage, check if the addon is enabled, if not enable it.  Could flag its enabling in register and if-so disable in unregister.
>>> from addon_utils import enable, check

>>> loaded_default, loaded_status = check("add_mesh_extra_objects")
>>> if not loaded_status:
...     enable("add_mesh_extra_objects")
...
<module 'add_mesh_extra_objects' from '/home/batfinger/blender-git/xxx/bin/2.91/scripts/addons/add_mesh_extra_objects/__init__.py'>

Note on my system the boolean tools addon does not register.


The easiest way is to bake the procedural texture into an image:

Add a plane into the scene, UV unwrap it and assign the procedural texture to it through emission shader (renders the fastest).
In UV/Image editor create a new texture of desired resolution.
Add texture node into the shader (unconnected but selected) and load the texture into it.
Bake the emission to the texture. Save texture as you desire.


Trouble combining multiple objects in the same mesh

Blender 2.8 edits all selected objects

  "They show up as being a part of the same mesh,"

A new feature of blender 2.8 is the ability to edit more than one object at once.  When entering edit mode, all selected mesh objects toggle into edit mode.

Going by the outliner in screenshot this is the case.

There is no need to separate them again.  Separating adds the newly separated object in object mode, so it appears to work, but is probably unnecessary

To edit one at a time, toggle out of edit mode, select only one object and toggle back in.


You could select the verts that are connected to these edges and then hit X >> 'Edges'. But Edge Select Mode is much better for this. You can change the select mode in the header:

Now you can simply right click them and delete them.

The faster way that might work:

In Edge Select Mode, deselect everything with A, then hit CTRLALTSHIFTM. This will select all edges that do not have 2 faces attached to them.

But your Mesh has a Mirror Modifier, so you'd have to deselect those edges. Luckily there's a third option:

Be in Edge Select Mode, select one of these edges with a right click and then choose from the header menu:

'Select' >> 'Select similar' >> 'Amount of faces around an Edge'. All orphan edges will be selected and you can hit x >> 'Edges'.


Solved. I have figured out why.
The reason for this was that there was two extra faces? I think I might have extruded it by accident and didn't notice.


When is cubic texture interpolation helpful?

Let's look at what the two mean and create examples. Our example image will be this (enlarged) $2\times2$ pixel grid:

Linear: In spaces between other pixels, there is a linear gradient of the two mixing colors:

Cubic: In spaces between other pixels, there is a cubic (also called Ease) gradient between the two colors:

When we compare the linear and cubic interpolations, the eased one seems to "bleed" a little bit, creating a much smoother interpolation, but it doesn't leave the original lines as defined, so it will blur the image.

Let's look at it with a more complex image:

Linear:

Cubic:

Essentially, Linear interpolation will hold to the original definition of the shapes in the image, but won't look as pretty. Cubic interpolation will look nicer and smoother, but that comes at the cost of image clarity, since the image will appear blurred.

Also, when I did (very) small test renders on my computer, Linear was milliseconds faster than Cubic.


Ctrl1 adds a Subdivision Surface modifier with one subdivision, Ctrl2 with two subdivisions and so on. However, adding the modifier this way only changes the number of subdivisions used in the viewport, and the number used for the render gets its default, which is 2. Go to the Modifiers tab and change the Render value in the modifier to the same as or higher than the View value. The idea behind this is to get an idea what the subdivision does even in the viewport, without making it too computationally demanding until it's really needed, which is, of course, in the final render.


Choose arbitrary vector as "up_axis" for camera with "Track To"-constraint

Align to and roll on vector.

In a related question showed the math of aligning an object to the view as defined by the camera, instead here will align the camera -Z axis to the object and roll the camera randomly around it.

Vector v2 is the global direction camera faces

Vector v1 is the vector defined looking at camera from object

The rotational difference between the two gives us the rotation required to make camera point at object

Change the space to rotate about the origin point of the object in global space.

Make another random rotation matrix to roll about this point about the axis v1

Test script (often would use context object for cube and scene camera for camera, to avoid need to edit and run, rather simply change active object)
import bpy
from mathutils import Vector
from mathutils import Matrix
from math import radians
from random import random

camera = bpy.data.objects.get("Camera")
target_object = bpy.data.objects.get("Cube")

cmw = camera.matrix_world
tmw = target_object.matrix_world

v1 = tmw.translation - cmw.translation
v2 = cmw.to_3x3() @ Vector((0, 0, -1))

R = (Matrix.Translation(cmw.translation) @
    v2.rotation_difference(v1).to_matrix().to_4x4() @
    Matrix.Rotation(random() * radians(360), 4, v1.normalized()) @
    Matrix.Translation(-cmw.translation))

camera.matrix_world = R @ cmw

Possibly worth mentioning, could do same by rolling first on v2
R = (Matrix.Translation(cmw.translation) @
     Matrix.Rotation(random() * radians(360), 4, v2.normalized()) @
     v2.rotation_difference(v1).to_matrix().to_4x4() @
     Matrix.Translation(-cmw.translation))

Make a dolly
Another approach would be make an empty, parent camera to empty. Track the empty to the cube.  Simply roll the camera using the z axis.
Examples.
https://blender.stackexchange.com/a/130456/15543
https://blender.stackexchange.com/a/176762/15543


Texture uses UV, Pixel effect uses Object Texture Coords

Two parts in this node tree:

Find the rotation of the empty

This is done using two radial gradient textures, one from the UVs one from the empty and get the difference.
As the gradient goes from 0 to 1, there is a discontinuity at the limit. To compensate that we look if this is a negative value and if it is set it back positive adding 1.
Then map from 0, 1 to 0, 2*pi in order to have the angle.

Use this rotation before snaping

From the angle above, rotate, snap and rotate back.
Note: set the image texture interpolation to closest as snap node may make glitches if not (this is not done in the file below).


How do I change my Edge Loop color from yellow to blue?

Edit > Preferences >Themes > Usere Interface > Axis and Gizmo Colors > Gizmo Primary


I looked at your file. As @Denis stated: You activated Snapping, the little orange horseshoe. Just disable it using Shift+Tab, and you can move the bones around again.


Weird semi-transparent lines and rectangles problem in Blender Internal Render (2.79)

Seems like problem comes from "Light" texture, it uses gradient to darken some shadeless materials and somehow final result has stripe artifacts.
After playing with the settings, I've found two ways to prevent it (still don't know why is it even happen):

Decrease "Light" texture's Filter size

Enable Autosmooth on the ground object:

P.S. didn't test it on other camera angles, problem might appear again.


In blender there are two Warps.

Warp Tool

The Warp tool pulls selected vertices towards the 3d-cursor. thats it.

Warp Modifier

The Warp modifier, doesn't appear to do what you'd like it to. It will warp in a straight line from A to B.

Tube Tool (can ..sortof)

TubeTool comes closer. Here a a description ( https://blender.stackexchange.com/a/28193/47 ) and here the link to the GitHub repository. Feedback welcome.

TubeTool labours under the assumption (currently) that the selected faces are part of one object. At present that means maybe duplicating them, separating selection and then joining them together into one object. The faint blue line emanating from the faces shows their normal, tube tool allows you to flip the perceived normal by providing an option to specify direction (negative or positive).

This will at the very least give you a nice curve between the two faces, from that point you can select a Bevel Object or reduce the amount of subdivisions in the default bevel circle. The upside to attaching a Bevel Object once the curve is created is that you can adjust the geometry of the Bevel Object to match the two faces.

TubeTool isn't very sophisticated yet, but it could be worth checking anyway - and I'm open to suggestions.


How do I make a boxed extrusion on a cube that has a subdivision surface modifier?

Select the end face, and the four edges. Next press Shift+E to crease the selected edges.
You can also crease the edge loop at the base to make the extrusion like a cube. This method works mostly the same for extruding inwards as for extruding outwards. You may need to crease more edges, especially those on the face.


Compress vs Uncompress when managing blend files with GIT

Back to your title's question:

Compress vs Uncompress file into version control system?

Use compressed if the system can not create a differential
Most version control systems have their own compress algorithm when storing each file.
Using Blender's compression will only confuse the system on file content and unable to find a minimum diff between different versions of files which may lead to massive amount of savings in your repository.
While some systems using .gz or other common compression methods, .blend files are most likely treated as binary files unless there is a toolchain to let the system decode the meaning of Blender's files. So an uncompressed .blend  might be treated as a compressed one, then choose the smaller one since Blender's compression is specifically to it's own file type.


Do a translate followed by a rotate followed by a translate

Can also obtain the equivalent of keystrokes gxx5 rzz45 gxx5, (ie local transform on x by 5, rotate on z by 45 degrees, local transform again by 5), by creating transform and rotation matrices, and chaining them together via matrix multiplication in the order wanted.

import bpy
from mathutils import Matrix
from math import radians

# Translation matrices
T0 = T1 = Matrix.Translation((5, 0, 0))

# Rotation matrix
R0 = Matrix.Rotation(radians(45), 4, 'Z')

obj = bpy.context.object

#
M = T0 * R0 * T1

obj.matrix_world = M * obj.matrix_world


How to start playing the video from the green cursor rather than from the beginning of the time-line?

From the Timeline editor's bottom menu select Playback and tick Follow.
Then Alt+A will play from the cursor.


What's the use of tool, 'Sort Elements'?

For almost all operations, there is no need to resort the geometry.

In a blender mesh, every vertex has index. The indices are usually set in the order, in which the vertices have been created.

I have created the vertices in this figure in this order.

Executing a short python script, we can confirm find out, that the actual indexed order is different. (When executing the following python scripts, toggle at least once into object mode to update the vertices property.)

import bpy

ob = bpy.context.object

# get x coordinates for every vertex
x = [v.co.x for v in ob.data.vertices]

print(x)
# >>> [0.0, 2.0, -1.0, 1.0, -2.0]

This is the indexed order of the vertices.

However, when we select the vertices and execute Mesh > Sort Elements ... > View X Axis, the order has changed and the vertices are sorted.

>>> [-2.0, -1.0, 0.0, 1.0, 2.0]

All operations (internal or scripted addons), which are dependant on the index, are affected when resorting the indices.

For example, I executed W > Randomize Vertices on two meshes. The right mesh has been sorted prior. The results are different.

Here is a gif to reproduce the example.


Unlike most command line programs the order of the options make a difference. The thing to remember is that blender executes each option in the order they are given, almost like a mini script.

The command you used blender --python-text my_text_block_name scene.blend says run this text block then open this file.

To get your example working you want to open the blend file then execute the text block - blender scene.blend --python-text my_text_block_name

More details about Blender command
and some example of how order works.