Prop Search Armature Bones I want to add a prop search to my addon which allows me to search and select bones of a selected armature in the scene.
But I dont know the path where to find the bones of the armature. I want to have it like in the constraints panel where you can choose an armature target and a bone target.

I have created something like this:

import bpy

#
#CREATE ArFi LAYOUT START
#

class armatureFind(bpy.types.Panel):
    bl_space_type="VIEW_3D"
    bl_region_type="TOOLS"
    bl_label="Armature Find"
    bl_category="ArFi"

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

        box.prop(bpy.context.scene.objects, "active", text="Armature") #Problem1
        box.prop(bpy.data.armatures, "rna_type", text="Bone 1", icon="VIEWZOOM") #Problem2
        box.prop(bpy.data.armatures, "rna_type", text="Bone 2", icon="VIEWZOOM") #Problem3

#REGISTER CLASSES

def register():
    bpy.utils.register_module(__name__)

def unregister():
    bpy.utils.unregister_moduel(__name__)

if __name__ == "__main__":
    register()

You can achieve this with two dynamic enum properties if you are fine with selecting an armature and a bone. If you want to select an armature object, things become more complicated. Below code updates the list of armature objects as the first enum property is changed - which is really ugly. Another way would be to place a button for the user to update the collection:

import bpy

class HelloWorldPanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "Hello World Panel"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

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

        col = layout.column()
        col.prop(sce, "arma")
        col.prop(sce, "bone")

        col.prop_search(sce, "arma_name", bpy.data, "armatures")
        arma = bpy.data.armatures.get(sce.arma_name)
        if arma is not None:
            col.prop_search(sce, "bone_name", arma, "bones")

        col.prop_search(sce, "arma_name", sce, "arma_coll", icon='OBJECT_DATA')

def arma_items(self, context):
    obs = []
    for ob in context.scene.objects:
        if ob.type == 'ARMATURE':
            obs.append((ob.name, ob.name, ""))
    return obs

def arma_upd(self, context):
    self.arma_coll.clear()
    for ob in context.scene.objects:
        if ob.type == 'ARMATURE':
            item = self.arma_coll.add()
            item.name = ob.name

def bone_items(self, context):
    arma = context.scene.objects.get(self.arma)
    if arma is None:
        return
    return [(bone.name, bone.name, "") for bone in arma.data.bones]

def register():
    bpy.utils.register_class(HelloWorldPanel)
    bpy.types.Scene.arma = bpy.props.EnumProperty(items=arma_items, update=arma_upd)
    bpy.types.Scene.bone = bpy.props.EnumProperty(items=bone_items)
    bpy.types.Scene.arma_coll = bpy.props.CollectionProperty(type=bpy.types.PropertyGroup)
    bpy.types.Scene.arma_name = bpy.props.StringProperty()
    bpy.types.Scene.bone_name = bpy.props.StringProperty()

def unregister():
    bpy.utils.unregister_class(HelloWorldPanel)
    del bpy.types.Scene.arma
    del bpy.types.Scene.bone
    del bpy.types.Scene.arma_name
    del bpy.types.Scene.bone_name
    del bpy.types.Scene.arma_coll

if __name__ == "__main__":
    register()


Change sculpting brush alpha visibility? When using brush alphas/texture as stencils in sculpting mode, it's often really hard to actually see the stencil image and know where it is or how it is rotated.

Is there any way to bump up the contrast or something so it shows up better?

There is a fantastic addon by Kgeogeo called Stencil Widget that allows a lot of control over the Stencil images in both Texture paint and Sculpt.

You will see an icon looking like a square with a triangle missing - that is the alpha control.

You can get it here and watch a short video here


Create strip around floor area I have a floor tile which is basically a square, but isn't quite.  I want to add a small strip around the side to be able to paint/texture this strip separately from the floor.

I've used some maths and the location of the other vertices to calculate the width of the strip.  I've then manually added extra vertices to the edge of the square floor, and manually connected them to "next edge" and run them straight along the x/y axis until the intersect with the opposite edge, to form a straight line.

Problem: doesn't create a face; without a face, can't select in Texture Painting.

So I took the 4 vertices I'd created and hit F to form a new Face.

Problem: have new face (one edge of the outer strip of my square) directly overlapping the square that was there before.

I'm guessing they haven't auto merged some how?

How do I tidy this up while ensuring I maintain my outer strip?

I have checked for doubles etc.

Thanks,
A

The face created is exactly the one  you asked for.. you need to miter the frame to make individual faces around the rim. Delete the big face. You can use F with vertices selected to create the diagonal edges, and then F again with edges selected, to fill the segments.

But it may be easier to start with the whole tile, and I inset it with Offset Even checked, working from the outside in.


Different number of Vertices, Faces and Triangles between object mode and edit mode In object mode it says that I have 1 of 99 objects selected and over 10000 Vertices, 2000 Faces, and a similar high number for Tris. When I tab into edit mode it shows the actual numbers of the object, 28 Faces, 100 or so Vertices etc. It is the only object that I have, I see nothing else. I have no idea what the cause is, when I delete said object everything goes to 0 again. So it doesn't appear to be extra objects that I'm missing. What would cause this?

This is happening because you may have a modifier on the object that does not affect the mesh during edit mode, but the changes are shown in object mode.


How to convert many triangles to one mesh? I wrote an algorithm to randomly generate terrain and I am trying to load and edit my results with blender.  The problem is that when I load my terrain in blender, the individual triangles are not linked together.

You can see when I shrink/flatten a subset the the faces, the rest don't follow and deform as a single mesh.

I tried deleting the faces and edges and using F to create faces from the points, but it does not give usable results.

How can I go about solving this problem?

You have a mesh with many unconnected faces.
In edit mode select all the triangles with A A. Then press W > Remove Doubles. Or on the tool shelf T under the Tools tab press the Remove Doubles button.


How to Join parts of an imported .3ds model When I imported the file the model was separated

I tried to join the different parts with Ctrl J but it doesn't do the trick.

You can join this with Ctl+P> Object. Just parent your clothes to body with this so whenever you move your character body your clothes, hair etc move with body.


How do I simulate "filling water" in Game Engine I'd like to make a mini game where the player would have a water tank being filled and it has an outflow where he controls. He will be able of increase or decrease the amount of water coming out of the tank. How can I do it?
I'm new in Blender and I made a water simulation of this tank being filled as animation, but I couldn't apply this to the game engine.
If you, guys, could give me a light, I'll be thankful.

Possible duplicate of this post. What you're trying to do is something not currently possible in vanilla Blender at runtime.

My advise is to fake it with different planes, particles, etc. but you have to learn Python to do this, and it will require a lot of work. Realtime simulations are demanding on your system, so even if you pull off full water simulation in Blender, 99% of everyone with a personal computer won't be able to run it.

So make a plane as your water surface, apply an animated texture to it, and animate the mesh itself. This way you'll at least have a water surface. For the inflow/outflow, make properties stating the water level. Animate this with two keyframes and let it cycle the values between 1 and 0 to make the water rise and fall. Animate some cylinders with the same process as the water surface so it looks like it's pouring out of something.

Remember, with any and every game, keep your polycount as low as you can. Running a water simulation at runtime will blow your polycount to the roof, and lag, or even crash on most systems.

Hope this helps.


Rendering smoke in Cycles? I am trying to render smoke in cycles, but the relevant blender manual page is designed for Bender Internal. I have everything set up except for the material.

I imagine you would set up the material nodes something like this:

But the problem is that there is no Voxel Data texture node, ans I am not sure what kind of shader should be used.

Is smoke in Cycles simply not supported yet? Or do I need to go about this a different way?

Reference: Smoke material in blender internal

As of version 2.73 from 2015:

Make sure render engine is set to cycles (BI wouldn't create the required cycles materials)
Select the object you want to emit smoke
From the menu Object/Quick Effects pick Quick Smoke

After that a material has been created that looks like:

In order to also emit flames it can easily be extended to:

Note that the attribute names have to be exactly as they  are show 'color','density' and 'flame'.

Important settings for the Domain object (besides higher-resolution):

Important settings for the Flow Object:

Add a procedural texture and animate some properties to animate the flames.

Full tutorial: http://www.blenderguru.com/tutorials/make-fire-cycles/


Planar decimate style in Cycles Shader? The image shows the same model with a level of subsurf, and with a 15deg planar decimate. The shaders are grey toon diffuse and gloss mixed with Fresnel.

I want to get the sort of look you get by using planar decimate on a model without directly decimating the model. The goal is to get planar shading, but without breaking up the silhouette of the model the way that decimating it will.

Ideally, I would have the regular version of the mesh, and then transfer normals from a decimated version of the mesh via the Data Transfer Modifier. However, this causes blender to crash if the mesh has any complexity, such as for this character, and can have other problems. So I am looking for other options.

Is there any way to use a material to get a more planar look? A baked normalmap may work, but would contribute to VRAM issues.

I've done this with a baked normal map, but as you point out, image textures do require a bit of memory. I've already prepared two characters, one is the default character from MakeHuman with two subdivisions, and the other is a duplicate of that, which I decimated with Planar and an angle of 5 degrees. I've also made sure they're aligned with each other on all axes.

Prepare an image to contain the normal map. Open up the UV/Image Editor and click New. I used the default settings.

Select the undecimated character and go into the Compositor. Add an image texture and change it to Non-Color Data. Add a Texture Coordiante node and connect its UV socket to the Vector socket of the Image Texture node. Do not connect the output of the Image Texture node to anything yet. If you do, you may get a Circular Reference error when baking.

Go back to the 3D View.Expand the Bake section in the Render panel, change Bake Type to Normal, enable Selected to Active, and set the Ray Distance to something higher than 0. Select the two objects. Make sure you select the decimated one first, then while holding Shift select the undecimated one. Then click Bake.

Once the baking is done, open up the UV/Image Editor and select the image you created. It should now contain the normal map. Make sure you save it or pack it before doing anything else, or you may lose it.

Go back to the 3D View and select the undecimated object, the go into the Compositor. Add a Normal Map node. Connect the output from the Image Texture node to the Color input of the Normal Map node. The connect its Normal output to the Normal input of any shader you want to be affected by this.

Here's the result I got with my characters. I've exaggerated the effect of the normal map by turning its strength up to 2.

With this render, RAM usage peaked at 63.95MB. I'm not GPU rendering, because my GPU is basically a potato, and I do not know if textures require more, less or the same amout of RAM when rendering on GPU. I used default settings when creating the image, so I did not enable the 32 bit Float option and the size is 1024x1024. If you require higher quality, it will obviously use up more RAM.


Fire looks very low resolution I have asked this question before and no one has helped me. I've been given the wrong answer and when I tried to explain that there was no reply. But anyways what my question is, is that I work in internal and when I create fire (high resolution is checked), parts of it is pixelated and looks very noisy. Here we can see it in Godzilla's mouth area:

And here it is noticeable in certain areas of the flame:

Under Intergration in the material for the smoke domain, decrease the Step Size and possibly also the Depth Cutoff. The step size determines how close together the volume calculations are, and decreasing it makes the render more accurate, but also slower. The depth cutoff sets the luminance below which to clamp to zero. Decreasing this also makes the render more accurate and slower.

This was rendered with the default settings, step size 0.100 and depth cutoff 0.010.

And this was rendered with values in the screenshot above, step size 0.02 and depth cutoff 0.005.

And as a side note (for if and when you decide to move to Cycles), in Cycles you change this under Volume Sampling in the render panel. The step size does the same as in Internal, but the depth cutoff has been replaced by Max Steps. This serves the same purpose, but with a different approach.


EasyCanvas iPad pro and Blender? Hey I just installed an Astropad Windows Alternative EasyCanvas, it works fine but blender doesn't seem to detect pressure from Apple pencil. Is there any way to fix it, my iPad shows as a generic HID Compilant pen?

in preferences
Click ‘Input’ - Change the ‘Tablet API’ to ‘Windows Ink’.
http://www.easynlight.com/en/supporteasycanvas/?faq=75
worked for me :)


Why is my fire simulation so blocky in Cycles rendered view? I'm making a candle, using a Mantaflow fire simulation, and all looks good in solid view. But when I switch over to Cycles rendered view, the flame looks very blocky and low resolution. It looks the same in the final render too. I followed tutorials using Quick Smoke to set up the flame, but for whatever reason mine always turns out looking way worse than theirs.
I've tried applying the scale of the Smoke Domain and Emitter objects, raising the resolution divisions on the domain from 64 to 128, and lowering the step rate of the domain material. None of these made any noticeable difference.
I'm quite stuck here, so any ideas would be much appreciated.

I've animated flames in blender a few times in the past, and one thing I learned is that if you want the flames to look realistic.  You usually have to set the resolution divisions REALLY high.  Around 600 or even 700 division should make it look really nice. Or maybe 400-500 if you're not going for super realistic.  Yes, it will drastically increase your rendering time, but that's the price you have to pay sometimes.


How to Make a image repeat in cycles I want to make a wall with a image repeating across it like wallpaper.

I tried it in the node editor but the image is taking up the entire plane. I just want it to be small and for the image to repeat across the entire plane.

How do I do that?

All you need to do to get an image to repeat in a Cycles material is add a Vector > Mapping node between the Texture Coordinates and Image Texture.  Set the Mapping node to Texture at the top and set any of the Scale: values to less than one to make the image repeat along a certain (or multiple) axis(axes).

The other option, without adding any other nodes, is to simply scale up the UVmap in the UV/Image Editor. A UV map larger then the image will make the image repeat.


How to swap / invert the RMB (that activates the "object context menu") with the LMB (that selects an object) in 2.8 I would like to swap / invert the right mouse button (that activates the "object context menu") with the left mouse button (that selects an object). how can I do that ? I see that this can be chosen on the splash screen,but when it starts on my blender 2.8,I don't see the chance to do that.

Go to Edit > Preferences > Keymap > • Select with


"Curve From Mesh/Text" not working on wireframe of cube I was following this link on solidifying edges. When I went to convert the mesh to a curve, nothing happened. Here's what I starting with a new file:

Select cube
Tab to edit mode
Ctrl + F > Wireframe
Tab back to object mode
Alt + C > Curve from Mesh/Text

Nothing happens. I noticed that it works if I add a Grid or Circle and try to convert those. What am I doing wrong?

I have Blender 2.71 (Release Candidate). I also tried converted the cube directly without converting it to a wireframe, but that didn't work either.

Context: I'm trying to create a picture like this, with shadeless faces (that occlude the background) and dark edges:

Conversion to wireframe does this in essence, for every face on a Mesh.

The wireframe conversion transforms each face into thin faces interior to  the perimeter of the face, this function has parameters that you can change to adjust the width of those faces, but by default it is rather thin.

  As a side note: The Curve from Mesh/Text conversion tool operates best on Meshes if you remove the faces first. (X, remove only faces). If the mesh doesn't have any Faces there is no need to convert to wire-frame (or remove doubles later on).

You can set the thickness of the wireframe to 0.000, and then you'll see little dots on the edges, because it still creates faces but they are so thin they will fall below the 'remove doubles' limit:

Removing doubles would look like this:

At this point you can convert to Curve from Mesh/Text. But I doubt that is actually what you want.

If you follow the link in the first comment on your Question you will be able to render results like this:

Conversion to wire-frame isn't the way to go about rendering with face occlusion.


Mesh interferes with the texture of a plane So I have a simple scene in blender, there is a track situaded in a grass field. However it seems that the road somehow inteferes with the plane. If I (re)move the track it solves the problem. The same happens with a little car I have that isn't shown. The grass texture is a seamless grass texture 1024x1024 if I recall correctly.

I've chequed the bounding boxes and wireframes and everything seems good.
You can download the .blend file below.

I don't know what you mean by the track interfering... but the texture mapping for the grassy plane is messed up.

First of all, your plane has been scaled in Object mode.

select Select the plane and press CtrlA and select Apply Rotation and Scale

(More on why you always want to apply your scale here and here)

Next:
Your plane has no UV map, so blender will not know how to map the image.

Go to top view. , enter edit mode select all (A) press U to unwrap the texture.

(note that I changed the number of repeats for illustrations purposes...


I want to make the muscles pump like a heart (Resident Evil 4 Final Monster) I want the muscles of the legs pumping and have translucent properties so to show something is pumping inside. I know I can do soft body or cloth sim but I'm not sure how. I don't know how to pump it after that softness.

I want these marked areas to pump and act like flesh in my scene. I have one year of experience in Blender but still don't know many things so please suggest tips that are beginner-friendly.
The look I'm inspired from is this:

I'd probably do it using shape keys:
Blender Character Animation: Shape Keys


How can I make text appear on the screen in the game engine when the character enters a certain area? I am making a game and I want text to appear when the character enters a invisible cube. I have tried to make a overlay scene, but I can't make it work. Thanks!

There are plenty of ways to achieve this.

Your scene idea could be implemented as follows:

Cube:

Collision sensor (filter for a property the character has)
AND controller
Scene Actuator Add Overlay -> your scene with text

Remarks:

ensure the camera of the overlay scene is showing something
ensure your character can be detected (static objects are not detected!). In doubt enable Game/Show physics Visualization.


Why cant I animate using shape keys or locroc Thank you for looking in to my problem.
I am having an issue applying shape keys or loc roc to my scene.  I am trying to animate one of the tentacles i have or just have shape keys move the mesh so that it can look like it's floating but when ever I apply loc roc or create a shape key nothing happens. I've been using a curve modifier to move the mesh around.  Is this why I cannot animate?
I've attached a link to the blend file.
https://drive.google.com/file/d/1TUsHGsixeDUOL0bCVrLPKSemdz7Pqu3a/view?usp=sharing

You can use shape keys, they seemed to be empty though (I'd use shape keys to make the tentacles ribbon/wave-like motion for the edges).
For the tentacle motion I'd use bendy bones -


How to deform (randomize) object so it would look different? I have 3d tooth, and I need to make it look different.
Is there any way to deform it? Scaling it, isn't what I need. My model has around 2kk faces and I have troubles editing subdivision and fractal settings.

My goal is writing a script that will randomize my tooth.

Add a Lattice Object and set its resolution for your requirements.

Select your Tooth and add the Lattice Modifier, select your Lattice.

You can now edit the Lattice vertices and deform the Tooth.

Feel free to add additional Lattices and have the deformations compound.

You will have to investigate how best to do all this in Python, but hopefully this gets you started.


few hotkeys not working and doing something else So as the title said there are few hotkeys which are not working in blender, I am using version 2.83 in windows. Whenever I press hotkeys such as Ctrl+1 or 2 or 3 etc., in order to apply subsurf modifier on the selected object I just go in front view or view rotates up or in side view respectively. Also in sculpt mode when I use hotkeys including number to switch brushes my view only changes respectively, is there a fix for the same.

It sounds like you have Emulate Numpad turned on, toggle it and see if that clears up the hotkeys for you.


Why does the mesh look so strange? It seems to be related to the mesh texture~

link to mesh

The mesh has custom normals.
Uncheck "autosmooth" in the property panel (object data tab, normals section).


Why are my videos rendering in black and white? I am making an animation and when I render the animation, it turns out black and white.
I have no idea why this is happening.

Sounds like the output might be set to BW in Render settings > Output. Make sure it is set to RGB instead (or RGBA if you need the alpha channel):


Add peg hole to each face of a model Is there a way to add a peg hole to each face of a model? There are a lot of faces, so it would be best if it could be done as one action (perhaps using a script).

Note that faces are not all aligned. They do all point towards the origin, though (meaning that the line between the origin and face's center is perpendicular).

Here's a picture of the model I want to add peg holes to using blender:

Steps:

Select all Faces.
Press I twice to Inset Individual Faces.
Set size of Inset with your mouse or by entering value.
X > Faces to remove newly created ones.

(optional) You can add Solidify modifier.


How can I remove this seam down the middle after mirroring? Yo,

I'm new to Blender and I'm trying to make a humanoid figure. I followed this tutorial. I have completed one half of the character but when I mirror it there is a seam down the middle. Clipping is on, too, and all the answers I found are to do with turning it on. I'm stumped.

Thanks in advance,

M~

I think the vertices that should be in the middle of your character, are slightly beyond the axis, like that :

In Edit mode, select all your vertices (A) and move them to the left* until they "stick" to the mirror axis (this is what Clipping does).

*left in my example, maybe right in yours


How can I colour/paint my object? Very very very new to blender but is it possible to colour different parts of an object? (.obj import from fusion). if so; how do I change the colour of different areas of my object?

Select your object, and go to the shading tab. Press Shift>A and then click Texture>Image Texture. Press new on the image texture node and put the resolution. (It's 1K by default, so click and drag down on the dimension values and multiply by 2,3,4,5 however high res you want it.) Once that is done, connect the dot in front of the clour input in the image texture node into the dot before the Base Colour input of the Principled BSDF node (You can connect the dots by clicking on one and then dragging it on top of the other dot you need to connect). Once that is done, switch to the Texture Paint tab. In texture paint you can press Alt>S and specify a file folder to save your image. If you don't do that and close blender even after saving the .blend file, your pianting will be lost. Make sure to paint directly on to your mesh. To paint just select a colour and start painting. The rest of the features can be learned by tutorials on platforms like YouTube.
Note: I reccomend that you watch a UV-Unwrapping tutorial on YouTube and UV Unwrap your mesh before this procedure.


How to make custom hotkeys? Is there a way to make a custom hotkey for specific functions?
Like to solve my problem here:
I’m working on a piece, its a replica and I have many references setup in some collections and I need to hide/unhide the collections all the time. I do it by hitting the relevant checkbox in the object browser list. Can I somehow hotkey that specific checkbox?
If coding, IK how to code, but I do not know how to get console or script in blender, or at-least I need a ‘pointer’ to get started.

You can add a custom shortcut directly on most commands, using the assign Shortcut option.
In this case select the collection, press on the context menu (F3) look for the command and right click. A new menu will allow you to assign a shortcut directly.


How to make an inventory system for the Blender Game Engine I want to make an inventory for an adventure game. The game is first person and the items to be collected will be used later in other parts of the game. To give you an idea, the game is something like an HOPA (Hidden Object Puzzle Adventure) game, here is an example:

I have already watched tutorials available on YouTube but they don't seem appropriate. The game is a point and click so no keyboard will be used.

Okay, what you are asking is quite a big task and you first need to make a saving function so that items are saved for later on and don't just disappear. That needs python, and luckily this exists: https://www.youtube.com/watch?v=ffws4ijjk-0

Then you need to make a second scene that has the HUD, which is basically just an image of some boxes where items would go. Then you would add an empty in each slot, and then set it up so that when you pick up an item (or interact with an item) the empty would add the object into the HUD slot where the empty is located. And then you would make a property for each item you can possibly get, so that when you have the item it can add 1 to the property. When you use the item, it would take away the 1 from the property and get rid of it from the HUD, by ending the object that represents the item. Finally, you need to add a property that keeps track of how many items you have. For example, if the HUD could hold 6 items, then you need to set it up so when you try to pick up a 7th item, it would not let you because the value is 6 already. Once this value is decreased to 5 or less, then it would let you pick it up.

This is mostly just my ideas and I have't actually ever done this, but I strongly believe it would work. It might be a bit tricky setting up which empty adds the HUD object though.


cuda binary kernel for this graphics card compute capability (6.1) not found I need help. I just bought an Alienware aurora r5 and it has a nvidia geforce gtx 1070 founders edition. I'm getting this error what do I do?

I'll just quote  Developer Thomas Dinges' (dingto) post

In order to support Pascal cards, we need to build kernels with the CUDA Toolkit 8. There is only a RC of the CUDA Toolkit 8 available yet, and so far only for registered developers. https://developer.nvidia.com/cuda-toolkit
As soon as the final release is here we will build Blender with sm_61 kernels.


alternatives for operator's report() function? it seems that the report() function of Operator type lets all other routines finish  before it actually reports. this makes it useless in many instances: for example, when reporting progress on baking (I have abandoned the idea of a progress bar and merely want to show a message: 'baking ith map out of n maps'). However, this message would always come at the end. Are there ways to supress this behavior and output a message instantaneously?
In Excel VBA, there's DoEvents() built-in function. It lets all processes freeze until the ongoing processes finish

probably, such thing as reporting to user interface must be the easiest thing to do in any API but... this is life. anyways, here's what I have found for myself.

Idea in short: so, when blender script runs, Blender does not redraw screen any longer. So I start drawing text into a particular window with blf. Because Blender is not redrawn while the script runs, you actually don't see it. So I force redrawing. And then you can see the text. Don't know how robust that solution is but anyways.

This is the function which starts drawing:

def UI_report_start(message, space_type):

    """
        draws specified message, in the specified space_type. space_type is a value in:

        ['Image Editor',
        'Node Editor',
        'UV Editor',
        '3D View']

        returns the draw handler and the space type
 for later deletion
    """

    # the drawer function
    try:
        blf
    except:
        import blf

    def draw_message(self, context):
        blf.position(0, 15, 30, 0)
        blf.size(0, 20, 72)
        blf.draw(0, message)

    if space_type == 'Image Editor':
        handler = bpy.types.SpaceImageEditor.draw_handler_add(draw_message, (None, None), 'WINDOW', 'POST_PIXEL')
        return handler, space_type
    elif space_type == 'Node Editor':
        handler = bpy.types.SpaceNodeEditor.draw_handler_add(draw_message, (None, None), 'WINDOW', 'POST_PIXEL')
        return handler, space_type
    elif space_type == '3D View':
        handler = bpy.types.SpaceView3D.draw_handler_add(draw_message, (None, None), 'WINDOW', 'POST_PIXEL')
        return handler, space_type
    elif space_type == 'UV Editor':
        handler = bpy.types.SpaceUVEditor.draw_handler_add(draw_message, (None, None), 'WINDOW', 'POST_PIXEL')
        return handler, space_type
    else:
        raise Exception('UI_report_start', 'Incorrect Window type specified')

this is the function that stops drawing:

def UI_report_stop(reporter, space_type):
    """
        stops drawing the report
        the drawing handler and the space type must be input
    """

    if space_type == 'Image Editor':
        bpy.types.SpaceImageEditor.draw_handler_remove(reporter, 'WINDOW')
    elif space_type == 'Node Editor':
        bpy.types.SpaceNodeEditor.draw_handler_remove(reporter, 'WINDOW')
    elif space_type == '3D View':
        bpy.types.SpaceView3D.draw_handler_remove(reporter, 'WINDOW')
    elif space_type == 'UV Editor':
        bpy.types.SpaceUVEditor.draw_handler_remove(reporter, 'WINDOW')
    else:
        raise Exception('UI_report_stop', 'Incorrect Window type specified')

this is a hypothetical function taking much time to complete and reporting is embedded into it:

def execute(self, context):
        handler, space = UI_report_start("does it have to be THAT difficult?!?!#$", '3D View') # <--- this starts drawing blf but you don't see it yet!
        bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1) # <--- this is redrawing the screen and you see the message!
        # from now on redrawing stops but the message is still 'frozen' in place and you can see it!
        for i in range(0, len(bpy.data.images['heavy'].pixels)):
            bpy.data.images['heavy'].pixels[i] = random()
        UI_report_stop(handler, space) # <-- this removes the message!
        return {'FINISHED'}

as you can see, it does not draw the progress bar, only a message but I can live with it.

You can also update the screen more frequently but redrawing and drawing blf takes resources, so do it only once in a while


Bone rigging incorrectly I am making a rigged character. When the wrist is lifted up, the whole arm should move, and the torso should not. The correct 'connecting line' from the wrist to the collarbone (may be hard to see, click on the image and it is clearer):

however the opposite arm's wrist is connected to the pelvis so that when it is raised the whole character tips:

How do I fix this, and connect the left wrist to the left collarbone, like the right?

Thanks in advance.

here is my .blend file:

EDIT: It turns out you have the Auto IK option enabled. To turn that off, press N with your mouse in the 3d view to open up the sidebar and go to the tools tab.

Uncheck that and you are good to go!

EDIT: The information below did not answer the question directly, but may help others as it can cause a very similar issue.

I looks like you just need to adjust the Chain Length in the IK constraint, found here:

What this does is tell Blender how many bones in the chain to use. The default is 0, meaning the whole chain is used, in your case up to the pelvis. I think you would need to set yours to 3, but you'll be able to see the line update as you change the length.


bpy.context.selected_objects: Context object has no attribute "selected_objects" If creating a basic operator and reading the list of selected objects upon execute I get the correct response:

class foo(bpy.types.Operator):
    bl_label  = "foo"
    bl_idname = "foo"

    def execute(self, context):
        print(context.selected_objects)
        return {'FINISHED'}

However I need to read the list of selected objects elsewhere, outside of the Operator, from within a subclass of threading.Thread.

Calling bpy.context.selected_objects anywhere else results in an error, as it doesn't exist.. which is both puzzling and irritating.

Has anyone else dealt with situation before, not being able to access the list of selected objects. Is there by chance another method?

I have thought about creating an operator that would return the list of selected objects if invoked through python code... but I do not understand operators fully (yet) and thus do not know if that is possible.

The context is dependent on quite a number of things, and not every context holds the scene's set of selected_objects. A safer and more consistent way to get the selected objects is this:

selected_objects = [ o for o in bpy.context.scene.objects if o.select ]


Adding specific information to file output Is there a way to add extra information to the filename that is created by Blender? For example, if  I'm rendering images of an animation, is there a way to have Blender automatically add something like sample size to the file name it creates? Something like %samp?

I'm trying to end up with something like

C:\Blender\rendered\images\my_animation_00001-2000.jpg

Where 2000 is the sample size that was used for that particular image.

You can add an application handler to be run before rendering that sets the output filename with the desired information. You can use python's string format to fill in the filename from a template string.

import bpy

def set_filepath(scn):
    scn.render.filepath = '//renders/animation_{0:04}-{1}.jpg'.format(
            scn.frame_current, scn.cycles.samples)

bpy.app.handlers.render_pre.append(set_filepath)

By pasting this into a text block in blender and adjusting the filename for the file, it can then be setup to run when the blend file is opened so that it will always be available when using the file.

Note that the handler will set the filename, that means you adjust the filename in the script - not in the render settings.


Soft body for a round character I wanted to give a try to create and animated a character i made back in the day and there's a few thing i would like to know to make easier to create it.

I completed the body with a few problems with the edges which i can take an idea.
Where i would like to know is if there's an easier way to "soft" the body to look like almost a perfect sphere instead of use the proportional editing everytime on each vertice or using sculpt.

PSD: The pike on the third image is intentionall. Last images on sculpt mode to clarify( need the body to be smoother like a round sphere)

You can use the To Sphere transformation to make sets of vertices more nearly spherical: https://docs.blender.org/manual/en/latest/modeling/meshes/editing/transform/to_sphere.html

You can also use Smooth Vertex to smooth out sets of vertices, as unintended jaggedness is a common problem when trying to achieve smooth features in a complex mesh:

https://blenderartists.org/t/is-there-a-way-to-smooth-out-the-vertices-in-blender/518443

I would, however, add this: when a key feature of a primitive form (like sphericity) is desired, it is usually best to start from a primitive (like, well, a sphere) that already has that form, and only gradually modify those features of it that you don't want to maintain. Working in the opposite direction (complex form to primitive features) is often considerably more difficult.


Transformations of instances of collection - problem with "origin" I have serious problems when I build complex machines from instances of collections.

Consider e.g. wheels/tracks of a Tank: Each wheel is instance of a wheel template which is a  collection of individual meshes (rim, axel, disk, damper ... )

This instance is multiplied 12x (6 wheels on each side), and then transformed by translation (offset between wheels in the track) and scaling x=-1.0 to get mirror symmetry (left track, right track)

But If I move the whole thing everything breaks appart, as each instance moves in different direction according to different pose of its origin.

Before I was working with "Softimage XSI" and there were many tools to solve this

Global / Local and COG mode of transforms (using different coordinate system)
Tools to modify origin of collection without moving the meshes inside the collection

I cannot find such tools in Blender 2.8

I don't think your coordinate space is at fault per se, I think you need to mess with your operating sets.  By description alone it sounds like you have your active Transform Pivot to be "Individual Origins", "Median Point" sounds like what you want.

You can mess with your working translation space by clicking the "global" directly to the left and choosing something else.

Something else you might want to do is parent all your pieces of your object to something, either the root mesh, an armature, or an Empty.  This will allow you to conveniently move and animate the whole set by moving the parent.

Lastly: if you mirror by duplicating and scaling by -1, you will also need to flip the normals depending on usage.  It is oftentimes better to use the Mirror modifier instead, it is more convenient and stable.


image rendered in blender differs from image saved to disk I have my rendering set up like so:

the idea is to combine the normals and the depth in to one texture which i can use in a game i am making. I could do 2 separate images, one for normal and one for depth, but it seems to be like i should be able to combine the 2 using the alpha channel to contain the depth information.

When i render it i get what i expect. I can click the rendered image in blender to see the colour and alpha values all over it, and they are consistent with what i expect. The row of boxes looks like it changes colour as it becomes more distant (because of depth/alpha) but the sampled rgb values are steady. The very near box is almost entirely transparent and the rgb values present and correct (i hope!).

(White cross marks where i was clicking)

When i save that image and edit in gimp everything has changed. With the row of boxes, instead of the rgb values remaining steady and only the alpha changing, both rgb and alpha changes. And the very near box has lost all rgb information. It's now just white with 1% alpha.

What do?

Edit:

If in blender i render the image, then go to the image menu and chose save as, i get a checkbox "save as render" on the left. If i uncheck this it works as expected (i think... not thoroughly checked it).

... just checked it and this isn't solving it. It keeps colour values in the extreme-alpha case, and it keeps colour values internally consistent, but the values themselves are all wrong compared to what the blender render window says they are.

Further edit:

It seems if i export as EXR the values are all correct. I can than convert to PNG and the values are all correct. Most peculiar. Would be marvellous if i didn't have to do all that extra work and it just made the PNG in the first place :)

Strangely enough it appears to work if you convert to premultiplied alpha:

This messes up the RGB values in blender, but the exported png then works as desired.
I'm not too sure why this works the way it does (I'd expect the opposite), but a lot of alpha handling in blender is rather odd..


Compositor doesn't affect Alpha plane In this render, the butterfly is an Image imported as plane with Alpha.
The non-transparent parts of the image have an Emission material with 18 Strength.

The Sphere above the butterfly has Emission material with 18 Strength.

However, once composited, the Glare effect from the Compositor seems to only work on the Sphere and not on the Alpha PNG.

How can I change my Node setup so that the Image-Plane also be taken into consideration by the Compositor?

I think the short answer is that the image plane is indeed being taken into consideration.  I checked that by altering the colors of your image so that the butterfly is white instead of pink.  In this case, the glare node does affect the butterfly.

I think your best bet is to really crank up the strength of the emission shader for your butterfly (I tried 200), which will give you the glare. If you want more control over the color of the butterfly image itself, you could experiment with render layers--use one layer for the butterfly image to be "glared", another layer for the color to be composited over top.


What is the difference among Alpha Over / Alpha Under / Over Drop? They are three modes in VSE. I think I know what the Alpha Over and Alpha Under do. But I'm still puzzling when trying to understand what the key difference the Over Drop is from the other two. I've looked them up in BlenderWiki here, but still no clue. Can any one tell more about this mode? Illustration or blend file would be much helpful here.

To my surprise, my following report here confirmed that there was something wrong here since 2.4x. Thanks to psy-fi (Antony Riakiotakis), the developer who has helped to fix it in commits here and here.

Now it makes sense that, as Wiki said, Over Drop is actually a "mixture" of Alpha Over and Alpha Under. In other words, the first selected strip would be the foreground (same as Alpha Under), while the fade value also controls this foreground (same as Alpha Over).

For easy understanding:


Scale along Z-axis only I was trying to scale this tilted cube along global z-axis:

I scaled it by twice with S+Z, the result ended up being:

I was baffled as clearly not only it scaled in z, but also in y.

Please help me comprehend this behavior. What does locking z-axis actually do? Why doesn't the result look more like:

?

As far as I know object scale can only be done along its own axis (X, Y and Z).

So if we have this cube orientation (rotated 45 degrees around Y for instance):

it cannot be scaled in the global Z axis only.

That's why we have this result:

So to obtain the wanted diamong shape, you need to either:

Apply rotation CtrlA and choose 'rotation'. Then scale along global Z:

Or:

Enter edit mode, then scale along global Z:


Help! Most of my project doesn't show, but still renders Please see the attached video, I've got no clue what happened.
https://youtu.be/Y7li1KvwnL4

It might be due to the clipping border as Serge mentioned above, you can click on View > Clipping border or use the ALT + B hotkey


delete shapekey keyframes with python I thought this would be straight forward, but I'm still struggling to learn the API. I need to delete keyframes for shape keys on the selected or active objects (either or really at this point) For whatever reason this doesn't seem to work for shape keys.
import bpy

context = bpy.context

for ob in context.selected_objects:

    ob.animation_data_clear()

Anyone any pointers?

Object animations are at object level (like location).
Shape keys animations are as its own data level. Add the line below:
import bpy

context = bpy.context

for ob in context.selected_objects:
    ob.animation_data_clear()
    ob.data.shape_keys.animation_data_clear() # <<<<


Why are my donuts appearing lIke this So a few months ago I did the donut tutorial in cycles, then I opened it in eevee. Unfortunately,there appears to be an outline. I have the Eevee toon shader add on, but I can't find it in my preferences, so I'm confused as to how there are outlines. My nodes are similar to the cycle nodes, but with the principled shader.

In Blender the outline called freestyle, you can find it in the properties window under the render tab.


What is the order of importance of the pc components to be able to sculpt with really many polygons in blender? I refer to RAM, GPU, CPU, I want to know which is the most important component to invest more in that than in the rest, I want to sculpt fluidly since that's more fun.

CPU(most important to frequency) and RAM(not that relative).

Yet, Blender is open source application, and it might not be a really good one to do specialize job like sculpting.

The things you referred are not the most important thing in fluidly sculpting. Most of the time, a good algorithm and code structure will make a huge difference. And those good thing is not likely include in Blender since there is too many aspect Blender need to care about, and there is not that much resources Blender Foundation can use to develop it.

If you really need and want to have a good experiences in sculpting, try some specialized application, e.g. ZBrush


Smooth the join between 2 separate meshes I have a body mesh where I separated the arms into another object to make UV mapping easier, but now the join between the torso and arms has this very noticeable line/bump.

Is there any way to smooth the gap? I would like to keep both the torso and arms as separate objects, but would also like to keep the cut between them smooth.

Thank you for your time.

I don't exactly understand what you are trying to achieve by separating the limbs from the body but IMHO there is no way to get rid of the line.

If you have two separate objects or even two sub-meshes that aren't connected, you will always have a visible line where they seem to be connected. This is just how shading in every renderer (at least the ones I know) works. And that's the reason why almost every 3D artist will keep limbs connected to the body.

Besides that your 3D Viewport is set "Solid" shading. In this mode your scene gets a basic material with basic lightning setup. That setup will make the line even more prominent compared to "Render View" with an actual light setup and a material applied. It might help a little, but you will never get rid of the line entirely.


Can't get my model out of wireframe mode I'm new to Blender and this site, so I apologize in advance if I'm not following any of the proper etiquette.  I'm no artist, but I'm trying to learn Blender so that I have some programmer art for me to work around in Unity.

I followed a tutorial for making a basic human model, I rigged it with rigify, and now I'm starting to export it following yet another tutorial.  The thing is, when I was trying to rig the model, I couldn't get the model to go transparent so that I could see the bones inside the model.  Eventually, I managed to get it into wireframe mode, but I can't get it back into solid mode.

It's probably just a display thing and not a property of the model itself, but I want to be sure.  I'm looking at the display options under the "Figure" pane in Blender, and none of the Display check boxes are checked, including the one that says "Wire".  I don't want to import a plain wireframe model into Unity, and even if that doesn't happen, this is functionality of Blender that I should really know anyway, so I'd appreciate any help that anyone has to offer.  If necessary, I can upload the .blend file, but I'm not sure what site people would prefer that I upload it to.

You have the maximum draw type of the mesh set to wire in Object > Display:

This setting limits the drawing of that object to a wireframe, regardless of other settings (it shouldn't have any affect on exporting).

Set it to textured or solid to see the faces.


Why can't I add an edge loop? I'm trying to add an edge loop on the first raw of the vertical squares. Why doesn't it appear on the last one and how can I fix this? Thanks.

Edge loops work only in clean quad topology, when they reach a triangle or a N-gon (your case) they stop. To add one more edge to your loop you can use the knife tool (shortcut K), then select the last vertex of the loop and click where you want the final vertex.


Is object data, as accessed by Python, not committed until you exit edit mode? I am trying to understand accessing object data from Python, in particular vertex data. In this simple test:

Make a new Blender document
In the scripting interface, make a function to display vertex information (as suggested here):

def showvertices():
  for item in bpy.data.objects:
    print(item.name)
    if item.type == 'MESH':
      for vertex in item.data.vertices:
        print(vertex.co)

Now, typing in showvertices() in the Python console seems to display the correct  information for the default cube:

Camera
Cube
<Vector (-1.0000, -1.0000, -1.0000)>
<Vector (-1.0000, -1.0000, 1.0000)>
<Vector (-1.0000, 1.0000, -1.0000)>
<Vector (-1.0000, 1.0000, 1.0000)>
<Vector (1.0000, -1.0000, -1.0000)>
<Vector (1.0000, -1.0000, 1.0000)>
<Vector (1.0000, 1.0000, -1.0000)>
<Vector (1.0000, 1.0000, 1.0000)>
Light

So far, so good. Now type:

Tab -> enter edit mode
A -> select all
GX2 (Enter) -> move all vertices 2 units in the X direction

This appears to work, the cube moves to the right (from the front view) and the X coordinate of the top-right vertex is shown as 3m instead of 1m as it was before:

However, typing in showvertices() in the Python console still displays the original information, not the updated positions:

Camera
Cube
<Vector (-1.0000, -1.0000, -1.0000)>
<Vector (-1.0000, -1.0000, 1.0000)>
<Vector (-1.0000, 1.0000, -1.0000)>
<Vector (-1.0000, 1.0000, 1.0000)>
<Vector (1.0000, -1.0000, -1.0000)>
<Vector (1.0000, -1.0000, 1.0000)>
<Vector (1.0000, 1.0000, -1.0000)>
<Vector (1.0000, 1.0000, 1.0000)>
Light

Now if I press Tab to go back to Object mode and type in showvertices() again in the console, the vertex information is now updated:

Camera
Cube
<Vector (1.0000, -1.0000, -1.0000)>
<Vector (1.0000, -1.0000, 1.0000)>
<Vector (1.0000, 1.0000, -1.0000)>
<Vector (1.0000, 1.0000, 1.0000)>
<Vector (3.0000, -1.0000, -1.0000)>
<Vector (3.0000, -1.0000, 1.0000)>
<Vector (3.0000, 1.0000, -1.0000)>
<Vector (3.0000, 1.0000, 1.0000)>
Light

So my question is, why does the information reported by the Python function not show the new positions until I leave edit mode? Is there a cached copy of the vertex information, and the "real" data is not updated until exiting edit mode?

This was with Blender 2.80.57, however the same behaviour was observed in version 2.79.

I think you just need to call the update_from_editmode () method of the object.
https://docs.blender.org/api/2.79/bpy.types.Object.html?highlight=update_from#bpy.types.Object.update_from_editmode


Animate camera alternating constrained paths all, I am new to blender, so sorry if my question seems dumb.
I just animated a camera to follow a bezier path. Now, I need to keep animating the camera, but I would like to either free the camera from the path or to follow a different path.
So, this is my question: is it possible to animate camera alternating among different bezier paths?
Thank you!

Yes you can use multiple paths.
The influence value in the follow path modifier can be animated. A value of 0 means that the modifier will have no influence on the object's trajectory.


How to Speed Up Blender 2.80 EEVEE Viewport? I am trying to test Blender 2.80 and get used to it. It seems to be the most unique Blender update that I've used. I was able to get very fast interaction in Blender 2.78 Internal viewport using GLSL shading but in 2.80 the viewport is slow and unresponsive. Is there a way to turn on backface culling or other performance-enhancing options

I am trying to move on from OpenGL rendering PBR-based scenes in the Internal engine and move to a fully PBR-based rendering system called EEVEE.

Are there any backface culling or other features that are similar that will enhance my experience?

I have an Intel i5, Intel HD Graphics 3000, 8 GB RAM, installed on my Lenovo Thinkpad X220 Tablet Laptop (not actually a tablet).

2.8 builds are snapshots of current development and are intended for testing a preview, not actual work. As parts, such as Eeevee, are not complete, there will be performance issues and bugs, and some features that are not yet present.

Given all of this, I would not yet be expecting any speed or performance features. And I wouldn't be worrying too much about their absence yet either.


Texture Animation broken in version 2.78? I'm trying to switch between two pictures during an animation and don't want to go to all the complexity of UV editing.  I found the following instruction which almost works in version 2.78, but not all the way?  Here's the link:
https://renderedsmoothie.wordpress.com/2013/10/07/keyframe-texture-change-in-blender-internal/

As you can see in the picture below, for the first half of the animation (screen shot on left), I've told texture to use the watermelon image.  The watermelon image shows up in the preview on the left, but the rendered view shows an apple as does the right picture in the texture preview.

In the second half of the animation (screenshot on right), the texture editor knows that an apple is to be displayed as seen in the left picture of the texture preview.

Do I have a setting wrong?  Why would texture preview show two different pictures?  Is this method of animation broken in Blender version 2.78?  Is there a version of Blender that works with this very simple and easy method of changing a picture during an animation?

Thanks in advance for any help or advice.

You have keyframed the texture list not whether the texture is enabled. In the tutorial images you can see that the checkboxes turn yellow, not the entire list background.

It seems a small detail but the mouse needs to be right over the checkbox to the right when you press I so that only the checkbox gets the keyframe. You can also right click on the checkbox and select Insert Keyframe.


Can I remove weights/vertex groups for specific vertices? I have done a rough head swap on a model. Tilting the head side to side makes my neck kind of protrude from my body and clip into the body and necklace. The problem is that that the bottom half of the neck is animated or weighted or whatever, and I'd rather it not be, I'd rather it just stay stationary.

In short, the thing I want is for the top half of the neck to stay animated and the bottom half to be still. Any help on how to do that? I have no idea how to make vertex groups or weight paint, etc.

Remove vert(s) from vertex group.

In edit mode, select the verts you want removed from group. Click the remove button on the Vertex Groups Edit Panel to remove from the active group.

Here is a sample where all the vertices of the default cube are added to the "Group" group.  The bottom face is selected and its verts removed from the group.  I've turned on the show weights in the mesh display panel to make visualizing the group easier.


Strange black lines in import of FBX file from Maya 2014 We tried to import an FBX file and it shows very strange black lines. Are these normals? Is it going to cause an issue? Also, trying to zoom in into this model makes it disappear. Just can't get close enough to analyze anything.

Those lines indicate a parent-child relationship.
It's actually a good thing, because it means the hierarchy of your model will still work in Blender! :)

If you find these lines annoying, open up the properties sidebar of the 3D Viewport by hitting N, open up the Display Panel and disable "Relationship Lines".


Extrude Individual Polygons Proportional to Polygon Area I have a selection of polygons that I plan to extrude individually, but I need the distance each polygon is extruded to be proportional to the area of the polygon, so that larger polygons are extruded farther than smaller polygons.

I figure I loop through the active selection of polygons, get the area of the polygon, use the Extrude Individual and Move tool with the extrusion distance equal to the polygon area times some scale factor.

But I'm not sure where to start — I assume the selection of polygons must be accessible through context, though I haven't found it yet. And I'm not sure how to use the bpy.ops.view3d.edit_mesh_extrude_individual_move() tool either, but that too seems like it should be very straight forward, I just can't seem to find my footing.

This also seems like it would make for a good option on the extrude tools. To get really fancy we could even allow for a user entered formula to determine the relationship between the polygon area and the extrusion distance, which I suspect could lead to novel results. Recursive extrusions with arbitrary or random tilts or scaling could make for an interesting tool too, though all that is way beyond what I'm looking to do here.

Here's a bmesh script with adjustable factor (in redo panel):

import bpy
import bmesh

def main(self, context):

    me = context.object.data

    if me.is_editmode:
        bm = bmesh.from_edit_mesh(me)
    else:
        bm = bmesh.new()
        bm.from_mesh(me)

    ret = bmesh.ops.extrude_discrete_faces(bm, faces=[f for f in bm.faces if f.select])

    for f in bm.faces:
        f.select = False

    for f in ret['faces']:
        f.select = True
        vec = f.normal * f.calc_area() * self.factor
        bmesh.ops.translate(bm, vec=vec, verts=f.verts)

    #bm.normal_update()

    if me.is_editmode:
        bmesh.update_edit_mesh(me)
    else:
        bm.to_mesh(me)

    #me.update()

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "mesh.extrude_faces_indiv_area"
    bl_label = "Extrude Individual Faces (area-proportional)"
    bl_options = {'REGISTER', 'UNDO'}

    factor = bpy.props.FloatProperty(name="Factor", default=1, soft_min=-100, soft_max=100)

    @classmethod
    def poll(cls, context):
        return (context.object is not None and
                context.object.type == 'MESH')

    def execute(self, context):
        main(self, context)
        return {'FINISHED'}

def menu_func(self, context):
    self.layout.operator(SimpleOperator.bl_idname, text="Individual Faces (area-proportional)")

def register():
    bpy.utils.register_class(SimpleOperator)
    bpy.types.VIEW3D_MT_edit_mesh_extrude.append(menu_func)

def unregister():
    bpy.utils.unregister_class(SimpleOperator)
    bpy.types.VIEW3D_MT_edit_mesh_extrude.remove(menu_func)

if __name__ == "__main__":
    register()

Note that it's pretty slow unfortunately :(

I worry this comes from the translate op for each face (or vec calculation?), don't think this can be made much faster.


Iterating vertex of every frame in Blender I built a human model in Blender first and then loaded a bvh file into ths model. Now I have 200 frames which show a running scene in Blender. I can iterate every frame. I want to get all the vertex coordinates from the 200 frames. I did it with the following code segment, but, want is to get the vertex coordinates of the original human model.

Can someone help me?

for frame in range(scene.frame_start, scene.frame_end):
    scene.frame_set(frame)
    scene.update()
    bpy.ops.object.mode_set(mode='OBJECT',toggle = True)
    obj = bpy.context.active_object
    loops = len(obj.data.loops)
    verts = len(obj.data.vertices)
    mat = bpy.context.active_object.matrix_world
    vertex = [mat * verts.co for verts in obj.data.vertices]
    the_file = "pointCloud_f" + str('{:03d}'.format(scene.frame_current)) + ".ply"
    print("loading "+the_path + the_file+'\n')
    with open(the_path + the_file, 'w') as wFile:
        wFile.write(headerOfPLY)
        count = 0
        for vcol in obj.data.vertex_colors:
            colors={}
            for i in range(loops):
                v=obj.data.loops[i].vertex_index
                c = vcol.data[i].color
                colors[v]=c
        for j in range(len(vertex)):
            wFile.write('%f %f %f %d %d %d \n' %(vertex[j].x,vertex[j].y,vertex[j].z,int(colors[j].r*255),int(colors[j].g*255),int(colors[j].b*255)))
    print("writing completed!")
    wFile.close()
return {'FINISHED'}

Shape of frame 1 of the scene

Shape of original human model

The mesh data always contains the original locations of vertices. Not sure if it is the only way but you can use object.to_mesh to get a copy of the mesh data that is deformed.

import bpy

obj = bpy.context.active_object
scn = bpy.context.scene

mod_mesh = obj.to_mesh(scn, True, 'RENDER')

for v in mod_mesh.vertices:
    print(v.co)

Note that this creates a new mesh object, so as you are iterating over each frame you will want to remove each copy as you go with -

bpy.data.meshes.remove(mod_mesh)


Instance Rotation over Lifetime I want to have instances rotate randomly over time, seems an easy thing to code, how about it?

I'm trying to make a sparkly / glittery surface to render and wrap around a human face model, or maybe just have instances of glitter rotate on the surface of that model.

You can use modifiers for it in the graph editor tab.
https://docs.blender.org/manual/en/latest/editors/graph_editor/fcurves/modifiers.html


World Space in transformation constraint not working as expected Relatively new to constraints and trying to make it so that moving the cube along the X axis makes the monkey rotate along the world's X axis.

No matter what kind of combination I choose for the target and owner spaces the head keeps rotating along the local X axis.

The only solution I've found is applying the rotation but what if I don't want to?

Use the Y rotation instead, change X rotation back to 0, change Y rotation to 90, then change the Y >> Y box to X >> Y. Now suzanne will rotate on the world X axis ( her Y axis).


Splitting a mesh at the end of a shape key-based animation I am using a series of absolute shape keys to progressively deform a mesh as shown below. Eventually, I want the soap bubble-like spheroid to detach from the originating plane and move away.

My naive approach was to create a further shape key, cut through the mesh at the last point of contact between the bubble and the original surface, and seal each of them separately.

But of course that does not work, as the split is really applied to the underlying mesh, not just to the specific shape key, so it is visible at each step, not just at the end.

How do I proceed from here?

Consider switching from 1 mesh to 2 meshes if convenient.  Render or Not Render is animatable with keyframes.  Combined Mesh is replaced with Floor Mesh and Floating Bubble Mesh.  Advantage Seams are avoided. Disadvantage Shape Continuity efforts will be needed.
Consider your mesh as always 2 separate submeshes if the Viewer cannot see seam vertices which are joined for part of the animation.  Shrinkwrap Modifier and Warp Modifier.
Consider Metaballs with reservations.  Explained Below.
Consider fluid simulations.  Larger Compute Time Demands.

Two Separate Meshes
Preliminary Results.
Warp Modifiers. Shrink Wrap Modifier.  No Shape Keys Yet.

Metaballs

Lower Portion Connected in image below.

Lower Portion Disconnected in image below.

I wrote with reservations because I have seen metaballs stop working at the most inconvenient times and simple conditions.    Then they work under other conditions such as particles.


Creating and adding a texture to a material (blender 2.8) I'm fairly new to blender 2.8 and I was wondering how to add a texture that I've created to a material.

If you want to add a texture to any material, simply go in to your shading window.
--> choose add (shift+A)--> image texture --> plug that in to a principled BSDF tats connected to the material output.
After that you can simply open up the texture you want and enyoy yore new texture.

P.S look upp some youtub tutorials on the topic


Explain N-poles and E-poles? what is N-poles and E-pole?
I can not understand it.
And i read the some blogs they said to E-poles has 5 edges and N-poles has 3 edges.

 -

This ,and more, is on the Topology Guides site:

  E-poles are the most common pole type and consist of five edges intersecting at a single vertex. E-poles are most notorious for appearing when extruding faces on a mesh and for forming unwanted flat “corners” within the topology when edge loops meet or turn.  E-poles are also what form concave corners in hard surface models.

and

  N-poles are vertices that consist of three intersecting edges. This type of pole is far less common, but often appearing around poles or inset parts of a mesh. In organic modeling, this pole is often known as the “nose” pole, since N-poles are often necessary for modeling the base of the nose. N-poles are also what form the corner of a cube or most other convex corners.


Blender 2.8 alt f (focus on object) not working in blender 2.79 shortcut alt f which navigates your view to the selected area doesn't work in blender 2.8 has the shortcut been changed or removed?

In 2.79, ⎇ AltF focussed on the mouse position by default while the Shortcut for view selected is NumpadPeriod.

In 2.8 they shortcuts are

View Select NumpadPeriod (unchanged)
Center View to Mouse ⎇ Alt MMB

You can change the mapping in the User Preferences.


Y and Z Keys are switched in 3D View I use both, a German and a UK keyboard layout. When I use the German layout the Y and Z Keys appear swapped in the 3D View and behave like in the UK layout. Inside text entry fields however the layouts behave as expected.

I use 2.78c on Ubuntu 17.10

Is this a bug, or a feature to ensure shortcut consistency? I find it quite confusing, that I have to mentally swap the Y and Z axes with the German layout.

I had this same problem! originally I thought it had something to do with me pressing Ctrl+I or something like that, but I later realized I had changed the keyboard from English to German. Once I switched it back everything was fine again.


How to enable or disable panels with the click of a button When I click on the "new" button, some panels that were disabled appear. I read their code, but I didn't understand. How do I get certain panels to appear when I click a button?

It's a panels poll method
The panels are defined and sitting there polling away, waiting to "show".
The poll classmethod of a panel returns true only when the required context (or otherwise related) conditions are met
Poll method for custom panel
Hide Panel With Python ("A Duality Duplicate")
In example displayed in question :
(Speculating haven't checked (...lately), Turn on Developer Extras in settings, so can right click on 99% of UI, view source and see how its done... a common practice is to)
Have one master materials panel, that always polls.  In this case the material slots, no panel header, has the option to add a material.
All the others seen are , subpanels ie Panels with their parent set to the master panel, or others in the space, that have poll requirements met.
In the properties space, there is a sort of "polling" option available by setting bl_context of the panel class to match that of the properties space context, matching the 'OBJECT', 'SCENE', 'RENDER' tabs.
Creating new tabs in properties panel
How do I add a panel to Object Properties?
These subpanels only poll when there is a context.material (In properties space there is a material context member, most likely context.material == context.object.active_material
When all the panels require the same poll it is common to see a mixin base class
class SomePanelBase:
    bl_context = 'MATERIAL'
    @classmethod
    def poll(cls, context):
        return context.material is not None

And for any defined panel
class MaterialFooPanel(SomePanelBase, bpy.types.Panel):
    ...

making any such defined panels only display if there is an active material.


Change the color of an empty? I know what empties are for, but I'd like to change the colors of empties as a visual aid (for example, red for camera controls, green for object controls etc.) while animating. Is this possible?

They can be changed from User Preferences > Themes.

Edit:

As you commented, per object viewport color is unsupported officially. Such idea has been discussed before, and decision is to allow per type color via Themes setting (see above), instead. So the answer is no (or not yet).

However, you may consider to use another trick in case you have to:

Create a simple mesh object, assign material with specific Diffuse color (Viewport Color for Cycles);
Parent it to the empty (or other objects);
Toggle off the renderability (or CtrlH), and also selectbility in Outliner if necessary.

Then, objects like empties and cameras can be indentified as you expect (except in Wireframe or Bounding Box view though). It might be the only solution so far, if you really have to.

Edit 2:

A specific feature to set per-object vewport color is available in Gooseberry branch build, I believe it will be soon merged into master trunk.


How to give my armature skeleton a body? i have done a armature skeleton but now i have to give it a mesh, is there any option to do it automatically ?

The approach is reversed. You need a model first, then an rig/armature to put into the mesh, then bind the mesh to the armature and then pose it.
Beside it looks like you posed some bones at the legs in the wrong direction as they point upwards.
Start with a basic tutorial to get the basic knowledge:
https://www.youtube.com/watch?v=f2pTkW-1JkE


Can an action be mirrored? Is there a way to mirror actions that were keyed for one side to be mirrored to the other side?

I tried to add another x-flipped action as the button (green 1) does for the current pose.
This button is only available in the pose editor.

Then I tried to copy and paste key-frame by frame (from green 2 to red 3) but it seems that we can't have two different views of the action editor. (When the selected action is changed in one action editor the other one copies the change and displays the same action)

How can an action be x-flipped mirrored into another action?

To extend Leon Cheung's answer (my reputation isn't high enough to comment yet), you can achieve the same thing by selecting ALL of the keyframes from the Action Editor (press A) and pressing CtrlC, and then pressing CtrlShiftV to paste the flipped animation somewhere else. This works for the WHOLE animation, and can save more time than doing it manually (and is a whole lot less error prone).


Cutting an archway in a wall of a model of a building I am a newbie at Blender, but love it. I am trying to create a model of a building which is to be constructed. There are several arched openings in walls. I am having a great deal of trouble being able to create these arches. I have googled but not found anything that works.

You could model the arch's shape from a plane and use Knife Project.

Select first the arch then the wall in Object Mode
Change to Edit Mode and apply Knife Project

After that you should have a model like:

If  you want to connect the arches select them by Shift-Alt-RMB and Bridge Edge Loops

Alternativley (as suggested by Gandalf3) you could use the Boolean Modifier.

For this technique you would need to extrude the arch like the red object here:

Align the objects
Add a Boolean Modifier to your wall, and set operation to Difference
Apply the modifier

The result should look like:


How to make a "Force feedback" effect with physics? So I made this neat animation by Cell Fracturing a sphere then rendering the physics.

Looks nice, however I want there to be an "Upwards Kick" so the fractured pieces don't just flop down on impact. Some of them should bounce up (in a realistic sense). How would I go about creating this effect in blender?

Go to the physics panel and have a similar setup for every shard like i did here with this sphere

dynamic
The setup for the floor is the same exept one thing disable dynamic in the physics tab.
So basically what you were missing (if im correct) its that you didnt setup a bounciness for your objects ;)
Also you may need adjust the solver iterations (in the scene tab in rigid body world section)(this will make physics more accurate)


Disabling occlusion culling in BGE hides nearby objects I am making a game which you can get here. I was editing different system settings in Blender to fix my one-digit framerate issues. I disabled the occlusion culling option in the world settings and now the game runs at a stable 60 FPS. I have one problem though. Any nearby objects, such as my zombies, will disappear if I get too close to them. Also, all HUD items which are parented to my camera disappear except for my text. I checked my camera clipping settings and it's at 0.25 blender units for the near one. It's not even that I can see through a close part of the zombie like you'd expect. I mean that they just completely vanish until I get far enough away. This is really annoying. Is there any way that I can have occlusion culling disabled to boost my performance but at the same time not have any near objects disappear? Thanks!

I found out that the character that my camera was parented to was scaled which in turn scaled my camera. I applied the scale of my player and cleared the scale of my camera and now this problem is fixed.


Boolean Problem with not generating new Difference faces I am not sure if something I changed is creating this problem (maybe something to do with culling faces?) but when I have an object and I attempt to use Bool Tools to cut the first selected item out of the second selected item and I hit [CTRL]+[numpad +] it cuts it out, and shows my cutter as a wireframe, but it doesn't generate faces in the shape of my cutter on the object being cut. I am including a screenshot of how it looks. I turned on normals so you can see that it is showing the inside of the object that is being cut out rather than showing new faces where it should have been cut.

I had created a simple box with an inset and internal "extrusion" with a bevel. Then I duplicated it and "joined" the two boxes. Then continued to have internal hidden surfaces that were overlapping with curves due to bevels. When I attempted to apply a "difference" boolean operation using Bool Tools, it didn't generate the new faces.

I stepped backward and instead did the following:

I create the initial inset and extruded and beveled boxes, and overlapped them like before.
This time I applied a union boolean operation to the two cubes instead of just joining them, which removed the hidden faces
Finally I created the cutter and used bool tools to difference the cutter on the unionized boxes.

It created the faces, but it also applied the earlier boolean union on the boxes at the same time. I was hoping it would be completely non-destructive, but it wasn't. So maybe the lesson is: duplicate and hide shapes that are unioned non-destructively before adding a cutter using a difference boolean, so you can roll back if needed.


Deforming when no deform is wanted I created a rigged lamp, where the lamp shader is made of a circle curve bevelled with a bezier curve. Now when I rotate the armature, the lamp shader gets completely deformed, even though the 'Deform' checkbox is unchecked for each bone in the armature. Is there something I can do to fix this?

My .blend file can be found here:

You need to keep the bone's scales to 1. This is not mandatory in the kind of parenting you used here for the other objects (but generally preferable).

Impact of armature scale on the rig :

If we start from a cube and a simple armature scaled Z to two :

Then parent the cube to one of the bones, the way you did it, you can see immediately that the cube is stretched (here the parenting is done by using directly the fields above the green line):

And effectively, when we rotate the bone :

Weirdly, this effect is not visible if you parent the bone this way :

And I don't know why (surely a 'keep transform' is involved in this parenting mode, but where is the data for that ? please comment if you know), as the result is now this (so apparently the same as before):

But if we move the bone again, same kind of result :

Your original file "corrected" :


How to create a mesh from metaballs which will always work with a Boolean modifier? My goal is to simulate a particle system in an animation, convert the particles to a mesh, then apply Boolean modifiers to the result mesh. This usually works. However, the mesh generation occasionally results in non-manifold elements which cause the Boolean modifiers to fail. The question is if there is a way to ensure that meshes generated from meta-elements will be a manifold and not contain non-manifold vertices. An idea solution solves the problems by

explaining how to generate the mesh without non-manifold elements;
explaining how to remove the non-manifold elements using a feature in blender; or
explaining how to use scripts to remove the non-manifold elements.

Manual editing of the mesh is not an option since thousands of meshes will be generated.

Details

Using Blender 2.76, the particle system consists of several thousand particles.
The particles are converted to a mesh by a script which runs on each render event. The script creates a metaball for each particle, then converts the metaballs to a mesh. This works fine. However, the resulting mesh occasionally contains non-manifold vertices. The non-manifold vertices can cause Boolean modifiers to fail.

Is there a way to either generate the mesh or modify the mesh to ensure that the all vertices are on the manifold. Manual editing is not an option since thousands of these meshes will be automatically generated in an animation.

Example:

This image shows the particle system during an animation:

This image shows a rendering of the meshed particle system:

This image shows the meshed generated from the particle system with non-manifold vertices identified. From the top of the image, 2-vertices are identified as non-manifold.

To see the issue with the mesh, this a zoomed version to the problem area is highlighted.

An example of a successful Boolean modifier applied to the mesh:

Update based on comments.

From testing with cubesurfer 0.95cubesurf 0.95 and Blender 2.76, the meshes generated are not always manifold.

Example:

For the same problem, here is the resulting cubesurfer surface.

This is the resulting mesh.

When selecting for non-manifold vertices, these are the non-manifold vertices and surrounding geometry.

Zooming in, these are the non-manifold vertices up close

There is CubeSurfer addon for meshing sph particles. Metaballs in Blender were very slow, but they were optimized recently. It is worth testing which is faster.
I don't know if CubeSurfer guarantees manifold mesh. But I am 99.999% sure that it doesn't. Now 100% sure after your test.
I dealt with similar thing many times (booleaning fluid mesh to have smooth surface where it collides with glass - so it renders nicely).
The solution is to export the fluid mesh in frames where the boolean failes as .obj files, then manually edit those meshes so they are manifold, and substitute them in frames where the boolean failed.
The detection and exporting can be done automatically. Also the substitution if the files are named to indicate which frame they belong.
I don't know any algorithm for blender that can automatically fix a non-manifold mesh to be manifold. It would be quite complex, as it is not an easy task.
There is this paper about it, uses Cutting and Stitching.
The boolean modifier will not fail on every non-manifold mesh, only when the non-manifold piece intersects or is inside the booleaned mesh.
Also putting a smooth modifier before the boolean might cause the boolean to fail less. But it won't fix all the non-manifold problems.
So to solve it you would have to write your own particle mesher that guarantees manifold mesh. Or to hire someone to do it for you, or find a very good soul to do it for free. It's quite a job to do.
Or use a program that can do booleans on non-manifold geometry (which is totally possible, blender just uses open-source library for booleans that is not able to handle non-manifolds) or which can repair non-manifolds. Some programs that could do this are listed here.

Geometric Modeling Based on Polygonal Meshes
...this package provides source code implementing useful repairing algorithms such as Gueziec et al's cut-and-stitch for conversion to manifold (IEEE TVCG 2001)...

Also MeshLab is a nice package worth trying. It can be scripted for automation. With others I have no experience but they might be even better candidates. You just wan't them to be able to process a series of obj's.

Another approach you could take is not to boolean at all, but rather use a volumetric material with very high density with clipping. You just need to figure out the math that clips, depending on the shape you want to clip with. From your pictures looks like you need to cull with 2 planes, the planes face the camera with the local Z axis:

This though produces some wood-like artifacts:


Grease Pencil in Blender 2.9 - cannot select vertexes anymore? I have just updated to Blender 2.9 and, when editing a Grease Pencil object, I cannot select individual vertexes like before anymore, only the whole stroke.
Is there a new option I have to enable ?
Thanks !


The camera's view is grey/grayed and I can't see anything out of the camera's sight? So everything out of the camera's sight is invisible and it's there's this grey/gray (I don't know how it's spelled) thing highlighting what can be seen. What's going on and how do I fix this? I need to use assets that are out of my view. :(

Seems like you are in 'clipping' mode. Simply press Alt+B and you should be good.


UV Editor: unwrapped faces disappear if I select other faces I'm trying to draw a 3D mushroom following this guide: https://www.raywenderlich.com/49955/blender-tutorial-for-beginners-how-to-make-a-mushroom

I need to paint the head of the mushroom and the stalk separately. For this reason I need to unwrap the stalk and the head of the mushroom and to group them on the UV editor. This is the the result that I should get:

Like you see on the UV editor there is both the head and the stalk of the mushroom. But if I try it myself, once I unwrap the head and I get this result:

If in the 3D editor I deselect all the faces (with the goal of starting to select the stalk's faces), the unwrapped mushroom's head on the UV editor disappears. Why? isn't there a way to "save" the faces unwrapped in the UV editor? how can I unwrap two set of faces without that one disappears?

There are two things going on here:

When you hit U > Unwrap, Blender only unwraps the selected geometry.  To unwrap the head and tail of the mushroom, select them both before unwrapping.
The UV/Image Editor view only shows the pelt[s] for geometry that is selected in the 3D View.  When you deselect something in the 3D view, it's unwrapped texture coordinates aren't deleted, they are just no longer visible in the UV/Image Editor.You can optionally use Sync Selection option so the UV selection matches the 3D view-port. This can be toggled using the button to the right hand side of pivot point popup.


I want to duplicate an object accross scenes but without deuplicating the materials attached to it Right now my Duplicate Data options under the Blender Preferences are set NOT to duplicate data material but this only work accross the same scene, not for the whole Blender file. Is there a way to only duplicate the mesh but not the materials? Because I'm using the same few shaders for all my scenes and it's important I don"t get any duplicate for batch rendering.

Turns out copying a whole collection will duplicate materials, this won't happen if you select materials and copy them from the viewport context. Learned something new!


any way to deform normals? These meshes need to be scaled up or moved along their normals.

ZZ works pretty well but they, obviously, go straight on their directions...

Any way to deform these normals to follow a circular path around the current 3D-cursor? or origin as well..

update:
I solved this way:

pivot to 3D-cursor
trasformation orientation to normal
extruded meshes
rotated meshes

If I understand this correctly This could be easier to achieve with the help of some modifiers.
If you model a single cog and use a mirror modifier to make it's symmetry it will simplify the process so that you only have to rotate two edges in one direction. Followe that by adding an array modifier to accomplish the whole gear it will take care of the rest.


Combining Edge & Vertex Bevel I'm trying to combine an edge bevel with a vertex bevel using the bevel modifier. I've watched numerous videos about hard surface modelling but all the different options are confusing me. I thought if I could tackle one problem at a time it might all start to make sense.

So, referring to the image, I'd like to apply an edge bevel (1) and a vertex bevel (2). With both bevels applied the edge bevel is being clamped (3) and I'm seeing some unwanted artifacts on the corners. If I uncheck the Clamp Overlap, I get the expected result (4) - not good !

I don't really understand what it does, but I've got the Auto Smooth turned on at it's default value of 30%. Again, I don't really understand what it does but I've tried tweaking the Harden Normals settings and that doesn't help either.

Any help would be greatly appreciated, and any explanation that makes this clearer for me would also be a huge help.

Many Thanks

This is because the second bevel is trying to bevel edges which shouldn't be beveled, creating too much geometry, thus creating the artifacts.

You will see that if you set the limit method in the second bevel to "Angle" and then progressively increase the angle, at some point the artifacts will disappear.
Notice how the vertices count in the lower right corner drops while you increase the angle limit. Alternatively you can set the view to wireframe (SHIFT + Z) in order to see exactly which edges are beveled.

The angle refers to the angle between the two face connected by the edge, 180° being coplanar faces, 90° being faces at a right angle and 0° being faces that intersect each other (also coplanar).

No limit Vs Angle limit = 21° :


Addon: create empy in edit mode I learn plugin writing/
So, I created plugin, was add empty object on active vert

bl_info = {
    'name': 'Empty on active',
    'author': 'Igor Yuchimenko',
    'version': (0, 1, 0),
    'blender': (2, 71, 0),
    'category': 'Add Mesh',
    'description': 'Tested addon create empty on active vert'
}

import bpy
import bmesh

class vertempty(bpy.types.Operator):
    bl_idname = 'v.empty'
    bl_label = 'Crete emty on active vert'
    bl_options = {'REGISTER', 'UNDO'}

    def active_vertex(self, bm):
        for elem in reversed(bm.select_history):
            if isinstance(elem, bmesh.types.BMVert):
                return elem
            break

    def execute(self, context):
        me = bpy.context.object.data
        bm = bmesh.from_edit_mesh(me)
        avert = self.active_vertex(bm)
        bpy.ops.object.add(type='EMPTY', avert.co)
        return {'FINISHED'}

def addToMenu(self, context):
    self.layout.operator("v.empty", icon = "OUTLINER_OB_EMPTY")

def register():
    bpy.utils.register_class(vertempty)
    bpy.types.INFO_MT_mesh_add.append(addToMenu)

def unregister():
    bpy.utils.unregister_class(vertempty)
    bpy.types.INFO_MT_mesh_add.remove(addToMenu)

But on run (when menu clicked) I get error

  RuntimeError: Operator bpy.ops.object.add.poll() failed, context is incorrect

So, as I understand, empty can't add to object mesh, so Ш get an error.

Use API methods

Using base API methods to add new objects to a scene, alleviates the need for context.

To create a new empty with name "somename" linked to the context scene at location (0, 0, 0)

mt = bpy.data.objects.new("somename", None)
context.scene.objects.link(mt)
mt.location = (0, 0, 0)

Note: to put the empty at the global location of the vertex

mw = context.edit_object.matrix_world
global_vert_pos = mw * avert.co

otherwise it will be at the local coordinate, eg one local corner vertex of default cube is (1, 1, 1), any transformation on the cube and it's global location will differ.

Soapbox: since context is an argument of execute method use me = context.edit_object.data  (there is no need to fully address from bpy.)

Note scene.objects.link is no more in 2.8


Changing Physics of Waving Flag in Python I have created a Blend file of a flag waving in the wind. This is done using a Wind Field and the Cloth physics attribute added to the flag mesh. The animation renders nicely in the Blender API using Cycles renderer. However, I want to make dynamic changes to the scene using using Blender's bpy Python module. Without using the UI, I load the blend file in Python and render it using the following script:

bpy.ops.wm.open_mainfile(filepath='...')

scene = bpy.data.scenes['Scene']
scene.render.resolution_x = 256
scene.render.resolution_y = 256
scene.render.resolution_percentage = 100

# Settings for Cycles renderer
bpy.context.user_preferences.addons['cycles'].preferences.compute_device_type = 'CUDA'
bpy.context.user_preferences.addons['cycles'].preferences.devices[0].use = True
scene.render.tile_x = 256
scene.render.tile_y = 256

# This line doesn't do anything...
bpy.data.objects['Field'].field.strength = 0.0

# This also has no effect...
bpy.ops.object.select_all(action='DESELECT')
bpy.data.objects['Field'].select = True
bpy.ops.object.delete()

# Fiddled around with baking, but has no effect...
bpy.ops.ptcache.bake_all(bake=True)

for frame_number in range(0, 200):
    scene.frame_set(frame_number)
    scene.render.filepath = "..."
    bpy.ops.render.render(write_still=True)

The animation renders exactly the same as what I get when rendering the blend file using the UI. However, it seems impossible to make any changes to the wind field or cloth physics (see comments in the code). Changing the wind field has no effect and even deleting the field altogether doesn't affect anything. My question is: what am I missing here? Maybe my understanding of the physics engine and/or animation is lacking, but I wouldn't expect the flag to display fluttering with the wind field completely removed. Any help would be very appreciated :-)

I already figured this out myself. It seems like the following order of calls is successful. The trick is to perform a free_bake and then calling bake_all after changing the physics parameters:

bpy.ops.ptcache.free_bake_all()

# Increase the wind speed (default: 1000)
bpy.data.objects['Field'].field.strength = 0.0

# And bake the new simulation...
bpy.ops.ptcache.bake_all(bake=True)


Objects disappeared and only show up in final render I added a tiny object, while i finished editing, all the other objects dissapeared from all the viewing modes, they only show up on the final rendered image. I'm making a guitar by the way.

This is the tiny object i added on solid mode, it also shows up the same on rendered mode:

Heres the rendered image showing the other objects beside it:

That's not the first time this happens, i always have to start another project from scratch.

It might be wrong but i think this always happens after i save the file while editing it.

How do i proceed ???

GUYS IT WAS LOCAL VIEW YOU CAN CHANGE IT TO GLOBAL VIEW ON THE "VIEW" OPTIONS OR TYPE "/" ON THE NUMPAD.

I was confused because i'm not a native speaker and people told me to type numpad/ which i  understood to be deactivate/activate the numpad.


"Object cube is not on s scene layer" error message when baking I'm doing this tutorial: Blender smoke animation

and when I go to bake before doing lighting and stuff it gives me an error that says "Object cube is not on a scene layer". I did parent some UV spheres to the cube and that probably has something to do with it. Here is a screen shot of my layers and outline editor. I hope I'm showing what the potential issue is in the screen shot. Is there a way I can bake these objects with still having a parent object?

I've tried looking on google and forums, but can't seem to find the answer. Thanks!

First of, as you can see in the top left corner of your viewport, it says "Local", which means you're in an isolated mode. You probably enabled it accidentally by pressing numpad / or it was on purpose but you didn't though about getting out of it when not necessary anymore.

Anyway, start by pressing numpad / again, that may already be the solution. If not enough, you may now see your 3D view layers :

And most importantly: which one you're in, which one you have the active selection in and which ones contain objects. From that, you will quickly determine if you need to move some object around. To move some objects to another layer, simply select the objects and press M.


Copy render settings between scenes using Python I simply want to take the render settings from one scene and copy them to another scene. Something like

bpy.data.scenes[1].render = bpy.data.scenes[0].render

except that this fails as bpy.types.Scene.render is read-only. Ideally I'd like the render settings linked between the scenes but I'll settle for deep-copying.

I previously found Can you link render settings across all scenes so they can all be changed at once? but it doesn't get an answer.

The only solution I can come up with is manually copying each and every attribute one at a time but this seems very cumbersome. I also found https://stackoverflow.com/questions/3818825/python-what-is-the-correct-way-to-copy-an-objects-attributes-over-to-another/3818861#3818861 which gets me some of the way but falls over for read-only attributes, i.e. the other classes within bpy.types.Scene.render.

Any help much appreciated as this appears simple to do! Thanks.

There is this bundled addon for this:

If you specifically need the python code, you can do it like this:

import bpy
settings = ["resolution_x", "resolution_y", "resolution_percentage"]
dict = {sett: getattr(bpy.context.scene.render, sett) for sett in settings}
for scene in bpy.data.scenes:
    for sett, val in dict.items():
        setattr(scene.render, sett, val)


Principled volume missing So I'm following a tutorial where the person adds a principled volume shader and I don't seem to have it and can't find it at all. I'm using blender 2.9 if that helps. Is there possibly anything I'm missing as it's confusing the heck out me

If you don't want to use Blender 2.8 yet, you need to use the latest build of 2.79. You can download it here

https://builder.blender.org/download/

Unzip the package and start Blender directly from within the unpacked directory.


After importing a .fbx model in blender it's not smooth with visible faces in viewport as well as render I have tried smooth shading, subdivision modifier as well as converting the triangles to squares with alt+j but nothing seems to work.
Album has pictures from fusion as well as blender.
https://photos.app.goo.gl/peU4eVkiR8YQ2E4cA

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

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

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

Otherwise, I'd suggest this:

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