Blender not saving changes to object's origin point On my current .blend file, when I edit a particular object's origin point and save it, opening the file again resets the origin back to where it was before. I'm unable to save the object with a new origin location. I tried doing CtrlA to set to apply location, rotation, and scale, and then saving it, but upon reopening the object was scaled strangely and the origin once again not in the right location.

It sounds like you accidentally added a keyframe to your object. So even if you move it, it will snap back to the keyframe position. You can fix this by opening the NLA editor and deleting all animation on your cube, or opening the Dope Sheet and deleting the keyframe you don't want. A common way to add keyframes by accident is by pressing the Auto Keyframe button (at  the bottom of the timeline), this causes any rotation, scale, or movement to your object to be keyframed.

You can acsess the Dope Sheet through this menu:

Once in the Dope Sheet, select the keyframes you don't want and press delete.


Select vertices on one side of a cube The aim is to select the vertices of one side of a cube.

My intention was to change the view's orientation using bpy.ops.view3d.viewnumpad and then select the vertices that are visible, using bpy.ops.vew3d.select_border.

    def changeView(view):
               for area in bpy.context.screen.areas:
                 if area.type == 'VIEW_3D':
                     override = bpy.context.copy()
                     override['area'] = area
                     bpy.ops.view3d.viewnumpad(override, type=view, align_active=False)
                  break

    def select_border(mesh,context, view3dAreaAndRegion=None, extend=True):
          if not view3dAreaAndRegion:
            view3dAreaAndRegion = getView3dAreaAndRegion(context)
          view3dArea, view3dRegion = view3dAreaAndRegion

          override = context.copy()
          override['area'] = view3dArea
          override['region'] = view3dRegion

          #change orientation to Front side
          changeView('FRONT');

          bpy.ops.view3d.select_border(override,
                                       gesture_mode=3,
                                       xmin=0,
                                       xmax=view3dArea.width,
                                       ymin=0,
                                       ymax=view3dArea.height,
                                       extend=extend)
           return view3dAreaAndRegion

This works, so long as I click 'Run Script' twice, or if the View is already set manually by hitting 1 on the number pad.

However the problem is, if I pan around,then hit 'Run Script' once, it selects all the vertices that are visible from that angle, before changing the view's orientation to Front.

You could use some vector math to select the right facing verts (deselect all verts and run this in object mode in the text editor, or paste in the console)

from bpy import context as C
from mathutils import Vector

for v in (v for v in C.object.data.vertices if v.normal.dot(Vector((1,0,0))) > 0):
    v.select = True

alternately, to select the left side, change the Vector to (-1,0,0). Top, (0,0,1) etc.


Procedural triangle fan Result so far:

Breakdown:

Single line:

Two Gradient textures with Constant ColorRamps added by Math node, one is rotated by 180 degrees. I can control line width by changing position of second color input in ColorRamps (they must be the same value in both).

This is wrapped in a Node Group called "Line".

Triangle Fan:

Four copies of above Node Group, each of them with different Z axis rotation (0, 90, 45, -45).

Question:

It seems to be complete solution but first of all it's kind a over complicated for my taste. It's working only with Texture Coordinates > Object and controlling width and line smoothness isn't to easy.

As much as I want to ask only one question they are too dependable of each other and answering one will eliminate the need for others.

1. How to make line width control easier? (I've tried with Wave but lines are crossing after scaling.) - Partially solved thanks to @kilbee.

2. How to control line smoothness?

Blend file:

Edit 1:

Thanks to @kilbee I have managed to pack node setup and control width but I have lost ability to smooth lines. I was wrong saying that one question will solve the other one:)

Blend file with @killbee setup:

I have also edited question a little bit to be more specific.

Edit 2:

@kilbee has done it. Amazing. Here is his version packed in Node Groups with little modifications (just Multiply nodes as Values):

I don't know if you'd find it easier, but I often use split vector values for this and (greater/less than) math node:

As you can see, this way you can easily control position on the object. Creating a line from this is simply a matter of offsetting the value in both directions and adding the results:

You can easily make it more compact, but I'll leave it as simple as possible to experiment with.

EDIT: Well ok then, I'd use gradient texture indeed and then just apply different formulas for color interpolation or/and scale the texture coordinates.
If you think about Gradient texture (Linear), it's actually a simple interpolation between black and white (0 to 1). Using right mathematical formula should give you any interpolation you want.
So I'd approach this first by scaling the mapping vector from Object output (multiplying by value higher than 1 would squash the values inside, while using values between 0 and 1 would extend the interpolation beyond the object). So, if you think about that, you could say that with default values you have a soft line of the width of your object:

The 'greater than' node explains it enough, I hope:

So to control the interpolation - the first thing that comes to my mind would be use power math node:

Then simply scale the mapping vector:

Simply multiplying vector values inside that group:

If you'd like to shift the lines, you just add a value to each axis, just like I did multiplying there.
If you experiment with different math formulas and Gradient texture interpolations (Quadratic, Ease) i think you will find the best way to control the line smoothness this way:

EDIT2: To debug transition you can literally draw it like a function: use Displacement Input for your Material Output (in this example I used simple box scaled in Z to 0.01, with adaptive subdivision). This is how values for Quadratic interpolation look like originally:

...and powered by 2:


Refraction quality is lower in rendered image than in the viewport preview I was playing around with Glass BSDF shader to see what it look like and how it interacts with its environment. Bellow, you can see a test scene.

Preview

Final
  The preview render on the sphere looks fine but when a final render was done the refraction of the checker-board was pixelated and distorted. The final render was done with 400 samples. Is that too little or am I missing something.
Is there a way to improve render quality of the refraction in the glass sphere?

File here :

The problem is that you are using flat shading on the mesh, as opposed to smooth shading that interpolates normals: https://docs.blender.org/manual/en/dev/modeling/meshes/editing/normals.html?highlight=smooth%20shading#shading

The reason why it looks ok in the viewport is that your subdivision surface modifier is set to 4 iterations for the viewport and 2 iterations for the final render. So the high subdivision in the viewport hides the flat shading.

Solution: Set viewport subdivisions equal or lower than final subdivisions, and enable smooth shading on the mesh (see above link).


What is the replacement for scene.update()? It seems the following is no longer available in blender 2.8 api

bpy.context.scene.update()

How do we update objects in the scene that have been changed by the script now?

Many instructions point to:

bpy.context.view_layer.update()

That's also what's mentioned in API documentation


Blender Read Only Properties Is there a way to check whether or not a Blender RNA or ID property is "Read-only" in python?

Yes indeed there is. Here's a very simple example using a World datablock and the .is_property_readonly(*property*) function.

import bpy
scn = bpy.context.scene
wld = scn.world
for a_prop in wld.keys():
    if wld.is_property_readonly(a_prop) is True:
        print("The property, %s, is 'Read-Only'" % a_prop)

This code would produce the following output:

The property, cycles, is 'Read-Only'
The property, cycles_visibility, is 'Read-Only'

The function .is_property_readonly(*property*) will output a boolean value, either True or False.


How to add different Gravity velocity for different objects? I am trying to make an animation on Cycles render and this is what I have on my scene:

I have a ball that rolls from a high platform until it goes down and hits 11 dominos and make them fall, I want the dominos to have a higher value of gravity than the ball so they can fall on the floor a little faster than they currently do, how can I do this?

I'm using Physics, Both the dominos and the ball are active "rigid body objects". I even tried to increase the gravity value on the "scene" control panel > "rigid body field weights" which it does increase the speed of gravity and makes the dominos fall faster (what I want) but it also changes the gravity of the ball and makes the ball roll too fast and looks unnatural, not what I want.

I've not used Cycles but the "Damping" setting in the physics properties (see pic) will slow down a particular object where it's used and leave the others alone.   The cube has damping applied (bottom right in the settings) and the cylinder doesn't.  You can see that they're falling at different rates.

The view is from underneath the grid -


How can I move a group along a path? I created a very simple railroad using an array-modifier followed by an curve-modifier, after that I wanted to run a train on the railroad. The Locomotive is consisting of several grouped objects which can be moved as a whole.

When a add another curve modifier to the groups parent all other grouped items stay in their previous location.

How could the group be moved along the curve?

It seems you have added a curve modifier which will 'bend' the object along the curve.

What you want to do, is to go to the Constraints-panel and add a Follow Path constraint to the parent. From there you can tick Follow Curve and press Animate Path to make the train drive along the rail.


How do i make grease pencil lines to disappear? i am Doing projection mapping with blender and need to trace a car by having different lines coming and going. how do i make grease pencil lines to disappear. as i only can figure out how to build the whole animation but not make the lines go away in the time line. Thanks in advance

In the "N" properties menu, go to colours and delete the colour which the stroke is using, and this deletes the strokes.


When I use the smoothing brush, the colors don't show up in my renders I have been following Blender Guru's blender tutorial from 2019 and it's gotten up to the point of rendering. The colors are supposed to be solid, but it seems like places I went over it with a smoothing brush turn up as the basic gray/white color.
Extra info that may or may not be useful (I literally started today)

The render is in cycles, but the same effect showed up in eevee
All the affected areas were places I used a smoothing brush when sculpting
No other brushes I used had this effect
I am using my GPU to render
I went over more of my donut with the smoothing brush and did another render. Any spots I went over with the brush also became that same color in the render, so I think I can deduce it is the smoothing brush causing this.

My guess is that you have a Duplicate sticking out of your donut coating. You have disabled the visibility in view port (Eye icon) but not disabled in Renders (Camera Icon)
If you dont have the camera icon next to your object in the Outliner Panel, Click the Filter at the top right to enable more selection modes.


Blender smoke cache saved but won't load as should after Blender is closed Can you please advise me on how to restore cached smoke simulation in Blender? I tried this with and without checking external.

The problem is that I am calculating this for several hours to finally appear in my scene and can't effort doing this every time I start working on my project.

I wonder if the problem may be either me not starting at frame 1 with the animation and/or the smoke simulation not matching the starting frame. But the reason I did start my smoke simulation at frame -200 is that I would like the fire to be already present and visible when the rendering starts.

smoke usually has to be calculated from frame 1

If cache isn't showing try selecting the external folder again via cache menu. Have animation cursor at frame one when doing this.


Blender setup for orthographic image rendering I want to use blender to render some stuff for use with a 2D orthographic view with a scale that 1x1 blender unit is 64x48 pixels.

I set the camera up by hand (as I would use for normal 3D renders). This is fine for rendering my buildings etc., but causes slight issues around the edges of tileable objects, getting semi transparent pixels where I need solid ones (I used a simple cylinder/"pipe" for testing with the end-faces removed), as well as some unexpected shading effects. While rendering each of the individual pipe parts looks OK, if I then combine them later onto a tile grid, it becomes apparent the edges are not quite right.

I assume because my manual positioning was not perfect. I could fix those manually in an image, but would really rather not have to, especially for my more complex models.

It also seems id have to play manually with the resolution, orthographic scale, and camera position to handle different tile sizes (e.g. this pipe is 1x1, but some objects with be 2x1, 2x2, 5x5, etc.). Is there a better and more automatic way to position the camera for such rendering?

Some of the individual 64x96 renders, the edge pixels are not quite right.

When they are put together on a tile-grid.

EDIT: Can anyone explain @quiliup answer, because if I render that I get the exact same thing, what does it solve?

As you have many questions, here are many answers:

Position

In orthographic mode, it is not important, how far away the camera is from the object (but stay within the clipping bounds). The position parallel to the object should be set and tweaked as you wish.

Tilt

As you already calculated right, the tilt of the camera downwards is $\alpha \approx 41.4°$. Here's how to calculate it for the orthographical view:

$\cos\alpha = \frac{48\text{ pixels}}{64\text{ pixels}} = \frac{3}{4} \implies\alpha = \cos^{-1}(0.75)\approx 41.4096221°$

the other rotation axes should stay untouched (parallel to the grid)

Orthographical Size & Resolution

This depends on how many grid squares you want to have in view. So we define, you want to have $m$ squares vertically and $n$ horizontally in view of your render.

If $n\ge m$ set the orthographical size to $n$.

The Render dimensions resolution: X-value is $n\cdot64$ px; Y-Value is $m\cdot48$ px.

The whole algorithm also works for different values $p,q\in\mathbb{N}$ with $p\ge q$ instead of $p=64$ Pixels and $q=48$ Pixels

With the above explained setup I got this render:

EDIT:

Fire Lancer pointed out that he wants a tileable setup.
Here's the setup with the blend file:


BGE: unwanted patterns in ground texture from repeated, seamless image I need to texture a 5km x 5km plane. Repeating the texture produces unwanted pattern, although the texture is seamless.

This issue has been already addressed for Cycles but not for BGE.

Is there any way to solve this in the BGE?

It is the nature of a grid to repeat the same pattern in a recognizable way. What you need is something that breaks the pattern.

Adding variations to the size does not really help as our brain can easily handle different scales.

Changing rotation can help more as long as the rotation is good enough. But this usually breaks the "seamless".

You can add variations by using more than one tile type. When you have 5+ with random order the repetition is much less noticeable.

Another option is to combine different tiles. This means you mix different tiles to confuse our brain. The repetition of the different "layers" should have a different scale. This way you can get easily a large field with just a few texture tiles that does not look repetitive (like dirt on the ground).

These are just a few ideas.


How do I rename packed images? (Script) I've got a code that loads textures, and determines which is what with eNUM list of texture-type. Basically, I get the right textures connected to their right slots of the material (e.g. 29318291083.TGA goes to Normal). Now what I'm trying to do is rename them and export them out so the texture I just mentioned would come out as 29318291083_Normal.TGA.

I assume Blender isn't able to rename external files so I added a line that packs each texture when it loads it, so I can rename it while packed, then export as a new .TGA.

Now I got the texture's packed but I don't seem to find a way to rename a packed texture.

Any help would be very appreciated.
Thanks!

Blender is able to do anything that you can do in python including renaming external files. I don't completely get what you are trying to do in detail, but you can rename textures in blender with

import bpy
bpy.data.textures['29318291083'].name = '29318291083_Normal'

In python you can rename a file with

import os
os.rename('a.txt', 'b.kml')

If your textures are stored similar to .obj and its .mtl (I didn't bother checking tbh) you can just use python to open the file, search for the right lines and rename them. As renaming files and editing text are very common methods, Stackoverflow provides you with lots of help.


Some Data Failed to Reconstruct, Motion Tracking I added tracks and stuff, but then when I tried to solve motion track, there was a error that said:

  Some Data Failed to Reconstruct

and it also said to look into the console for details, which I did. This is what the console said:

By my understanding, my video is 372 frames long, and Blender is cutting the footage at 318 for some reason. Here is the image of the scene:

Why? Here are links to my .blend file and also my video. Also the next morning I did a camera solve, but then most of the frames went red.

Blender is failing to reconstruct because it cannot get enough good tracking information to reconstruct the 3D motion for a section of the video, so it reconstructs only a portion of the shot. The frames where it failed are marked in red.
There are many reasons why your shot fails to track properly making the 3D reconstruction impossible.
I'll address a few.
1- A successful track is determined primarily by the quality of the shot.
Blurry, distorted images will be much harder to track than clear, sharp ones with unique features in which to anchor the trackers.
In this case, you're getting "rolling shutter distortion" or "jello effect" from the sensor of the camera on your iphone. The movement of the camera makes the image dance all over the frame giving the trackers false information.
-To correct that you would need hold the camera steadier, or undistort the video using other tools like Virtual dub or warp stabilizer on adobe premiere or afterfx.
In parts of the shot the camera moves way too fast. The image has so much motion blur that the trackers no longer have enough features to follow.
-solution: Do not move the camera so fast, so the image stays sharp.

The scene itself has very few distinctive features to anchor the trackers on. The cement floor and the wall have almost the same texture, so blender has a hard time finding specific points from frame to frame. The best tracking points in an image are those with unique features and sharp contrast.

-Solution: Find a distinctive features in your scene or add them to make the tracking accurate. You can do that with bright tape or with a color that is not part of the scene (you can also use marbles or colored balls). Those markers you can remove later.
2- The way the camera moves in the original shot determines the kind of camera solving that is required.
The default camera solver in blender presumes some parallax, or change in perspective, like when you walk and objects in the foreground move faster in the frame than those far away.
If the camera is static on the same place (not advancing laterally or going up or down) but just rotating or tilting, then the shot cannot be solved with the regular mode in blender.
-Solution: You have to use "tripod solve" (even if your camera was not on a real tripod). That solution will give you a 3D camera that mimics the original move and the tracking points will be projected form the camera, not necessarily reconstructing the  geometry of the original objects. In tripod camera solving it is much harder to accurately estimate distance.
3- Accurate tracking is the only way to get a proper solution.
The error messages and red bars you see are all the frames blender couldn't reconstruct and are listed as the errors on the console. This happens as the result of blender not having enough information to accurately recreate the camera in the 3d environment.
Solution: Refine your trackers, make sure they don't slip or start tracking unwanted parts. Delete trackers with errors (use the clear track forward/back tool). Play with the correlation values when the tracker fails. The goal is to have a solve error as low as possible. If you can get it to be around 0.3 you'll be fine
(But you can save yourself some time by going out and shooting a new video keeping in mind all of the above).
good luck!
FOR MORE TIPS ON MOTION TRACKING READ THIS POST


Blen4web and Alembic animation not playing I created alembic files from different 3d software (from iclone type ogawa for Blender).

When I import the alembic file into Blender 2.78 (together with the blend4web SDK latest release) and play the timeline the animation runs smoothly, but when exporting the scene the json or html files do not play the animation.

The Problem

How do I transfer the animations from alembic to mesh so it can be played after the scene is exported in json/bin or html format ?

I also tried using an add-on, but it didn't work. Here is the link to animation jointer.

It helps joining all the animations in one and creates keyframes per frame animated plus other features.

You might want to try baking your vertex animation with this dedicated tool available in Blend4Web:
https://www.blend4web.com/doc/en/animation.html#vertex-animation
See also this tutorial:
https://www.blend4web.com/en/community/article/48/


period key won't on iMac Am using an iMac the period key won't work for me to jump back to the center of the 3d viewport after moving and rotation the 3d viewport want is the hotkey for iMac

Try Shift + C  shortcut. That should reset the 3D cursor to the center and your view-port.


Material is black at edges when rendered Some areas of the PBR textures+Principled shader material that I used appear black when rendered. This only happens from some angles. I tried recalculating normals, merging by distance but to no avail. Any help appreciated. It looks fine in the material preview, just get this black on the sides based on the viewing angle only in the rendered view.

This issue was resolved by adding a Normal Map in the PBR node setup. Missed that earlier...


Surface Area and Volume Measurements I am fairly new to Blender and I'm hoping to find a way to easily calculate surface area and volume of irregular objects in Blender. I was looking into the Measureit addon, however it seems that I would have to break the measurements up and add them together since the objects I am working with are irregular (I'm modeling animals). Is there any add on that would help to enable this, or perhaps anything regarding coding in Blender?

Thank you!

3D print toolbox

In the 3D print toolbox add-on (it's already bundled with the official verion of Blender, you just have to enable it) there are two buttons (you can fin the right on the top of the tab), one for the volume and one for the surface (area)

Results are shown in the latest line of the panel once one of the two buttons is pressed.

The commands take into account the whole object, so if you need to get the surface of one part of your object only, you'll have to separate the faces into another object.


Creating curved grid with triangle windows How to model curved grid with triangle windows and keep it smooth? I tried to model everything and then snap (project) it to main mesh, but it causes a lot of wird shading at corners.
The mesh's on pic.

The shading issue is coming from the subdivision modifier trying to average out all those cuts into the surface. The explanation for how to resolve that issue is a bit lengthy so please bear with me.

I've assumed you're trying to build these windows and attach them to the outside of the curved surface. If you intend to use the Boolean modifier to cut these windows into the curved surface, there's another world of hurt coming.

Also, the final model isn't 100% perfect, there are still some minor shading issues which could still be cleaned up.

I've made this by modelling a window as its own, separate object and using an array and mirror modifier to duplicate it.

The window itself is rather simple. I took a plane and inset it (the shortcut key is I. From there, I cut out the center triangles and applied a Solidify modifier. Since I intended to use the Simple Deform modifier to bend the window, I needed there to be sufficient geometry for the bend to work properly. To add that geometry, I used the Subdivision Surface modifier.

To maintain the shape of the window cutout while using subsurf, I added a few support loops and a slight bevel modifier. To keep the face shading from getting messy, I marked the edges of the outer/inner perimeter of the window frame as sharp (you can do this in Edit mode by selecting the edges, pressing Ctrl+E and selecting Mark Sharp. This will cause the edges to appear blue by default in Editing mode, but is not shown in my wireframe screenshot).

As mentioned earlier, I used the Bevel, Subdivision Surface, and Simple Deform modifiers to bend the window shown below.

In the process of replicating the window, I need to move the origin which screwed up the Simple Deform modifier. I would thus need to apply the modifiers, but before doing so< I saved the original window without the modifiers applied and hid it. Backing up your models before applying destructive editing can save your life if it turns out there was a problem with the model before applying those modifiers.

Noting that your model has a forward-facing window than a horizontally flipped window, I took the object and added a Mirror modifier with an object offset before applying the Simple Deform modifier. Doing it after the fact would mess up the mirror line.  Admittedly, this could have also been done by hiding all the modifiers, duplicating it and rotating the duplicate 180 degrees.

At this point, I applied all the modifiers. To duplicate the object and rotate it around the curved surface, in my case an open cylinder, I used an Array modifier with just an object offset (make sure you disable the relative offset). The object, in this case, add an Empty Axis at the origin and use that as the target object.

When you do that, you'll find that all the array modifier isn't working yet. Move the 3D cursor back to the origin (Shift+S - Cursor to World Origin), select the window, right-click and Set Origin > Origin to 3D Cursor.

Now, select the empty axis and rotate it on the Z-axis only, and each additional window from the Array modifier will be rotated that angle around the origin. Rotate it so that the windows line up just right.

Finally, just to keep things neat, parent to the empty axis to the window so that you can move the windows around without messing up the array modifier then hide the empty axis.

I've included the blend file below.


How do I switch between cameras? I have two render camera objects in the scene, about to be three, I'd like to know how to switch between them as when I hit zero, it only enters the view of my frontal camera(the first one I placed.) is it possible to switch between them?

Change the main camera for your scene in properties panel:


Extracting key frames from long animation I've bought a number of animated 'game-ready' models. I need to modify these in Blender and export them in a different format.

The Blender versions (at least) of the files have all of their animations in one long sequence. A text file is available with the start frame for each animation. I cut these up manually into actions based on start frame and length.
The animations also have their transforms set each frame. This creates very large files, so I try to extract a number of key frames, say every 10th, and interpolate. (It's not perfect and may require some tweaking afterwards, like adding more key frames)

My problem is that doing this manually is very time-consuming. The process requires a lot of steps and is error-prone. Working with a model with 3000-5000 animation frames can also be slow.

My question:

Is there an existing way I can automate any or all of the process (step 1 and 2) (barring writing my own script)? Tools? Built-in functionality?

Thanks

Bake your animations

Make a backup copy
Select all the bones involved, then in Pose mode go to Pose > Animation > Bake Animation.
In the pop-up window:

Set Start Frame, End Frame, and Frame Step (in your example set it to 10).

Check "Only selected" (only selected bones will be baked); "Visual keying" (the position after all modifiers and constraints will be baked); "Overwrite current action" (you've made a backup copy, right??)

The "Clear constraints" option will remove all constraints from the armature after baking, making it perfectly animatable by the new baked action.

"Clear parents" involves object mode only, so it doesn't apply here.

Set "Bake data" to "pose"
Bake!


Minimum number of samples for the Branched Path Tracing If I turn on "Branched Path Tracing" in Cycles/Render Properties/Sampling, then I can set the number of diffuse, glossy, transmission, AO, mesh light, subsurface and volume samples. What bothers me is that the minimum number of samples is for each of them one, and not zero. As far as I understand it, this forces me to waste rays on things I am not interested in.

For example, if I have no subsurface and volume scattering in my scene, then I should set these values to zero, right?

EDIT WITH MORE EXPLANATION: Also note that the number of subsurf rays is multiplied with the number of AA rays (as you can see bellow the controls in the "Total Samples"), so if I have 64 primary AA rays, then (as far as I understand) I am forced to use at least 64 subsurf rays, 64 volume rays etc, which is not so little, especially because I am interested in animations. And even if I do have subsurf materials, I might want to temporarily set the subsurf rays to zero in order to better understand their contribution or to save time while doing non-final renders.

Cycles generates each sample type as different "images" which are then combined into the final render. Each of these passes can be made available in the render layer settings which can then be used within the compositor.

While cycles could be made to work with one or more of these passes being missing, there is no benefit to doing it. A simple scene with one sample of each pass can be rendered in less than a second. It is only when you are rendering with hundreds or thousands of samples that a pass adds any time to the render, having one sample of a type you don't use can only add less than a second to your render and the couple of MB that could be saved in memory use will not make a difference on any recent computer.

AA is Anti-Aliasing, it softens the edges to hide the jagged edges seen from sudden colour changes. 64 AA samples is high, the AA samples defines how many neighbouring pixels are used to determine the final pixel colour and as you noticed it multiplies the final sample count.

If you want to know the effect of each pass then enable them all in the render layers and mix them in the compositor where you can turn each on/off to see how they effect the final image. CGCookie has a fundamentals of compositing series that explains how to do this.


How to highlight areas of a desktop recording in video sequence editor I'm using blender for editing desktop recordings using open broadcaster software.

I would like to highlight areas of the screen to draw attention to them by surrounding them with a red rectangular box.

How can I do this in blender?  Do I need to create a transparent image containing a rectangle of the correct size for each area using another application like Inkscape, or is there a better way?

Making the shape in a 2 paint program like GIMP or drawing program like Illustrator is quickest. But with Blender you can animate and iterate more quickly.
You can use a mask from the UV image editor.

First press F12 to render the present frame into the Image editor.
then change to Mask Mode and create a new mask (name it)

In the VSE add the mask as a strip in the place that you want it to appear

Select the new mask strip and add a Gaussian Blur, set blur in properties panel (N key) to 10 or more (depending on render resolution).

With Blur effect selected add a curve modifier and make a sharp peak.

Now add a color correction modifier. Set the Gain value to a nice bright color.

Change the mask strip's Blend type (in the properties panel again) to add.

Now you should see a colourful box outline around your region of interest.

What is cool about this approach is that you can animate the shape, color and thickness of the curve during the edit.


Use tracking information from video to make a 2d panorama I am proficient in computers, but a relative noob to blender.  My video is H.264 with 1080p@60. I have loaded a video in and did the whole tracking system and collected the movement data.  I slowly panned left and right and up and down and have about 700 frames.

I followed a tutorial on stabilizing videos, but the exercise got me thinking.  If blender knows exactly how far frame 1 is off from frame 2,3,4, and etc it should be able to make an excellent panorama from it.

You start with the 1st frame as your base.  Lets say the tracking data says your picture moved up 10 pixels and right 10 pixels.  So you take the top 10 (rows) pixels and right 10(columns) pixels and you add them to the top and right of frame 1 and do this for the rest of the 700 frames.  If it offers no new pixels ignore that frame.  Then you have a panorama.  It would be nice to be able to overlay certain frames if a few are blurry or otherwise defective.

Is this possible, and of course how?

I was in the Node Editor and linked the video and tracking data, but then what?

The only way to achieve this in Blender I think is with Dynamic Paint. But the vertex paint can be poor quality. You'll have to bake an image sequence. Of course you only need the last frame.

Track the image with 1 marker. Use "offset" if marker leaves frame.

Solve the track for Tripod.
In Geometry tab of the MCE link an empty to the track.
Go to the 3D view and create a plane for the canvas, subdivide it
lots. The more you subdivide it the sharper the image later.
Give it a Copy location Constraint (new empty)and a copy rotation
constraint (camera rotation).
Press 0 to look through the camera and scale the canvas so that it
covers the camera view from first frame to last.
Then add another plane using the Images as Planes addon. This will
be the brush.
Give it a constraint to copy the camera location but in edit mode,
scale it to fill the field of view and move it towards the canvas
object.
Add a Solidify modifier so that the image plane goes through the
canvas plane.

Go to the physics tab and activate Dynamic paint > brush. Set
 material to the movie image material.
Now select the canvas and in the physics tab activate the Dynamic
 paint > canvas. Turn down Drying time to 1 frame.

The canvas should move below the camera in sync with the original camera move. The source movie should be projected onto the canvas from the camera point of view.

To reduce the processing you would use fewer frames from the source pan. Blender won't drop frames in Texture mode so you would have to preprocess them in the VSE, by applying a speed effect which will drop frames. In this way a pan that could use 100 frames could be created with just 10 frames. Tracking would be a bit more challenging.


Object rotates unexpectedly while following path https://imgur.com/0AWoBcQ here is my problem. I am trying to make this car go in a traight line, turn around, and come back. I have a path set up for this, but when I link it with the follow path constraint it starts rotating... strangely to say the least. I have tried moving the parent empty to the center of mass and that did not work, so thats off the books. can anyone help?

You need to apply the scale of your curve, it squashes the scale of the empty and therefore of the car:


How to search through multiple Blender files to find a specific object? Is there any way to search for an object (such as you would import using the Append option) when not in Blender?

I was a bad boy and made a model inside a .blend file a long time ago and have no idea what file I built it in, and didn't save it as a stand-alone file. Short of searching through every .blend file I have, is there anyway to locate it?

Use blendfile.py

Using the blendfile script outlined in answers to Is there a way to acces external .blend file's data with python script? to quickly read blend file and  run thru objects in a blend file without having to open it with blender.

Here is a simple demo script which prints out file name and a list of objects within that file.I've simply dumped the blendfile.py and script below as blendobjects.py in a root search folder. (rather than using sys.argv etc.. might get back to it)

# install as module or put in same folder.
import blendfile
from pathlib import Path

def get_id_name(block):
    name = block[b'id', b'name'].decode()
    return name[2:]

for file_path in Path('.').glob('**/*.blend'):
    bf = blendfile.open_blend(file_path)
    objects = bf.find_blocks_from_code(b'OB')
    print(file_path, [get_id_name(o) for o in objects])
    bf.close()

result (run in system console not blender), prints blend file name and a list of objects in that file, which can be redirected into a file and searched.

batfinger@shitbox2:~/Documents/blender$ python ./blendobjects.py
MS2Props02.blend ['Camera', 'Mesh_0449', 'Mesh_0449.001', 'Mesh_0484', 'Mesh_0484.001', 'Mesh_0490', 'Mesh_0490.001', 'Mesh_0773', 'Mesh_0773.001']
yawpitchroll.blend ['Camera', 'Cube', 'Empty', 'Lamp', 'Suzanne']
tests/snoff.blend ['Camera', 'Cube', 'Lamp']
tests/aubio_tests.blend ['Camera', 'Cube', 'Cylinder', 'Lamp']
tests/untitled.blend ['Camera', 'Grid', 'Lamp']
tests/belt.blend ['Armature', 'Armature.001', 'Camera', 'Cone', 'Empty', 'Empty.001', 'Empty.002', 'Empty.003', 'Lamp', 'Torus']


Textures stretching when UV mapping So, my textures stretch on the mesh when i uv mapped them. I do not know how to avoid this kind of problem. (Extreme stretching on the tables legs)
(i am trying to achieve that ps1 look)

First, in Object Mode, check that the object isn't scaled on any axis - scale should be '1.000' for x, y and z as in the screenshot below. If you have numbers other than 1 you can fix this by going to Object > Apply > Scale in the top left of the 3d viewport.

If that's fine you can try re-unwrapping the object by selecting all the faces in Edit Mode, pressing U key and selecting Smart UV Project. If the texture still looks wrong, select the faces individually in edit mode in the 3D Viewport then select the corresponding face in the UV Editing window and rotate and scale it until you get the right look.
Good luck!


How do I send multiple command line commands to the same Blender instance? im pretty new to blender, and im facing the need to issue python scripts to blender outside of blender via command line.

Im using the following from a windows shell: "blender exe" --python "python script path" And it works as expected.

The problem is, the second time i issue the command, blender opens a new instance and that's not the behavior i need.

I need to be able to issue commands via command line to the same blender instance.

Is there something (like an argument specifiying the blender process id) i can use to execute different scripts in the same blender instance from the command line?

Thanks in advance

For a slightly 'hacky' way of achieving this, create a handler to look for the presence of a file and execute the contents of the file (and remove the file) whenever it is found. Once the handler is running all that is required is for any script to be executed to be copied into a specific location and Blender will 'consume' it.

In a text editor, click 'new' and paste the following code (and name it 'exec_from_file.py') :

import bpy
import os

filename = 'blender_script.run'

def scan_for_file_to_exec(scn):

    global filename

    try:
        file = open(filename)

    except FileNotFoundError:
        pass
    else:
        print("scan_for_file_to_exec: Got file")
        content = file.read()
        file.close()
        os.remove(filename)
        exec(content)

bpy.app.handlers.scene_update_pre.append(scan_for_file_to_exec)

print("scan_for_file_to_exec: Scanning for file '%s' in directory '%s'" % (filename, os.getcwd()))

Click 'Run Script' and optionally tick the 'Register' checkbox to automatically run the script whenever the blend file is opened. This will install a handler that will be triggered every time the scene is updated (which appears to occur continuously). The script outputs a line to the console window when it first runs, indicating the file and directory it is scanning for.

scan_for_file_to_exec: Scanning for file 'blender_script.run' in directory '/home/rich'

Whenever the file exists blender will read the contents, remove the file, and execute the code.

All that is now required outside of Blender to trigger the running of a script is to copy the required script into the relevant location and it should immediately disappear and be executed.

For Linux :

cp my_script.py /home/rich/blender_script.run

For Windows :

copy my_script.py c:/users/rich/blender_script.run

For multiple files, copy each file in place, waiting for each to be consumed before copying the next.

NOTE : You need to ensure that Blender is invoked from a location where your user has permissions to read/write files - or you need to run 'As Administrator'.

For example, once the above handler is running (and assuming both you and Blender have permission to read/write to the relevant directory) you can create Suzanne by running the following from the command line (in the relevant directory) :

echo bpy.ops.mesh.primitive_monkey_add(radius=2) >blender_script.run

Then create another different sized in a different location :

echo bpy.ops.mesh.primitive_monkey_add(radius=2, location=(-1,-1,-3)) >blender_script.run

An alternative method is to use a similar handler to read the input from the 'blender' process itself and execute any commands received on that stream. When you launch Blender you can direct the output of another process (eg, a python script) into the 'blender' process and Blender will execute them as they are received.

For this, create the following script in a Text Editor block named 'exec_from_stdin.py' and click Run Script. Don't forget to click 'Register' so that it runs automatically when the blend file is loaded.

import bpy
import select
import sys

def my_scene_handler(scn):

    #print("In scene handler")

    # Check to see if any input on STDIN
    if select.select([sys.stdin,],[],[],0.0)[0]:
        # Read a line from input
        line = sys.stdin.readline()
        print("Got a line '%s'" % line)
        exec(line)

bpy.app.handlers.scene_update_post.append(my_scene_handler)

Now when you launch Blender to load the file it will listen for commands on 'stdin' (standard input).

You can now 'pipe' any input into Blender by launching it using a command similar to the following :

<command> | blender

NOTE : This method doesn't appear to work correctly under MS Window - Linux (and, presumably Mac) only - due to differences in how Windows handles input streams.


View video at any angle How can I see a video loaded in the background at any angle?
not only in the view of the camera or left right up down

Without using additional geometry or compositing, you can use the image as background for the world. Set the Texture coordinates to Window.


How does anti-aliasing work in cycles? As far as I understand, cycles anti-aliasing in cycles (per default), works by sampling around a specific arc/vector determined by the camera position/rotation.

This explanation and my experience lines up with the answer here
https://blender.stackexchange.com/a/3554/245
but kind of disagrees with the explanation given in
https://blender.stackexchange.com/a/17845/245 specifically the image https://i.stack.imgur.com/irhyB.png

describing sampling.

If sampling is working this way, the image will always be anti-aliased.

So my understanding for sampling is as follows

Where the radius of the circle is the width of the  width value of the "pixel filter" in the UI.

This would mean however, that either not all the space is sampled or the sampled space overlaps (thus blurring the image) and the only way to get high quality (super-sampling) anti-aliasing is to manually render at increased resolution and downsample the image later. Is there a way around this?

tldr: The default anti-aliasing setting samples significantly outside one pixel which reduces the effective resolution. For a maximum effective resolution use the "box" setting which acts as an incredibly high multisampling anti-aliasing filter.

From my own experiments and the information provided in the discussion from the patch https://developer.blender.org/D1453, the sampling with the Blackman-Harris-Filter happens in a circular pattern around the center of the pixel, with the density following the Blackman-Harris-Distribution.

In the default case, with a "filter width" of 1.5 pixels, this means that up to 5 pixels in a horizontal line contribute to the central (third) pixel. Not only the nearest neighbor but also the next nearest neighbor pixels. This leads to a significant "blurring" of the image. Only "filter width" values below ~.65 pixels guarantee sampling stays within the original pixel. This however leaves out the corners of the pixel.

Chosing an "optimal" default and distribution is not possible as per wikipedia:

  The goal of an anti-aliasing filter is to greatly reduce frequencies above a certain limit, known as the Nyquist frequency, so that the signal will be accurately represented by its samples, or nearly so, in accordance with the sampling theorem; there are many different choices of detailed algorithm, with different filter transfer functions. Current knowledge of human visual perception is not sufficient, in general, to say what approach will look best.

However what originally motivated me to post this question, was the blurring when working with pixel accurate sprites. With the default anti-aliasing setting it felt like detail got lost in the renders. However turning off or reducing the width of the filter too far killed the anti aliasing even inside the pixels.

When using the "box" anti-aliasing filter and adding a Gaussian blur in the compositor, I can no longer distinguish the results from the Blackman-Harris filter, but I have the freedom to adapt the sharpness in after the render.


Prevent overlaping loop cuts from merging I'm trying to create two parallel loop cuts on a pyramid. The way I saw how to do it is to first make one loop cut in the middle of the pyramid which will be vertical to the base, then do a second loop cut and push it against the first one to be parallel also to the base. The problem I'm having is that when I push the second loop cut against the first, the two loop cuts seem to merge together because when I try to move the selected loop cut, then both cuts seem to be moved around.
How can I prevent the second loop cut from being merged with the one it's on top of?

Most likely one of these two options is on:

Proportional editing, on left and the first edge loop is influenced when you move the second one

Auto merge vertices, on right and the vertices were actually merged when you moved the second one onto the first


Rigging a wheel with multiple parts? I imported a Martian rover with the wheels having multiple parts. There are 6 wheels in total and they seem to be "connected" in some way (if you click one part of the wheel all the other parts on the other wheels get highlighted too). How am I supposed to rig this?

Here is the link to the model: https://nasa3d.arc.nasa.gov/detail/nmss-sev

I'm afraid you'll have to re-organise the model quite a bit.

I would start by hiding everything but the wheels. Then select all the wheel parts (A) and join them together (Ctrl-J). This will give you one object consisting of all the wheels.

Now switch to edit mode, select a wheel assembly (B or C) (make sure you can reach all the vertices, "limit selection to visible" should be unchecked, light colour) and use P→"Selection".
Repeat until you have 6 separate objects.

Then, for each of these wheel assemblies, you'll have to set the origin to the center of the wheels. Easiest (for me): in object mode, select each wheel and use "object"→"transform"→"origin to geometry" (or animating them is going to be tricky).

Then you'll have to do the same for the wheel supports. Think about how different parts move in relation to the others, that'll give you a good indication on how to combine them (Parent-child relations).

While you are working on such projects, use layers to organise the parts and hide parts you are not working on (by hiding the layer).


Blender Material Color in Mitsuba (or any other) Shader I have imported a large WRL file (contains >3000 parts) with colors included (one material for each part!).
In Cycles and Blender-Render, the colors are rendered just fine.

But what do I do if I want Mitsuba, Luxrender or Yafaray as renderer?
Is there a way to get the Blender-material-color and put that in a 3rd-party material?

I know how to make a material with python and apply it to a mesh. But how do I get the color of the selected object's blender-material?

How to make a Mitsuba, Luxrender or Yafaray matrial is one thing I yet have to find out too.

Thanks for your help.

You can read the mat color from Blender Internal material like so:

# from material
mat = bpy.data.materials['Material_Name']
color = mat.diffuse_color

# or from object
ob = bpy.context.active_object
if len(ob.data.materials):
    # get 1st material slots material
    mat = ob.data.materials[0]
else:
    # no slots
    print("No Material")
    mat = None
if mat:
    color = mat.diffuse_color

To change LuxRenders material diffuse color:

mat.luxrender_material.luxrender_mat_matte.Kd_color = color

Mitsuba:

mat.mitsuba_material.mitsuba_bsdf_diffuse.reflectance_color = color

In Yafaray there is no need to change anything, it will use:

mat.diffuse_color


Print all commands in the Info view? The Info view doesn't show every command (scripts) which I actioned.
Example open new file, reload file, import, export...

How to show them?

While the info window can be helpful, the list of commands it shows is not a complete list, some operators are intentionally filtered out because they don't relate to editing your data (panning the view for example or scrolling the text window).

One example is renaming an object, changing the name in the 3Dview properties sidebar or object properties shows in the info window but renaming in the outliner doesn't show.

With opening/reloading blend files, the info window is cleared after opening a blend file, so the open command would be cleared out. If you refer to opening text files in python, any task using basic python functions isn't going to show in the info window, a call to a bpy based function would need to be made for blender to echo it into the info window.

EDIT:
You can see most if not all of the missing actions by setting

bpy.app.debug_wm = True

Note that this will give a lot of extra entries, including zooming, typing in the console, scrolling up and down....


Set value through variable How can i set value of referenced variable but not the variable?
Hard to explain, here is example:
Var = bpy.context.object.pose.bones["Forearm.L"].constraints["IK"].influence #I saved influence into Var
#influence of that bone is 0.5
Var = 1 #But it didn't set to actuall influence, its just set to Var in code memory
#influence of that bone still is 0.5 but Var is 1 now

This is Python question in fact. First line does not get influence but gets the value of it.
You should get
c = bpy.context.object.pose.bones["Forearm.L"].constraints["IK"]

then
c.influence = 1

_ lemon


Why is the camera going inside my mesh, when the camera is not inside? I found an answer to a problem, and I thought it would be good to post.  I was having a problem where when I hit ctrl-alt-0, Instead of going to the view of the camera, it would go inside a mesh itself.  I did not have any hidden cameras either.

The answer to this problem is simple.  Blender has a feature where you can select an object, hit ctrl-0, and that object becomes the "camera."  Thus, the camera view was inside my object.  This is pretty neat!  I'm not sure how to use it in a beneficial way, but it must be good for something.
If you want to set the camera view back to your original camera, select your camera and hit ctrl-0.


How to place a light inside a clear object I've seen it best in The LEGO Movie Series. I want to emit light from inside an object. e.g. how they do fire. I want the object to maintain a plastic look. A translucent plastic.

I already have a good translucent plastic material. But placing a light inside results in a material I'm not happy with.

How can I get this the plastic to look right with a light inside it, while still emmitting light?

Edit: It also doesn't diffuse throughout the brick correctly.

This is the result and the node setup:

Important: set the shader property to this: (alpha blend)

THe box needs to have transparency, so that the light can "come" out. This does the first mix shader. The second one mixes then the material of the cube with your plastic look (i just took a diffuse shader to simplify it)
a even simpler way would be this:

UPDATE for cycles:
works too
of course you have to tweak the diffuse material to your plastic material. I just simplified it.
Instead of a lamp i placed another cube with strong emission as light.


Triggering NLA animations? I've recently set up my NLA tracks for an entity someone has, and I'd like to be able to "trigger" the animations at any specific point. Is there a way to do this?

I know I could just shift or copy the NLA track, potentially. But I'm wondering if there's a way to just 'trigger' it in Blender? Or does it manually need to be set up?

In the image, you can see I've established my tracks:

Opening: Goes from Closed to Open and back again (which is just a copy/paste of the frames from both Open and Closed)
Open: Base reference that I'll have active whenever I want the thing open.
Closed: ^ but for whenever I want the thing shut.

However, "Opening" could be triggered multiple times to the same entity. It basically opens and shuts the object and I'd like it to be repeatable without copying NLA tracks over and over again. But if it's unavoidable, I can certainly do that too.

Keyframed animations only happen at a specific time that we have set, using the NLA it is possible to duplicate an action so that the same animation can be repeated at different times. While we can copy and paste the same thing into different places, it is a manual process.

To automate animations we can use constraints and drivers. Constraints use a simple interface to configure a range of preset conditions, drivers expand on this to allow values to be calculated using python expressions or scripts.

If you have multiple objects that you want to move in unison, constraints can allow one object to be the master control with the others moving in relation to the master. This means you only keyframe the one object at the time you want them all to move.

It is possible to input a distance between two objects into a driver, this would allow an object to move if another is within five units of it and have it move back when it is farther than five units away. While we can get great control over an item, it requires the use of python, even if only a short expression to define the calculation to use.


Is there a way to map a floating point value using a Bezier curve with nodes (Blender 2.8)? I want to a floating point value in the range [0.0, 1.0] to another floating point value in the same range. I'd like to implement this mapping using a Bezier curve.

I've read the documentation for the RGB Curve node, and also the following  answer (how does the RGB curve work?), but I would like to know if there is a way to apply a bezier curve but only to a floating point value (and not to a whole vector).

A potential solution is to use the RGB Curve node, but focusing only on one of its channels. In the example below, I am passing as input a floating point value in the range [0.0, 1.0], and the node tree below does the following

Feed the input floating point value to the RGB Curve node (since the input is one-dimensional, we focus on only one of the RGB channels; red in this example)
Separate the output into the three color channels (RGB)
Isolate the red channel (at this point the output is still in the same range, [0, 1])
Multiply the red channel output by a (problem specific) scaling factor


Project Texture from Camera (like Window, but not from Viewport) I have a Window projected texture and a fixed camera. The texture was made in another program based on a render of the scene. As long as I am looking through the camera, the texture is lined up properly. But if I switch to the viewport camera, then the texture is projected from the viewport, and so looks wrong.

Is there a way to do something like Window projection, but have it always be projected from the Active Camera (or object I can place in the same location), and not the viewport? Preferably a node based solution. I understand that the UV project modifier might work for this, but then I have to maintain that on every object in the project rather than just adding some nodes to a group.

This setup projects texture from camera and adjusts scale based on Z depth.

Works only in camera/perspective mode due to Z-depth socket used in calculations, viewport zooming doesn't affect texture scaling also due to Z-depth.


Camera not showing anything when rendering I have 2 cameras.
It's working perfectly when I play the animation in preview.

The first camera works perfectly. When I press F12, it's rendering:

However, after the frame goes to camera 2, Blender shows this:

I already looked for a solution on the interned but could not find one (maybe I was not using the right keywords).

Select everything and press W when you are in Object Mode then press Clear All Restrict Render!That should do it!


BGE shaking camera when i walk or run I couldn't seem to find any videos on how to do this.
I'm making a game and I want it so when I walk or run the camera shakes.
how do I do this

You can make an animation with the camera. Click this little red button in the timeline. (That inserts keyframes automatically when something is moved.) Select the camera, press alt + a to start the timeline, press g to grab it, and shake it around. press escape when you are finished. You can do this a much more sophisticated way, of course. :) Save your action. In the logic editor, use whatever sensor that causes you to run and link it to the action actuator also (where your camera is animated.) Remember to set the beginning and end keyframes to be where you had started and stopped the shaking. If you want a much more controllable way to do it, try using something from this video: https://youtu.be/PU_uhfO1Bsk

Hope that helps. ;) Tell me if you need more information. It would be a good idea to add more information to your question as well.


How do I change the shortcut icon back? v2.81 I was looking up some shortcuts and pressed some combination of key that change one of the icons. See the highlighted icon in the image. That icon is from the icon sidebar on the left edge of the screen. This one used to be the "box select" icon and now it's the "Tweak" icon. I would like to change it back.

Ok after some more playing I found it. Any of the icons with the arrow in the corner you can left click and hold to bring up a sub menu.

Also using the keyboard shortcut for box select will change the icon to that again.


Guidance on how to set a plane to look like the sea during a storm I am a complete Blender beginner and I am trying to follow this beginner's course as suggested by this forum:

http://www.cdschools.org/cms/lib04/PA09000075/Centricity/Domain/81/BlenderBasics_4thEdition2011.pdf

However, I am stuck cause I cannot get the right texture for the water DESPITE doing everything exactly like the instructor says.

In the link below you're see a screenshot of my 2 monitors displaying:

Left Monitor: My Blender 3d with 2 windows, left most showing the rendered texture for the water

Right Monitor: The instructor's PDF file showing how the water should display.

Link is here--> http://snag.gy/eFMIi.jpg

Can someone help me out with this please?

Turn off colour in the influence panel. Only apply this to the normal map


How do I fix vertices scaling towards selector? I've recently started using blender, and was working with it just fine, when I accidentally changed how the scaling and rotating works. Now when I try to scale something, it scales as if the selector was the senter. Axis locked translations are also affected by this, as I have to find the selector to translate it.

If your selector is what it is scaling to, then you may have changed the Median point, or bumped your keyboard and it changed.

Easy fix!

The third little box on the end of your screen will have the options to change the median point.

The original option you were probably using was the one called median point before it changed. just click on that one and it should fix it.


Can I have a custom "bounding box" for the near sensor? I was playing with the near sensor and I was wondering if I can have a bounding box for it, that does not calculate distances from the origin point but from the (for example) faces of the mesh.

If the origin point of the mesh is something that cannot change, then could I possibly customize the bounding box so it would not be a sphere? Maybe it could have some fixed dimensions, parallel edges still though (not something complicated).

I guess it involves some scripting, any ideas?

A near sensor detects objects within a radius from the object's origin. This naturally means that it detects objects within a sphere, the size of which is determined by the "distance" field on the near sensor. You can, however, work around this spherical limitation fairly easily. Add a cube and modify it to whatever special shaped detection region that you want. (you don't have to start with a cube, you can use any method you want to get the mesh). Parent your special bounding shape to your player, and set the physics type to sensor, make it invisible, and set the collision bounds to triangle mesh.

Then, you can use two collision sensors to activate whatever your near sensors would normally do. (To connect logic across multiple objects, simply select them both). Just make sure that the property you're looking to detect is on all the objects you want to be detected. (No the property doesn't have to be filled in as "WhateverYourDetecting."


How to add a UV Map to a Mesh Using Python I've made a script that creates a mesh in Blender using a binary file containing mesh data. That works fine, but now I need to get textures on the mesh and I want to create a UV map from the UV data in the file. However, I can't figure out how to add the UVs to the mesh.

Ideally, I'd like some system that lets me add a UV per vertex as I add the vertices. Should I be using UV loops? I don't really know what they are, but there is some information about BMLoopUV at the following url, although no example usage:
http://www.blender.org/documentation/blender_python_api_2_67_release/bmesh.types.html#bmesh.types.BMLoopUV

There are 2 existing resources that show this:

The best is the template for this purpose that comes with blender 2.67:

See Text Editor -> Templates -> Python -> Operator UV.

There is also a snippet in BMesh docs.


Scaling has not been happening from the center point I am very new to blender and this could be a silly one for the pros here.

While scaling, I prefer the reference point to which scaling happens, to be the center point of all selected vertices. But then for some reason, scaling happens with reference to one of the selected vertices. How do I fix this?

So, in the Pivot Center option, instead of Active Element, choose Median Point:


Moving keyframes by 30 I'm trying to move a set of keyframes by 30.  If you see in the photo the first one is at 0 and 30 and line up correctly with a space of 30.  I then try to move it to 10 so the next keyframe would end at 40.  However, it seems to end at 39.  Is there a reason for this?  Thanks.

First keyframe is 1, not 0.
Make frame #1 your start one and then you have 30 frames like <1, 30>. Move start to #10 and it ends at frame #40.


Modelling an awkward and complex shape I'm learning Blender and started a project to model an old Leica camera I have. The top section of the camera has a very awkward solid shape, I've bitten off more than I can chew!

In my limited knowledge I basically started with a cube and simply extruded bits, moved vertices around, used edge loops, and added a subdivision modifier. I'm really struggling with all the differing slopes and edges.

Clearly I've approached it in a way which is not really working well, is inaccurate, and not efficient. I'd like to know how people would tend to tackle a shape like this?

don't worry, with training you can do much better. try to see how others model or what they use. I'm not a hardsurface modeler but here is my solution to this shape using box modeling:

use bevel when you can. or other modifiers.

other method includes but not limited to:
modeling with boolean (for easier workflow try hard-ops or booltool addons) then retopology it.


Turn off incremental render Is there a way to turn off the incremental rendering, so it only updates the viewport once the render is finished?

I'm using the "render preview" in 3D viewport, with eevee. When I rotate the view with the mouse, it is very jerky, because of the incremental render. I don't mean it's slow between frames: my scene is small and quick to draw. What I mean is that it first draws a very coarse version of the scene, then fills in details over two or three more screen refreshes. It is still quick, but the interleaved coarsely rendered frames really makes it hard on the eyes when you rotate the view.

EEVEE, just like Cycles. has Samples. Directly turning incremental rendering off is not an option, but you can turn down the samples to the lowest value. This would give you a smiliar result.


How to add a sensor to an object using the BGE Python scripting I want to add a sensor to each of several "players" using the bge + python.  Each sensor will need to have its own distance function, because each player has a different range of perception. This is how I add the players to the scene:

for i in range(world_config.initial_population_size):
    pos = Vector((random.uniform(-10,10),
                 random.uniform(-10,10),
                 3))
    p = Player()
    t = own.scene.addObject("Player")
    t["Player"] = p
    t.worldPosition = pos

Now I would like to do something like.

t.addSensor(Distance=t["Player"].perception())

So that later I can compare which player sees the other in an interaction.

There is no function addSensor in the API search_1  API search_2.

So you can't add a sensor through python. The sensor requires to be added in logic editor for a single object, but you can add an object with a sensor and controller to the current scene.


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

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

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

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

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

You can distort a texture using another texture, like this:

(click on the images to enlarge)

Or you could mix bumps and displacement with other textures:

If what you are after fake relief (or bumps maps), but not real geometry displacement, this would work fine. Otherwise I would recommend using a displace modifier.


Creating looping cloth animation for sprite Helllo!

For a project that I am doing, I need to render the my model to a sprite sheet. This is all fine, except that the model has a cloak, which uses a cloth animation. I need to smoothly transition from the end of the cloth simulation to the start, so it doesn't just jerk back, but I can't find any way of doing this.

Thanks in advance.

You can use a similar solution to that described in Create Seamlessly Looping Animated Displacements to fake a fluttering cape that loops seamlessly by using the True Displacement feature along with generated Sine waves to produce the effect of rippling cloth. To add variation we can add in multiple waves of differing strengths, frequencies and direction to produce a more effective motion.

Here's the material :

Note that apart from the nodes at the top right (for the shader) the material essentially consists of three repeated structures - one for each Sine wave - each one consisting of a Mapping node to allow the wave direction to be adjusted, some maths to set the Frequency (the first multiply node), the Sine function to generate the wave, and a Multiply to set the amplitude. The results of the three waves are combined using Add and passed into the Displacement node (set to True Displacement 'experimental' feature set).

Note the nodes to add in an Offset generated from the Value node - this should be varied from 0 to 1.0 over the course of the animation. Ensure the F-Curve is set to Linear interpolation and set its range to one frame longer than the desired animation (so, say, Value varies from 0.0 at frame 1 to 1.0 at frame 51 - and we'll use frames 1 to 50 for the looped animation (since frame 51 should be the same as frame 1)).

To ensure the Sine functions all return to the start point at the end of the animation ensure all of the frequency Multiply nodes are set to a multiple of 2*pi (since there are 2*pi radians in a full cycle).

Note also that the top line of nodes includes a Subtract node based on the Z coordinate for the amplitude multiplier so that the displacement increases from top to bottom of the "cloth".

Here's the final result :


How to export a 'posed' mesh as an STL file I'm new to Blender and am trying to export a mesh that I've manipulated with an armature, as an STL file. It will export as stl in the 'rest' position, but when I pose it, then export as STL, then try to open STL file in other software, there is nothing. Is it possible to do this, or will it only export in the rest position?

Ok, I figured out that after I pose the object, I then need to convert it back into a mesh. Then it will export as an stl file. I selected the object in 'object mode', in the object menu selected 'Convert to -> Mesh from surface....'

(I tried 'apply modifiers' but it didn't seem to work for me)


fading an adjustment layer I'm trying to add a color adjustment to a strip in the VSE and got that working fine, but I'd like it to fade in and out rather than hard stops and when I add the cross or gamma cross, it just fades to black rather than to the strip below it. I've tried playing with the settings (add, subtract, alpha over, etc.) but none of those do what I'd like it to. I have successfully done crosses between regular strips and to color strips so I'm fairly certain I'm doing it correctly, but the adjustment layer is hanging me up. Is there something different I need to do for an adjustment layer?

You can animate Opacity value of Adjustment strip, for creating nice fade effect.

How to animate values:

Select Adjustment strip and in the N-tab find Opacity value.
Set time where you want to fade start, hover mouse cursor over the Opacity value and press I
Set time to the end of fade, set Opacity value to 0 and press I again, while  hovering cursor over the Opacity value


Video Texture Module Resolution? I got this script from a tutorial:
http://www.tutorialsforblender3d.com/Game_Engine/VideoTexture/VideoTexture_Render_1.html

It allows to set a video texture In the game that's is a render of a camera in real time. For making security cameras monitors for example.
 The only thing I need is to add a command line to scale down the resolution and it will be good to go.
Can Someone Help? See the File.

Script:

import bge

# get current scene
scene = GameLogic.getCurrentScene()

# get the current controller
controller = GameLogic.getCurrentController()

# get object script is attached to
obj = controller.owner

# check to see RenderToTexture has been added
if obj.has_key("RenderToTexture") == True:

    # update the texture
    obj["RenderToTexture"].refresh(True)

    # if RenderToTexture hasn't been added
else:

    # import VideoTexture module
    import VideoTexture

    # get a list of objects in the scene
    objList = scene.objects

    # get camera name being used for render to texture
    camName = obj['cam']

    # get camera object
    cam = objList["OB" + camName]

    # get the texture material ID
    matID = VideoTexture.materialID(obj, "MA" + obj['material'])

    # set the texture
    renderToTexture = VideoTexture.Texture(obj, matID)

    # get the texture image
    renderToTexture.source = VideoTexture.ImageRender(scene,cam)

    # save RenderToTexture as an object variable
    obj["RenderToTexture"] = renderToTexture

When setting up the image source specify a capsize.

e.g.:

source.capsize = [50, 50]

Based on your code:

BGE 2.50+

setup

import bge

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

cameraName = owner['cam']
materialName = owner['material']

scene = bge.logic.getCurrentScene()
camera = scene.cameras[cameraName]

materialId = bge.texture.materialID(owner, "MA" + materialName)

renderToTexture = bge.texture.Texture(owner, materialId)
owner["RenderToTexture"] = renderToTexture

source = bge.texture.ImageRender(scene, camera)
source.capsize = [50, 50]
renderToTexture.source = source

refresh

import bge

controller = bge.logic.getCurrentController()
controller.owner["RenderToTexture"].refresh(True)

BGE 2.49

setup

import GameLogic
import VideoTexture

controller = GameLogic.getCurrentController()
owner = controller.owner

cameraName = owner['cam']
materialName = owner['material']

scene = GameLogic.getCurrentScene()
camera = scene.cameras["OB" + cameraName]

materialId = VideoTexture.materialID(owner, "MA" + materialName)

renderToTexture = VideoTexture.Texture(owner, materialId)
owner["RenderToTexture"] = renderToTexture

source = VideoTexture.ImageRender(scene, camera)
source.capsize = [50, 50]
renderToTexture.source = source

refresh

import GameLogic

controller = GameLogic.getCurrentController()
controller.owner["RenderToTexture"].refresh(True)


How to select two objects add a boolean modifier and enter name for object to be unioned So currently when using the boolean modifier you have to set the type and then select the object manually.

I am curious how one could automate this like this:

select two objects
select Add Boolean Union button

the button will do this:
add boolean modifier to active object
set type to union
select other object as to be unioned to the active object

Ideally the object selection should be done via mouse selection.
First click is the tool object and last click is the active object to add the modifier to.

Modifiers are stored in an object's modifier list and a new one can be added by calling obj.modifers.new(name, type). To adjust the modifier settings you can either collect the created modifier object returned by the new method or access it through the list.

import bpy

target_obj = bpy.data.objects['Cube']
cutter_obj = bpy.data.objects['Sphere']

bool_mod = target_obj.modifiers.new('cutter', 'BOOLEAN')

bool_mod.object = cutter_obj
bool_mod.operation = 'DIFFERENCE'

# or directly -
bpy.data.objects['Cube'].modifiers[0].object = bpy.data.objects['Sphere']


subdivision creates unwanted creases tried "remove doubles" on the whole model with bigger threshold with no results, also tried to unmark all edges as sharp/crease. all faces are quads.
link to .blend file

Non-manifold mesh

The issue is caused by subdividing a non-manifold mesh. Here's a pic showing some of the possible situations:

Source: autodesk's maya guide

Your geometry fall in the first case, the "T" shape. With this kind of ambiguous edgeflow, the subdivision surface modifier can brings to unespected results for the user.

You have a bunch of interior faces in coorrispondence with the artifacts:

You should get rid of them to achieve the expected result. As there are just two, I'll suggest to select them manually in edit mode while in wireframe view and delete them (X).


How to duplicate an object with random start frame? I created an animation, a creature is walking. I would like to duplicate it several times in one scene but with different start frame. For example, obj1 starts from frame #5, obj2 starts from frame #10 . This way they don't look like they are the same object. How can I do that?
BTW, I am using Cycles.

Thanks :)

duplicate your character (shift+D) then right click to keep it in the same place above your original character

then shift the new duplicated character by changing the value of delta location/rotation/scale (object tab > delta transform)

now you have two distinct objects moving together, you can shift the keyframes of the second object in the dope sheet editor (b to box select all keyframes then g to move them)

now you have two objects with two shifted animations.


Array not sealing together So I have a simple wall built and when I go to add an array mod to it, it doesn't seal the two instances together. There's a little crack in between them. Why is this happening?

Use relative offset - 1 settings in array mod.
Or maybe your mesh vertices that must connected does not co-planar with this object boundary.


Use mist with scene that has world texture/background Is it possible to use mist in a Cycles scene in addition to a world background?

First, set a world background.
Then, go to the Render context in Properties and enable Transparent (in the Film panel).
Create two render layers.  For the first one, enable Mist (in the Passes panel).  For the second render layer, disable Combined and Z, and enable Environment.  Also, under Exclude, select all layers (we only want the background texture).
Create this node setup:

The value in the Multiply node controls the strength of the mist.  The result is:

(my settings in the Mist Pass panel of World context were Start:20, Depth:1000, Falloff:Linear)


How to save as an OBJ and import to Element 3D I am trying to create a Ka-Bar knife in Blender. Problem is I cannot figure out how to save the finished product as an .obj file, then import it into Element 3D to use as a 3D object.  I don't even know if I am doing it all correctly in Blender.

You can run the command from the File >> Export menu

Or press the spacebar to activate the "Search command" function and start typing his name (Export OBJ)

After that, you will see the file browser where you can choose the exporting folder. On the left, at the bottom of the sidebar there are the exporting options.


Why Are There Glowing White Lines Around My Minecraft Rig? I'm really bad at blender, so my mistake might be the simplest, but I have a few glowing lines around my Minecraft rig and blocks.  Here's the blender file: My .blend file
If this helps, my rendering engine is on Cycles Render.

This can probably be resolved by setting the texture interpolation to Nearest Neighbour. This gives you that pixelated Minecraft look too. See the answer to this question for more info in how to do that.


UV Project Modifier in Cycles has no effect. What am I doing wrong? I put a UV Project Modifier on a Suzanne. I added an image plane with the texture I want to project onto Suzanne and positioned it.

Note: The texture is not showing as transparent in the screen shot because I forgot to check the settings for that in the menu when I used the Add Images as Planes add-on, but trust me that the texture does have alpha data.

I UV unwrapped Suzanne. The Image plane is already UV unwrapped because the add-on takes care of that. In the modifier's settings I specified the image plane as the projector object. I specified the UV map to be the only one that exists on my Suzanne ("UV Map"). I did not specify an image because I understand this is for Blender Internal only (correct me if I am mistaken - also I tried this once just in case but it made no difference).

I created a Cycles material for Suzanne that uses the image from the image plane, and specified the coordinates to be from Suzanne's the UV map (which I expected to be modified by the modifier). The alpha from the image is supposed to factor between a plain Diffuse Shader and a textured one. However, nothing is showing up at all and although I read the Blender manual page on the UV Project Modifier I did not glean any answers from it. Can somebody please tell me what I've missed?

You need to select the image to use in the UV project modifier and enable Override image.
Your Diffuse nodes need to be flipped:


Should I Join or Parent? I am making a battleship, and there are many tiny cylinders and cubes for detail. Because the only things that needs to be animated are the turrets, should I join all idle parts together?

It's not brutally important when you have a limited amount of parts.

Blender 2.79 is still not amazing at handling many 1000s of objects, so sometimes joining can speed selection up quite a bit.

But there is one thing to think about:

If your detail objects make up a lot of verts, I wouldn't put them into the hull but their own object. That way you can, to speed up test rendering, switch them off and keep the hull.

Depending on complexity, that can make a difference.

Another aspect: you can parent objects to faces. Not too relevant here but if you have an object that might change later, parenting the details to a face means you can change the height of a floor and the objects will follow.

If it's all geometry, you either have to select all tiny meshes or abuse a vertex group for selection purposes.

Yet another aspect: Object origins make for great rotation centers. If it's a mesh, you either need a used or hidden center vertex or you have to select the right verts to place the cursor.

My advise here? Save a backup copy of the unjoined objects, join the details into one or a few objects (bow, midship, stern etc) and parent those to the hull.


Texture paint problem Why i cant painting using texture ? it showing only color. I think about stencil brush mapping.

In order to effect the mesh you need to make sure the texture is loaded in the material. To paint onto it in cycles you need to make sure the image node exists in the node material and to have it effect the render it needed to be wired up.


How to close view windows in blender? How i will able to close these windows at right. please give me a answer.

Drag the signs at the corner of each window in following directions.It will help you close all the windows.


About the omission cube of the Grease pencil in Blender v2.8 Here are the differences between my viewport and the Tutorial's viewport.
Q. How to show the small orange cube and the object data?

The 3 axes arrows has become the orange cube, and the pen icon has become the green squiggly line.
The icons have been changed since the tutorial was recorded in the early stages of the Version 2.80 and the icons were not final at the time. But you should find the same information in these submenus.
Although I think there has been changes to how the grease pencil object data works so you might see things arranged differently.


UV mapped textures not affected by lights I have imported a .3ds model into my scene, and applied the textures which are UV mapped. The model renders ok except it is not affected by any lights I place in the scene.

I would like to have a number of lights and the shading of the model to look as it should. Is this not possible with such textures?
When rendering with 'foreground' selected the result is very dark as shown:

When I render with 'background' selected this is the result:

I have a sun above the model and a hemi lamp very close to the right-hand wall but this seems to have no effect.

Any help on this would be much appreciated!

Here is a link to the .blend file: https://www.dropbox.com/s/qujhazkc668r64q/Test%201%2014-08-14.blend

The issue is you're not rendering the layer with your lamps.
Your model is on both layer 1 and 11, but your lamps are only on layer 11.

Go into the RenderLayers tab, select the foreground renderlayer and select layer 11 under Layer:


Can't properly UV Unwrap (Black spots) Can anyone have any idea of what might be causing this ? Thank you.

Depending on which unwrap method you used (unwrap, Smart UV project, etc), faces may not be aligned. This is what appears to have happened to you. Good ways to ensure consistency when unwrapping:

In object mode, apply rotation & scale (Ctrl + A)
In edit mode, select an edge (pref. facing away from camera)
Search (Ctrl + F) for "mark seam"
Select all geometry
Unwrap again (Smart UV project)
Adjust Smart UV project parameters as necessary

This should solve the major distortion of your UV map. Unwrapping is a tricky business—I'd recommend Gleb Alexandrov's YouTube tuts for finer details.


Random Streaks in Appearing Only in Final Render My rendered animation shows a large streak on some of the frames, and not on others. The streak doesn't show in the viewport, only in the final render. Rendered using cycles.
Here is what the Render should look like. It's relatively normal.

Now earlier in the animation, there is a large streak up. (Image cropped for file size issues)

Here's the mug part of the composite.

Here's the shadow part of the composite. (Can't be seen over black background)

Here are the composite nodes used. They are the default for motion tracking. I haven't changed them.

Thank you, susu, it was just motion blur. Turning it off fixed the problem.


How do i get my grid to stay on top of plane Hey I have looked around for answer but cant find it how do I keep my grid on top of my ground plane

First solution : Use X-Ray Mode
The shortcut is ALT + Z or click this icon in the top right :
Second solution : Use the material alpha
This works only in lookdev mode and you need to set Eeevee as your renderer first. Click on your object and go to its material or add one if it doesn't have one already. Then go the alpha value and lower it, don't forget to set the alpha blend mode to "Alpha Blend".

Enhance the grid line visibility
If you want to see the grid lines more easily, you can tweak the opacity inside the user preferences :


Loop cut interrupted I have pressed CTRL + R to create a loop cut which is interrupted at the left side of the front wall. I am not sure why my loop cut stops instead of going all the way round.

I have uploaded a ~.blend file here:
http://www.pasteall.org/blend/36809

Thank you!

First, I have edited your question because the term you were using in asking your question was not the right one. In fact, you were asking about loop cuts, not edge loops. The difference is that an edge loop is a set of existing edges linked end to end, while a loop cut defines a path upon which existing geometry will be modified to add a set of edges.

If you switch to vertex select mode, you'll see that the loop cut is interrupted because the two large faces just beyond where your desired loop cut ends in your screenshot are n-gons. There are six vertices around the perimiter, three on the top and three on the bottom of each face. A clue to this is the fact that in the right-most inset faces, in face select mode, the squares designating the center of mass of the faces is offset to the right, when compared with the other three.


Missing mesh display panel in 2.71 I'm new to Blender and currently following a tutorial.  I am using v2.71, the tutorial was filmed on 2.66.1.

On the tutorial in the properties menu there is a tab called "Mesh Display". But on my version this option is not there and I can't find it! So, where is it???

This panel is only available in edit mode. Press ↹ Tab to toggle edit mode, or select it from the drop down in the header of the 3D view:

Once you are in edit mode, you should see the mesh display panel in the Properties region (on the right in the above screenshot), which you can toggle visible with N.


Helix Shaped / curved Road I'm trying to make helix shaped road. I tried screw modifier but it's ended up with weird shapes. Here my road onbect :

I tried array and simple deform modifier but i couldn't bend it from z axis too. Here my result :

I researched alot and i ended up with screw modifier. But i couldn't use it properly. It's look like really weird. I couldn't fix it.

I want to make helix shaped road like this :

Thanks for the all tips and comments!

Curve Modifier with Spiral

You can't keep the materials or the mesh structure (yelow and black alternance) with the screw modifier because it was made to work with 2D profiles, not 3D objects.

You could instead go back to the array and use the Curve modifier (instead of Simple deform modifier) to bend the array using a spiral curve as deforming object.

You can use the "Add Curve: Extra objects" add-on to quickly generate a Archmedian or Logaritìthmic curve with the needed radiut and height displace.

Here's a possible modifiers stack for the object.

After that, fix the "rollercoaster effect" by switching to Z-Up twisting method in the curve parameter.

You can now repeat the road turn for each level of the building with an another array modifier.


Blender freezes when trying to bake normal map I am trying to bake a normal map for a model I made but keep encountering the problem that blender freezes up for hours when I try to bake the normal map from a high poly to a low poly version of the mesh (with the help of a cage) And at first I thought it is my bad laptop (4 gb ram, i7-4700MQ CPU 2.40 GHz, NVIDIA geforce GT 740M ) but on a better computer it still froze up, on which I never had issues with baking before.

Could someone take a look at the file and see if something is wrong with it? Because I can't find a cause..

https://drive.google.com/open?id=1C9AxyCNdtdMmz0L87N3qx6Y7RwCltuYH

Ok,
I downloaded your file, baked a 2k normalmap and it took me less than 5 min (Macbook Pro).

So, I could not reproduce the behavior you mentioned and the only thing I changed was to reduce the preview subdivision of your multiresolution modifier on the highpoly mesh.


Make material thick around edges I want to make the material in the provided .blend to be like the provided image. .blend https://drive.google.com/open?id=1ZDs_sCikX-TMTRcuNTmoQeKwBAvsabfk

Here is the solution that I came up with:

1: These nodes are a fresnel node with other nodes to disperse it

The second group is a color ramp to blend in the fresnel to the rest of the material
This is a mix shader to add it to the rest of the material


animate object shaped with curves modifier by moving curve vertex So I created this beaded bracelet and want to know if it possible to animate the path so it looks like it is "wiggling" (ideally grab two opposite vertices and move them around.)
Since it is a nurbspath I cannot parent, and using a curves modifier and then changing the path  doesn't seem to do anything.
The string and beads are a joined object with a curves modifier already applied for this initial shape.

As Ray Mairlot says, you can hook your vertices to empties, you can also hook them to bones (which, contrary to empties, would allow you to have a Rest pose). In my opinion, converting your nurb to a bezier will make things easier (I don't know where the Set Spline Type is in 2.8 though).

Create your armature with as many bones as you have vertices in your curve. Put them over those vertices.
Switch your armature to Pose mode, select the bone you want.
Shift select the curve, go in Edit mode, select the vertex that is supposed to be controlled by this bone.
Press CtrlH > Hook to Selected Bone.
Now you can animate your curve.


How can an empty be added at intersection of edges using Python? I have 2 Edges intersecting at 90 degree. How can I add an Empty aligned to them. I suppose this can be done using mathutils. I need the matrix and not just the Translation component which is not aligned.

Thanks, this will be very useful!

Getting the location is indeed trivial, even more with mathutils.geometry.intersect_line_line().

Getting rotation here is not so hard either. Let's call your two edges e1 and e2 (note that this is theoretical code, assuming you have your vertices array and empty object already at hand):

# We get 'average' intersection point - in case the two edges do not actually exactly intersect.
inter = mathutils.geometry.intersect_line_line(vertices[e1.v1].co, vertices[e1.v2].co, vertices[e2.v1].co, vertices[e2.v2].co)
vi = (inter[0] + inter[1]) / 2

# Then, we get our first axis.
ax = (vertices[e1.v1].co - vi).normalized()

# We get our third axis by cross product of first axis and second edge.
az = (ax.cross(vertices[e2.v1].co - vi)).normalized()

# Then second axis is crossproduct of the first and third ones.
# Note that if you know for sure your two edges are orthogonal,
# You can skip that and rather create ay exactly as we did with ax.
ay = (az.cross(ax)).normalized()

# Those three axes allow us to create a rotation matrix directly.
# However, we need to put them as columns, not rows. Since matrix
# creation in Blender uses rows, we'll have to transpose it.
mrot = mathutils.Matrix((ax, ay, az))
mrot.transpose()

# And now, we just have to make this a 4d matrix and add translation component.
mat = mrot.to_4x4()
mat.translation = vi

# And set this a base matrix of our empty:
empty.matrix_basis = mat


relationship between light intensity and 8bit grayscale what is the relationship between light intensity (I) and the 8bit value of my black&white render output?

The background is that I want to simulate a sensor that sends a signal every time the intensity at a point (pixel) changes a certain amount.
The sensor should be invariant to lighting conditions so the real sensor measures photocurrent on a loglinear scale.

After reading this and this I think the sRGB scale is corrected in a similar way

But is the (8bit) grayscale value (for example rendered as a png file) then corrected in the same way? So if I want to check for loglinear changes in Intensity, I just compare the integer values?

I think yes, but I would really appreciate a second opinion

Light is remarkably predictable and, as with most energies, strictly a linear phenomenon.

If we have a pixel of emissive energy, and we use photographic terms, our ability to perform math is ridiculously simple. To increase the amount of light by double, or in photographic terms a stop, we simply double the value. Want to go down a stop of intensity or halve the quantity? Easy, halve the value.

Our visual system on the other hand, is strictly nonlinear. We sense the visual stimuli and uniquely bend the values to meet the needs of our perceptual system. In particular, we bend a very specific range such that we can detect gradations acutely, while sacrificing the darker and lighter regions our iris has dialed into view.

Given that our devices are significantly lower dynamic range than any physical scene, we cannot however simply pass radiometrically linear ratios of light to our display / output referred contexts. If we did so, the values would appear vastly too dark, even with darker viewing conditions.

To compensate for this complex phenomena, the values need to be bent away from the radiometrically linear ratios such that the relative emission is roughly that which our eyes would expect to perceive the relative levels as expected.

Most imaging formats bake this bent version, also known as transfer curved or tone response curved, into the data itself and the curve varies by color space. Others, with unique design constraints, may or may not depending on file tags and metadata. EXR is one such example that specifically mandates a linear format for the data within.

Finally, the issue of black and white or grayscale adds another layer of complexity. Such a representation is typically an averaged luminance obtained from the RGB triplet. Every colorspace within an RGB color encoding scheme will have uniquely colored primary lights. These colors can be mapped to an absolute color model known as XYZ. The Y axis in this non orthogonal model is relative luminance. To obtain a greyscale representation of any RGB colorspace, one multiplies the Y position of each channel by the value.

TL;DR No you cannot rely on the data values in any given format to be representations of radiometric ratios. It varies by format and within a format, by color space. Further, even if you invert the two part formula for something like an sRGB JPEG, you will only arrive at a rough display linear value set that terminates at display referred 1.0, having compressed and discarded much more of the dynamic range from something such as a camera. EXRs on the other hand will often offer scene linear representations that require no transfer curve inversions. With focus on a sensor-like response, a sensor will capture largely linearized values with nonlinear responses near the edges of the sensitivity ranges.