AttributeError: '_RestrictContext' object has no attribute 'object'

Some edits
Give operator a poll method so it requires an active object of type mesh (or a type that can have decimate modifier)
Add the modifier using the api method.
bl_info = {
    "name": "test",
    "author": "Aziz",
    "version": (1, 0),
    "blender": (2, 80, 0),
    "location": "...",
    "description": "...",
    "warning": "",
    "doc_url": "",
    "category": "Mesh",
}

import bpy

class ReducePolygons(bpy.types.Operator):

    bl_idname = "reduce.polygons"
    bl_label = "Reduce Polygons"

    @classmethod
    def poll(cls, context):
        ob = context.active_object
        return ob and ob.type == 'MESH'

    def execute(self, context):
        ob = context.active_object
        dm = ob.modifiers.new(name="Foo", type='DECIMATE')

        dm.decimate_type = 'UNSUBDIV'
        dm.iterations = 1
        bpy.ops.object.modifier_apply(modifier=dm.name)
        return {'FINISHED'}

class LayoutDemoPanel(bpy.types.Panel):

    bl_label = "test"
    bl_idname = "SCENE_PT_layout"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"

    def draw(self, context):
        layout = self.layout

        layout.label(text="Mesh Optimizations:")
        row = layout.row()
        row.scale_y = 2.0
        row.operator("reduce.polygons")

def register():
    bpy.utils.register_class(LayoutDemoPanel)
    bpy.utils.register_class(ReducePolygons)

def unregister():
    bpy.utils.unregister_class(LayoutDemoPanel)
    bpy.utils.unregister_class(ReducePolygons)

if __name__ == "__main__":
    register()


View jumps around when clicking with 'lock to 3D cursor' enabled

I found a solution to the issue I was having in the settings by unchecking 'Prefs -> Navigation -> Orbit & Pan -> Auto -> Depth'
The description says it uses depth to improve the navigation functionality but I feel like when using lock to 3d cursor it is more of a hinderance, which is a shame because it does improve the navigation when not locked.


I'm using cycles render and I can't figure out how to render the image texture

In properties, goto material. And click use nodes if you haven't already.

 Then click the circle next to color, and select 'image texture'.

 Then use the drop down menu to select your texture, then render, and done.


The 3d instance trails can be done in more than 1 way in Animation Nodes.

First, please note that the example video is actually using 2d footage with alpha (green screen) and basically stacks the img/frames on top of each other. The impression of 3d is just like those Dragon paintings that are allover the net. There is some 3d as the water or such, but that is not the essence of it

To do this with 3d objects, in Animation Nodes I detail in the video 2 cases:

a very simple motion/transform. this is very easy, just need to read the values for every frame, given a keyframed motion.
a more complex animation with armature/bones. here there are several solutions, but I prefer using Actions/ NLA strips cause they leave the most computation to Blender and not to python (way slower). just instancing and tweaking a limit to those nla strips

it also includes variants for all frames / offset frames and some indication for further using cycles or scaling effects etc.

AN Motion instance trails 1:

https://youtu.be/q9unQC3PTcI

Note:

For the 2d effect, you need to stamp the images on top of each other. That can be most efficiently done in Blender using Dynamic Paint, and just stamp the frames with an obj on another. The settings are not quite easy, as you may not want blur or antialias or so, but that is another topic, another q.

Even for your own 3d rendering that should just work, maybe with some extra 3d eff on top, in editing..


Is it possible to access an array in a custom property in a driver?

Use self.

Assuming the driver is on the same object as property

Have set a custom property on the object

>>> C.object["xxxx"] = [4, 3, 2, 1]
>>>

Scene current frame is known to the driver namespace as "frame", and can be used in expression without setting up a scene.frame_current driver variable for it.

Set use self of the driver to true, and self is the driven object in expression.

self["xxxx"][int(frame) % 4]

Driver variables by default are floats, hence the need to typecast frame

Getting Fancy

Can add pretty much anything to the driver namespace.

A simple wrapper class with a move method using the "xxxx" custom property if defined else use a default.

import bpy

class Mover:
    def move(self, frame):
        l = self.ob.get("xxxx", [0])
        #print("debug...", ob.name, frame)
        return l[int(frame % (len(l)))]

    def __init__(self, ob):
        self.ob = ob

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

Can now add the driver to any object

Mover(self).move(frame)

or since frame is in namespace could grab its value, with a default juuuuust in case

frame = int(bpy.app.driver_namespace.get("frame", 0))

and the driver can become

Mover(self).move()

The possibilities are endless.

Note when using self in drivers the slow expression warning is reported, for what are the simplest of expressions.

Use self and the slow python expression


To make particles rendered only in certain areas during animation you should control their size with a texture assigned to particles system. In this case particles will be emitted but will be visible only where texture allows them.

Create a cube which will act as a 'domain' for your particles (it will affect particles' appearence).
Scale it accordingly with the object. Rotate it 90 degrees by Y axis.
By default texture of Blend type will use X and Y axes for mapping. In this example cube will be moved by Z axis, hence all the coordinate system should be changed. For this reason the cube will be rotated to rotate its coordinates which will be used as coordinate system for particles' texture. Hence do not apply scale and rotation.
Position cube appropriately and keyframe its location.
While in Particle System settings go to Textures tab and create new one (make sure that type of textures is set to Particles in the top of the Textures tab).
Switch its type to Blend (to use texture as a gradient).

Open Colors rollout, check Ramp and create 2 more color stops to make texture influence in both directions (in this case, +Z and -Z). Choose appropriate Interpolation type, in this case used Constant for more visible effect. Set up color stops so black is in the corners and white is in the middle.

Because texture influence should change together with moving object, that object can be choosed as texture coordinates centre. In Mapping rollout choose Object and select that scaled and rotated cube from dropdown list.

Lastly, in Influence tab uncheck Time and check Size. The particles' appearence will be controlled by affecting their size instead of density.
While Density will work it won't cause refresh of amount of particles emitted when object used as coordinates centre moves (probably a limitation) and hence this won't work for animation.

Now particles will be shown only as the cube moves down:


Can I affect the particle frequency of objects in a collection?

In the particle settings select the Use Count for your collection. Then change the count for each item in the collection.  See the settings near the yellow arrow in the image above.


You already answered your question by your own:

Behavior:
When moving play walk animation

This implies:
When not walking -> do not play walk animation.

As you do not explicitly told the character to stop (e.g. by command) you need to detect any events that stop it from moving.

There are many options to detect such events:

no movement requests from user
getting other requests from user (e.g. jump, run, stand, crouch)
hitting a wall
floating (e.g. when falling, jumping)
speed below a limit

I guess you want to know the last option. This is not possible with logic bricks. You need Python to activate actuators when the object does not move anymore:

import bge
controller = bge.logic.getCurrentController()
owner = controller.owner

limit = owner.get("limit", 0.001)

lastPosition = owner.get("_lastPosition")
position = owner.worldPosition.copy()
owner["_lastPosition"] = position

if lastPosition is not None:
    travelledDistance = (lastPosition-position).length
    if travelledDistance <= limit:
        for actuator in controller.actuators:
            controller.activate(actuator)

This needs to be activated all the time (enable True Level Triggering).

Attention

this is inefficient and should be used at a very limited number of occurrences
this does not differentiate between other situations when the character is not moving (e.g. sitting, sleeping)
you can tweak the limit by setting a float property limit


Make the original mirrored object invisible

Don't know how to do this properly, but here is what I came up with:

You could create another object that envelops the object you want to hide and use a boolean modifier with difference set as the operation. Then just hide the enveloping object as shown in the image :-

You could offset the mirrored object's UVs (see image) by (1, 1), then in the shader substract (1, 1) from UV coordinates - the mirrored object will have original UVs and the original object will have negative coordinates. Enable alpha clipping in the material, make transparent everything that has UV coordinates less than 0 and the original object should be invisible. Similar results could achieved by comparing the coordinates of axis the object was mirrored along. The original object would still cast shadows though so beware


Motion foward is stoping the character's fall

I haven't used logic bricks since 2008, and I quickly moved into python scripting for more flexible control, but I believe the issue you are seeing is from your Servo Control attempting to match all of the velocities, instead of the axis you expect it to effect.

I assume Z is up, and that your servo control is set to zero. The servo control tries to reach zero velocity on the z axis, effectively resisting gravity!

The XYZ limit buttons below the Linear Velocity field actually limit the force the servo can apply to reach the target linear velocity. If you turn on the Z limit button and leave the min/max values at zero, then the servo control will have no power over your Z axis.

Good luck!


Blender 2.8 Eevee depth of field "geometry clipping" issue

Yes in Cycles everything looks ok. I found some workaround using defocus node in post. Enyway the bug is still there.


Yes,Thise is possible using a new branch under developing right now (Not officially).

All you have to do is to create images in the image editor and use them in your nodetree,and you can paint in the viewport of in the image editor.

You can see PBR painting at the end of this video

And you can download the branch from here.

Edit for the question in the comments:

Yes you can in the viewport painting,just check cavity mask and edit the curve to get what you need,
But I love doing it procedurally using nodes and pointiness feature.


Your first question is not very clear, maybe show a picture of the kind of crown you want to create. If you want to fill a face, select the 4 vertices you want and press F. But instead of extruding 4 distinct vertices, select a top face and extrude it with E then scale down. You can simultaneously extrude several faces as individual faces with alt E, then scale them down with the Pivot Point set to Individual Origin.

For the second question: You can either model or sculpt your ornement. If you choose to sculpt it, the best thing is to keep a low-version of you crown, and once you're good with the sculpted high version, you bake its normals and use the normal map you get to fake 3D on the low-poly. To sculpt I guess you can do it 2 ways: either with the Multiresolution modifier or with Dyntopo. Here is a comparison that might help: sculpting - Everything is edgy and sharp, but I want it smooth


For whatever reasons, hard to say without knowing how you weighted the model, those vertices have not been properly weighted.  Thankfully, it's easy enough to fix.  Select your object and switch to weight paint mode.  Select the appropriate bone.  'v' switch to vertex mode and select the vertex (probably a single vert, so just RMB.)  In properties/data/vertex groups, make sure your assign scale is set to 1.0 and hit the assign button.  (Selecting the bone earlier should select the appropriate vertex group automatically.)

There are plenty of other ways to do this, some of which would be easier, depending on how your model is laid out.


How to subtract alpha channel from another alpha channel?

You need nothing more then a Mix node set to Subtract with a factor of one.

To replicate your bottom image, plug your first image in to the first socket on the mix node, and the blurry image into the second socket.


How do I sort out this tracking actuator?

1. Select a plane and create a Navmesh.

2. Add game property to object (the object can be located in another layer and the property can be any type you need).

3. Configure the logic bricks for the tracker object with steering actuator.

4. Finally the script.

tracker.py.

from bge import logic
class Tracker():
    def __init__(self, controller):
        print('init')
        self.objective_list = [obj for obj in logic.getCurrentScene().objects if 'objective' in obj.getPropertyNames()]
        self.actuator = controller.actuators['seek']
        self.actuator.navmesh = logic.getCurrentScene().objects['Navmesh']
        self.actuator.behavior = 3
        self.actuator.selfterminated = True
        self.tracking_obj = False
        self.colSensor = controller.sensors['Collision']

    def change_objective(self):
        if self.objective_list:
            return self.objective_list.pop()
        return None

    def main(self, controller):
        if self.colSensor.positive:
            print('HIT..')
            self.colSensor.hitObject.endObject()
            self.tracking_obj = False
        if self.tracking_obj:
            print('seeking')
            return
        print("Getting objective")
        self.actuator.target = self.change_objective()
        controller.activate(self.actuator)
        self.tracking_obj = True

def main(controller):
    if not 'init' in controller.owner:
        controller.owner['tracker'] = Tracker(controller)
        controller.owner['init'] = True
    controller.owner['tracker'].main(controller)

Blend File


Press ⎇ AltF10, this is the shortcut for Toggle Fullscreen Area, which can be found in the View menu. As you loose the menus in this mode you either need to use ⎇ AltF10 or ⎈ Ctrl - ← Left arrow or → Right arrow to get everything back. This differs from maximise area as it also removes the info editor and headers.

If you also use ⎇ AltF11 to go into fullscreen mode you also loose the window border and get nothing but the 3dview on your monitor.

An older answer provides an addon that displays mesh component counts. A small adjustment will enable it to display in the properties region so that you can see it while in full screen mode, using N to show/hide it.

Find class Properties_meshinfo(bpy.types.Panel): and change the following lines to place it in the 3d view.

class Properties_meshinfo(bpy.types.Panel):
    bl_label = "Mesh Information"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"


How to get/select a bone by it's name in python?

This also works
bpy.data.objects["Armature"].data.bones["Jaw"].select = True


If you look in the upper left corner when you are doing the Extrude Along Normals you will see that you can change the behaviour. In this case you can press S or Alt to get Even Thickness.

Even Thickness is also an option in the Solidify Modifier.


Render your animation to png, not as FFMPEG. So you will have your single frame pictures on your hard disc. You can then make a movie out of it with video editing from Blender. If you are just missing one frame of your animation, you still have a 99% of a movie - instead of nothing.
If you want more help you should provide us your .blend file.
Reason for being stuck can be a lot. From you machine has to low memory until it is not stuck, but just calculating ...


If you just want to organize them conveniently, you can simply group them into a new group (or several, if needed). To select all objects within a group, first, switch the Outliner's Type display mode to Groups, then click on the icon(s):

If you want to remove them out of those empties, you can press Shift Ctrl A to make all selected duplicates real, instead of instancing:


Are there any critical drawbacks of rendering animation on per frame basis?

No, if you render all your frames individually the result will be the same of pressing "Render Animation". This button is only iterating over all frames and sending the render command for each of them.

As for the render crash, you could use a modal operator that checks if you press Esc (for example) and aborts the render without making Blender crash


As far as I know, Blender doesn't have that feature. And settings the percentage doesn't work, because it is limited to whole numbers.

Here is a workaround using math.

Lets say the resolution is 1920 x 1080 and you want to scale the width down to 1000, then the following will keep the aspect ratio.

width  / previousWidth * newWidth = newWidth
height / previousWidth * newWidth = newHeight

The same applies the other way round.

Since the current width is already input in the resolutions X field, we can go into that field and add the number for previousWidth x newWidth. When exiting the field the value will be calculated. Repeat the same in the resolutions Y field with the same data.

This is how it looks in action.

Since pixels are whole numbers, the exact proportions can not always be retained.


How do I make a normal/displacement map when all I have is a photo?

I've compiled a list of options when it comes to normal and bump map creation. All that remains is to try few of these out and see which results you like best.

To me, the most advanced of the free solutions is MaPZone 2.6, but I haven't tried any of these so I am not sure.

Or you can try the web based Smart Normal, for very basic normal maps generation.

Another tool is  Knald which offers high quality, accurate height maps generated from a Normal/Derivative or photo-sourced texture.

I didn't include urls, since they can be easily googled.


How to get dirtiness on a simple texture?

I would recommend establishing a paint set up in Blender first on the model by painting details on the model in the 3d view using Texture Paint mode, and then take the saved image textures into Photoshop to further build on the initial block out. Here in the picture I have used a cloud texture on a texture paint brush set to multiply and Rake and Random for the stroke, and painted grunge burns on the areas where I cloned the image texture into my basic canvas texture.

One thing to note is that you can use Photoshop to paint in 3d view, so you might just try importing your model as .obj with your basic material and texture and then adding a layer in photoshop, doing your detail work there.


After importing a .fbx model in blender it's not smooth with visible faces in viewport as well as render

I haven't used Fusion, but I know that the models in that software are geometric representations for mathematically-based models of designs to be used in real life. This means the geometry is automatically generated depending on things such as display resolution, zoom on the model, and model complexity among other things.

When you convert it into an FBX model, Fusion has to decide how to compress this mathematically-based model into an actual geometric model. I believe that unless Fusion doesn't have the setting to increase the resolution of exported models (which I doubt), then this issue isn't necessarily a problem for Blender.

Nonetheless, if you cannot make model smoother by using the subsurf modifier, make sure the modifier is visible to both the camera and the viewport (the eye and camera symbols in the modifier tab should be selected):

Otherwise, I'd suggest this:

Make sure the object is actually a mesh and not something else like curves possibly (if not convert it into one).
(optional, but might make selection easier) Use Alt+J to turn triangle faces into square faces.
Select the hard edges of the model and use Shift+E to add creases.
Use the Subsurf Modifier or smooth subdivide to smooth the mesh.


How to call python animation node operator?

For Animation Nodes I developed a system that automatically generates operators for certain functions on nodes. Otherwise I would have to write a lot of overhead code all the time. This is why the operator has a weird name like invoke_function_1. It also explains why the operator does not exist when you run your script at first. The operators are only created when needed.

Those operators are only should only used on the UI. In all other cases you should call the underlying functions directly.

In your case you have to do something like this: bpy.data.node_groups["NodeTree"].nodes["summary_list"].newInputSocket().


There is no one click button to make blender act just like sketchup, but most of what you want can be done.

To turn on grid snapping press Shift Tab.

By "Selectable surfaces" I think you would want to select a face. So in edit mode (Tab to toggle in and out of edit mode) press Ctrl Tab > Face.

All keyboard shortcuts and mouse actions can be changed through the user preferences. File > User Preferences or Ctrl Alt U then the Input tab.


How to restrict to cycles use only 90% of gpu?

From the Blende manual on GPU Rendering

  Why is Blender unresponsive during rendering?

  While a graphics card is
  rendering, it can not redraw the user interface, which makes Blender
  unresponsive. We attempt to avoid this problem by giving back control
  over the GPU as often as possible, but a completely smooth interaction
  can’t be guaranteed, especially on heavy scenes. This is a limitation
  of graphics cards for which no true solution exists, though we might
  be able to improve this somewhat in the future.

  If possible, it is best to install more than one GPU, using one for display and the other(s) for rendering.


Shape key driver not working with IK bones

You should try some or all of the following things:

Unlock the shapekeys:

In your Driver Editor, choose Type > Averaged Value:

Create a Modifier > Generator with a X value of -1:


particle object rotation beginner question

This is because the origin of the leaf object is at the bottom(so try to set the origin at the bottom of this leaf object). Also, try to rotate the original leaf object(experiment with the rotation of the leaf object you will get an idea about it). I think you know how to change the origin of the object.


UV mapping a Logo on Specific face of object

The distribution of the material has nothing to do with the UV layout. You have 3 material slots, 2 of which are empty and apparently not assigned to anything.
Go into edit mode select everything, assign a material to the 1. slot and press assign.
Then select only the face the logo is supposed to be on, select the 2. slot and press assign.
That will fix it in your case, but best practice is to keep it in one material, use a 2. UVLayout just for the logo and mix it in with your main texture (or color).


How do I hide an emitter plane while keeping it's emitted light visible in a cycles render?

In the object settings, uncheck "Camera" under "Ray Visibility";

This;

Becomes this;

This setting removes the emitting object from view (while leaving it's light) regardless of whether you are looking through a camera or the normal viewport.


Difference Boolean 2.8 not working as expected; Weird shading and not removing face

In the SVG shape - delete the edge split modifier.
In the cylinder add an edge split modifier.

The current edge split modifier is breaking the shape into multiple pieces which doesn't work with the boolean modifier. Using an edge split after the boolean operation will give you the sharp edges you want.


Cylinder becomes deformed at corners with curve modifier

!!! Check out my other Answer which avoids using the curve modifier.

If you don't want a curved look at the corners but you have to use the curve modifier then you might do this:

Since the curve modifier tries to displace vertices along the curve you need some more vertices so the deformation can be closer to the real shape of the curve. So a simple solve would be to add some loop cuts to your rope or do the detail modeling of the rope first (because then the rope will probably have many more vertices anyway).

Also for the modelling part of the rope-like ornamentation maybe have a look at the rope-modeling answer by @Robin Betts:
How to make a rope curving in a certain way

Happy Blending! :)


Is there a way I can display live/real time webcam video in the Motion Tracker?

Unfortunately no. It may be possible to stream video in using a codec module via python however the tracking markers likely couldn’t reliably keep up at a standard frame rate for a 720p+ so you would be limited to tracking sub HD resolutions and/or suffer delay/stuttering. Tracking via proxy and putting track over full resolution might work but would incur accuracy errors and be harder to track. There are programs designed specifically for real time tracking which you would be much better off using than Blender.

Also don’t forget that even if you managed real time tracking the best graphics quality you could achieve is GLSL render or BGE. Unless you are a shader code expert you would be quite limited by this. Though not terrible certainly a step down from other rendering options.

If you are into coding and want to find a non standard solution to this problem you could do a search for a real time tracking module and stream it your video and enter the resulting track data into a more capable game engine... But it would be a lot of work, certainly not the easy and Blenderish way your asking for :(


I see that You set render samples to only 10 but used an emission node.. so I suppose You are trying to get a shadeless material..

the correct node setup for this kind of result is this:

don't really need for a 100 emission size, just 1 to 3 ^^

If You are trying to reach a different kind of result so... raise up your samples to 200 up to 1000 to archive much better results in cycles :)


Make particle instances stand on the plane but rotate randomly

Under the Rotation settings (which have to be enabled, as they are) increase the Random property under Phase.


Make sure you apply any previous transformation to your curves/mesh (in Object Mode) with Ctrl+A, in my case, X axis was scaled to zero so naturally it became flat.

I did not realized this all the while thinking the only transform I did was in edit mode.

Hope that someone find this helpful as well :)


Render layers: what is All Z, Zmask and Mask Layer

When "Mask Layers" are used, any render information from the selected layer is omitted from the active render layer.

In blender Z is generally used to determine depth and distance away from the camera. I can only assume "Zmask" would be omitting things base on distance depth away from camera.

I do not have an answer for "All Z".


Use Snapping.
Select the vertices you want to move.
Enable snapping (magnet icon) and set it to Snap to Vertices.
In a lateral Orthographic view move the vertices you want to align.

Other tools to be aware of:
Scaling to zero.
Select all of the vertces and scale to $0$ on the axis you need.
In this example all of the vertices are scaled on the z axis, this is done pressing SZ$0$:

For a more precise alignment, copy the coordinates of a vertex in a given axis, and make the selected vertices be at such coordinates using the Item > Transform tab.
You can set the coordinates to global.

To copy and paste values, just move the cursor over to the value you want to copy and press Ctrl+C to copy and
Ctrl+V to paste


Roughness in cycles render. Need help with nodes

First of all problem with the roughness raised because of the missing glossy map. To tell the truth, I don't have it :)
So if you created your maps as me in photoshop and applied it as texture (Normal; Diffuse and the main one)  always save it as tiff format (don't forget about compression when you save it). Other formats like png make less quality. Also, use RAW photos as donors of maps.
Second: if applied your hi-res texture on your object(without a glossy map) and after rendering you're found that the object looks dry ( For instance you rendered you brownie cake or donut) don't worry! You can solve this problem with MIXShader. After changes of your Principled BSDF Shade create the second one, Glossy Shader. Turn off the first one and adjust glossy shader. Then add Mixshader. Connect Glossy and Principled Shader to Mixshader and magic will happen.
In my case, I adjust bump and normal maps they blowing out my object reflectivity. It helps a lot but not as I want because of a problem with the texture source material.
Second I didn't use HDRI, therefore I add it.
Thanks to everyone who helped me!!


How to control one object with two pivot points

One way is to use Active element as pivot point.

Parent both empties to your object
Set Pivot point > Active element
Select your object and then the empty you want to pivot around


Displaying airflow inside of an engine model

Smoke seems like the correct medium to display airflow. Since Blenders smoke does not support suction, you'll have to fake the flow using multiple Forcefield.

Model a simplified collider and mark it as a smoke collision object.
Add an emitter which is fitted into the collider.
Add a forcefield to direct the smoke.

If you use multiple forcefield, make sure they don't intersect by using the maximum distance and falloff properties.

In the smoke domain, decrease the temperature difference to a small value. Otherwise the smoke will drift upwards or downwards on its own.

Hide the collision object before rendering.

Connected smoke interacts. This enables us to fake suction by filling the whole domain. I filled the whole domain with red smoke, except for the entrance. After the first frame, no red smoke is emitted (keyframe the Volume Emission), but green smoke is continuously being emitted. The green smoke will now get pulled even though it does not intersect with the forcefield.

With rgb colors, we can extract the color information and use it as a mask for rendering.


Script not running as Handler or in Driver

Below is the code that resulted in proper solution to my problem. Thanks to @Chebhou who provided help and resolved the issues in my code. Refer to the comments in the first post for clarification.

import bpy

def refreshNow(val):
    mat = bpy.data.materials['Material']
    nodes = mat.node_tree.nodes
    nodes["Mix"].inputs[0].default_value = nodes["Mix"].inputs[0].default_value
    bpy.context.scene.update()
    return val

refreshNow(0)

bpy.app.driver_namespace['refresh'] = refreshNow
#scene parameter was missing in original code
def my_handler(scene):
    refreshNow(0)

def register():
    bpy.app.handlers.frame_change_post.append(my_handler)
# this was also missing from the original code, I still don't know what it does, but it works!
if __name__ == "__main__":
    register()

===Alternative Solution Using Modal Operators===

I managed to fix the issue by using a Modal Timer rather than utilizing handlers or drivers. This is not exactly a solution to why the driver or handler doesn't work but it is definitely a workaround to get what I wanted done.

Below is the code for anyone who might need it in future. This is simply the Modal Timer template, I just replaced the default functionality of changing theme color to reinforcing the MixRGB node's factor input to itself. I have also removed the functionality of cancelling the event.

import bpy

class ModalTimerOperator(bpy.types.Operator):
    """Operator which runs its self from a timer"""
    bl_idname = "wm.modal_timer_operator"
    bl_label = "Modal Timer Operator"

    _timer = None

    def modal(self, context, event):
#        if event.type in {'RIGHTMOUSE', 'ESC'}:
#            self.cancel(context)
#            return {'CANCELLED'}

        if event.type == 'TIMER':
            mat = bpy.data.materials['Material']
            nodes = mat.node_tree.nodes
            mix = nodes["Mix"].inputs[0]
            mix.default_value = mix.default_value
            print('Current Frame:')

        return {'PASS_THROUGH'}

    def execute(self, context):
        wm = context.window_manager
        self._timer = wm.event_timer_add(0.1, context.window)
        wm.modal_handler_add(self)
        return {'RUNNING_MODAL'}

    def cancel(self, context):
        wm = context.window_manager
        wm.event_timer_remove(self._timer)

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

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

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.wm.modal_timer_operator()


These are the shading effects visible on the mesh. They were added with Tangent Shading from the Materials > Shading rollout.

From the manual:

  Tangent Shading
      Use the material’s tangent vector instead of the normal for shading - for anisotropic shading effects (e.g. soft hair and brushed metal).

You could see on the preview white line across the ball. Once you turn off the option the preview will be changed.
When unchecked the mesh will be rendered as usual:

If you unwrap the mesh, the tangent shading will use the UV map to define the direction of shading and it won't be interrupted as it is in the original file. See related topic - Strange anisotropic artifacts?


Texture baking turns part of my object black

I know, 9 months late. I'm new to blender, but I figured this one out. If you have gloss in your material, you have to make a separate gloss map. The color is there. Save the diffuse map first, then make the glossy with a new texture map (save that), and finish by reloading the diffuse map. You now have 2 maps, plug them in where appropriate, and all should be fine.


I have made a node setup that renders like this:

It consists of two diffuse shaders. One is your stone texture from above (well almost). The other is a simple green "dirt" material. The real trick is to combine the dirt with the stone in a believable pattern. I tried multiplying two noise textures with some distortion. Distortion makes noise be liked two colors of paint where you have stirred it some. You get a swirling pattern.

To get this further, I would add some bump to the dirt shader. Also, I would bake an AO map and use that in the mask, letting it influence the mask so that there is more dirt in crevices.

Here is the node setup.


How to Convert Material Displacement to a Mesh?

What you can do is using a Displace modifier instead of a Displacement node.
To get the same result as your current 3D reliefs, you need to save the black and white image texture you're using in your Displacement node.
Either this image is already existing as one unique image and in that case it will be easy to load it into your Displace modifier, or it's made of a mix of several nodes, in that case I guess you'll need to bake the b&w texture.
To do so, make sure you're in Cycles Render, plug your nodes so that the b&w composition is displayed as a diffuse image on the surface of your plane. Create a new Image Texture in your Shader Editor, don't plug it into anything, inside this Image Texture click New to create a new black image, call it Displace Image for example, keep this node selected.
In the Render panel > Bake, choose Bake Type > Diffuse, disable Direct and Indirect, enable Color, click on Bake, the image called Displaced Image should now be the b&w displacement image.
Once you get your b&w image, use it in the Displace modifier: Create a Displace modifier, click on Texture > New, in the Properties panel > Texture, in the dropdown menu, select Displaced Image.
With the same b&w image, you'll have the same effect, on the left Displacement node, on the right Displace modifier:


I don't think there's any automatic way to do it easily, what you can do is:

Use the Mirror modifier to repeat the shape symmetrically

Enable the Proportional Editing option / Connected and Sphere mode.

Move one central vertex, the others will follow. I've left the topology as it is (with ngons) but it might need some corrections depending on what's your final purpose.

Use several Array modifiers to repeat the pattern.


Animation is a very vast subject and requires a lot of practice , patience and know how of blender simulator, giving a full answer here is not possible, however a very loose guidance is given below.

the grains on the ground, rock like structures and DNA spore look a like are straight forward modelling.

to create a moving ground/belly , you need to follow the http://blendtuts.com/tutorials-list/afterearthmap tutorial

for DNA spores to move towards rocks and go back, use boids (Basically allows you to simulate horde/flocks etc and can be moved back and forth between targets).
Basics explained in https://www.youtube.com/watch?v=nJT9zRi56w0


Pulling in one edge of a cube. I cant get the right movemen

not sure to understand, are you trying to do this?

I used the visual transform widget to make it easy to understand, but you could do the same using GY and grabbing to the desired amount that edge over Y.


Can someone explain the math/rationale behind this behavior?

Let see how waves is generated.

It takes your x coordinate (X will be go down like in your view), then multiples by scale value in your case it is 1:

Numbers 1,2,3 ets will be white, 0.5, 1.5, 2.5 ets - dark (real algorithm uses Sin function to convert this number to lightness, but I get this because it simpler to view):

Usually, y coordinate uses too, but you separate coordinates and get only first one, so I set Y coordinate as scale because it simpler to view.

Now let see, that happens if i set Scale to 2:

As you see, waves gets smaller. If i make the scale bigger I will not see waves, just because my grid haven't enough resolution for this. So instead I try to put Y coordinate as scale to see that it will do:

So, you see this effect because scale is not regular and waves gets smaller and smaller while scale gets bigger across y-coordinate.


How to get an evenly distributed noise on compositor?

Adding a blur of two pixels gives a nice distribution throughout the tone range.

Edit

This is custom color noise setup.


How do I keep a cloth simulation from interacting with a particle emitter, while still interacting with the particles?

You can do as follows:

Add a loop cut right in between the cube (cloth).
Delete the following lines:

Change the "Element to Snap to" to vertex.
Then Extrude the following highlighted lines towards the middle while stopping at each loop cut:

If all steps are done correctly the bag should open up like this:

NOTE: The more lines you delete in step 2 the wider the bag will open up.

BTW Here is the solved file:


Problem baking a diffuse texture with a metalic material

You could change metallic to 0, bake the textures and then change it back to what it was. Or add a Diffuse BSDF node, connect it to the output and connect the texture to it, and then bake. When you are done baking go back to using the Principled BSDF node.


if you press n and go to:
item -> transform -> scale
can you see if the scale is all 1?
for example scale is all 1

if it is not all 1, for example, if it is something like (4, 1, 0), it is not all 1

if this is the case, this might help: go into object mode, select the object that is causing the error, Press ctrl+A, and then choose Scale

now check to see if the scale is now is all 1. If it is try beveling again.
I hope this helps
if it does not work. Do you happen to have other modifiers or connections to other objects that might be changing the scale of the object?


bpy.ops.object.location_clear() Does not clear locations for keyframe'd objects

Thanks to zeffii on the #blenderpython IRC channel on freenode I've got this sorted out. The issue is that the keyframes take precedence over the plain matrix_world so clearing it has no effect from the script. The solution is to mute the animation before clearing the transform, then un-mute it to restore the animation to how it was previously.

So the final script ends up basically like this:

# Select all the objects we want to export and save
# their matrix_world so we can restore it after exporting
# If the object is animated also mute keyframe animation so
# it doesn't block *_clear
for curve in obj.animation_data.action.fcurves:
    curve.mute = True

# Clear positions for exporting everything at its identity transform
bpy.ops.object.location_clear()
bpy.ops.object.rotation_clear()
bpy.ops.object.scale_clear()

# Export meshes to OBJ
bpy.ops.export_scene.obj(...)

# Restore transformations by setting matrix_world back to what we saved earlier
# If the object is animated also unmute keyframe animation to restore it
for curve in obj.animation_data.action.fcurves:
    curve.mute = False


Get active camera from VSE Scene strip (Animation Nodes)

You can just use an expression to get the scene_camera attribute of the sequence strip.


You could build the outline, and then create the topology inside.

Start with straight edges, and then bevel the corner vertices
Add a slight inset (to keep space for beveling later)
Build the inner topo-flow so it doesn't get in the way of other corners


How do I create a clay/fingerprint texture on a Blender model (as shown in the art pieces here)?

I saw the happy globe on reddit:)
You can get a goot fingerprint texture for free from Poliigon.com.
https://www.poliigon.com/search?query=Fingerprints

You need to change the render engine to Cycles and create a material while you have an object selected.

Click the "use nodes" button and open the node editor (where the different modes can be chosen).

In the node editor press Shift+A and chose "Image Texture" from the menu. If you use the add-on "Node Wrangler", you can click on the image texture node and press Shift+T to get your mapping node.

You then choose the texture of the fingerprints in the image texture node. You got to create a bump node and plug in your image texture there and then plug the bump to the normal node of the shader you choose. I recommend the principled shader. You could also directly use the displacement node to plug in your image texture. In that case just put a math node in between them and choose the multiply function to control the strenght of the displacement. If you do that you can change to the experimental feature set in the render panel and then go to the Settings section of the material tab and change the material tab from bump to true.

Don't forget to unwrap the mesh object you want to apply the texture on.
I hope this works for you as an explanation. It's a very broad question.


The Blend1 files are your previous manual saves. This is so that if something goes catastrophically wrong with the most recent file (and that you can't fix it), you can load up previous manual saves (Blend1 files).

If you wish to disable this:

Go to Edit > User Preferences
Then go to the "Save & Load" tab.
Reduce the number of "Save Versions" to 0.


You can delete what vertex group each individual vertex belongs to

3D view Editor-->Edit mode-->(n) properties shelf-->vertex weights.

Imagine each vertex group = a muscle.

The more vertex groups control a single vertex= the more muscles are connected to that vertex .

So when you are trying to make the belly bigger with one muscle, the other muscles are still attached=you get uneven stretching.

And the muscle strength can only be changed manually in weight paint mode or by using the vertex weight modifier.


The problem you are facing could be that the middle of your bumper model, where the mirroring starts, isn't completely flat along the x-axis. You can fix this by selecting the vertices, scaling and then pressing X and 0.

After flattening the vertices, go to the properties panel by hitting N and put the vertice group to 0 on the x-axis.

Here are some pictures:

The situation

Select these vertices

Scale to 0 on the x axis

X co-ordinate to 0


The red line you want would create n-gons.
But if you build the frame differently, you can simply add a loopcut.


It is not possible to move keyframes directly in the timeline window.

But in the dopesheet, you can select all the keyframes of an animated object at once, by click the top one, in the master channel :

You can still box select with B like @Cosifa said, and move, scale, or duplicate them.

Edit: Oh! and you can always re-arrange your window panes as you want, to suits your needs if you want a big 3D view and a little dopesheet window at the bottom screen ;)


Exported .dae models have a cube embedded in them

The most likely reasons are that the cube was either hidden when you exported or on another layer and you just exported the entire scene. One other thing you could try is when exporting, select the model(s) you want to export and tick Selection Only.


How I can add a control to a hand rig for easy hand poses?

You may do it using a Copy Rotation bone constraints and drivers.

I'll show you how to do it using one finger and then you may implement it to the whole hand. Add the Copy Rotation constraint to last two bones, so the lower bone copies the middle bone rotation and then middle bone copies the top bone rotation.

Set the constraint's spaces to Local<-->Local for each constrained bone. Now, when you rotate the upper bone the other ones follow to create a fist.

Add a circle (it may be a bone with a custom shape or other object). It'll be your controller. Select the top bone (the one without the constraint), go to the Transform panel and add a driver to the rotation value (in my case a Z axis rotation). Hover the cursor over the value, press the RMB-->Add Single Driver. Go to the Graph Editor and set its mode to Drivers. Press N to open the properties panel. In Drivers panel choose the Transform Channel and Average Value options, set the circle as a controller in the Object/Bone window. Change the space to Local and type to Scale. Use Generator modifier to adjust things. Press Update Dependencies button at the end. Now scaling the circle affects the rotation of the bones.


Yes, there is: You need to separate each character into a render layer. And use MASK and EXCLUSION. That´s for an advanced setup. It´s the only way your machine can render 1 character at the time. Later on the compositor, you can place them all back as renders on the same frame.
Otherwise: yes, your machine will keep crashing because of short RAM memory.

Thank you for your consideration to vote me as the answer by clicking to the left :the icon with a check mark and upvote this answer.

BFCT_Schiller


You have to unwrap the object and give it a material with the texture for it to show up.

First you have to tell blender how to put a 2D texture on a 3D object by unwrapping it, which means selecting edges where the mesh will be cut to flatten it.  This is done by going into edit mode, selecting the edges, hit Ctrl.+E > mark seam, then U > unwrap.

Then you have to give it a material with the texture.

If you are using the cycles render engine this is done by first going to the materials panel of the properties view and clicking New.

Then switch to the node editor and add an image texture node by hitting Shift+A > texture > image texture.  Then add a diffuse shader Shift+A > shader > Diffuse BSDF, plug the color output of the image texture into the color input of the diffuse and the BSDF of the diffuse into the BSDF of the material output.


noise texture Projecting outward from center point

You can add a scalar multiple of cosine of the angle that the vector makes with the x axis to the x component, and similarly with the y component but with the sine of the angle, this will produce:

Higher scalar values means more line-like distortion. A radial distortion can be done as follows:


How to make a soft body stay static and not vacillate at all?

First method:

Simplest solution would be to reduce Cube mass to something like 0.5. This will prevent wobbling but it will keep Cube in place so Sphere will go trough it.

Also you will have limited control over Cube behavior.

Second method:

This is what I can recommend. In this method we need to first settle down Cube on Collision Plane, and then affect it by Sphere.

In this method you have full control over collisions. In my example I've used settings that will allow to move Cube by Sphere, but you can also change it to destroy Cube without moving it or just "melt" into it.

First of all you will need simple Plane with Collision turned on and Soft Body and Cloth > Outer > 0.001

Then set Cube Soft Body values as below:

Pull - lower value, lower impact over whole Cube.

Bending - higher value will move Cube, lower will keep it in place.

Test Blend file:


How do I re-link the video of a project when editing on a different computer?

Yu could try packing it into the blend file. I dont have 2.7x anymore but I think it is File->External Data->Pack All Into .blend


Try removing doubles in your mesh, you can easily do this by going in Edit Mode  pressing  W > Remove Doubles.
You can also type Remove Doubles after pressing the  Space Bar.


How to make softer, more natural lighting?

The reference image is a studio lit still life. There are two "Soft Boxes" camera left and a spot light on the background. Probably a black card camera right to prevent light from filling in the shadows. It appears a relatively long lens was used to compress the scene and emphasize the shallow depth of field.

Here is how I recreated the scene in Blender with a camera focal length of 150mm.


Rigify and automatic weight painting error

Clear parent relationship, select the mesh, edit mode, remove doubles 0,001, then parent again.

Seems to work (i've tried with a brand new rigify generated armature)


Need help scaling creating views of a diagram

If you are saying that the diagram ur drawing doesn't become larger then you can duplicate one coach by pressing (Ctrl+D) and put it in the back of coaches and do this till you get the size you want..
And if u want to add words on the engine it can be done by UV unwrapping..
Hope it will help.
I'm also new to Blender btw!Thank you.


Particle Systems adding margins and placing on top

We will be changing the origin position of the cube. The particle system works by attaching the origin point of the selected object to the surface of another. By changing the origin point, we can also change the position of every particle on the object.

Select the object to be used as a particle (the cube in your case).
Go into edit mode, and press A to select all vertices.
Move the cube geometry.
Go out of edit mode. As you can see, the geometry of the cube should have moved, but the origin point remains the same, effectively changing the origin point of the cube.

As for the part where you need to add a margin, a simple fix that I thought of (and should be easy to make using python) is to duplicate the plane and scale it up. There are no settings in the particle system that allows you to create a margin to my knowledge that doesn't involve using some sort of painting.


How to stop mesh getting into another mesh

Blender will not automatically handle these. One solution is to setup Softbody simulation. Another solution, simplest I think is to use Shape keys.


Usually I would recommend use of the Boolean Modifier. But since Blender 2.72 there is a new mesh tool to intersect geometry in Edit Mode. Starting from the default Cube and a Plane in Object Mode, subdivide the Plane to your liking and use e.g. the Displace Modifier or Sculpt to give it some bumps.

Apply the Modifier and join the Cube and the Plane with CtrlJ and both selected. Go to Edit Mode (Tab), select only one vertex of the Cube and press CtrlL, hit Space and type "intersect". Choose Intersect from the popup menu. Note, that you need Blender 2.72.

Press P and select "By loose parts". Tab out of Edit Mode and delete (X) the part of the Plane, that lies outside of the Cube. Three objects should be left.

Two open parts from the cube, and the region of intersection. Copy the region with ShiftD.

Select a part of the Cube and one region together (ShiftRMB) and press CtrlJ. Do the same thing with the other two objects. You can now Tab back into Edit Mode and "remove doubles" (optional).


The traditional method for dirt/wear mapping has been to use an Ambient Occlusion shader to catch recesses, with the normals flipped for convex protrusions. In the AO node available in more recent builds of 2.79, the normals are flipped by using the 'inside' option.

AO is not strictly responding to the angle between adjacent faces, it's  a representation of how many hits there have been within a distance threshold, from a sample of rays fired in the hemisphere of directions surrounding the surface normal at that point.

A more specific response to the curvature of a surface can be obtained from its 'Pointiness' value, which you can get from the Geometry input node:

... which as far as I can gather uses angles between adjacent edges to approximate curvature.

In order to make it work here, this cube had to be subdivided. A Simple subdivision will do, or, as illustrated, Catmull-Clark with a bevel to hold the edges.

The values generated from these shaders can be used to control the mix of other shaders or colors,  or anything you like that can be controlled by a number. If different gradations are needed, you can put the values through a color ramp, curves, or map them to another range in some other way, as in the second example.

They can be combined in ways like this:

Or this, using AO alone, which is not toplology-dependent.


Whoops, now to setting the pose lib

Simple operator that takes the name of the poselib (action) you want to make active, and sets it on the active object

import bpy
from bpy.props import StringProperty

class SimpleOperator(bpy.types.Operator):
    """Change the Pose Lib"""
    bl_idname = "object.set_pose_lib"
    bl_label = "Set Pose Lib"
    name = StringProperty(options={'SKIP_SAVE'})

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        action = bpy.data.actions.get(self.name)
        if action:
            context.object.pose_library = action
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

Example of usage

import bpy

def draw_button(self, context):
    # change to a pose named "Pose"
    poselib = context.object.pose_library
    name = "PoseLib"
    op = self.layout.operator("object.set_pose_lib", text=name)
    op.name = name

bpy.types.DATA_PT_pose_library.append(draw_button)


Is there a simpler way to get the Vectors of a local axis?

The two essential information that you need are the world matrix and the axis / vector in local space that you're interested in. In your case the latter is pointing in the direction of the local y-axis which is equivalent to the vector:

$$axis_{local\ y} = \begin{pmatrix}0.0 \\ 1.0 \\ 0.0 \end{pmatrix}$$

The world matrix contains the information how the object is rotated in the global coordinate system. Therefore we need to decompose the world matrix to get the rotation matrix*, which can then be multiplied with the vector to get the direction of the local y-axis in the global coordinate system.

(*) Internally this is a quaternion

For example, if the object isn't rotated at all, the rotation matrix is:

$$rot = \begin{pmatrix}1.0 & 0.0 & 0.0 \\ 0.0 & 1.0 & 0.0 \\ 0.0 & 0.0 & 1.0 \end{pmatrix}$$

$$\begin{split}axis_{global\ y} &= rot \cdot axis_{local\ y}\\ &= \begin{pmatrix}1.0 \times 0.0 + 0.0 \times 1.0 + 0.0 \times 0.0 \\ 0.0 \times 0.0 + 1.0 \times 1.0 + 0.0 \times 0.0 \\ 0.0 \times 0.0 + 0.0 \times 1.0 + 0.0 \times 0.0 \end{pmatrix}\\ &= \begin{pmatrix}0.0 \\ 1.0 \\ 0.0 \end{pmatrix}\end{split}$$

The axis doesn't change, which is what we would expect since the local coordinate system is aligned with the global coordinate system. When the object is rotated by 90° around the global x-axis, the local y-axis now points upwards in the global coordinate system:

$$rot = \begin{pmatrix}1.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & -1.0 \\ 0.0 & 1.0 & 0.0 \end{pmatrix}$$

$$\begin{split}axis_{global\ y} &= rot \cdot axis_{local\ y}\\ &= \begin{pmatrix}1.0 \times 0.0 + 0.0 \times 1.0 + 0.0 \times 0.0 \\ 0.0 \times 0.0 + 0.0 \times 1.0 - 1.0 \times 0.0 \\ 0.0 \times 0.0 + 1.0 \times 1.0 + 0.0 \times 0.0 \end{pmatrix}\\ &= \begin{pmatrix}0.0 \\ 0.0 \\ 1.0 \end{pmatrix}\end{split}$$

import bpy
import mathutils

obj = bpy.data.objects["Cube"] # Replace with your own object selection

(translation, rotation, scale) = obj.matrix_world.decompose()
local_y_axis = mathutils.Vector((0.0, 1.0, 0.0))
local_y_axis_global_coords = rotation @ local_y_axis
print(local_y_axis_global_coords)

The approach works with any vector in local space, not just the axis.

If you're only interested in the $x$-, $y$- or $z$-axis, then you don't need to multiply with the rotation matrix as Robin Betts correctly noted. When the world matrix is normalized or the object scale is 1.0, then the local $x$-, $y$- and $z$-axis in global coordinates are equivalent to the first three column vectors.

import bpy
import mathutils

obj = bpy.data.objects["Cube"] # Replace with your own object selection

normalize_matrix_world = obj.matrix_world.normalized()

local_x_axis_global_coords = [row[0] for row in normalize_matrix_world[:3]]
local_y_axis_global_coords = [row[1] for row in normalize_matrix_world[:3]]
local_z_axis_global_coords = [row[2] for row in normalize_matrix_world[:3]]
print(local_x_axis_global_coords)
print(local_y_axis_global_coords)
print(local_z_axis_global_coords)

The world matrix is the result of multiplication of the scaling, rotation and translation matrices.

Scaling with matrix $S$
$$\begin{pmatrix}x'\\y'\\z'\\w'\end{pmatrix} = \begin{pmatrix}\alpha & 0 & 0 & 0 \\ 0 & \beta & 0 & 0 \\ 0 & 0 & \gamma & 0 \\ 0 & 0 & 0 & 1\end{pmatrix} \cdot \begin{pmatrix}x\\y\\z\\w\end{pmatrix}$$

Translation with matrix $T$
$$\begin{pmatrix}x'\\y'\\z'\\w'\end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 & t_x \\ 0 & 1 & 0 & t_y \\ 0 & 0 & 1 & t_z \\ 0 & 0 & 0 & 1\end{pmatrix} \cdot \begin{pmatrix}x\\y\\z\\w\end{pmatrix}$$

Rotation around x-axis with $R_x$:
$$\begin{pmatrix}x'\\y'\\z'\\w'\end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & cos(\theta) & -sin(\theta) & 0 \\ 0 & sin(\theta) & cos(\theta) & 0 \\ 0 & 0 & 0 & 1\end{pmatrix} \cdot \begin{pmatrix}x\\y\\z\\w\end{pmatrix}$$

Rotation around y-axis with $R_y$:
$$\begin{pmatrix}x'\\y'\\z'\\w'\end{pmatrix} = \begin{pmatrix} cos(\theta) & 0 & sin(\theta) & 0 \\ 0 & 1 & 0 & 0 \\ -sin(\theta) & 0 & cos(\theta) & 0 \\ 0 & 0 & 0 & 1\end{pmatrix} \cdot \begin{pmatrix}x\\y\\z\\w\end{pmatrix}$$

Rotation around z-axis with $R_z$:
$$\begin{pmatrix}x'\\y'\\z'\\w'\end{pmatrix} = \begin{pmatrix} cos(\theta) & -sin(\theta) & 0 & 0 \\ sin(\theta) & cos(\theta) & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1\end{pmatrix} \cdot \begin{pmatrix}x\\y\\z\\w\end{pmatrix}$$

The rotation matrix is:
$$\begin{split}R &= R_x \cdot R_y \cdot R_z \\ &= \begin{pmatrix}cos(\theta_y) \cdot cos(\theta_z) & -cos(\theta_y) \cdot sin(\theta_z) & sin(\theta_y) & 0 \\ sin(\theta_x) \cdot \sin(\theta_y) \cdot cos(\theta_z) + cos(\theta_x) \cdot sin(\theta_z) & -sin(\theta_x) \cdot sin(\theta_y) \cdot sin(\theta_z) + cos(\theta_x) \cdot cos (\theta_z) & -sin(\theta_x) \cdot cos(\theta_y) & 0\\ -cos(\theta_x) \cdot sin(\theta_y) \cdot cos(\theta_z) + sin(\theta_x) \cdot sin(\theta_z) & cos(\theta_x) \cdot sin(\theta_y) \cdot sin(\theta_z) + sin(\theta_x) + cos(\theta_z) & cos(\theta_x) \cdot cos(\theta_y) & 0 \\ 0 & 0 & 0 & 1\end{pmatrix}\end{split}$$

The world matrix is:

$$ world = T \cdot R \cdot S  $$

If the scale factors $\alpha$, $\beta$ and $\gamma$ are $1$ or we normalize first, then $T \cdot R = T \cdot R \cdot S$ because the $S$ is the identity matrix:

$$ T \cdot R = \begin{pmatrix}cos(\theta_y) \cdot cos(\theta_z) & -cos(\theta_y) \cdot sin(\theta_z) & sin(\theta_y) & t_x \\ sin(\theta_x) \cdot \sin(\theta_y) \cdot cos(\theta_z) + cos(\theta_x) \cdot sin(\theta_z) & -sin(\theta_x) \cdot sin(\theta_y) \cdot sin(\theta_z) + cos(\theta_x) \cdot cos (\theta_z) & -sin(\theta_x) \cdot cos(\theta_y) & t_y\\ -cos(\theta_x) \cdot sin(\theta_y) \cdot cos(\theta_z) + sin(\theta_x) \cdot sin(\theta_z) & cos(\theta_x) \cdot sin(\theta_y) \cdot sin(\theta_z) + sin(\theta_x) + cos(\theta_z) & cos(\theta_x) \cdot cos(\theta_y) & t_z \\ 0 & 0 & 0 & 1\end{pmatrix}$$

The first three entries in the first three columns give us the local axis in global coordinates for the $x$-, $y$- and $z$- axis respectively. This is because if we multiply the local axis vector with the matrix, the result is the same as the column in the world matrix:

$$ axis_{local x} = \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0\end{pmatrix}$$

$$ axis_{local y} = \begin{pmatrix} 0 \\ 1 \\ 0 \\ 0\end{pmatrix}$$

$$ axis_{local z} = \begin{pmatrix} 0 \\ 0 \\ 1 \\ 0\end{pmatrix}$$

$$ world \cdot axis_{local\ x} = \begin{pmatrix}cos(\theta_y) \cdot cos(\theta_z) \\ sin(\theta_x) \cdot \sin(\theta_y) \cdot cos(\theta_z) + cos(\theta_x) \cdot sin(\theta_z) \\ -cos(\theta_x) \cdot sin(\theta_y) \cdot cos(\theta_z) + sin(\theta_x) \cdot sin(\theta_z)\\ 0\end{pmatrix}$$

$$ world \cdot axis_{local\ y} = \begin{pmatrix} -cos(\theta_y) \cdot sin(\theta_z) \\ -sin(\theta_x) \cdot sin(\theta_y) \cdot sin(\theta_z) + cos(\theta_x) \cdot cos (\theta_z) \\ cos(\theta_x) \cdot sin(\theta_y) \cdot sin(\theta_z) + sin(\theta_x) + cos(\theta_z) \\ 0 \end{pmatrix}$$

$$ world \cdot axis_{local\ z} = \begin{pmatrix} sin(\theta_y) \\ -sin(\theta_x) \cdot cos(\theta_y) \\ cos(\theta_x) \cdot cos(\theta_y) \\ 0 \end{pmatrix}$$


Flock behavior using Blender python scripting

Blender actually has a built-in boids implementation. If you don't need to use Python for some reason, you can do this with Particle Systems.

Go to the default cube (or whatever object you want the flock to start from), go to the Particles tab (second from the right in the Properties panel), and click the New button.
Scroll down to the Physics section, and click Boids. There are a lot of options to tweak here.
Now you have a basic flock, but they'll just drift around aimlessly at this point. (You can watch them by pressing Alt+A.) To make them attracted to an object, select the object, click on the Physics tab (all the way to the right), and then click Force Field.
Set it to Force to make them attracted or repelled to the the object.

A negative strength will attract them, while a positive strength will repel them.

In the particle Physics section on the emitter, you can make them interact with other boid flocks in your scene.


How to parent eye armature to head bone in body armature

Your question sounds like you have two different armatures (which are objects), you're selecting both and then entering edit mode (which in this case will be a "double" edit mode, working simultaneusly on two different objects). But the parenting you're looking for is possible only internally to one single object.

So, select the eye armature, shift select the head armature, press Ctrl J (join two objects into a single one).

Then select the new object (armature), enter edit mode, select the eye bone, shift select the head bone and press Ctr P (keep offset).

And, yes, teeth and head can be treated in the same way (create the new bones in edit mode with shift A or Shift D).


The first thing I suggest is turn off autoscale and do the scaling with a Transform node in the compositor, that way you'll have more control on the final output and composition.
You do have access to the Tracker information by adding a Track Position node and manually typing the name of the tracker you want to use. (Keep in mind that that same tracker has to be part of the set of trackers used for the 2D stabilization)
Some manual positioning might be necessary to place the mask on the right place, but after that the mask should follow the stabilized footage.

Here's a possible Node arrangement:


How to recreate this kind of line animation in Blender?

You'll probably want to use curves but they can be hard to make without using Animation Nodes or some other addon.
I have used particles with motion blur.

I made a curve and fit an object array along it. I applied a wind>curve force filed to the curve, while I applied a force>surface force field to the array object.


Apply depth transparency to array object

Use the camera data node and a color ramp to control the transparency.

Note that you might need to increase the transparency bounce settings for the  Light Paths to prevent artifacts.

Or you might want to try controlling the transparency through the Ray length on the Light Path:


Yea... shadows are a bit complicated to get right with real time graphics. It can get better but not perfect.

You can try if the Soft Shadow option will help your scene. The viewport will be sluggish with it on...


Why is there no displacement in height in the texture after adding the normal and height maps?

You are sending the vector into the Normal input of the shader. Using altered normals in materials by definition does not deform the mesh. To deform the mesh with a material, send the vector from a Displacement node into the Displacement input on the Output node, and set the material’s displacement mode to “Displacement only” or “Bump and displacement. Note that this will only work in Cycles, and will not generate new vertices: the mesh must be subdivided quite a bit for any noticeable effect.
To displace a mesh with a texture without using Cycles, use the Displacement modifier instead. Note that this will not generate new vertices, just like the last example.


Blender Compositing view ( move left & right )

In 2.82 you can move with Shift + middle click. Try that maybe?


How to create lampstreet particle in Evee?

Put the streetlamp model and the light emitter into an own collection, let's say you call it "streetlight".
In the Particle Emitter settings under Render > Render As choose "Collection".
For the Instance Collection choose the created "streetlight" collection.
Check "Whole Collection" underneath. This is usually not desired if you have collections of different trees, stones or whatever because you want them to be picked randomly. But in this case this means each particle is now the streetlamp model with the light at the correct place.


Firstly threading isn't well supported. the context error would be from the threads not having a context. You may be able to pass the context from execute(self, context) to the threads and override the context when calling the operators.

I would suggest that a better option would be to use a modal operator. Based on the modal timer operator template included with blender -

import bpy
import numpy as np

class ModalTimerOperator(bpy.types.Operator):
    """Operator which runs its self from a timer"""
    bl_idname = "wm.modal_timer_operator"
    bl_label = "Modal Timer Operator"

    _timer = None

    def modal(self, context, event):
        if event.type in {'RIGHTMOUSE', 'ESC'}:
            self.cancel(context)
            return {'CANCELLED'}

        if event.type == 'TIMER':
            txt = str(np.random.rand(1))
            context.scene.objects['Text'].data.body = txt

        return {'PASS_THROUGH'}

    def execute(self, context):
        wm = context.window_manager
        self._timer = wm.event_timer_add(3.0, context.window)
        wm.modal_handler_add(self)
        return {'RUNNING_MODAL'}

    def cancel(self, context):
        wm = context.window_manager
        wm.event_timer_remove(self._timer)

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

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

if __name__ == "__main__":
    register()


Non-Random Particle Emission from all vertices

This isn’t possible at present. The node system is being radically redesigned with Everything Nodes at which point we should be able to do this and so much more.


You notice his cursor is offset to the left so when he rotates the face, it rotates around the cursor position instead of in-place.  To get that effect you need to make sure you are using 3D Cursor as your pivot point before rotating the face.  The button for pivot point is at the bottom of the 3D view next to the viewport shading button.


If I get the latest version of blender, will I lose anything in my old project files?

Blender is for the most part backwards compatible, that means files created with previous versions will generally open problem free in future versions.

Apart from major version jumps (like from 2.4# series to 2.5 or like the future 2.7# series to 2.8) Blender should open files created in older versions without any problems. Some times changes are made and "version patching" will happen internally automatically, that means blender will automatically try to fix anything that changed so it will look as close to original as possible. That being said there may be an occasional thing that breaks or causes a minor glitch, but never to the point of totally breaking or being unable to open your work.

Hell for the most part Blender even prides itself in being able open files created with recent versions of the software in very old versions, albeit with lots of warning and broken things.


Use Anamation Node with texture to drive rotation

Welcome to Stackexchange! The first thing to do is to sample the values of the pixels of the image. This can be done using this small snippet of python code:

bpy.data.images[imageName].pixels[:][0::4]

We are basically making a copy of the pixel values and only getting every fourth pixel, the pixels list include the values of all four channels of the image since your image is BW, we only get one of the values, hence the [0::4].

Next, we get the width and height of the image, we get the width using:

bpy.data.images[imageName].size[0]

And the height using:

bpy.data.images[imageName].size[1]

We then use the Distribute Matrices node to create the grid with the same width and height of the image. We use the Axis Rotation Matrix node to create a rotation matrix from the pixel values and multiply both matrices list. Depending on which version you are using, you will either use the Replicate Mesh node to replicate a unity triangle along the matrices or use the new Transform Mesh node to replicate the unity triangle as I will be using here. We then output that mesh and set the container object as the parent of your circle object and activate Face Duplication for the container object.

The pixels of an image have a grid structure, thus assigning the values of pixels to objects distributed on a grid is easy. If the objects are not distributed on a grid, then one would have to guess what the value of each object is, this is called an Interpolation. There are multiple types of interpolations, the simplest of which is called the Nearest Neighbour Interpolation, and this is what we will be using here. Basically the bounding plane of the structure is aligned with the image, then for each object, we find the closest pixel to it and assign its value to it.

Let the structure be defined by the vertices of a mesh. We imagine the image as a plane whose lower left corner is at $(0,0)$ and upper right corner at $(\text{Image Width},\text{Image Height})$. The first thing to do is normalize the vertices locations, that is, transform the vertices locations into the range $[0,1]$ in both axis:

See the documentation for more info. Then we multiply the x location by the width of the image and the y location by the height of the image, that way, the bounding plane of the structure aligns with the image we imagined. By flooring the x and y locations we get an integer representing the index of the column and row of the closest pixel to each vertex:

Linear Indexing can be used to compute the index of a pixel in a flat list knowing its column and row index, the equation is $\text{index} = iw+j$ where $i$ and $j$ are the indices of the rows and columns respectively and $w$ is the width of the image, by implementing that:

Now, all we have to do is sample the pixel values at those indices as follows:

Finally, compute the matrices and use them just as we did before:

Blend file for study:


The best way to trouble shoot a noisy image, is to render all the main colour render passes (Dif, Gloss, Trans, Sub, Emission and AO) out, and inspect each one. You'll see one or two that are really noisy, and then you should be able to adjust your samples to clear them up.

I'm a big fan of Branch Path Tracing mode, because it lets you reduce samples in passes that don't need it and increase samples in those that do. I'm fairly certain you should be able to get something looking decent for 500 samples, but you may have to redistribute them differently.


How do I combine 2D and 3D animation together?

Combining video images with 3D generated imagery is possible as long as the video in question is encoded using a format supported by blender.

Blender has no support for Flash so the images would need to be transcoded first using a different program.

Likewise. Blender cannot export video on Flash format. You would need to render first on a video format (or image sequence) and encode into Flash with a different program.


How to put if condition for empty material index

You can find more info on if statements in Python here.

You can find a lot of useful information about bpy in Blender's Python console using the auto complete function (Ctrl+Space):

The script you are after could be something like this:

import bpy

obj = bpy.context.object
name = "My_node_name"
if obj is not None:
    if obj.type == 'MESH':
        if obj.active_material is not None:
            if obj.active_material.use_nodes:
                nodes = obj.active_material.node_tree.nodes
                if nodes.get(name) is not None:
                    print(name + " node is in the material's node tree.")
                else:
                    print(name + " node is not in the material's node tree.")
            else:
                print("Material does not ue nodes.")
        else:
            print("Object does not have an active material.")
    else:
        print("Object is not a mesh.")
else:
    print("There is no active object currently in the scene.")


as long as no complex textures need to be there (and they shouldn't if  you want to be able to see from the cockpit) it should be perfectly acceptable to have a material that is basically uniform.

  Disclaimer; I've been called sloppy on this before, but never had bad results.


How can I make a particular Blender rendering pause as soon as another thing is being rendered?

Since you're runnning Linux and Nvidia GPU, you can use nvidia-smi and a simple bash script to see what is occupying your Nvidia graphics card at the moment, and pause your rendering accordingly.

My code is based on grep regular expressions matching the rendering process you want to be of idle priority and the rest of the Blender CUDA jobs.

I've come up with a Bash one-liner that does the job for me:

while [ True ]; do nvidia-smi | grep ".*[1-9]*.*C.*blender" | grep -v $(pgrep -f "blender Idle_Animation.blend")  && { pkill -SIGSTOP -f "blender Idle_Animation.blend"; echo "pause"; } || { pkill  -SIGCONT -f "blender Idle_Animation.blend"; echo "go"; }; sleep 5s; done

How this works?

It loops forever
Runs nvidia-smi that returns a nice table with processes using the GPU
It uses grep to find blender processes that use the CUDA functionality
It uses grep again with a -v switch to exclude the IDLE process from the search
If there's anything left after that filtering it'll send SIGSTOP to all blender processes matching "blender Idle_Animation.blend" command
If not - it'll send a SIGCONT effectively un-pausing (or doing nothing if they weren't stopped) all IDLE processes
It waits 5 seconds before checking again

You need to just replace the "blender Idle_Animation.blend" with whatever string that'll identify your idle rendering processes. The pgrep -f will analyze the full command used to start a process, so if you run blender -b Idle_Animation.blend -a you can use exactly the same string to identify all processes belonging to that job.


How to know what's happening with a patch I submitted for Blender

Don't be afraid to nudge the developers if it's been a while. You could do that on https://blender.chat in the #blender-coders channel, or by mentioning the assigned reviewer in the patch comments.


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

only RGB channels, entirely black:

only Alpha channel:

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

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

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

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

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


Assuming the lamps are sortable by their name and the animation (which is supposed to be shifted) is the only animation on the object, the you could use a python script to shift the keyframes of all fcurves of an object.

To use the script, selected the objects and execute the script. The selected objects must have an existing animation. First make sure to make the materials single user, by selecting all objects, then pressing U in the 3D View and choosing Material and Texture.

By changing the value of the offset_amount variable, you can change the timing.
Decimal values 0 < x < 1 are also possible.

import bpy

offset_amount = 2.0

# get selected objects
sel = bpy.context.selected_objects

# sort them by name
sel.sort(key=lambda x: x.name)

# loop through all selected objects
for i, s in enumerate(sel):
    # get the fcurves of the active action
    # of the material of the object

    fcurves = s.material_slots[0].material.node_tree.animation_data.action.fcurves

    # loop through all fcurves
    for fc in fcurves:
        # loop through all keyframes
        for kp in fc.keyframe_points:
            # change the x (time) value of the keyframe
            kp.co.x += offset_amount * i


Why is bake action creating weird rotation?

This is caused by "Gimbal Lock". To correct for it, switch the rotation mode from XYZ Euler to Quantarion and then rebake.


The AMD radeon r7 265 is on the list of supported devices: https://wiki.blender.org/index.php/OpenCL

There are two settings you need to change to enable GPU rendering.  The first is in User Preferences like you show, and the second is in the rendering tab of the properties panel.

Increase tile size for better GPU performance with non-progressive rendering.


If you export an armature and its animation as an fbx file format, you will have to re-parent the armature to the new mesh, and set up all of the weight painting, but you can keep the animation and the armature structure, if that is what you want to do. Select the armature, and export it as an fbx. Then import it into the new file.


Size is relative. You can have tiny objects cramped into single blender unit or large objects across hundreds of units and both would render the same size on screen.

The scale of the scene is up to you to choose, you don't have to follow the metric units.

To answer the question, the maximum absolute size is 3.402823 × 10^38 blender units, which is a limit of 32bit float.

Just be aware that there might be some computational artifacts with handling small numbers and with objects too far from scene's origin (precision limitations). These might become visible even for objects just 500 units away from origin:

Bug T43835: Strange cracks appear on model


Uses for the Location vector of the Particle Info node?

Particle Distance to Some Particular Point

The particles are colored differently within a certain distance to a given point P0.  Emission Shader. In the user ortho view is the cylinder with a particle system. The white torus has that same point P0 as center.  Image above.

Cycles Material Nodes calculating distance and employing color ramp.  Image above.

Click image above to see larger image.

The OP has asked about Textures Controlling Particles Systems.

This is a quick piece of information for further research.  The two columns are of the Particle Texture Settings which are visible only in Blender Internal Render Mode. Cycles will [not] show the same info, yet will be influenced by the textures as well. You can switch back and forth as [interesting] as this might seem.  The three yellow arrows emphasize Texture Panel Purpose, Mapping, and Influence areas.  This is not a tutorial on the topic.  I use two columns for the same settings out of edit convenience and readability convenience.

With a more complicated frame change handler and Python anything is possible. Same comment for BAN - Blender Animation Nodes.


It depends on your mesh. If the eyesockets are UV spheres with the poles left and right then it's fairly easy.
You might need one or two more edge loops that work as the compressed lids. To close the lids you rotate the edge loops over the eyeball, the upper lid down and the bottom lid up.

You can do this in the following way:

Select the vertices of the upper lid and assign them to a vertice group Ctrl + G. That way you can easily select them again.

Clear selection Alt + H and select the vert at the pole. Then you can move the 3D Cursor to this postion (Shift + S).

Choose 3D Cursor as the Transformation Pivot Point (see (1) on the image).

the eyes of your model are tilted in space so the front or side view won't work. But you can adjust the view with Shift + Numpad 7 to the pole vertice (or use menu View → Align View → Align View to Active → Top).

Finally, clear selection Alt + H and select the vertice group of the upper lid Ctrl + G. Then rotate these vertices along the eyeball (R). Check the vertices on the other side. You can adjust the position or rotate them individually if needed.

Repeat the steps for the lower eyelid. With a Solidify modifier you can add easily depth to the eyelids. Save the deformation in Shape Keys and animate it. Hope that helps.


Create a UV Sphere and delete the bottom half of it in Edit Mode. Go back into Object Mode, select the entire half-sphere and scale it only on the Z axis. (press "Z" while scaling is activated) That should give you a concave disk.


How to run the blender benchmark on windows?

In order to run the benchmark 1.0 beta 2 on Windows you will have to:

Download the .zip archive from https://opendata.blender.org/
Extract the .zip
Run the blender-benchmark.exe

The benchmark website will be updated in January 2020 according to Ton Roosendaal. This will likely include an updated version of the benchmark software as well.

  Note: the benchmark test was with Blender 2.79. The benchmark site
  gets a complete refresh first half January.

If you're interested in the progress of the new Blender Benchmark, you can check the linked repositories Blender Benchmark Bundle, Blender My Data and Blender Open Data and tickets related to the Blender Open Data project.


Strange curved topology edge when merging vertices

It looks to me like you're merging vertices from two "sheets" of the surface -- the sheets separate as you move to the right. It also looks like you have a Subsurf modifier on, right? Then here's my thought: Each of the vertices you merged had four edges attached. When you merged them, the merged vertex had somewhere between five and eight edges (depending on whether you also merged some of the adjoining edges; since the surfaces are still separating on the right, you probably didn't merge all of them). But Subsurf works well on quads and four-edge vertices; it gets confused on n-gons and poles (vertices with more or fewer than four edges), often causing "pinching" effects.

You won't be able to fix it entirely, but adding edge loops near the poles can make the pinching effect smaller.


I would bevel a curve to give it thickness, and have easy control over the curve shape.

Make a curve circle and put it in place. In your case: Shift + c. Shift + a and choose Curve > Circle. Then S 1 4 Enter. Then G Z 2 0 Enter.

Put a Shrinkwrap modifier on the curve and target the knight. Mode: Project, On Surface. Direction: Negative (only)

Press Alt + C and choose Mesh from Curve/Meta/Surf/text. Then press Alt + C again but now choose Curve from Mesh/Text. Changing the curve to a mesh and then the mesh back to a curve Applies the modifier and gives us more vertices on the curve.

In Edit Mode A to select all. then hit F3 (default search key) and type "Set Spline Type" and choose Bezier. Then hit F3 again and type "Set Handle Type" (or press V) and choose Aligned.

(Alternatively you can click on the buttons next to Edit Mode in the header of the 3D Viewport. Curve > Set Spline Type > Bezier. and Control Points > Set Handle Type > Aligned.)

In Object Mode Scale the curve a bit bigger, 1.05 times seems suitable. Then go to Properties > Object Data Properties > Geometry > Bevel, and set the Depth Value to 0.03 m (and maybe increase the Resolution value).

Fine tuning:

Decimate Curve to decrees the amount of vertices. Subdivide to increase them if needed. (Both also easily found by hitting F3 in Edit Mode).
Select vertices and press X or Del and choose Segments if you want an opening in the bar curve.
And of course move the vertices around to get the exact desired shape of the bar. : )
Press Alt + C and choose Mesh from Curve/Meta/Surf/text, if you want a mesh bar in the end.


How to add gradient between colours in object?

There are several ways to do it, you could use an Image Texture node and paint on your object.

You can also do it procedurally with a Texture > Gradient Texture node and a Converter > ColorRamp node:


This is a common problem. You're probably getting a "heat weighting failed" error, as described here:
heat weighting: failed to find solution for one or more bones.
This happens when you're trying to bind an armature to a mesh that consists of one or more pieces of non-manifold geometry. It doesn't matter whether these pieces have been joined together or not. If there is non-manifold geometry, you can encounter this issue. The only solution is to rebuild the mesh to get rid of anything non-manifold, so that you end up with one single, continuous mesh with no mesh collisions or holes. That will likely be a labor-intensive effort, but you might be able to reduce some of the workload by using the Mesh Cleanup tools.


If you look at your materials tab in the properties panel, you'll notice that there are several different material slots. The one you want to use (Material.004) is not the first one, so it is not the default one that Blender will choose.

To fix this, go into edit mode, select the faces you wish this material to affect, and click on the "assign" button in the Materials tab.


Precise commutative rotation on global X and Y

The angle between a vector and the Z axis and a vector in the right ortho view appears to be such that tan(θ)=y/z.  The angle between a vector and the Z axis in the front ortho view appears to be such that tan(φ)=x/z.

As long as θ and φ aren't going to be π/2 you can pretty easily set z=1 and then y=tan(θ) and x=tan(θ) .  If the π/2 is a possibility you'll want to have code to check for that case and use an alternate formula like tan(π/2-θ) = z/y and similar for φ.

So after following that procedure we have an <x,y,z>, but since you talk about rotations, I assume you have an object with some feature you want to align with this vector.

To accomplish this requires an understanding of quaternions, or you just copy the code from http://web.purplefrog.com/~thoth/blender/python-cookbook/rotate-to-match.html

import bpy

from mathutils import *
from math import *

def compute_rotation(src_vec, dest_vec):

    a = src_vec.normalized()
    b = dest_vec.normalized()

    c = a.cross(b)

    theta = asin(c.magnitude)

    if (c.magnitude>0):
        d = c.normalized()
        st2 = sin(theta/2)
        q = Quaternion( [cos(theta/2), st2*d.x, st2*d.y, st2*d.z] )
    else:
        q = Quaternion( [1,0,0,0] )

    return q

obj = bpy.context.active_object

obj.rotation_quaternion = compute_rotation(Vector([1,1,1]), Vector([1,0,0]))

The src_vec is a vector on the object (it might be the X, Y or Z axis, or some other important feature like an antenna) and dest_vec is the world space vector we want that source vector to be rotated to match.

Another thing to consider is that there are many orientations that are compatible with dest_vec = q*src_vec (just imagine spinning the object around src_vec), but the q calculated by this procedure will have the minimum θ.

To see how messy things can get, read http://web.purplefrog.com/~thoth/blender/python-cookbook/narratives/animate-random-spin.html


I need to do a very simple terrain with texture map

Import the height map using Import images as planes.
Enter edit mode and subdivide the mesh like a 100 times.

Add a Displacement modifier.

Set the texture to use the height map. Set the color space to Non-Color (height maps should be treated as data, and have no "gamma" curves)

Don't worry if the displacement seems exaggerated for now.
Back in the displacement modifier, set the displacement axis to Normal and to use the UV map.
The height for the displacement can be conrolled moving the strength slider.
For a better level of detail add a subsurf modifier before the displacement:

(be careful not to set the subsurf modifer to a high number, 1 or 2 subdivision levels should be enough, otherwise you might end up with an unmanageable amount of vertices and your computer might slow down or crash)
Then assign the color texture image as the color for your material.

Why the funky edges on the surface? Your height map needs a bit of cleanup before doing all of this
NOTE:
Usually the import images as planes plugin is enabled by default. If it isn't, you'll have to enable it manually. In the top menu find Edit > Preferences. Then from menu navigate to the add-ons section and find Import-Export: Import Images as Planes.
To enable the add on check on the box to the left of the add on name:

For versions previous to 2.8 the settings can be found here:


If a 3d view is not in local mode then bpy.ops.view3d.snap_cursor_to_active() is the equivalent of

context.scene.cursor_location = context.active_object.location

Could also just get the location from the lamps in the scene

import bpy

context = bpy.context
scene = context.scene

lamps = [o for o in scene.objects if o.type == 'LAMP']

for l in lamps:
    # add sphere
    bpy.ops.mesh.primitive_uv_sphere_add(location=l.location)
    # unlink from scene (could bpy.ops.delete or bpy.data.remove )
    scene.objects.unlink(l)

or pre select the lamps and use

lamps = context.selected_objects


Not on the same slot. Re-rendering will wipe the information from the current slot.

To save the previous render use a different slot (You might want to save the image to an EXR file).

To render only a section use the Border Render option (CtrlB), then you'd need to composite the new section on top of the old one using the compositor.


You probably just need to switch the tree type to compositing nodes


The texure of the rendered model looks different than in the viewport

Generally you will have to set up materials in order to see UV images in the render, because for the rendering engine more parameters than the image and its mapping are needed. Create basic materials, assign the textures to them and use the UV map in the texture panel. This way it should be close to what you see in the texture view.


Making an Interface in blender game engine

The Mouse Sensor when set to Left Button will send a positive pulse whenever the left mouse button is clicked. To get it to trigger only when over a specific object you have to add another Mouse sensor set to Mouse Over and plug it in to the same And controller as the click sensor. Like in the image below.


Advanced UV unwrap and bump map / displacement problems

I think I've done what you appear to be attempting and using of all things a moon map texture designed to be unwrapped on a sphere, certain I'd have the same problem.

I UV unwrapped it using 'Smart Unwrap' and got good results albeit with one section showing an annoying area at repeated intervals.

Because this was aligned along the ring's circular surface , I went into the UV editor and rotated the image 90 degrees.  Then rescaled and dragged all the outer surfaces in the editor to eliminate that pattern.

The end result -


You probably have set the undo steps to Zero in the User Preferences :

go to : User Preferences➜Editing➜ Undo➜ Steps  and set it to some number ( default 32 ) then save the settings


How to create a realistic shader for french fries?

The method I'd prefer for realism is microdisplacement.  Set your Cycles feature set to experimental so that you can use the Adaptive feature of the Subdivision Surface modifier.

And then set up your material for displacement and bump so that when you connect something to the displacement socket it modifies the mesh.

I used the same Noise Texture for both the Base Color and Displacement, so that I could make the areas with the most displacement a more golden brown.  The Scale values have to be adjusted for the scale you're working at.

I found that a Midlevel of 0 did some work to kind of puff up the model as though it had actually been deep fried, which was kind of fun.
Subsurface Radius value was 1, 1, 1 for this shot.
If that doesn't suit, or if a bunch of highly subdivided shapes are going to be too heavy for the final scene, I think it looks ok with Bump Only, you'd just have to do some work with the model to avoid it looking flat.  It looks like you have some pretty good shape variations to work with so maybe that's a place to start.


Yes you may mate. It's because this part of your mesh is not straight. In other words, the line between middle of the rectangle and the last vertice of each corner on other levels of the building is a straight line. In the part, where you have the gap, it's not.


Animation Nodes Delay of Cell Fractured Collection Matrix

I think change the scale to 0.2 in 'offset matrix'


How to properly add a chrome-like material in cycles to a thin object?

Random shading tips

Different world colors for background and reflections

Below is an example of using a different color for the background than for the reflections. In addition to colors, you can of course also use, for example, an HDR image for reflections and radial gradient for camera, or other kind of combinations.

Procedural reflections

For reflective materials something is needed to be reflected. Common and nice looking method is to use an HDR image. However, sometimes a simple gradient node can look nice in reflections. You can sort of 'paint' your reflections with it in real-time, which is cool :)

Keep the scale

When using procedural shaders, it's important to reset the scale of the object if it has been scaled:

Don't skimp on detail

When modeling an object, it's good to test how the light will bounce off the surface. For example, adding some double-beveling easily leads to nicely highlighted rims for some metallic objects:

My test

dented_chrome.blend


Final:

Overview:

This is the cleanest quad topology I can think of.

I don't know if this is the proper way, but for me it works always the best. Try not to think about quad topology but about Edge Loops and how can you use them along the mesh. If you will work that way, quads will come naturally after some time.

Here you have example with Edge Loop that will allow to control sharpness of the Edge itself combined with Subsurf Modifier.


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


How do i frame selected objects in non-local viewport?

I'm not sure if this cover your needs, but you can enable addon Stored Views. Located in 3D View > Sidebar (N)
From there you can save any view or camera view and switch between them.