invoke_props_dialog: callback during change? While creating a custom pop-up (via invoke_props_dialog) with two integer values (in this case representing a start frame and stop frame) I find that the "execute()" method (upon clicking the "ok" button) is when values within my class (derived from Operator) actually get a chance to be used. Intermediate changes to those integers (prior to clicking "ok") cannot be accessed.

I am wondering, if I wanted changes to my start frame integer and stop frame integer to always enforce that start frame is less than or equal to stop frame is there a way to do this prior to clicking "ok"? I am wondering by what method I can take an edit to start frame or stop frame which breaks this condition and force the other to a valid state.

Example, someone increasing start frame integer, as it exceeds stop frame, would force stop frame to increase so as to never break requirements...and to be visible prior to clicking the "ok" button. Is there an ability for invoke_props_dialog to name a callback to run upon any change?

The props_dialog shows Properties, so you can define set/get functions for them like for any other Property to control changes: https://docs.blender.org/api/2.79/bpy.props.html#get-set-example

Example for your case:

class SomeOperator(Operator):
    bl_idname = "test.some_operator"
    bl_label = "Example"

    def set_start(self, value):
        if value > self["stop_frame"]:
            print("start frame has to be smaller or equal to stop frame")
            self["start_frame"] = self["stop_frame"]
        else:
            print("setting start frame")
            self["start_frame"] = value

    def get_start(self):
        return self["start_frame"]

    start_frame = bpy.props.IntProperty(set=set_start, get=get_start)
    stop_frame = bpy.props.IntProperty()

Notes:

You have to define both a setter and a getter (you can't define only a setter, the property will return always 0 if you set no getter).
In the setter/getter you should call the operator's properties with self["property_name"], not self.property_name. This way you can get/set the value without calling your own setter/getter functions (which would lead to infinite recursion).


Why bump node giving stretched results I have a leaf texture and add some bump node. When i render the image is stretched. Any suggestion or help with the bump nodes whats going wrong.

You have a single ngon with 1646 vertices.

Not great topology in my opinion. On a polygon like that you're more likely to find UV mapping errors or inconsistencies.

For a simple object like your leaf, you don't need to have so many vertices. You can use a single plane and have the alpha channel define the outline.

Here's the same leaf using only four vertices:


Texture painting in game engine When I paint a texture, I can see the results when I press p.

But when I include the scene in my game using logic.getBlendFileList, I just see the 1st texture :

Looks like something is not properly packed... When I try to uncheck "automatically pack" and "pack all files" again, I get a "some images modified, changes will be lost, continue?" and sure enough, if I continue, the rock and sand brushes/textures are lost.

How can I make sure the new painted material gets packed? Alternatively, is there a way to make a new image out of the 3, to UV map on to the mesh once everything is painted, ensuring its consistency (at the cost of terrain editability) ?

OK, found out (in this video) in the UV image editor displaying your painted texture, menu image/Save as image (F3). That's it, save the file, your multi-texture is packed.

NB: If you paint the image again, repeat the steps but end with image/Reload image (Alt-s)


How does face snapping work? I am new to blender and I was following this tutorial to make a donut.
But when it comes to the cream on top I cant deform the mesh on top to make it creamy so I end up with two ugly meshes.  I did like in the tutorial and enabled snap face, is there somthing am missing?

Make sure to have more faces on the donut than on your icing.
You can do this by adding a subdivision subsurface, you don't have to apply it.
If this doesn't work as well, you can use the shrinkwrap modifier. Make sure this is below the subdivision subsurface modifier.
Go to the modifier tab and add a shrinkwrap modifier. You will also need more verts on the donut than on the icing while doing this.
Good luck with your donut!
Emiel


Render a scene twice but once it renders with an extra object Hi i have a scene with a kitchen and i am using the sky texture and a large volume to create godrays, except to make the scene less noisy i am rendering it twice with two identical scenes but one has this volumetric effect and i am using the compositer to blend the two renders, but i am trying to reduce file size and want to find a way to get rid of the duplicate scene and simply render twice but once have this volume, i believe it is possible as the vfx setup can do this but i have no idea how this works, any help would be perfect

Ok i figured it out, in blender 2.79 they had something called render layers, in 2.8, and 2.9 they use view layers, to do this you will see ticks in the outliner, and unticking them will make them not be rendered, and in the top right there is a section called view layers, if you duplicate them with the same settings you can tick or untick each one and then composite them together


Abstract Wave with Particle System I want to create a wave made out of particles/dots. The wave should look like this:

I tried to achieve this effect by adding an ocean modifier to a plane. Then I added a particle system to the plane but now I don't know how to go on. How can I make the particles lay on the 'ocean' and move when the ocean is moving?
PS: I know there is a way to do this with a material in the Blender Render. But firstly I want to create the whole thing in Cycles and secondly I want to have particles.

Method 1 - Dupliverts

You should use a mesh such as a cube or a simple Icosphere for your particle, this will allow you to properly shade the particles like any other mesh

Select the particle mesh, in my case an Icosphere
Select the ocean
parent the particle to the ocean, Ctrl P
Select the ocean
In mesh panel, set duplication type to verts

http://www.pasteall.org/pic/show.php?id=67612

Method 2 - Particle System

Make sure your particle system is one the bottom of the modifier stack.

In the particle system enable Use Modifier Stack

If you want to use another mesh as the particles you need to select the particle system and under the render tab, Select Object as your render type. Then you can choose you object.


Bevel in 2.81 is not the same as in 2.8 I am a beginner and I am modeling a technical piece in blender 2.81 and I can't get the same result as in youtube video (2.8) I use:
https://youtu.be/WSR6bVFe5LM?t=974

Either bevel is broken in a newer version or I am doing something wrong...

This is what author of the video has, what I need:

So he selected 2 "bottom" edges, clicked Ctrl+B for bevel filled in amount & segments count = 12, that's all!

What I have in blender 2.81:

I tried to change bevel types & parameters but I can't get the same result!

Also, I can't apply transformations for some reason:

I go to the object mode, press Ctrl+A, select All transformation OR just Scale but scaling numbers are not changing, so it is not applied??

Please help me to get the same results as author of the video has... I am stuck for 3 weeks already with this issue :(

A link to a blender file + reference image in case someone want to try on his PC:
one drive

holy smokes! I've realized my error! it is not enough just apply "all transformations" in objects mode, before that you need to select the object itself! that was a key... now all is working as needed!

p.s: why blender doesn't show an error if you haven't selected anything!?


Normal map editing as ordinary image After baking from the photogammetry mesh I've got the normal map wich has areas that need to be corrected. Can I edit the normal map in Photoshop as the ordinary image - apply patching, bluring, clone stamp and other similar tools?
I'm worring about the fact that the normal map encodes the normalized vectors and after editing these vectors will became denormalized and any artifacts can be appeared...

You can edit the normal map as much as you want, just use the good spectrum of colors, so use the eyedropper. If you blur the image then the 3D relief will be softer, if you put other colors than the normal spectrum you'll have dark spots:


Uv map of appended object Let us say I have uv unwrapped an object and changed the uv map. Now when I append this object in another blend file, how can I obtain the changed uv map too. Because I think when I unwrap the appended object I get the "original" uv map

Try linking the object, duplicate it, delete the linked object. The duplicated object has the uv maps of the original, but you can now modify them.


How should i go with modeling this pistol grip piece? im trying to make this pistol grip or at least somewhat resemble this.

Add the image in your 3D view and draw its profile:

Extrude the mesh, use a Mirror modifier:

Work the geometry in 3D:

Give it some additional edge loops in order to sharp some edges:


Clay render linked objects in 2.8 I have a scene full of linked objects from other blender files. How do I clay render the scene with linked objects in blender 2.80?

You can also do this without any addon.
Just use the Material Override option in Cycles.
It will render all objects with the selected material.

1) Create your Clay material.
2) Select it in the Material Override panel.
3) Select how many samples you want to render (0 will use the scene settings)

Material Override with a material selected.

Material Override currently works in Cycles only, Eevee doesn't support this feature.


Disappearance of 3D axis from viewport In my recent project work, I did something that resulted in the disappearance of the 3D axis in the viewport of the "Layout" workspace, not only that all that four buttons(including zoom thingy, move, camera and projection buttons). I am not sure what lead to this. Weirdly, both 3D axis and 4 buttons exist in all workspaces except in "Layout".(screenshot attached)
I googled to check the problem and found a similar issue caused using transform hotkey(devtalk blender). Although I didn't do anything similar.
Is this a bug? How can I resolve this?
Specs:
OS: Ubuntu 20.04.2 LTS
Type: Blender LTS
Blender Version: 2.83.14
Missing 3D axis in viewport of Layout workspace

3D axis i am talking about, as u can see this appears in all other blender workspaces

The Interactive Navigation controls can be toggled by pressing the gizmo icon in the upper right corner of the 3D view or by pressing ⎈ Ctrl` (backtick not single quote/apostrophe).


EEVEE 2.8 : the light goes through the egdes of a simple cube? The scene : a simple cube with the front face deleted, and a simple light behind the cube.
The light could be seen inside the cube. It comes through the edges !
How to prevent this ? Thanks a lot !
Emmanuel

Welcome Patrick!

Yes, there are a couple of ways to handle these problems in EEVEE.

Thicker geometry reduces the problem:

Increasing the Shadow Exponent value on the spotlight makes the fade shorter.

Adding contact shadows fills in the fade:

It should however be noted that Contact Shadows are created with the depth map and may create undesired artefacts. This could be handled in a single shot but if you render a sequence it might be harder.

The VSM shadows (In render settings) generates a bit noisier shadow gradient but should be hided with less geometry.

Or if you absolutely need to keep your geometry paper thin you could add a tiny contact shadow.

Here is where you find the settings:


Texture not loading in render view Cycles For some reason my Blender doesn't want to load the texture in render mode.
Texture is loaded by Blender with no issues, I can see it in texture mode, in preview of material. Just not on the model itself. Instead I get pink error of no texture.

Solution for this one was saving file (that was dds) as png and loading the texture from png file.


The video preview on Blender is suddenly just a still image. How do I make it actually show a preview of the video? Sorry if my question seems a bit newbish.

But basically, this part that shows the video preview doesn't move at all.  It's just showing this picture, even though the little Mega Man screen in the bottom left is a video.  It's just stuck there on the preview.  How do I make it actually show a preview of the video?

Again, sorry if the question is obvious.  I'm new to Blender and desperately trying to make sense of it.

If the video has not yet been rendered, and you only want to play the preview then you will press  Alt + A . If it has been rendered, then you will use  Ctrl  + F11. I see that you're in the uv/image editor also, switch to 3D view to see your preview. You can do this quickly by changing windows with the menu on the far left of the header on the bottom of the window.


How to define a colorband in Blender 2.74 using python script I need to define a colorband using python script, but I don't know how to do this in Blender 2.74. In 2.49 version has a command colorbandDiffuse but in 2.74 version I can't find out.

Cycles and Blender Internal render engines have a different Materials ecosystem. They're similar in many ways, but different on important details.

Blender Internal

import bpy

mat = bpy.data.materials.new('experiment')
mat.use_diffuse_ramp = True
elem = mat.diffuse_ramp.elements.new(0.25)
elem.color = (1,0.2,0.3,0.3)

Cycles

Involves adding nodes, or appending a premade material from a different .blend (also easy but a different topic)

import bpy

mat = bpy.data.materials.new('experiment4')
mat.use_nodes = True

ramp_node = mat.node_tree.nodes.new('ShaderNodeValToRGB')
elements = ramp_node.color_ramp.elements

elem = elements.new(0.25)
elem.color = (1,0.2,0.3,0.3)

# the default 'new material' always has a 'Diffuse BSDF' node,
# here we obtain a reference to it
diffuse_node = mat.node_tree.nodes['Diffuse BSDF']

# nodes need to be hooked up!
mat.node_tree.links.new(ramp_node.outputs[0], diffuse_node.inputs[0])

The reason I mention appending an existing material is because it can be a lot more convenient to tailor a complex material once and use many variations of it in subsequent blends by appending the material and adjusting known values. Scripting Cycles materials can be a little verbose :)

If you still have questions then hopefully you'll have some idea what to ask about.


gridfill error : Connecting edge loops overlap This is the link of my video :
https://youtu.be/vAUB8Zj4APg

Here's the link for the blender file :
https://www.dropbox.com/s/fz7f0s0l3tl0ob1/gridfill.blend?dl=0

Basically i just want to create surfaces using GRIDFILL command. The left edges has no probelm while the right one give me weird error. I tried to find out what really happen but have no clue. Can anyone help ? i've attach my  blend file to test.

I'm not sure why it doesn't work the way you are trying, I would venture to guess it's a bug or a limitation of the algorithm, as there is no reason for it to work one way and not the other.

That said, you can still use the grid fill tool on the empty section if you select the two 'connecting' edges (the horizontal ones in the image above). You can also go into the settings of the failed gridfill and change the span to 6 and the offset to 1 and that works too.

Also, if you add geometry around all the edges it will work as well.


What is the best way to set up crowd animations? I was working on a Minecraft animation and was thinking about implementing a large battle with around 200 units on each side. What is the best way to go about animating a large crowd like this?

In my opinion, there are two viable options open to you, one is to use the boids particle simulation with animated armatures, but this would limit you to a single animation (for Minecraft characters this might indeed work). Note that the armature object being replicated by the particle system needs to be on the same layer as the particle simulation.

the second option is to use the Animation Replicator with Offset addon from blenderdiplom on a bunch of different models using follow curve modifiers.. again, this would limit you to one animation. There's a handy tutorial on their site showing how to use it.

In both instances you could have replicate small numbers of characters but use more than one particle system/curves with different animations for a bit of variety, but it would take a LOT of work. In either methods, there would be no way to have opposing teams react to each other and trigger 'fight' animations, for instance.

Since it's Minecraft and the animation would most likely be quite simple, my suggestion would be use boids (check out David Ward's youtube channel, he has a video tutorial showing this exact thing, then when you have a good basic crowd, you could Apply the particle modifiers and then manually add the arm swinging/fighting/dying animations. Like I say, for 200 characters this would be a lot of work, but if working with actions, the NLA editor would save you a bit of work here.

Good luck!


How do I change animated values for multiple keyframes? In Blender 2.82 I have lots of keyframes for a camera that I want to change position to altogether at once, how can I do that? The local animation is correct, but the whole location for all of it needs to be changed, like add 2000m for all in Z axis, add X, Y...
If not possible in Blender, can it be done in AE? It's over 700 frames so nothing I want to do manually :) .

I don't know exactly how much it will help you, but you might want to try looking into the addon AnimAide: https://github.com/aresdevo/animaide

In the graph editor it has the "Anim Transform" tool which "freezes time, so any transformation you do to an animated object or armature affects the entire animation equally".


Selecting all objects inside a mesh Is there a quick way to select all objects inside a mesh? For example, I have a 15x15x5 grid of cubes. How would I automatically select all the cubes that are inside the toroid-like mesh object?

Update:

Weight Mode:

Torus Settings:

Since script is not here so one handmade tech. using Dynamic Paint from Physics Properties. Tested with official 2.82

for Torus add Dynamic Paint as Brush
Join Cubes Ctrl+J, add Dynamic Paint as Canvas > Surface Type > Weight and in Output click "+" icon if "dp_weight" is marked red. When you switch to Weight Paint mode you can see all Cubes placed inside Torus are red.
Apply modifier for Cubes

When you switch to Edit mode you can see weight color as well if you enable Viewport Overlays > Vertex Group Weight.

To select red cubes go to Properties Editor > Object Data > Vertex Group > Select
Because some of the cubes were selected only partialy, you can select whole these by Select Linked Ctrl+L.

Notes: If you need Cubes separated back, just press P > by Loose parts.
(In experimental 2.83 I have some glitches in 3Dview editor > Weight Paint mode, but weight is visible from XYZ axis.Probably some personal issue with graphics card, because on Eevee mode Blender crash totaly.)
Just for fun ...


Baking Models with AO Recently I have been working on an aircraft that has been a little project of mine, and I have wanted to bake the AO onto it.

The first picture is what happens when I bake it. While the second one is what I want it to look like. As you can see there is a weird black spot and to the right of it a spot that is darker then it should be. The same with the nacelle under it, the nacelle appears slightly darker then it should be. The bottom picture is of the aircraft with the viewing AO in the shading menu, I just want what I see in the shading menu to be perfectly put onto my UV map.

I would agree with HATMAN - Possibly inverted Normals or doubles. Go into Edit mode, Press W - Remove doubles (also available from the tool menu on the LH side). Along the bottom menu, you can also recalculate normals by going to mesh> normals>recalculate outside . They should help.

When you do these, take note of the top bar (where it says the amount of tris etc), and it will tell you if it had to remove doubles etc..


Part of the geometry disappears when in edit mode I need to seperate the bars from the cells in this model.

But when i go in the Edit Mode, the bars disappear.  I am using an array modifier, but I think the problem is not with the array.

It looks to me like you have hidden the bars.  To hide something, select it and press H.  If you are in object mode this will hide the objects that are selected, in edit mode this will hide only the geometry that is selected.  You can also press Shift+H to hide everything but the selection.

To unhide everything, just hit Alt+H.


Blender proportional edit slider gone in 2.8 and above? I'm using a Wacom tablet and don't have a scroll wheel to adjust spread of my vertex proportional edit selection.  My other option are the PageUp PageDwn buttons. I would love to find the Proportional Edit slider that was around in older version of Blender but it doesn't seem to be there is 2.8 and up.
Any pen tablet users have any ideas?
Thanks

Solution discovered by OP:
I found a great solution. On my Wacom Intuos Pro pen tablet, my touch ring set to "ZOOM" is a perfect substitute to a mouse scroll wheel. Anyone using a pen tablet (with a touch ring) instead of a mouse can do this to adjust the spread of the proportional edit! Problem solved
For those whom this solution does not help:
The slider can be found in the Operator Panel. You can only adjust the size after the fact though (as far as I know), and the selection circle is not visible, so it's not ideal. Nevertheless it's there:


How can I reuse texture within the same model? Say, my model is an octagonal prism.

I want to texture it - a circular pattern on the caps, two of the side rectangles with a colored stripe, the remainder a generic white surface image.

If I "unwrap" it, it will produce 32 faces: 8 for each cap, and 2 for each of 8 sides.

But in reality, I need only 6 - every single face on the cap will use one image, plus two images for the two kinds of rectangular sides (each of 2 triangles) - colored, and blank. This is a massive saving on texture size.

I found a plenty of info on how to reuse textures across models, but how can I use segments of the same texture within different faces of a single model?

(please explain more complex parts and include trivial detail you'd usually skip when explaining to seasoned Blender artist - I'm a beginner.)

In edit mode select all edges and mark them as seams, then select only one face, U to Unwrap, in UV editor place the UV in the right place of the texture.

Repeat for all others 31 faces.

This is for understanding the principle, then you can find all the available shortcuts!


How do I copy/paste pose in blender 2.83 I'm trying to copy paste object pose. I'm going to pose mode and copy source object pose with Ctrl+C, then I'm going to destination object, pressing Ctrl+V and Blender displays the dialog:

Unfortunately, nothing else happens.
Please tell me how to complete the paste operation. What am I doing wrong?

Select Bone-6-8 (upper arm) of Armature.001, go in the Dope Sheet, select all the keyframes, copy, then select Armature.003, and paste in the Dope Sheet, the animation is copied. You could also simply switch the Dope Sheet to Action Editor mode and select the animation if you want to use the exact same animation.


Blender Python Advanced Panel in 3d Space Have you got any ideas on how to achieve this kind of interface that pops up at the 3d space?
This image is from the archipack addon.

I've read the script and the panel itself is found on the 3d space UI and wondering how he created this type of panel with layout design and interactive buttons inside the panel.

You have to draw the interface yourself in a modal operator. See the modal operator template in the text editor, and use the bgl module to do the drawing.


How Do I Set Up Blueprints that are Not Really Designed to Model Cars So I have really wanted to make a 2016 Camaro SS but there are no really good blueprints for it. So Im using regular images that give the front,side,top, and back, however, it still does not quite work. How do I set up them in a way that they will work?

Add two pics at the same time, set them to fit in the same view, then select the side where you want to see the actual background picture.


HDRI With Volumetric to Create Throw Pattern? I have a scene below where I am wanting to get an HDRI image to come in through the windows and light the scene in the window areas and have a god ray like effect.  I want to do this with a volumetric effect and have the HDRI lighting create throw patterns in the scene.  Is this possible?  To have volumetric lighting where the HDRI creates throw patterns?  Thanks for the help

You can't use volumetric scattering and any kind of surface in the world settings simultaneously.
(see: Why doesn't an Environment texture appear when the world has a Volume Scatter shader?)
Volumetric scattering will completely obscure the HDR.
(Blatant Quote from the Blender Manual)

Volume World
A volume shader can also be applied to the entirely world, filling the entire space.
Currently, this is most useful for night time or other dark scenes, as the world surface shader or sun lamps will have no effect if a volume shader is used. This is because the world background is assumed to be infinitely far away, which is accurate enough for the sun for example. However, for modeling effects such as fog or atmospheric scattering, it is not a good assumption that the volume fills the entire space, as most of the distance between the sun and the earth is empty space. For such effects it is be better to create a volume object surrounding the scene. The size of this object will determine how much light is scattered or absorbed.

To illustrate this workaround: create a box around the scene (it will act as a domain) and have that box use volume scatter:

Please note that the volume scatter is plugged to the volume socket of the material for the domain, the surface socket should not be used.
Note that the default density for the Volume scatter node is usually too high at 1.0, use smaller values until you find one that works for you.
Here's a scene lit entirely by an HDR image (HDR credit goes to giantcowfilms.com).

Then, if you have windows and are using glass on the windows, you need to modify the shader so that it lets direct light through.
(read: How to illuminate the darkness inside glass objects in Cycles?)


can´t get scaling to work properly I'm trying to create a lightbulb using a tutorial on youtube, and I am completely new to Blender.

I'm trying to tighten the bottom of the lightbulb by scaling it down, but it doesn't scale proportionally. Instead it wavers off to the side.

What I have so far:

Expected result (screenshot from the tutorial):

Click this icon and select Median point.

Read more here : Pivots


Using HDR Image makes real world scale architectual model float I completed a real world scale architectural (units = feet) that was exported to FBX and then imported into blender for rendering purposes. The model looked great and I needed to finally add an HDR image prior to rendering. My issue is the image looks HUGE compared to my 3D model which checking scale by creating a plane object representing the extents of my model and this looks good to the model but to the HDR image 2 things are easily noticed. 1. Trees and buildings in the image even off in the distance are bigger than my model. 2. my model floats above the ground of the image so even positioning the camera you can tell the model is floating and just doesn't look right.

I tried to scale and reposition but this just hoses the appearance of the image.
Is there anyway to correct this and make my model appear on the ground of the image. I got the image from HDR Haven recommended in tutorials I have watched and with architectural models appears it is sitting on the image ground without any adjustment of the image or the model that is sitting at 0,0,0 location.

Other thing I noticed when zooming and panning is model is getting clipped which doesn't happen when image is removed.

TIA!

Cheers!

Rick...

The HDRI is rendered at infinite distance. When trees appear too large then this is because the panorama was taken at a close distance to the trees. What you could do is either set the background to transparent and composite with one of the backplates provided with the HDRI (this allows some cheating with the scaling during compositing) or chose an HDRI with realistic dimension that depicts a place with enough free space to actually build a house. For example this one.


PopCorn Particle Background Anyone have an idea of how to make popcorn fill up my screen using practices, or got some video that would help me out, thanks!
I am trying right now, but they keep jumping up and down and not staying in place, how can I fix that at least, would help tons.
Okay an update, I am getting there, but my popcorn right now has no collision, I checked on size deflect, but that's not it. Currently, I have 5000 emitters and it still won't fill up the whole box.

I are almost there!

If you want your background to be static, the important settings are:

a very high Number of particles
Frame Start = Frame End = 0
a very high Lifetime
emit the particles from the Volume of a cube, so that the density is even (this is important)
remove all Velocity from the particles
remove all Field Weights

For the collisions, emitting particles from the volume greatly reduce that problem: the distribution is more even and if you want you can set the Distribution (in the Source section) to Grid and play with the Random value


Hotkey to navigate scenes in Blender 2.8? In Blender 2.7, i could change the layout with Ctrl + ← and Ctrl + →.
In 2.7, the scene was layout dependent, allowing me to navigate the scene this way.

However, in Blender 2.8, the layout has become the workspace and works completely independent of the scene.

I didn't find anything other than a mouse click to change the scene.
Do you know how to navigate scenes using keyboard shortcuts in 2.8?


Does anyone know how to fix the blocks turning purple when I import my minecraft world (.obj)? I would appreciate any help, thank you!

Purple color (instead of expected shading) = missing texture. Meaning, you have to locate the texture and reapply it to your mesh manually.


Magic Textures question Is there a way to have the white areas be clear in this glass marble example?

Use the color output of the color ramp to mix in a Transparent BSDF with another mix shader node. Make sure the transparent BSDF is the bottom slot of the mix shader in this case.


node.add_node by code -> use_transform doesn't work Cycles Render, Node Editor,

I want to add a tooltip for the shader buttons in the node toolshelf. I create a class for that that contains the tooltip and creates the node. And call it by a button then.

It works somehow. I have my tooltip and the class adds the node. But the use_transform setting gets ignored. Means the created node is stuck under the tool shelf or where ever it gets created, which is somehow random. I have to pick it up again.

What do i overlook here? Why is use_transform=True ignored?

Examplecode. First button is the one with my tooltip. The second one works directly. Note that you need to have an object and a material to get the first button to work. I haven't solved that part yet:

import bpy
import os
import bpy.utils.previews

################ Tooltip class ###############################

# Tooltip
class NODEEDITOR_texture_image(bpy.types.Operator):
    """Image Texture\nHere you can load an image as a texture"""
    bl_idname = "node.texture_image"
    bl_label = "texture image"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        bpy.ops.node.add_node(type="ShaderNodeTexImage", use_transform=True)
        return {'FINISHED'}

###########################################################################

class NodesIconPanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "All Nodes"
    bl_idname = "nodes.common_buttons"
    bl_space_type = 'NODE_EDITOR'
    bl_region_type = 'TOOLS'
    bl_category = "All Nodes"

    @staticmethod
    def draw(self, context):
        layout = self.layout
        default_context = bpy.app.translations.contexts.default

        ##### Textbutton with Tooltip

        layout.operator("node.texture_image", text="Image Texture with Tooltip")

        #### Textbutton usual
        props = layout.operator("node.add_node", text="Image Texture")
        props.use_transform = True
        props.type = "ShaderNodeTexImage"

 # -----------------------------------------------------------

def register():

    # Register all classes

    bpy.utils.register_module(__name__)

def unregister():

    # Unregister all classes

    bpy.utils.unregister_module(__name__)

# This allows you to run the script directly from blenders text editor
# to test the addon without having to install it.

if __name__ == "__main__":
    register()

There are two operators called: bpy.ops.node.add_node() and bpy.ops.node.translate_attach_remove_on_cancel(). To get the same result, you put the second(modal) operator in your return and use the INVOKE_DEFAULT option:

class NODEEDITOR_texture_image(bpy.types.Operator):
"""Image Texture\nHere you can load an image as a texture"""
bl_idname = "node.texture_image"
bl_label = "texture image"
bl_options = {'REGISTER', 'UNDO'}

def execute(self, context):
    bpy.ops.node.add_node(type="ShaderNodeTexImage", use_transform=True)
    return bpy.ops.node.translate_attach_remove_on_cancel('INVOKE_DEFAULT')


Any way to download maps rendered by cycles nodes? I understand that this is probably completely impossible, but the chance that it is possible merits the question. Disregarding camera-specific nodes, such as fresnel, take for instance the pointiness node, which is entirely geometry based. Can I extract a pointiness map from an unwrapped mesh? This might sound uphelpful, because you could get these simple maps from handplane or xnormal, but what about very complicated setups, that are still completely geometry?

If it is really "No", I will accept that as an answer.

Maybe I'm not understanding your question, but in general you can bake whatever kind of map you want by feeding the attribute into a color input.  Using an emission shader and baking the emission makes things easy.  Uh, I think as with @Danyl Bekhoucha's answer here you should multiply the gamma by 2.2 so that the color is treated as non-color data when it is displayed (i.e. blender is going to gamma-correct it, so you need to un-gamma correct it manually).  Apologies in advance if I've gotten that confused somehow.

You may wish to edit your gradients with a color ramp or whatever, it's all configurable and depends on how you plan to use the data.


How can I tell what mesh selection mode blender is in I'm not very experienced with scripting but was hoping to be able to find out what mesh selection mode (edges,faces or verts) Blender is in while in edit mode to make some custom hotkey assignments that takes this into account.

I have worked out how to set up a basic modal operator so need something to feed into an if statement.

Thanks

You can access this via the Scene property:

http://www.blender.org/api/blender_python_api_2_76_release/bpy.types.ToolSettings.html#bpy.types.ToolSettings.mesh_select_mode

Or if you're editing meshes using the BMesh API (if you're modifying the mesh in BMesh already).

http://www.blender.org/api/blender_python_api_2_76_release/bmesh.types.html#bmesh.types.BMesh.select_mode

Example to run in the console:

>>> print(bpy.context.scene.tool_settings.mesh_select_mode)
<bpy_boolean[3], ToolSettings.mesh_select_mode>

To see the values, you can get get the sequence as a tuple

>>> print(tuple(bpy.context.scene.tool_settings.mesh_select_mode))
(True, False, False)


lock edge length - editmode? I want to block the edge length even if you are moving or rotating the edges in edit mode.

I did some research, but no one give a good answere.
link 1
link 2
link3
link 4

finally I tried to use a modal operator with event.type =='MOUSEMOVE', but this don't work if I'm using another operator.

THINGS THAT I KNOW

If I want to move the vertex A without changing the size from edges Ab, Ac and bc, the only way that I know is using a rotation operation.

BUT, in order to do that  I have  to change to Edges, select edge Ac and bc (in that specific order), after that change the pivot point to "active element"... in this case the edge bc, after that change the "transform orientation" to normal.... and after all I can not rotate in the right way!!

then I did a easy addon with some buttons that do the work

row = layout.row()
        props = row.operator("view3d.pivot_point_set", text="Pivote Elemento Activo", icon='STYLUS_PRESSURE')
        props.type="ACTIVE_ELEMENT"

        row = layout.row()
        props = row.operator("transform.rotate", text="Left Slow", icon='STYLUS_PRESSURE')
        props.value = 0.392699
        props.constraint_axis=(True, False, True)
        props.constraint_orientation = "NORMAL"

        props = row.operator("transform.rotate", text="Right Slow", icon='STYLUS_PRESSURE')
        props.value = -0.392699

        props.constraint_axis=(True, False, True)
        props.constraint_orientation = "NORMAL"

        row = layout.row()
        props = row.operator("transform.rotate", text="Left Total", icon='STYLUS_PRESSURE')
        props.value = 3.141599
        props.constraint_axis=(True, False, True)
        props.constraint_orientation = "NORMAL"

        props = row.operator("transform.rotate", text="Right Total", icon='STYLUS_PRESSURE')
        props.value = -3.141599
        props.constraint_axis=(True, False, True)
        props.constraint_orientation = "NORMAL"

but.... do you know some easy way as lock the edge length?

thanks

UPDATE 1

AFTER some research and apply some comments  I made some previos addon in order to apply hooks and constrains to "each" vertex that I want "look", and I get some interesting results:

the main problem is when you want lock more than 3 edges or vertex....... some ideas please?

Put together a bmesh "proof of concept" for this and haven't converted to operator.

It's not really locking edge length, rather finding the closest point on the edge from the vert, and rotating the vector made from that point to the vert, around the axis made by the edge.

To run the test code, in edit mode, vertex selection mode, select the 3 verts of the triangle ABC, with A selected last.  (thinking  using one selected vert that is part of a triangle face, and not a member of any other faces could be the way to go)

Run the script which adds a vertex to the "pivot point" calculated using mathutils.geometry.intersect_point_line(pt, line_p1, line_p2) then using the rotation matrix with edge as axis, adds a vert for the circular "fold" path, in 5 degree increments.

import bpy
import bmesh
from mathutils.geometry import intersect_point_line
from math import radians
from mathutils import Matrix

context = bpy.context
edit_object = context.edit_object
mesh = edit_object.data
bm = bmesh.from_edit_mesh(mesh)

# 3 verts selected in vert mode
e0, e1, v  = bm.select_history

# pivot point

pivot_point, pc = intersect_point_line(v.co, e0.co, e1.co)
bm.verts.new(pivot_point)

radius = v.co - pivot_point
for i in range(72):

    rotmat = Matrix.Rotation(radians(i*5), 3, (e1.co - e0.co))
    bm.verts.new(pivot_point + rotmat * radius)

bmesh.update_edit_mesh(mesh)

For the operator, which would move the vert by the rotation rather than displaying path,  would need a decision on how to choose vert / edge and setting the vert coord to the rotation, whether to make it modal, give it shortcuts etc.

Example operator here https://gist.github.com/batFINGER/dec833554fd7682bcf6621760389ab7a


I need a code to get the current value of the waveform from an audio file at specific frame I would like to build a function that does something based on the current value of the waveform of an audio.
Inputs:

An audio file: like a speaker object or a path on the hard drive or a track name in VSE or whatever.
Frame number.

Outputs:

A number that represents how high or low the audio is. But I don't need to get the volume which is constant by default (100%). I need to get a number that represents the current point on the waveform.

Is there a python code that does the following? I'll use it for something like visualization and auto move the mouth (auto speak).

I would recommend looking at other forums on python for how to read audio files. This is not possible with blender’s normal API usage. You would need to go through Python.

Pygame. I believe that pygame.mixer can return a sound as an array which will give you the individual samples. This is what you need.
Wave. A module for reading the data in wave audio files.

You may not be able to install these Python packages to blender’s copy of Python, But you might be able to run python externally to convert an audio file into your own, native-Python-readable format for blender to open.


Blender: When resizing the body of the model, the eyes are not affected Someone has any idea how to solve this?
In the 3D model i'm working on, I put a "constraint to" on the eyeballs, so they could be part of the body. But when i'm resizing it, the size of the eyes stays the same.
Any suggestions?

Your armature can have a  bone to the eyes so that when the armature is scaled so are the eyes.  Create one or two eyeball bones which are connected to the head bone or neck bone.  Thus when you scale armature master bone to scale the fish body, the eyeball bone will scale too.

These are typical settings for the eyeball bone.

Verify the inherit rotation and inherit scale settings.

You can have the eyes use a single bone of the armature as [Bone] (object) parent.  So that means no weight painting is necessary.  Thus the bone is behaving like an [empty] in the relationship of being a parent to the eyes.


Cloth Physics Clipping I'm trying to make a shirt to go on my model. However when adding cloth physics, for half of the model the shirt collides into the model for a small amount of time before clipping through.
I created these two sheets to show basically what the shirt is doing when running the simulation.

The model other then the hair is one whole object with the collision modifier, with the other side of the model being exactly the same, just reversed with no mirror modifier. I tried importing this into the 2.79b version of blender and I don't get this issue at all. Any idea of why this would happen? This issue is occurring in blender version 2.91

This looks to be a problem with Normals - with the Normals at one side of your model pointing ‘outwards’ and the other side ‘inwards’. Did you model by mirroring the opposite side?
Check and correct your normals (might be able to just ‘recalculate normals’ or select the problem areas and ‘flip normals’) and re-run your simulation.


Basic snapping isn't working I'm just beginning with Blender and am following a lovely youtube tutorial to learn how to use it. In this tutorial we're making a set of Minecraft pillars to animate. In his video the blocks/mesh snaps into place absolutely perfectly each and every time. I have had no such luck. I've experimented with all the options under the snap to drop down and every mesh still ends up being off.
My most recent attempt had the points at the following: X -0.0147, Y -0.044 and Z 1.998 where they were supposed to be X 0, Y 0 and Z 2. That is the best I've been able to accomplish without manually changing the values in object properties. I realize leaving it as is and continuing to build the pillar will result in greater and greater differences which will make the final product completely wrong. I am not the greatest with math and do not care for the idea of having to calculate the position of everything I make because the snapping does not work.
I did try to post this problem on the Blender subreddit but not a single person saw it there. Does anyone have thoughts on this or am I just going to have to become better friends with mathematics?

In the snap settings, activate the setting "Absolute Grid Snap". It snaps to a whole number on the grid regardless of where it started from. So if you start dragging from 2.346, it will snap to exactly 2.


Create an object at each vector in a list in Sverchok? If I have a list of vectors, is it possible to create an object (e.g. a cube) centred on each vector in the list, using Sverchok? If so, how can this be done?

There is a lot of steps to make this happen, but it is pretty simple, so here it goes:

Make sure that you put your list in a .txt file - for this example call it PointList.txt, and it will use the CSV format.
Load this file into Blender.
Note: In this format every line in the file is one point location in X,Y,Z:

In the 3D Viewport Add a Cube - Shift+A >> Mesh >> Cube.
In the Node Editor Add a Text Input Node - Shift+A >> Text >> Text in.
Set your Text Input Node to have the following settings & Click Load:

Csv, User defined Dialect, "," Delimiter, "." Decimalmark
Next Add a Vectors In Node - Shift+A >> Vector >> Vector in and connect your Text Input Node to like the following:

Col 0 -> X, Col 1 -> Y, Col 2 -> Z
Next Add a Matrix In Node - Shift+A >> Matrix >> Matrix in and connect your Vectors Output of your Vectors In Node to Matrix In Node at its Location socket:

Next Add a Sv Instancer Node - Shift+A >> Scene >> Mesh instancer. Then ensure that your Object Name is set to the name of the Cube that you added in Step 3. above, click "use" and connect the two Matrix Sockets between the Nodes like the following:

Result:

To help you convert your data format, here is a screenshot of how to convert the format that you have shown in your comment:


Blender 2.8: How to output renderings in real time just like what is shown in the viewport? I just was able to start up Blender 2.8 with some of the example projects on the website, and I'm able to pan around and see the real-time render in the viewport, but how can I OUTPUT this real-time render to a PNG sequence? I'm pretty sure it's possible, I was reading that its done the same way as an openGL render was done in 2.79, but I don't see the same settings anymore in the alpha version, and openGL is a seperate render option now...

SO: How can I render IN REAL TIME (almost at least), the same thing I see in the viewport, as an output of PNG files ? (NOT the simple F12 way unless theres a way to majorly speed that up)

What you might want to try is to render it using Eevee. You select Eevee as render engine and then you can render your sequence as you would in cycles, just in real-time (or close to it).


How to create this nice colorful glass material? My glass object is too dark. I tried to use the light path node to limit the shadow and reflection to make it brighter, but it doesn't have a good real shadow. I don't know why.
Thank you

I think I'm not too far with this setup (rendered with Eevee, it might be slightly different with Cycles): I've made a mix between Glass, Transparent and Glossy. It also needs Volume Scatter to give it this blurry depth:


Using a volumetric spot light, it is possible to hide totally the elements that the light doesn't reach? I'm using a volumetric spot light, and in a animation, i'm moving the light so it shows some elements, and for now i got there three objects, but i do want to know if for example it is possible to totally hide (fade in totally black) the objects that aren't below the light, as you can see in the picture, those are still shown, as faded-gray objects.
I already changed the light strenght, but if i do that i lose another illumination detail that i already made.
Is there any way to fix this? if not ill just edit the video on an editing software using a mask.

Thanks in regard :)

You can change your spot with a 0 bounce (direct light only). The light won't bounce outside you volume anymore.

This will affect the lighting of your main object (no indirect light), so you can move the 2 others to another layer and add a "no bounce" Spotlight (duplicated or parented if animation is needed) and composite render layers. Your main object (with a spot with more than 0 max bounce) will have a nice direct and indirect lighting and the others won't be affected by bounces.

This setting was added in blender 2.73 official release (release notes)


How to animate an object so it follows the slope (normal) of another object? I'd like to animate an object moving over a surface and have the object positioned so it follows the slope (normal) of the surface.

Using a shrinkwrap constraint, the object will follow the change in height of the surface.

However, it is not clear how to make the cone follow both the height and slope (normal). In the image below, the red cone shows the desired orientation of the white cone at one point in time.

How can the cone in the animation be animated to follow both the height and slope (normal) of the surface?

Sample blend file here

Using the solution from Lukas, and making sure scaling was applied to the objects, this is the result!

I got it to work using a second mesh and the shrink wrap modifier (not the constraint).

First thing you need to do is add a single triangle mesh object.

Then place your cone object so it is sitting on top of the triangle.

Select the cone object, then  shift  select the triangle.  Now tab into edit mode.

In edit mode select all three vertices and press ctrl+P, then choose make vertex parent.

Back in object mode add a Shrink Wrap modifier to the triangle object.  Set the target as the ground plane and set the mode to project.  Make sure to select the right axis.

The cone should automatically adopt the z-y coordinates of the triangle, and the z height and normal of the ground above or below the triangle.  If the triangle doesn't follow the ground properly try checking both the Positive and Negative options in the shrink wrap modifier.


What does simple sub-surf do? I recently modeled a cupboard in blender to be sold in turbosquid . I read somewhere that a simple sub-surf modifier would make my normal model to a high poly model. So I added a simple sub-surf modifier and applied it. That was the first ti,e that I used a simple sub-surf and never knew what it'd do. When I went to edit mode it had a lot of loopcuts which was making my PC laggy . Is it really that necessary to add in this much geometry to the mesh? Why is it needed and where is it used?
Thank you.

For the record, all "Simple" Subdivision Surface Modifier does is subdivide your model, only it does it in the temporary, non-destructive manner that modifiers do (until you apply it).
Unless you are looking to add extra detail to your model, there is no reason to make a high poly version of it. It's my impression that lower poly count models are preferred on sites like TurboSquid.
Often models sold on sites like that come with 2 versions - a high poly and a low poly. The high poly generally is good for still images and renders, but has an unacceptable number of faces to be used in something such as a game engine. For this, people can either use the low poly model, or bake the normal information from the high poly to the low poly to add the look of detail without adding actual geometry.
If used in a game engine, the unmodified low poly can also be used as a LOD (Level Of Detail) model for times when the object is visible, but too far away for detail to matter. So all, in all, you should be aiming  to use as little geometry as possible in the models you plan to sell. You only need as much subdivision as your detail requires for it to "look good"


How do I animate a smooth texture animation? I am following the Youtube tutorial https://www.youtube.com/watch?v=-h6JLUctbYs and I am stuck at trying to animate my texture. Every time I try to play the animation, the texture jumps to different parts of the object, and not in a smooth flowing pattern. I tried many things to fix  this but can't find a solution. All help is appreciated!

Don't animate the "Location," you want to be animating the "Rotation" of the mapping node.


Grease Pencil Wont Convert into Bezier curves in Blender V2.80 beta I'm following Jama Jurabaev's Blender tutorials from the Gumroad where he takes lines made with grease pencil and converts them into Bezier curves.

For some reason Blender 2.8B wont let me follow the same steps. I have my grease pencil model drawn up and all my control points selected while in edit mode, however when I click on the "strokes" button there is no option under the strokes drop down tab to  convert to Bezier.

The Convert to bezier option only appears in object mode, but nothing shows up when I convert to Bezier from object mode.

If anyone can point me in the right direction I would really appreciate the help!

Thanks!

I am not familiar with that tutorial but this is how I do it in Blender V2.80 beta, a bit different to V2.79b.
At the time of writing this I could not find shortcuts for these functions.

Once you finished with the drawings, press F3 on your keyboard.
The search box will pop up and type in Convert Grease Pencil and click the Gpencil: Convert Grease Pencil option, see image below. You may see more selection in the list

The below menu will pop up and select the one you need.

The Bezier is created which you can see in the Outliner. The below image is in Edit mode showing the Bezier edit points, which I edited a bit to move it above the object and curved it to make it visible. I created an offset 3D tube extrusion here from the Bezier, that is what you see in green next to the Bezier.


What is the purpose of a test environment for rendering and where can I get one? I am learning Blender and I see a lot of videos where people use like "test environments" to test lighting, reflection, etc.

Something like this (seen in Blender Guru Video)

I was wondering if they have a specific name and what is their purpose (above testing light and reflections)?

If someone knows where to download one (for free) would be great.

I guess you're referring to HDRIs.

There are things to know about how to use them. Among all the tutorials out there, you should watch the Image-based lighting course by Gleb Alexandrov. It's the most up to date and best one.

Now here's where you can find some good ones for free :

Free bundle on HDRI Haven plus all those marked with the green CCO in the corner
in the demo version of Pro-lighting : Skies
Freebies on HDR Maps

Less high-res (usable for lighting and reflections but not for direct background viewing) :

free set on HDR Sets
a bunch on CG Advertising
all skies on HDRI Skies in 2K resolution

I guess you're pretty much covered. Have fun Blending.


How to enable CUDA on Ubunutu 14.04 for a GTX 970? Yes, I've read this post already. But it didn't work. Now I'm looking for more information and ways to diagnose the problem... and perhaps find a solution.

The base system is an Ubuntu machine (14.04 LTS), 64 bit, and a GTX 970.

The GTX 970 is a "rather new" card and is not supported by the proprietary nvidia driver that "comes" with 14.04.  You have to install version 343.22 which is available via the xorg/edgers ppa repo.

Additionally, as mentioned here, the utility nvidia-moprobe has to be installed, to give non-root users access to CUDA.

Furthermore, they also recommend to install the newest development build from https://builder.blender.org/download/, as 2.72b does not support the GTX 970/980 (no idea why), and to install CUDA 6.5 from nvidia for the CUDA 6.5 toolkit.

I've done all this, but it's still not working. Along the way, I came across some conflicting information, which I hope some of you can clarify.

I've read on various sites, that the GTX 970/980 is only supported starting from nvidia driver 343.22, and CUDA 6.5. So I think this is a given fact.

Which means, that I can't use the CUDA library from the main Ubuntu repo, which is v5.5.

In some postings I've read that the builds from the buildbot contain a pre-compiled CUDA kernel and installing the CUDA toolkit is not necessary, in other places a CUDA update is recommended for better performance.

There is an Ubuntu bug report regarding the nvidia-modprobe, however I have no idea if this also relates to Blender.

Apparently the current Blender build (2240c26, Nov. 28, 2014) does not recognize the GTX 970 in the described configuration.

The nvidia-settings utility confirms that 343.22 is running on my system. And the GTX 970 is listed there.

My questions are:

Does the builderbot version come with a CUDA kernel and if so, is it 6.5 compatible? If not, is there a way to tell Blender to use the external toolkit (short of compiling from source)?
Which devices does Blender use under Linux to access CUDA? I.e. is  nvidida-modprobe necessary, and if so, how can I tell that it is working?
What does the developer build have, that 2.72b hasn't, that is needed here?
Are there any switches when starting blender, that might shed some light why it does not use CUDA?

Thank you for reading this far :) - any help is welcome.

I got it working, and I can at least partially answer my questions:

Problem #1: There are two CUDA 6.5 packages at nvidia, a "normal" one and one "with Support for GeForce GTX9xx GPUs" (here). Choose the later one.

Problem #2: I had already installed the nvidia 343.22 driver from xorg/edgers. The CUDA packages comes with its own 343.19 (as well as its own nivdia-modprobe).

FYI: I've used the .deb file (not the .run one). This drops a handful of other .deb files onto the system, but does not install them. After apt-get update-ing they can be installed using: apt-get install cuda

I needed to bring the system into a terminal-only state where no nvidia driver was running in order to remove the 343.22 one and install the cuda package.

Regarding to my questions:

Blender does use the (external) CUDA install.
2.42b produces a black screen and an error message in the terminal, i.e. there is a code change needed for the GTX 970 to work
nvidia-modprobe is part of the package - i.e. no need to install it separately.


How to rotate/spin an animated soft body object Probably there's a easy solution to it, but I cannot manage the following:
These two balls are both Soft Body and are colliding into eachother thanks to a force field. I want to give these balls more of a spinning effect during the animation, but if I do this by keyframing the rotation, it seems to be the soft-body ignores it. Any ideas somebody?

A work around I found for my specific situation was to animate the camera instead of the soft-bodies. This gave me the desired effect of a more dynamic animation.
I parented an empty to the camera, and keyframed a rotation to that so the camera's pivot point was around the two soft-bodies.


Proportions in python? I am looking to have one preoperty follow another, but to be less in size. Example: speed is 1, proportion is 0.1; speed is 10... and so on. How would I achieve this? Thanks!

Code (not working):

import bge
from bge import logic

def property(cont):
    own = cont.owner

    if 'Speed' in own and 'Recoil_Level' in own and 'Proportion_Size' in own:

        speed = own['Speed']
        level = own['Recoil_Level']
        size = own['Proportion_Size']

    else:
        print('No properties found in Weapon_Recoil_Level_Determiner')
        return

    level = speed / size
        print("recoil level: ", level)

cont = logic.getCurrentController()
property(cont)

Always assign to the property itself not a copy of it :

import bge
from bge import logic

def property(cont):
    own = cont.owner

    if 'Speed' in own and 'Recoil_Level' in own and 'Proportion_Size' in own:

        speed = own['Speed']
        level = own['Recoil_Level']
        size = own['Proportion_Size']

    else:
        print('No properties found in Weapon_Recoil_Level_Determiner')
        return

    own['Recoil_Level']= speed / size
        print("recoil level: ", own['Recoil_Level'])

cont = logic.getCurrentController()
property(cont)

level is just a copy ( not exactly but this how you should see it ) when you write  level = speed / size then level will change but  own['Recoil_Level'] won't change


Is there a tool similar to maya's "edit edge flow" in blender I personally enjoy modeling in blender more than maya, but this one tool is so extremely helpful. It should be included in blender if there isnt something similar already. Is there a place where I can suggest tools?

Heres an example

https://www.youtube.com/watch?v=8-G7UblIjTs

Not exactly, but there are some tools which you can use to get similar results in specific situations.
Shrink/Fatten (Scale along normals)
Press AltS

Smooth subdivide
Change Smoothness in the redo panel (F6) after subdividing

Smooth loop cut
Change Smoothness in the redo panel after cutting, or set the smoothness while positioning the cut with AltMouse Wheel (the smooth value is displayed in the header).


Mirror is missing edges in Edit Mode Is there a way to always make the edges show?

I enabled Draw All Edges located in the Object Properties panel however, in Edit Mode I am still not seeing certain edges due to the depth. I would like to see them on the mirror though all the time.

Edit Mode

Object Mode

Perhaps enabling the "Adjust edit cage in modifier result" option in the Mirror modifier panel is what you need?


Make things glow in the game engine I recently learned how to make things glow in regular blender. It's a pretty cool effect that would go nicely in a game, but when I switch from cycles render to blender game, it no longer has the same emit effect as before. Is there a way to make it keep the effect in the game engine? Thanks.

If the object is supposed to move around, you're best off parenting a point lamp to it of the same color.

Add lamp and object at the same location
Make material for object "shadeless"
Make lamp same color (copy/paste hexadecimal values)
Parent lamp to object
Profit

if the object isn't going to be moving i.e. a stationary lamp or glowy gem, or wall torch or dropped phone the best route to take is to bake all the textures of the objects around it. this should save alot of processor speed since it doesn't have to render another lamp.

if you want me to write that part too, I can. but for now look up "cycles texture baking" on youtube. it will make your life much happier.


Fluid flow object does not generate any fluid Is anyone else having a problem with the fluid sim not working?

I have tried many times to simply take the default cube and turn it into a fluid domain and nothing happens much less adding fluid or outflow objects.

Here is the .blend file but there isn't much to it.

Am I missing something really simple here?

Tried GPU, CPU, supported, experimental, even the 2.75 test build.

Many thanks.

Outflow will not produce any fluid so you should use Inflow or Fluid type object inside the domain , also you should bake the fluid simulation to see the results :


programmatically start the game engine? I have this piece of code that's meant to start the game engine (and it does so if I just run this on the default screen)...I have a script that generates an environment with planes, spheres, etc. and appended this piece of code on the bottom but I'm getting a poll() context error...I'm in 3d view by default and the below thing should make it run in the game engine...any way to fix this so it actually works?

bpy.context.scene.render.engine = 'BLENDER_GAME'
    for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
        override = bpy.context.copy()
        override['area'] = area
        bpy.ops.view3d.game_start()
        break

My guess is that you are in edit mode. The bge will only start in object mode.

Adding this line bpy.ops.object.mode_set(mode='OBJECT') to your script will alleviate that issue.

Your edited code:

import bpy

bpy.context.scene.render.engine = 'BLENDER_GAME'

for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
        bpy.ops.object.mode_set(mode='OBJECT')
        override = bpy.context.copy()
        override['area'] = area
        bpy.ops.view3d.game_start()
        break


Motion tracking is oriented incorrectly; no depth I took a quick video on my iPhone 4, and tracked it in Blender. It appears to have tracked quite well. Note that I have some tracks in the foreground and some in the background:

However, after solving, Blender seems to think that all the tracks are basically planar, at a roughly fixed distance from the camera:

I used the tripod solve mode, because the camera isn't moving (just panning/rolling) in the shot, as suggested here. Is this correct?

I did select the "iPhone 4" preset, but I didn't change any of the other settings.

What can I do to get the scene to be tracked correctly?

Video file: Dropbox link.
Blend file (not packed; video not included): PasteAll link.

If the camera is not moving (you're not walking or otherwise displacing the camera to have some parallax) the only way to solve the shot is using tripod solve. Normal solve will only give you errors.

It's very hard however to accurately get depth on a tripod solve.

From the wiki:

  tripod can be used for footage where the camera does not move and only
  rotates. Such footage can't be tracked with a generic solver approach,
  and it's impossible to determine the actual feature points in space
  due to a lack of information. So this solver will solve only the
  relative camera rotation and then reproject the feature points into a
  sphere, with the same distance between feature and camera for all
  feature points.

Once the scene is solved you might not get the right orientation using the default tools (like floor, wall or origin) but you can set manually by selecting the camera in the 3D viewport and rotating it to make the plane and cube match the orientation of the real images (remember to set the original footage as background image). All the trackers are parented to the camera, so they will follow it as you move it along.

What you want to get is something like this:

sample file here


How to remove material and faces that are textured by it? I have a huge mesh with many-many textures and vertices. I would like to remove a material and all the faces using it (from the mesh). How can I do this?

In EDIT MODE

Select one face having assigned the material to remove.
Select -> Similar (Shift-G) -> Material
X

Python:

bpy.ops.mesh.select_similar(type='MATERIAL', threshold=0.01)

Note: The operator has a few option you see in the left panel left:


How to customize default sizes new created objects I work with metric system and units in millimeters. But all new geometry from Shift+A is 200mm. How can I change it?

Use the "Add Plane" window to change value from 200mm to 150mm al subsequent planes added to this file will start with 150mm. You can then File->Defaults->SetStartupFile" to use this file as your default file.


How to add a panel to the properties region in the Image Editor? How do I add a panel to the properties region in the image editor?
The code below is just a slight modification from the "ui_panel_simple.py" template. I changed the bl_space_type to be the text editor, and the bl_region_type to be UI which I thought would put it in the properties region, but it does not work.

import bpy

class HelloWorld(bpy.types.Panel):
    """Creates a Panel in the Text Editor properties region"""
    bl_label = "Hello World"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = 'TEXT_EDITOR'
    bl_region_type = 'UI'

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

        row = layout.row()
        row.label(text="Hello world in the text editor!", icon='WORLD_DATA')

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

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

if __name__ == "__main__":
    register()

The script works as written. The "problem" with the script is that it is putting the hello world in the text editor and not the image editor. bl_space_type takes:

EMPTY, VIEW_3D, GRAPH_EDITOR, OUTLINER, PROPERTIES, FILE_BROWSER, IMAGE_EDITOR, INFO, SEQUENCE_EDITOR, TEXT_EDITOR, DOPESHEET_EDITOR, NLA_EDITOR, TIMELINE, NODE_EDITOR, LOGIC_EDITOR, CONSOLE, USER_PREFERENCES

as accepted values, one for each window type in blender. The script in question has TEXT_EDITOR and not IMAGE_EDITOR.

import bpy

class HelloWorld(bpy.types.Panel):
    """Creates a Panel in the Image Editor properties region"""
    bl_label = "Hello World"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = 'IMAGE_EDITOR'
    bl_region_type = 'UI'

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

        row = layout.row()
        row.label(text="Hello world in the image editor!", icon='WORLD_DATA')

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

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

if __name__ == "__main__":
    register()


Is it possible to have a property sensor detect another property? Is it possible to have a property sensor detect another property?

Like this:

Is it possible to have a property sensor detect another property?

(I assume you want to compare on property's value with another property's value.)

No, the property sensor evaluates a single property only.

When you want to evaluate more properties you can use the expression controller:

property_1 < property_2

or the Python controller

import bge

controller = bge.logic.getCurrentController()
owner = controller.owner
if owner["property_1"] < owner["property_2"]:
    for actuator in controller.actuators:
        controller.activate(actuator)
else:
    for actuator in controller.actuators:
        controller.deactivate(actuator)

I hope this helps


Change view rotation command Does anyone know how to change the rotate view command?
The scroll on my mouse is a bit buggy and I can't find it on the keymap.

Menu Edit User Preferences.  Then Keymap on left side.
Name Search  text ... rotate.
3D View will show the match.


Black artifacts in my renders I'm getting black artifacts in my renders. It looks like black pepper.

I've already re-calculated the normals (they were already facing in the right direction, anyway). You can see the artifacts on the door and the awning:

I'm using v2.68, but I get the same thing in v2.70.

The black artifacts are caused by intersecting meshes. In order to fix the issue, select the house model, enter edit mode and use W > "Remove doubles". Finally, go back to object mode and check if you have any duplicates of the objects in your scene, and delete them.


Why can't I parent two bones together? I am trying to parent two bones together on the human body I made. For some reason, on 2.77, no matter what parent option I use, the bottom abdomen bone and the upper leg bone wont "connect" (as much as they can when it comes to parenting). I'm using this video to learn how to rig, but what it tells me to do doesn't match up with what is happening on my screen. Any suggestions, tips, or option changes I don't know about?   Blender Rigging 1/2

The linked video shows parenting with an Offset. If you'd like the two bones to actually connect in your own rig, select Connected instead. Better yet, select the bone roots and hit F afterwards, so your original thigh bone stays nice and aligned with the rest of the leg.


Can't get node editor to add volume scatter for smoke domain in 2.71 I downloaded the latest stable (2.71) after seeing a slightly older tutorial on smoke in cycles (https://www.youtube.com/watch?v=oSiV5gg_lCs).

After adding a mesh and then hitting Space to add "Quick Smoke", I cannot get the smoke domain in the node editor to allow me to add a Volume Scatter like the tutorial.  As a matter of fact, I can't find any "Attribute" nodes either.

I found volume_scatter in the source code as shader options in the node editor's include files, but I can't seem to get a shader to apply to the quick smoke.

Any ideas on what I'm missing?

3-days frustratedly yours,
--Josh

Select your smoke domain (not the sphere)

Open the Node editor and make sure you are on the shader node editor,
(the Sphere icon on the left). also click on the object material (The cube icon).
Enable Use Nodes


Need help rendering a panoramic equirectangular movie of a computer game recorded in box projection mode in cycles Firstly, I clearly have taken on something for which I don't have enough blender knowledge, but as I have spent so much time practising to get to this point, I don't want to give in.

I have made a movie recording of a flight in a simulator called DCS World, and want to try and do a 360 movie of a flight. I have set the simulator to display as a box projector with 6 square panels in one video. The video is much smaller in length and resolution than what I will need, but I will record in higher quality, better side-matches etc, when I grasp how I can complete this.

In Blender, I have set the camera as panoramic equirectangular and put the camera inside a cube. I am using cycles render as the panoramic camera options are not available in Blender render. I have UV unwrapped the cube and added the video texture to the cube. If I view the cube in 3D View with material, I can see my the video texture on each of the sides as I would expect. However, if I try to render this as a single image, I only see the front panel, same for as a video. Is there anything I should be looking out for?

The video even though only about 5 seconds long is huge, but I can dropbox it and the blend file if anyone wants to take a look, and point me in the right direction.

Kindest regards

Andy

It is hard to say for sure without the video file, but based on what you provided the answer is pretty simple: your camera is not actually positioned inside the cube.  It is positioned outside the cube, and therefore it's just rendering the face of the cube that's visible to it.

I made a few minor changes to your file: I repositioned the camera to inside the cube; rotated it 180 degrees to face the "middle" of the image; played with your cube's UV map to get it to fit the still you provided; and changed the material to an emission shader for visibility.  This was my render:

Is this the type of thing you had in mind?

Edit: since the cockpit still was not posted in the question I am including it here for reference.

with some further tweaking, I got the render to look like this:

It is important that the camera be centered within the cube, you can align the objects by using the Object-->Transform-->Align Objects command.

There are some discontinuities in the image, a few may have to do with my lack of precision in adjusting the UVs, but I think most of them come from the fact that your sample image does not wrap perfectly.  The panel to the top of the center is screwed up somehow, for example it includes additional images of those windshield seams.  Also the seam where the leftmost and rightmost edges join doesn't seem to be a perfect fit.


How to animate a lightbulb going on and off how would I apply all ofthis into an animation? I would like to animate a lightbulb switching on and off but it seems some of the properties discussed are not available outside the compositor.

https://www.youtube.com/watch?v=-Ya-7olrPyc

The principle is the following but can be more or less complex starting from the video as it will surely involve several drivers and to do it in material and compositing nodes settings.

Here the cube's color is changing depending on the position of an empty along Y (the effect is visible in rendering mode):

In this example, I add a driver to the 'fac' value of a mix shader:

Then open a view and set it to 'graph editor' (1), then set it to 'drivers' mode (2), select your object (the lamp in your case), then its material and the 'fac'. Then (4), open the right panel (N) and choose the 'drivers' tab:

Add for instance an empty. Then in the driver panel, use it as input (variable) object (1), and for example choose its Y position to drive the result. Set (2) the driver to 'scripted expression' then set the expression to (var > 0) so that the output is 1 when the empty.Y is above 0, and is 0 when it is below 0.

Doing that, the mix shader node is driven by this previous driver's output. So you can animate a lamp this way, just moving an empty.


Create "two-sided" curves I have been trying to create tubes for use in my game (in Unity).

I've used this question to accomplish that. The extruded curve's normals are facing out, like I would expect. However, this means that when imported into Unity, the inside of the tube is invisible, and the collider that is generated is only recognizing the normals in the proper direction (like I would expect).

My solution so far has been to convert the curve to a mesh, duplicate it, and flip the normals. This works, but it feels super inefficient, and like I am missing some tool or modifier that might exist.

Any advice is appreciated, as it seems I am perpetually new to Blender :)

I think you are missing Solidify modifier.


transparent instead of solid grey models? I'm new to Blender, and I think I accidentally pressed something to turn everything into this transparent point only mode instead of solid grey models. Could someone explain how to change it back? Tysm in advance! Sorry if this question has been answered before, I just can't find it probably because I am describing the problem very badly.

You may have clicked transparency in the viewport next to one of the four viewport shading spheres. To set transparency off, press ALT+Z. This will disable it.
You currently are in wireframe also, so click on the shader sphere next to wireframe if you want to go to a different view.


Cycles hybrid rendering The Cycles render engine can render both on the CPU and the GPU. I often render over-night so I do not need my computer to be responsive.

Is it possible to render with Cycles using both the CPU and GPU? If not, are there any other workarounds that maximize the hardware's potential?

  This question here: Can I use both GPU and CPU together when I render with Cycles to decrease render time? focused on single frames optimisation.

If you render an animation, you might achieve what you want by having two instances of Blender running. One renders with CPU, the other with GPU. Both use the same file and the same folder to render the image sequence.

You can tell blender in the Output panel to create placeholders and to not overwrite existing files. Placeholder creates an empty file when the rendering of a frame starts and disabling Overwrite tells Blender to leave this particular frame in peace if it already exists. This is the simplest approach to creating a render farm.

I must admit that my best graphics card is too old to test this approach myself. If it works, you might also want to check temperatures and render for a few hours before you leave the equipment unattended. Everything at your own risk.

If you want to render a single image, you can set a different seed in the Sampling panel and render for example 2000 samples with the CPU and 4000 with the GPU and overlay both images in the compositor.


Cycle render noise wont change i have watched many tutorials on how to reduce noise in cycles. however, no matter what i do its still grossly overflowing with fireflies. i must be missing something basic but i dont know what it is. i was watching a tutorial where he put the emitter plane in a hallway and changed its location and size and it made it crystal clear. i tried this and it just makes it worse. i have no idea what i am doing wrong.

Here is the tutorial i was watching.i was just trying to recreate the first example.
https://www.youtube.com/watch?v=81k22ijYiIw

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

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

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

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


Glass material is smudgy and doesn't look like glass I downloaded this 3D model of a glass vase and I tried fixing the material in Blender using Cycles as my rendering engine but it looks so different in comparison to the material preview. See screenshots below:

Can anyone figure out why this is happening? If anyone can help me out, I'd greatly appreciate it. Been stuck on this for so long already and I'm getting frustrated. I've tried almost everything but nothing seems to work (such as putting roughness to 0, transmission to 1, using glass bdsf, etc)

Some things that could help:

To brighten shadows inside the glass, add more Transmission bounces
For shooting glass (and other shiny objects), use high-contrast lighting
Denoiser still needs a lot of samples to avoid artifacts and smudges

3-4 lights, HDRI environment, 1000 Render Samples + Denoiser

Related:
How to make this glass more realistic?
How to illuminate the darkness inside glass objects in Cycles?


Selection in Edit Mode not working I was doing a lot of different things in Blender recently and I could select verts with C, B and right mouse button. Now, it is not working anymore. Not even selecting edges or faces. Just the whole object by A. I guess I must have pressed any key that locks it by accident.
I was doing some UV changes, some Mesh deformation and was tweaking things in texture paint mode. I cannot really say where it happened but somewhere later after the mesh changes were applied.
Hope anyone got a clue what to do.

EDIT: I was streaming with OBS again and it happened again! I closed and re-opened both programs a few times, selected different .blend files and the problem still occurs. Closed everything, re-started blender first. I then switched to xSplit and it appeared again...

Have no idea how this could help but here a picture explaination. Added a cube to the current file.

 Console information added.

Figured it was the issue with a setting in the software I use to stream my work. Check if you have got anything like "Multi-Adapt-Compatibility" activated on the selected Blender source in that program. Deactivate it. Restart both programs and check if it works.


Animation ramps up seed and slows down I have an animation that slowly increases its speed and slowly stops. How do I stop it from doing this? I have set it to linear extrapolation but it still does the same thing.

Not extrapolation, but interpolation. Meaning: the kind of transition between two keyframes. Set the interpolation to Linear. @susu


How can I copy animation from an object while it was attached as a child and then paste that animation to it after detaching it? This is a follow-up question from the answers to this question:
How to attach an animated object to a rig?
I'm creating a medal ceremony where a judge will be putting a medal on the winner. Now I thought it will reduce a lot of work if I could just connect the medal to the judge's hand up to the frame where it reaches the winner's neck, and after that if I could just disconnect it from the Judge's hand while they take the hand away.
So I used the solution given in the above question and was able to successfully and easily animate the medal up to when it reaches the winner's neck. Now to continue to the rest of the animation, I would like to animate the medal without any relation to the hand as it would become very tedious to keep changing the pose of the medal relative to the judge's hand for the rest of the animation.
How can I achieve this? One of my ideas was that I copy the animation of the medal while it's in a child relation to the hand bone and then un-parent it and paste the animation on the independent medal. But how do I do this?
Right now when I unparent it, the animation vanishes from the medal (probably because it was only moving due to relation with the hand), and copying the keyframes/animation (while as a child) is not giving the same animation because I think the animation as a child is relative.
OR is there a way to remove the parent after some specific frame? But I think this would require the use of code and thus difficult for a beginner like me.
For reference, this is how my medal looks like while it's parented to the hand, and of course, I'm able to modify the pose of the medal relative to the hand but it would become a tedious task to keep doing that for the rest of the animation even when their relation is of no use anymore.

This is the last point till when the parent child relation between the hand and the medal was helpful. But next the hand has to move down and I don't want the medal to keep moving with it anymore.

Note - I felt my question is considerably different but related to the above and therefore I didn't ask it as a comment there (I don't have enough points for it either XD).

If this is for a video production, is of lengthy footage and further animation or constraint(s) are needed for models after the medal presentation, baking and/or the Child-of' constraint could prove troublesome.
or even impractical.

A quite simple and straightforward solution could be to split the project between two Blend files.  The 2nd with a different parent to the 1st.
The video clip above was done that way and required a different parent for the man's hands after he'd presented the medal.
The medal and it's cord also needed a change.  They were parentless in the first but needed the girl for a parent after the presentation.
Both Blend files were rendered out as lossless video and the clips joined later in the Video Sequence Editor.
For this method a straight out parentage using CTL-P,  and for the 2nd file,  ALT-P to remove it would be a much cleaner and trouble-free way to deal with the switch.
IMPORTANT -
The only trick to keep in mind when removing or changing parentage, constraints or physics, is to immediately purge the model(s) of all constraints, physics, and keyframes (clear animation in the Outliner)  --> BEFORE  <--  moving the timeline cursor.


How to unfold mesh with a principled BSDF material onto a flat object in 2.8? I'm trying to unwrap an image that I've applied to a mesh with a Principled BSDF shader. Here is the material node graph:

Is there a way to include the material I've applied to my icosphere in the UV unwrap?

Here is the UV map I want to unwrap to:

Add an image texture node
Click on new on it and create a picture file, this node must be active (select it)
Switch to Cycles render
Decrease the render sampling to 1
Select diffuse in the Bake tab and select only Color for the influence
Click on Bake then save the baked picture


Inverse Kinematics leg/arm rig bending the wrong way I have a character who is rigged using 'Rigify'. I've put inverse kinematics on his two forearms and his two shins, and this problem is mainly a problem on his shins. I want his legs to be able to bend only like following:

But it can also bend this way, which I want to make impossible.

So basically - is there a way for an inverse kinematics rig to allow only bending in a certain direction?

I am 4 years too late, but still.
You need to create another bone outside the leg and it should not be parented to any other. Now open the bone constraints(where you created the inverse kinematics) and you will see "Pole Target", select your Armature and below will appear "Bone" and select the bone you created.
After that the bones will only bend in the direction of this pole target bone, so you should put it in front of the model.


Resetting my transforms but I can't do an even bevel I'm having some basic problems with bevels. Or rather with resetting the scale of my object.

To recreate my problem.

Create  abox
scale it in x:10, and z 0.1
ctrl+A choose apply scale to deltas
select long edge on the mesh and ctrl+b to bevel. Bevel is not even.

What am I doing wrong?

Select your object in object mode and hit Ctrl+A and then Apply "Scale"

or

Scale your object in "Edit mode" rather than Object mode, then Ctrl+B "Bevel Edges" in will be even.


How do i toggle off this weird cursor tracer when in texture paint mode? (Blender 2.8 LS) i got this weird cursor thingy after messing around with my keyboard when blender crashed. This only shows up whenever I left click.

This is the stroke stabilizer, to smooth out strokes.


Why does combining a surface and volume node result in a black material? I'm trying to make a fluid with something dissolved into it. It's almost opaque but there are some spots of lower density solute. This is why I can't just use nodes on surface alone--I need to be able to have the opacity partly dependent on thickness.

I figured I could use a Principled Volume node and then put a low roughness, max transmission Principled BSDF node on the surface to give it the reflection and physical surface.

It didn't work. I was expecting the cube to look a bit like white watercolor paint or milk mixed with water. Instead, I got a black cube.

What is this and how can I fix it?

I had the same question, and I believe that this value under Scene Properties>Render>Light Paths>Max Bounces>Volume. When there's a surface material on the volume, it always takes at least one bounce to get into the volume. I believe this defaults to 0.


Realistic sectional door animation I'm trying to animate a sectional door, but without success.

I made a profile using a bezier spline and I want the sections to follow exactly the profile.

If I use the Follow Path Constraint, the section does follow the profile but in an unrealistic way :

Adjusting the pivot does not allow a more realistic way.

The main issue with follow path is that the orientation is made on only one point : the pivot but I want here is to have two "pivots" : one for each extremity of the section of the door.

I also try to use the Curve modifier with a whole door, but it doesn't solve all the issues :

Here the extremums of the sections follow exactly the profile, but the placement is difficult (conter intuitive, I have to move the door down to get it up ...), and most important it introduces some deformations on the door extremums, and this is not realistic. Moreover it would be more realistic to have independent sections of the door instead of of full block (because the last section have different movement)

I also tried to use some empties to follow the profile (using drivers, I was able to move only one empty and move the others on the profile with good spacing between the empties), but I wasn't able to set the door sections follow exactly the empties.

Anybody have a good suggestion ?

Ideally I would like to have :

Wheels that follow the profile (I can do that with some king of cylinders, it works well) ;
Sectional doors that are independents each others (they should be independent objects) ;
Sectional doors extremities are tied to the wheels ;
Sectional doors must be rigid (no deformation like in curve modifier) ;
Animation should be simple (a single empty that is moved on one axis can drive the full animation).

Model a single segment e.g.:

Add an Array and Curve modifier

Now you should be able to animate open/close by translating the x-axis.

Method 2

To avoid that the Curve modifier distorts the segments, you could add another object say plane (Empties cannot have the array modifier) and parent the segment to the plane. Use face duplication on the plane to create the undistorted segements.

Note it is important to apply scale.


Align viewport rotation to normal vector like Shift+7 in edit mode I know this question has been asked and answered before but the behavior I want is what ⇧ Shift + Num 7 exactly does in edit mode which is to align the viewport to "face" the element selected (in my case a face or polygon) and "rotate" the viewport on its axis to match the orientation of the normal.
My code takes care of the first part which is to position the viewport to "face" the polygon and have no problem orienting itself on their normals except for faces that are rotated in multiple axis. e.g. the active face in the picture below, for the other faces which are angled only on a single axis the script has no problem orienting itself on their normals.

In my original code, the variables are delivered by raycast so I'd like to achieve this effect using only hit, normal plus the viewport and object properties. Face index is avoided since the target objects are using unapplied modifiers.
import bpy
import bmesh
from mathutils import *; from math import *

for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
       rv3d = area.spaces[0].region_3d

obj = bpy.context.edit_object
mat = obj.matrix_world
me = obj.data

bm = bmesh.from_edit_mesh(me)
f = bm.select_history.active

start = f.calc_center_median()
normal = f.normal

stop  = start + normal
norm = start - stop
norm.normalize()

q = norm.to_track_quat('-Z', 'Y')
rv3d.view_rotation = q
rv3d.view_location = start

bmesh.update_edit_mesh(me, True)

rotateview_blend_file

I solved it. If the tangent picks the wrong direction and doesn't align to the viewport, the rotation matrix inverts and uses the negative value of the angle for correction. Keeping it here for prosperity and to help those seeking this kind of alignment behavior.
import bpy
import bmesh
from mathutils import *; from math import *

for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
       rv3d = area.spaces[0].region_3d

obj = bpy.context.active_object
mat = obj.matrix_world
me = obj.data

bm = bmesh.from_edit_mesh(me)
f = bm.select_history.active

up = Vector((0,0,1))
up1 = Vector((0,-1,0))

center = f.calc_center_median()
normal = f.normal
tangent = f.calc_tangent_edge()

mw = mat.to_3x3()
quat = normal.rotation_difference(mw.inverted() @ up)
rot_mat = mw @ quat.to_matrix()

loc, rot, scale = rv3d.view_matrix.decompose()

mat_scale = Matrix()
for i in range(3):
    mat_scale[i][i] = scale[i]

rv3d.view_matrix = Matrix.Translation(loc) \
    @ rot_mat.to_4x4() \
    @ mat_scale

vrot = rv3d.view_rotation
rot_axis = vrot @ up
rot_dir = vrot @ up1

rotdiff = rot_dir.rotation_difference(tangent)
M = mw @ Matrix.Rotation(rotdiff.angle, 3, rot_axis)
rv3d.view_rotation.rotate(M)

if (rv3d.view_rotation @ up1).rotation_difference(tangent).angle != 0:
    rv3d.view_rotation.rotate(M.inverted())
    M = mw @ Matrix.Rotation(-rotdiff.angle, 3, rot_axis)
    rv3d.view_rotation.rotate(M)

rv3d.view_location = obj.matrix_world @ center
bmesh.update_edit_mesh(me, True)


Create Plexus plugin-like effect Image Credit

How to create the outer nodes effect in Blender Cycles, including the lines? I know this is achieved using a particle system, but don't know how.

Also can anybody suggest any plugins for blender that does the same?

I would use Sverchok (A Blender node system for Geometry)

Click on the image to view full size.

How it works is you feed Sverchok a base mesh, in this case the blue Icosphere with some distorted noise displacement. This mesh is used to generate a second set of vertices positioned some distance away in the direction of the vertex normal. The vertex normal is defined by the average face normal of all faces which are connected to a vertex.

This new set of vertices has the same vertex index order, this means we can reuse the edge list (list of vertex indices which makes up each edge) and create tubing from the resulting edges.

The new set of vertices is also used to place duplicated instances of the node sphere (in this case a NURBS SurfaceSphere)

Alpha_0 : This mesh is outputted by the BMeshViewDraw node. Because it's only outputting one mesh the name has _0 appended. This node outputs the new (offset) vertices.

In the properties of Alpha_0 switch on duplication to Vertex.
(I dragged the duplication menu-item to the top for convenience)

Sigma_0 : The tubes, Curve Objects, generated by SvCurveViewer Sigma. These tubes are built from new vertices and old edge list.

SurfSphere: In properties set the parent to Alpha_0, this will then duplicate the SurfSphere at every vertex of Alpha_0's mesh.
.

You'll notice as soon as you parent an object, that the child becomes part of the parent item. The outliner shows it like this:

Result:

Pros and Cons:

Pro:

Learn Sverchok, it can be applied to many scenarios involving geometry
Sverchok is 150+ nodes which can be combined to give a massive amount of modulation in your end result
I co-write Sverchok, if you have questions about how it works visit the issue tracker.

Con:

You have to install and enable Sverchok, it does not come with Blender
At first it might seem confusing, but it works very similar to any other node system. Nodes take input and perform some operation and produce output. Each node does something different, generally the name of the node is sufficient to indicate what it does.