Rendering with background, but saving with alpha? Excuse me for my language)
I want to setup render view like V-Ray Framebufer in 3Ds Max:
 I'd like to render object and see it on a background image. But it still needs to have alpha-transparency, so if I'll save it to png there will be only the object with no background.

Here is what I'd like to see:

And here is what I'd like to save (in alpha chanel):

This would be a good place to use the compositor:

Have a renderlayer of your object on a transparent background, and another renderlayer with just the background. Let the transparent background render remain connected to the "Composite" output node, and mix the two renderlayers for the "Viewer" output node so you can see it on the background while in blender.

If you want to save time on rendering, and your background doesn't change, you can render the background, save it as a texture, then mix using that texture instead of an additional renderlayer.


Copy material to another object? I saw a video where the person copied a material from one object to another (Cycles).

How can I accomplish this?

Select all target objects and also the source object (the source object needs to be active, so either select it last or select it again after you selected all target objects).

Go to the Material tab, select a material slot and click the specials menu button.

Click Copy Material to Others to copy.


Bug in addon to Change header color dynamically Bug in addon to change header color dynamically

I made an add-on that changes the theme color of the header if the automatic keyframe feature is enabled.

The color change function works fine.

However, the following bug occurs in the object gizmo transform gizmo.

Mouse hovers no longer highlight
Drag operation is delayed a little

Why do bugs occur in Gizmo by changing the theme color? I have no idea.

python

import bpy

bl_info = {
    "name" : "header_color_change",
    "author" : "Bookyakuno",
    "version" : (1, 0, 0),
    "blender" : (2, 80, 0),
    "location" : "hoge",
    "description" : "hoge",
    "category" : "UI"
}

def TEST_HT_header_color_change(self, context):
    layout = self.layout
    layout.label(text="")

    if bpy.context.scene.tool_settings.use_keyframe_insert_auto == True:
        bpy.context.preferences.themes[0].topbar.space.header = (0.4, 0.000000, 0.000000, 1.000000)

    else:
        bpy.context.preferences.themes[0].topbar.space.header = (0.137255, 0.137255, 0.137255, 1.000000)

    return {'FINISHED'}

def register():
    bpy.types.TOPBAR_HT_upper_bar.append(TEST_HT_header_color_change)

def unregister():
    bpy.types.TOPBAR_HT_upper_bar.remove(TEST_HT_header_color_change)

if __name__ == "__main__":
    register()

'''

I think that the issue comes from changing preference data during a UI draw, that is, you are accessing data that should not be altered while drawing the UI.

An alternative approach that seems to work is using handlers to alter the theme settings. In 2.80 the scene_update_* handlers have been renamed to depsgraph_update_*.

def TEST_prefset(scene):
    prefs = bpy.context.preferences

    if scene.tool_settings.use_keyframe_insert_auto == True:
        prefs.themes[0].topbar.space.header = (0.4, 0.000000, 0.000000, 1.000000)

    else:
        prefs.themes[0].topbar.space.header = (0.137255, 0.137255, 0.137255, 1.000000)

def register():
    bpy.app.handlers.depsgraph_update_post.append(TEST_prefset)

def unregister():
    bpy.app.handlers.depsgraph_update_post.remove(TEST_prefset)


Material for "sponge" wall paint I managed to import a SweetHome3D room into Blender and now try to get the walls look as if they were painted using "sponge technique" i.e. covered with "ingrain wallpaper", painted with a basic color and then again using a sponge and a second color.

Any idea where I could find an existing material or how to create one myself?
Images on the Net are usually not seamless and neither are ones that I could create with GIMP. Could Blender generate this effect procedurally?

Example:

Edit:
Screenshot of not working node setup

Edit:

Here is one result you could achieve with noise and voronoi textures:

The concept is fairly simple, first create two base shaders.
 Here it is the two sets of diffuse/ glossy. One for the darker and lighter color of the paint. Then, just mix between them with a noise texture.

The scale of the noise texture will control how much variation there is between the two layers, and where the variation falls. The color ramp will control the intensity of the transition between the layers. Changing the interpolation to ease or b-spline might be interesting depending on your needs.

Then use voronoi (or some other texture with high scale) for bump to give the texture of the wall.

Here is the node setup for the example above:

click to enlarge


Blender 2.8 drivers, trigonometric functions not working? I am trying to make an object rotate based on its position. Basically the Y-angle
gamma = arcsin(var)
where var is the driver variable connected to the x-location of the object.
The only problem is that blender does recognize sin() but neither asin() nor arcsin(). According to the documentation of 2.79, asin() should work.
Is this a missing feature or has it changed in 2.8?
EDIT: If this is missing, would a taylor series of arcsin work? I could imagine that that would significantly decrease performance.

Domain Error

My suspicion is rather than asin being unavailable, you are getting a math domain error.

in python console

>> "asin" in bpy.app.driver_namespace
True

>>> bpy.app.version
(2, 80, 74)

Indicating the math.asin(angle) method is known to driver namespace.  Would seriously consider not filing a bug report re it missing

To test have typed #asin(frame) directly into x location of an object (frame , also in driver namespace, is current frame)

and as expected at frame 1, returns $\pi/2$ (or 90 degrees).

Remember the values passed to $\arcsin(x)$ need to be in domain [-1. 1], hence if i change to frame 2

ERROR (bke.fcurve): ../fcurve.c:2084 driver_evaluate_simple_expr: Math Domain Error in Driver: 'asin(frame)'


Update and add-on problem I have Blender 2.73 and want to update to 2.75 but when I do it does not unzip correctly or completely, and it does not show up in my control panel where the installed programs show up. Also I want to install the Blend4web add-on but the install from file does not work. I really don't know about scripting and all that so I would need a detailed walkthrough if I was going to install it that way. Can anyone help me with these issues?

When you do the update the installer file it should be an .msi file. if the one you have is zipped, unzip the file in a temporary file location, and the double click the [filename].msi file.  You should ensure that you install it in the same directory as previous installations, if you did not use the default for your previous or first install.

The addon, after it is unzipped should be a *.py file; you can find help on this installation at this location: Installing an addon


Get access to generator modifier x values for drivers I want to know if its possible to get access to the property of the generator modifier in the driver panel. I want the X property to live set it in the Tools Panel.

Looks like you cannot access this property, but there is a workaround by scripting the generator yourself and by adding 2 custom ID properties to the object to control it.

import bpy

class Panel(bpy.types.Panel):
    bl_label = "Custom Panel"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'

    def draw(self, context):
        layout = self.layout
        layout.prop(context.active_object, '["offset"]')
        layout.prop(context.active_object, '["multiplier"]')

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

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

if __name__ == "__main__":
    register()


Blender PNG saved as 48 bit color depth really? I chose the options 16 bit, RGB, PNG, etc, and the image saved on my desktop says in its details "48 bit" color depth, then when saved again in a paint program, it got lowered too to 32 bit and 1/4th its original size, which had me upset btw. But did it even save it in 48 bit in the first place?

There are lots of programs that refer to bit depths in different ways. The confusion comes from whether they are referring to the number of bits per pixel or the number of bits per color
 channel.

16 bit per color channel RGB is also referred as 48bit color by some programs ( each pixel will use 48 bits to store color information: 16 bits for the Red channel, 16 for the Green and 16 for the Blue: 16 x 3 = 48).

16 bit RGB with Alpha channel is also referred sometimes as 64bit (RGB + A or 16 x 3 + 16 = 64 )

What most programs label 32 bit images are really 8 bit per channel images plus an Alpha channel: (RGB + Alpha 8 x 3 + 8 = 32 bits per pixel.

Without the Alpha channel an 8bit RGB image would use 24bits per pixel.

To make things more confusing it is possible to use 32bit per channel when using OpenEXR or HDR files...

There are some programs (like versions of GIMP previous to 2.9 or other paint programs) that cannot deal with 16 bit images and will convert them to 8 bit which will always result in data loss.

8 bit images allow for only 256 different values per color channel, with a total of 16 million combinations.

Even though 16 million colors sounds like a lot and is close to the limit of what the eye can see, it presents problems when representing subtle gradations  where you need many more values. The most common artifact that you'll see in 8 bit images is known as "banding". In this image banding is clearly visible in the sky:

Photo by geograph.org.uk

16 bit allows for 65,536 values per channel giving over a trillion possible combinations. Using a higher bit rate will solve most of the banding issues and will give you more flexibility in terms of color correcting or further processing of the images.


Why the mirror modifier is not applied on my half-cube? I've applied a mirror modifier on my half-cube but even though the pivot point is centered correctly (in the center of the half cube) in both object mode and edit mode. It is still not mirroring my half cube. Why is it not working?

The pivot point in object mode:

The pivot point in edit mode:

You are mirroring in the X direction, while your half cube is oriented along the Y direction. So the mirror works, but the generated vertices coincide with existing vertices.


How to remove certain part of the object name for hundreds of objects? I am new to scripting and trying to find a way to remove the marketing_ prefix from a few hundred objects in one go. I can get the script below to work fine one the active objects but I cant figure out how to apply it to all objects in the scene or all selected objects.

import bpy
bpy.context.object.name = bpy.context.object.name.replace("marketing_", "")

How to do that for multiple objects? Any help is greatly appreciated.

For selected objects:

import bpy

for o in bpy.context.selected_objects:
    o.name = o.name.replace("marketing_", "")

Or for all objects in the scene:

for o in bpy.context.scene.objects:
    o.name = o.name.replace("marketing_", "")

Or for all objects in the file:

for o in bpy.data.objects:
    ...


Domain stays a cube when baking? Whenever I bake my domain, it stays a cube. It does work when the fluid object is outside of a hollow obstacle I've placed it in.

I've recalculated the normals, and tried resizing the domain, but nothing really seems to work. Blend file is below.

Recalculate the normals on all the meshes. Remember to go to edit mode and select all faces. Then go to Your fluid settings on the glass and choose "volume" instead of "both" under volumen initialization:

I have added the fixed file below:-)


Fluid starting point I want to run a fluid simulation, but I want the fluid to start at some other frame than the start.

How do I make the simulation start on a farther frame?

You could do this by adjusting the offset value of the fluid simulation.

Here's a short summary of this:

Go to the offset settings of the Blender fluid domain (Assuming you are using Blender v2.81 or before), and adjust the value to a higher number to make the simulation happen earlier, and lower to happen later.

This will cause your fluid to show up later or earlier depending on the offset value. For a detailed answer to a similar question, look here.


How can I emit particles without them overlapping each other? How do I make a particle fit perfectly around a torus without absorbing or immersing each other in blender particle system. I made the torus the emitter, and use the sphere as the particle. I have tweak the particle number and some other things. Is there any other way I can achieve this?

You can use the Grid distribution to place the particles regularly over the surface. Increasing the associated 'Random' setting moves each particle by a random amount giving a less regular appearance if desired.


How do I apply a skeleton rig to multiple objects? I have 15 total parts and I thought that the rig skeleton fits with the multiple objects. So I tried to look up information online. No luck. So this might be a nooby question and may be closed as too broad but, how do you apply a rig to multiple parts? Please be nice.

It's a valid question.

If you mean your model is made of multiple meshes, select all of the meshes, then lastly, select the bone, and press ctrl+p and choose your favorite option. Maybe with automatic weights.

You can have any number of meshes paired to a bone, but you must select the bone last, before pairing. I actually prefer this method when working with meshes that should not be distorted by bone movement, like a mechanical robot. Each piece that should only twist and move, not bend, I parent to an individual bone separately. It works to parent them one by one as well.

Tip: You can also select all of the meshes and press ctrl+j to join them, if that is the desired result. You may want to apply modifiers before joining though.

If you mean that you have multiple different models that can all use the same bones and animations, then pair the first object, then the second, then the third, all in the same way.

First, pair one of the objects you would like paired. Most likely this will be using ctrl+p and choose your favorite option. Maybe with automatic weights.
Now select the second object, then the bone. Repeat the process of pairing by pressing ctrl+p and choose your favorite option.

Now if you select the skeleton and go to pose mode, you will find that both meshes will move along with the bone.

Tip: To make things simpler, you may wish to move your skeleton to one layer, and each model to another layer. That way you can pose the skeleton on one layer, and view the results on each layer with the different models.


Sunroof style motion - conceptual issues I'm trying to make what is essentually a sun-roof, in that the object lifts up slightly and moves back over the surrounding frame. I figure what I need is a curve and a "clamp to" constraint, but it is not clear to me the proper way to implement this. Whenever I get to the part after I select the target curve, my sunroof object jumps elsewhere. I have yet to find the combination of the below where I get satisfactory results.
I have tried:

Making sure the origins are the same for a curve and object
Using a bone to follow the curve (with the idea of attaching the bone to the object
applying all transforms to the object, curve and bones
Watching a lot of vidoes that didn't provide the information I am looking for.

My end goal is to rig up this sunroof in an array and be able to control their position all from a "control nob" empty.

Thanks!

Add a follow path constraint and have the object follow a curve (yes both objects have to have their origins on the same place).

By controlling the offset you can make the object travel along the curve.

To control rotation use an empty as the control object for a copy rotation constraint.


Making my own Modifier : Make Texture operate as mask on vertices I’m would like to perform on operation in blender that I don’t think I can yet, I would like some help on how I can develop it in the right way.

I would like to delete geometries depending on a texture and following the UV map.
Imagine the Displace Modifier, where you indicate the texture and that you want to use the UV but instead of extruding vertices based on the grey level, it would delete or keep vertices based on a threshold.

Because you can’t create modifier as addon, I’m already making my own from blender source code. I believe it is actually ready, what do I need to do so that my modifier appears with the other ( precisely ) ?

Also after that I will aim do the same thing but with subdivide operation, where my mesh will be subdivided more in specific area depending on a grey level texture.

Any help is welcome.

A possibility (to avoid a bit difficult coding), more than a real answer:

Use a displacement modifier on a cutting object.

Then use this cutting object for a boolean 'difference' operation on the object you want to cut (or remove some vertices).

This is illustrated in this animation:


Extrude Arch like in the video I found a video about Gothic Arch modeling on Youtube using Blender 2.78.

At 1:28 the creator extrudes the vertices of the arch.

However, I can't figure out how it was done. The keydisplay does not show any special shortcuts. The extrude settings on the left seems to be default.

How to reproduce this extruding behaviour?
Any shortcuts or settings changes? Additional plugins?

I guess some shortcut since there is that small (black) gizmo with the dottet line.

No Addon, plain Blender.

The arch was mirrored.

The mirrored arch is extruded along the normals and meet in the middle. Like the extrusion in the video.

Here the view with only one side editable:

Side note:
Without the mirror if you have the whole arch. You can archive something similar with extrude followed by scale. e then s


How to create a 3D virus envelope like this in image below? I got the lipid bi-layer but just a plane of it, I need to make a aspherical envelope of virus, how can I recreate it in blender?

Link

The virus model and the animation of the merging into a cell wall can be generated using animation nodes.

Overview

The virus is formed from 3 meshes for the exterior surface, the interior surface, and the contents. Two additional meshes are used for the lipids and proteins on the surface. Animation nodes are used to place the lipids and proteins on the surfaces.
To animate the merge of the virus and a cell wall, the animation nodes are used to move the lipids and proteins from their initial position to their final position. This is done by moving the location of these items along an interpolated path between the initial and final mesh.
This example was done using Blender 2.79 and Animation Nodes 2.0.

Creation of the Virus

Create a lipid model. Once this is created, choose a scale so it can be used for the virus and the cell wall.

Create a model of the surface proteins. This should be in proportion to the size of the lipid model.

Add a small 'Ico Sphere' to represent the contents of the virus.
Add a larger 'Ico Sphere' to model the interior surface of the virus before the merge. The image below shows the virus contents and the inner surface.

Add another, even larger 'Ico Sphere' to model the exterior surface of the virus. The exterior sphere should be placed so the distance between it and the interior sphere is about equal to twice the length of the tails on the lipids.
Create the animation node trees as shown below for the inner and outer surfaces. The key concept is that the mesh for the ico sphere has vertices with both location and orientation (normals). This can be used to position the lipids and proteins. By mixing the lipids and proteins randomly on the exterior of the virus, the desired 3D structure is obtained.

Animation of the Merge

To move the lipids/proteins the animation is broken into 4 equivalent parts: the interior of the virus, the exterior of the virus, the top of the cell membrane, and the bottom of the cell membrane. For these 4 parts, the same kind of solution is applied. A source mesh is used to initially place the lipids/proteins. A destination mesh is used to define the location at the end of the animation.
For the sake of brevity, only the exterior of the virus will be explained in detail. A similar approach is used for the interior, top surface, and bottom surface. The ico sphere for the exterior is created. The mesh is duplicated and edited into a flat surface. This surface is made so the lipids/proteins will follow a simple path from the eco-sphere mesh to the flat mesh.

An animation node network is created to position the lipids and proteins as shown below. The position and the normal for the vertices is used to the lipids/proteins change their orientation when moving.

Similar networks are created for the interior, top, and bottom.
The meshes for the interior and exterior of the virus are animated moving towards and through the cell membrane. This helps make the merge look smoother.
The virus contents are animated moving with the interior and exterior meshes and finally into the cell.

The blend file can be found here:

The key technique to create this animation was by Jacob Verburgt at Milwaukee School of Engineering, Class of 2018. His original animation is at https://www.youtube.com/watch?v=9cV8KBup7Eo

Thanks to Brenticus to pointing to his animation on Reddit.


Vector node question I am a Newbie in blender.

In general, If i do a character in Maya, I will sculpture a high poly in Zbrush and export the normal map and displacement map to Maya. Then I texture it and rig it.

But, I found there are some different in blender.
So, Hoping you can tell me what is the different between vector map, normal map and bump map in blender? and the different between displacement map in maya? and the pipeline of character modeling in blender.

Bump Mapping and Normal Mapping

Bump mapping and normal mapping are technically the same thing. They both add fake vectors and manipulate existing ones to generate the effect of higher polygon numbers by faking geometry light reflections. Both can be used for render purposes and in game engines as well. The difference between them is the amount of information they yield.

Bump maps are grey scale images, they provide their information using values between black and white. Normal maps are RGB images, they provide additional directional information using red, green and blue.

The modern way to fake geometry through light reflections are normal maps due to higher accuracy. Some games still use bump maps in some cases, where the effect is less noticeable and the smaller file size reduces loading times.

Micro Displacement (not to be confused with Vector Mapping)

Micro displacement at this point of Blender development is only possible within Cycles render engine for render purposes. At this point it cannot be baked to a texture. It works only on high-poly models and only offers benefits in conjunction with Blenders fairly new adaptive subdivision feature.

Micro displacement provides more detail on models in general and adaptive subdivision reduces detail on objects that are further away from the camera. Combine them and you reduce render times significantly.

Vector Mapping Node (as shown in your screenshot)

The vector mapping node is used to transform image or procedural textures. You can manipulate their size, rotation and location.


Noob Question: Symmetrized my bones, but Weight Painting is still mirrored? So I am currently trying to weight paint the lips on my model such that they deform according to my Lip bones. I used Symmetrize to ensure that there are .L and .R groups, and the Mirror Modifier on my mesh has Vertex Groups checked. But when I go into Weight Paint mode and select one of these .L or .R bones, the weight painting is symmetrical. I would like it to be such that a bone on the right only influences vertices on the right. How may I go about achieving this?

Link to .blend file:
https://drive.google.com/file/d/1QuQFWPfEyLrBtm0oP8SSyCSxa-LeHZ24/view?usp=sharing
Thank you for your help!

The mesh object does not have enough vertex groups for the deformed bone names.
The results of searching with the keyword "Lip" are shown in the Vertex Groups List in the figure.
Select Mesh Object, then Armature in Object Mode. Press the Ctrl+P key and select With Empty Groups.

PS: Lip2C.L is a non-deformed bone name and can be removed from the list.


Defining materials for a whole scene (file) I have the impression that materials are defined per object. Probably the reason why Blender keeps adding ".001" ".002" etc. to the material names. can anyone explain this automated nomenclature?

How can I set materials for a whole scene (in my case, a whole Blender file), so I can have a consistent list of material names (only set by me, not Blender) from which to choose for materializing objects?

Put differently: Is there a way of moving the material (creating) tab from the object-specific section (physics, constraints, particle etc.) to the scene-specific section (world, output, render, scene etc.)?

Materials are conceptually associated with users. In order for a material to be persistently stored it either needs to be assigned to an object (a real user) or the Fake User option needs to be enabled for it. If neither is the case, then the unused material won't be saved. That is the reason why you're always creating materials linked to an object when using the user interface.

However this doesn't mean that a material can only be used for one object. You can assign a material to as many objects as you like, across different view layers and scenes.

Creating a material

A material can be created in the Material Properties. You will need to select or create a new material slot, then you can create a new material using the New button.

Alternatively you can create a new material based on another material by clicking on the New Material icon shown below:

Reusing existing materials

Once you've created a material, it can be assigned to other objects. Select the object in the 3D view and choose a material from the dropdown list.

Users and fake users

Materials that are currently without any user will be marked with a zero in front of its name in the dropdown list. If you don't assign this material to an object or activate the fake user option (the shield icon marked in yellow), it won't be saved in your project.

If a material has multiple users, then a button with a number will appear. You can create a separate copy of the material for the currently active object by clicking on the button (marked in red).

More information can be found in the manual.


How to detect collision amongst concentric circles In my shooting gallery game, i have a bulls-eye formed from concentric rings (each a separate object). It seems like for any collision bounds i use, the bounds for the outer rings cover the inner rings. Hence, when i hit the center ring, all rings sense a collision since the outer rings collision bounds overlap the center rings.

Any ideas on how to handle this?

Add a single collision mesh for the entire board, then calculate the distance to the centre to determine which ring was hit.


Randomly place and scale objects? I want to create an abstract rendering of lots of cubes floating in the sky. It would be good if they could also be clustered together. I'm thinking of something sort of like this:

Does Blender have any tools for placing clusters of objects, and randomly scaling them? What's the best process to do this?

The best tool for this situation is the randomize transform tool. It's not a tool that has a shortcut key and it's buried in the object menu (Object > Transform > Randomize Transform), so the easiest way to access it is to simply search it using Space.
To create the wall from that image, do the following:

Create a plane for the wall.

Duplicate a few cubes around

Use the randomize transform tool and set it to affect the location of the objects (except the axis along the wall) and the scale of the object. Something like this:

You'll get something like this:


Python export addon: assign faces to vertex groups Hi I am making an export code for a custom model format.

I need the mesh to be divided in parts, each part has to be made of triangle faces with their vertices assigned to 7 vertex groups.

The following code is supposed to store the faces ingroups, once a group of faces has more than 7 vertex groups, it should go to the next group.
Every vertex has only ONE vertex group assigned (one bone) for simplicity.

The problen is, this code only works for the first group, then it sets split = 1, and that's it... split is never 2. So I get the first group with its 7 vertex groups, and the second group with the rest (more than 7).

I'm new in python, I am surelly making some big mistake here, thanks a lot!

for face in obj.data.polygons:

    #assign group to face
    for vert in face.vertices:
        for item in obj.data.vertices[vert].groups:
            if split == 0:
                if item.group not in VGROUP[0]:
                    VGROUP[0].append(item.group)
            if split == 1:
                if item.group not in VGROUP[1]:
                    VGROUP[1].append(item.group)
            if split == 2:
                if item.group not in VGROUP[2]:
                    VGROUP[2].append(item.group)
            if split == 3:
                if item.group not in VGROUP[3]:
                    VGROUP[3].append(item.group)
    if split == 0 and len(VGROUP[0]) == 7:
        split = 1
        file.write('Hey, vgroup split 1!\n')
    if split == 1 and len(VGROUP[1]) == 7:
        split = 2
        file.write('Hey, vgroup split 2!\n')
    if split == 2 and len(VGROUP[2]) == 7:
        split = 3
        file.write('Hey, vgroup split 3!\n')

    for vert in face.vertices: #store vertices in DATA
        DATA[split].append(obj.data.vertices[vert].co[0])
                    #uv, normal, etc...

update... edit

Ok I'll try to explain in other way.

I want to divide a list in parts, so that every part contains only x different items.

My code tries to take a list, read it item by item, and when it has found x different items, it stores them in another list, and continues reading the original one.

For example:

a = [0,1,0,1,2,1,0,1,3,0,2,2,4,2,2,6,2,1,6,3,2]

for item in a:

#Take a, read it, if the value is new in r0, store it in r0 until r0 has 3 values:
if split == 0:
    if item not in r0:
        r0.append(item)
if len(r0) > 2:
    split = 1

#Continue reading a, if the value is new in r1, store it in r1 until r1 has 3 values:
if split == 1:
    if item not in r0:
        r0.append(item)
if len(r1) > 2:
    split = 2

#Continue reading a, if the value is new in r2, store it in r2 until r2 has 3 values:
if split == 2:
    if item not in r0:
        r0.append(item)
if len(r2) > 2:
    split = 3
#and so on

The results should be:

r0 = [0,1,2]
r1 = [1,0,3]
r2 = [0,2,4]

But the results are very different:

r0 = [0,1,2] #Ok this one worked !!
r1 = [1,2,2,1,0,3,4,6] #Mmm.. What?
r2 = [0,1,3,2,4,6] #completely lost

I export vertices from a mesh, each vertex has one bone assigned to it (or one vertex group), so i get a list containing all the vertices with their vertex group, then i want to split the list in parts containing 7 vertex groups.

Thanks again

Well I spent days with this, and suddenly I got it, thanks anyway.

This cuts a ist in parts, for example, my vertices list, without repeating items in every part.
I had to use a while, for loops are not working exactly how I thought in python.

split = 0
r0 = []
r1 = []
r2 = []
#and so on...

a = [0,1,0,1,2,1,0,1,3,0,2,2,4,2,2,6,2,1,6,3,2]
i = 0

while i < len(a):
if split == 0:
    if a[i] not in r0:
        r0.append(a[i])
    if len(r0) == 3:
        split = 1
        i = i + 1

if split == 1:
    if a[i] not in r1:
        r1.append(a[i])
    if len(r1) == 3:
        split = 2
        i = i + 1

if split == 2:
    if a[i] not in r2:
        r2.append(a[i])
    if len(r2) == 3:
        split = 3
        i = i + 1

i = i + 1

#the results are:
r0 = [0,1,2]
r1 = [1,0,3]
r2 = [0,2,4]


Is there a way to numerically position sun in sky texture? I'm creating a scene set in a real-world location and require the sun to be at exact locations for the day, however, I can't seem to find a way to precisely control the sky texture's sun position. Is this possible with nodes or anything?

I'm not sure it can help you anymore, but I recently found this Addon.
It sets the Sun according to the geographical position of your model, day and month of the year, time of the day, and Utc zone!

https://www.youtube.com/watch?v=fAJeML3A60I&t=87s


Does Blender have an equivalent of Rhino's Curvature Graph? Rhino allows to check the quality of a curve with its powerful Curvature Graph tool, like this:
Although Blender mainly deals with polygon, the concept remains the same, especially when modeling organic surfaces such cars/mouses. For example: .

https://gist.github.com/10eb529d7de33a70aa1c3febcf609127
please, copy link and try to import this in sverchok


How do I install the add ons into blender? I want to install add ons for importing .vrm files.
I need to know how to get the add-on from my macbook's files into blender and install it correctly. When I bring up the file, it is not a zip file even though I downloaded the zip file.

The Reason that I couldn't use the zip file was because Safari automatically opened them. If anyone else is having this problem, open Safari, click preferences, and uncheck the box that says "Open 'safe' files after downloading".


How do I denoise an image sequence that has already been rendered? I have completed Andrew's donut tutorial and I have a full set of 30 frames that makes up the image sequence. I opened another Blender tab (closing down the tutorial with saving) to compile the frames into a video. However, I forgot to denoise the frames.
Now when I go to the 'Compositing' tab and open the Image Editor, the 'Render Result' is completely blank. Is there any way to denoise the image sequence without having to re-render the whole sequence?

You can try to connect the image (or image sequence) to the denoise node without using the Normal and Albedo sockets but the result won't be as good as it could be.

In general, Intel's OpenImageDenoise is the best option for now, see how to set it up properly: How to properly connect the Denoise node in Compositor?. Alternativly, you can try using other software, see: Denoising Animations in Cycles.

Next time, I suggest enable Denoising Data and set the file format to OpenEXR Multilayer which allows to store any additional passes like Denoising Normal, Denoising Albedo, etc. to the image file as well (without doing anything), see: Save all render passes to EXR image?


How to make a real mirror on blender with cycle engine I need to add a mirror object in Blender. I'm looking for the existing objects, but can not find any object. I am wondering how I can add such an object.

I felt this was a good question, so I've added an answer for future users. Also, maybe some of my info will add to what you've already discovered.

To make a mirror in cycles, use a glass shader (for obvious reasons), a fresnel shader (to ensure that the light hitting the mirror is complimented by the angle at which it’s shining, as described here), and a glossy shader at low roughness (which is similar to a glass shader but will bend light in a slightly different way, adding to the realism). These can all be easily found by hitting Spacebar and typing the node name. The base object is a simple mesh plane.

I’ve added two glass shaders with 2 different colours, for additional realism.

Be sure to add another coloured plane behind the mirror, so the light rays stop at the mirror glass (and are then reflected) instead of passing right through.


Hair particles breaks in half - blender cycles I'm in Cycles Render, I've added some hair to a mesh, and then I combed it.
As you can see on the image below the hair breaks in half when rendered.

Does anyone know what might be causing this?

To see if we are on the same page, here is my broken hair:

If that is what you are seeing -- and it looks similar -- here are ideas/options:

Have you tried using the B-spline checkbox under the Particle System's Render  area? Also choose a higher "Steps" settings -- although doing so increases render time... But see if that addresses the issue.

In the same vein, see if using Curve Segments as primitives (this is under the Particle Systems "Cycles Rendering" area) helps. Turn on cull back-faces and  turn curve subdivisions to 4 or 5 or 6.

For comparison:

The image above is without B Splines and with primitives set to Line segments. My hairs break at the first crinkle... perhaps that is what you are seeing?

Above: Same as first image, but with B Splines on and Steps set to 5.

Above: Same as first image, but with (B splines not on) and Primitives set to Curve segments.


How to detail this cushions? I am creating a photo realistic leather club chair. I've finished the blockout and im now moving on into creating the high poly. I plan on sculpting wrinkles and such on the chair, but i'm unsure as to how i can sculpt these stitches on the chair's cushion. Here is a reference photo:

i'm thinking of using an alpha but can't seem to find an appropriate one. Is their a way i can model this is?

You wouldn't want to sculpt the buttons but instead use a separate object for that. I would probably just create one and the use the array and curve modifier to position them. Repeating objects along a path


Weird line in my mirrored mesh was following a tutorial where I stumbled into this weird line in my mirrored mesh (sorry for the feet lol)

You can also download the blender file

Problem

This is caused by faces inside your mesh. The main sign of this is that the crease only appears when subsurf is turned up; the inside faces add weight that pulls the verticies inwards (according to the subsurf algorithm).

Solution

Tab into edit mode and uncheck the X box in the Mirror modifier. Your properties panel should look like this:

This will leave you with half a human. Change into face select mode:  and select these faces:

Key X and select Faces. Tab out of edit mode and recheck X in the Mirror modifier. This is the repaired mesh:


Is there an equivalent of a cage for Blender Internal Render? I see in Cycles, there's the option to use the cage during a bake.

Can you also use it in Blender Internal Render?

No, there is no option to use a custom cage for baking with the Blender internal engine. The closest you can get is the "distance" setting, which will sort of simulate a cage.
From the Manual:

Select to Active
Enable information from other objects to be baked onto the active object.
Distance
Controls how far a point on another object can be away from the point on the active object. Only needed for Selected to Active. A typical use case is to make a detailed, high poly object, and then bake it’s normals onto an object with a low polygon count. The resulting normal map can then be applied to make the low poly object look more detailed.


Merge objects in softbody simulation I have joined the objects but they just won't hold together. In the first image, it's as it should be and on the second once it hits the ground, the objects get separated.

You have joined cubes into one object, but in Edit mode vertices are not merged.
Hower with a cursor above a vertex and hit L (Select Linked) ...

your mesh is selected partly - means vertices are not connected. This is the reason why it falls as separated.

it should behave like this ... I used Remesh modifier > Blocks to quickly generate merged cubes at similar density like yours ...

BTW - Your topology is too uneven and dense.
Wire density has essential impact on simulation result.

With the same Softbody setup, but low poly resolution ...

Here after Limited Disolve X operator ...

Note: You have to Apply Remesh modifier before simulation, because Softbody sim is calculated first and Remesh after - so it wouldn't be taken into a count in simulation.


How to check if the active object is using no material Is there a way, to check if the current object is using no material for cycles engine, so that the code could take a logical decision based on that!

Get all the materials

materials = bpy.context.active_object.data.materials

Count the material slots

nMat = len(materials)

Check if a material slot is empty (in this case, the first slot)

isEmpty = not materials[0]


Parenting to bone make object move I'm trying to make clothes for Manuel Bastioni generated meshes.
So I can parent a mesh to an armature and it keeps its transformation. However, as soon as choose a specific bone, the mesh undergoes undesired translations and rotations.
Here it is before parenting to a bone, but already parented to the armature:

Now parented to one of the armature's bones:

I can painstakingly replace the mesh afterwards but it's undergone too much transform to make it a matter of a couple of rotations.

N.B.: I cleared all position and rotation on the original mesh before parenting and it was in perfect position.

Any idea why it moves and how I can stop this from happening?

I suspect that the object your are trying to parent to a bone already has a parent. If that is true, then try removing the object's parent then parent it to the bone. This may not always be easy, depending on your object structures and dependencies. But at least it should solve the problem of the object jumping when you parent it to a bone.


How to zoom out of the backdrop in the compositor? The Backdrop Image in my compositor is too zoomed in because my image is high res. How can I zoom out?

The four controls for manipulating a Background Image in the Compositor:

V zooms out.
Alt + V zooms in.
Alt +  MMB pans around.
Alt + Home fits backdrop to the available area.

Also note the changes to the Node Editor Properties panel, such as the addition of the Backdrop dropdown, which, among other things like the hotkeys, allows for precision zooming.

Refer to the Manual for additional info.


finger is very slightly deformed I do not understand why the finger deforms very little with respect to the su bone.
has the maximum weight, it should move along with your bone.

The fact that it is red means that the influence of the selected bone on this part is the most it can be, but it doesn't mean that other bones don't have influence as well...
To make sure that this bone is the only one that controls this part of your mesh you can select it in Edit mode and in the Properties panel > Object Data > Vertex Group, on the dropdown menu on the right of the vertex grouo list (down arrow button), choose Remove From All Groups, then reassign to the right group with the Assign button.


Moving a Linked Library Is there a way, after a library is linked to move that library to another location? I have a library that is in a different folder than my scene file and for the sake of more easily sending it to a renderfarm I want to move it all into one folder. Is there a way to edit link paths?

Yes. At the outliner panel, find blender File in the menu.

You will see then the current file listed along with other linked files. You can edit the path by clicking over it twice with the left mouse button, or using Ctrl+ left mouse over it.

You must rewrite the new access path yourself. Save and reload to apply the changes.
WARNING !! DO backup before you do this! If the linked file is not found, the result will be a broken file without the link. If you save again with that error, you will loose any reference (instances to that file) forever, forcing you to relink again.


Intersecting a plane with another plane, creating a cut (Boolean/knife project doesn't work) I'm working on this project where I want to connect a floor to a wall. My understanding of Blender is still pretty basic so my workflow has a lot of hiccups. What I'm trying to create is a canal with its underwater climate.

That said, this is what I did:

Extrude a cube in a hallway
Delete the top plane
Separate the bottom    (floor) plane from the wall
Adding an ocean modifier to make it look    like an underwater
ground.
Dragged the sides up slightly with some    sculpting

The walls are pretty basic right now, but I actually want to add a brick wall displacement texture to give it depth.

I decided to skip that step because I'm already stuck at my current problem. That problem is attaching the walls back to the floor by making them intersect.

I'm essentially looking for a way to create a ''slit'' in the wall, by making the floor intersect with it as seen below.

Boolean seems to be of no help and I can't find any information.
I tried to dumb down the problem by making two simple planes intersect like so:

But even with a simple setup like that, I couldn't get it to work.
Any tips on my workflow are appreciated.

The only thing I can think of to do is to never separate the bottom plane from the walls and to modify the floor myself by sculpting. In that case, I will give the walls their own texture and use a displacement modifier to give it the depth.

TLDR: I'm trying to cut a plane with another plane (two separate objects) and Boolean or knife project is not working the way I want it to.

A bit of depth seems to help. In the following image the target of the modifier has some depth (using Boolean Difference) and it seems to work nicely.


How to render this style of geometrical objects Referring to http://www.cs.cmu.edu/~kmcrane/Projects/DGPDEC/paper.pdf

The document includes numerous geometrical object that are illustrated in a very particular style that is appealing. Can this be replicated via Blender?

It certainly can. If you want all the details, though, the question might be a bit broad for BSE, because the style involves quite a wide range of Blender's capabilities.

So just a quick rundown:

Objects .. all easily created in Blender. There is support for mathematical surfaces, either directly, through scripting, or via import.
Material for the surfaces. here,  faintly blue, specular, tweaked against the renderer, EEVEE. Backfaces set to a more neutral hue.
Lighting A faintly Blue world color, not in final render, just for providing ambient light, the color in shadows. A spot key-light, white, size and specular intensity set to provide soft highlights.
Black Line: Freestyle: 2 Line sets: One to pick out object external borders and Freestyle-marked edges, One to pick out 'Silouhette', which gives the overlap in the curved outline in the surface at the back.
Black Line: Black Objects:  the dots and the arrow are actual black objects in the scene, as is the text. It would probably be better to render typography in a 2D vector-based application- the sampling in a 3D render doesn't do it any favors.
Rendering: EEVEE, for speed, and because we don't want physically-based photorealism, and all the computation that would take. At the moment, though, for quickly developing Freestyle sets and styles, it could be better to go back to an earlier Blender, so you can use the old Blender Internal renderer to get previews in the viewport. EEVEE doesn't do that yet.
Compositing: the renders are on transparent film, so the result can be laid over any 2D background. The Black objects are rendered in a separate View Layer so they be laid over the surfaces in 2D, and not be occluded by them.

This sounds a lot, but it only has to be set up once. When the components are set and tweaked, your kit is in place to render in this style. All that's left is modelling.

I'm not saying this .blend is exemplary.. you will probably be able to think of better ways to do things. Maybe, though,  playing with it could give you a kick-off, and provoke narrower technical questions.


Keyboard shortcut to play animations in the timeline in reverse? To play an animation (physics simulation, etc.) I usually use Option(Alt) + A

Is there an easy way to play the animation backwards with a keyboard shortcut?

After some vigorous button pressing, I found this

Option(Alt) + Shift + A

It behaves the exact same way as Option(Alt) + A, except the animation plays backwards.


FPS drops sporadically, with Gsync turned on, even with just one cube in the scene Problem has been ongoing for quite a while. (more than 3 months, can't remember exactly when, sorry)

If I move the mouse outside the current part of blender framerate instantly shoots back up - for instance if i move mouse cursor from "3D viewport" over to "properties", for instance.

Frame drops are down into the single digits.

If fps drops while in 3d viewport, rotating the camera also makes FPS go back to normal (until it happens again)
FPS drop is not only happening when using the main blender window. It can also happen when I have "blender preferences" window open.

I use blender for modeling for 3d print, so I only use the modeling workspace. I most often work on simple models.
I use Solid mode Viewport Shading most of the time.

If I play a youtube video/twitch/netflix on my secondary monitor, while working with Blender, FPS drop does not happen.

If I turn Gsync off, the drops does not happen. The drops do happen regardless if i have Gsync turned on for full-screen, or for both windowed and full-screen.

The reason this is a problem for me is because when the fps drops happen, the 3d viewport especially looks like it's getting a few shades darker gradually. It might also be a trick of the eye as a few flickers are going on, which irritate my eyes.

Anyone have an explanation, or better yet, a solution? (if it is possible to turn off gsync for just one app that would also be nice, but I haven't found anywhere I can set that up)

System:
Windows 10 Home
16GB ram
gforce gtx1660 (6gb) newest drivers, as of typing.
Primary monitor is gsync enabled, but secondary is not.
blender and OS is on a SSD, but blend files are saved on a hybrid drive.

Yes it's possible. Go to nVidia Control Panel > Manage 3d Settings > Program Settings.

Add Blender under Select Program To Customize. Changing to the following settings fixed the g-sync stutter problem for me:

Monitor Technology: Fixed Refresh
Preferred Refresh Rate: Application-controlled


Blender Freestyle - some edges are partially missing even after marking for Freestyle edges I am trying to render some simple geometric form using freestyle in Blender. But  parts of some edges are missing - even though I have marked freestyle edges. Does anyone know how to fix this?

The issue seems to stem from the scale of the object. While you've set the unit scale down, it's still large in Blender units. I suggest setting the unit scale back to one and scale the object to the size in millimeter that you were intending. This results in correct freestyle edges.


Missing FFMpeg Codecs for rendering I'm using Blender 2.79b on Fedora 28. When I go to render a scene I only have three options for direct video output. (AVI raw, AVI Jpeg, frame server). I have checked and re-checked I have ffmpeg installed with all codecs, I also have OGG lib's installed, neither of which show up. Any help getting Blender to detect other codecs would be greatly appreciated.

Thank you for your time and assistance.

Joe

Problem solved!!! The Blender software provided by the Fedora repositories has an issue. After removing and re-installing the issue was still there. I then removed Blender via DNF and installed the package from the blender website and the issue is resolved. I now have ffmpeg and other codecs to render with. Thank you again for your support everyone. Joe


Animate between script-drawn frames? A am making a scientific animation of cell development in a plant stem, as though you could watch time-lapse through a microscope. The cells "grow" as Python data structures, and their progress gets drawn frame by frame into Blender. Now, I want to smooth the action by animating between frames, but since each frame is individually drawn, Blender does not know which cells are the "same" between frames. Is there a way to tell Blender that two objects in different frames are the "same"?
I'm fairly familiar with the API and can see how to add keyframes on objects, down to individual points. The cells do various things: enlarge, change shape, undergo mitosis, get pushed aside by underlying growth, and mature into wood. A brute-force idea is to animate opacity, so one frame fades out as the next fades in; but there must be a better way, with more control. How does Blender normally track that an animated object is the "same" across frames?
plant cell growth animation

It's not clear from the question your exact requirement because the link provided doesn't work.
Since you already know how to set keyframes using the Python Api here,animating between keyframes is only a matter of setting the correct interpolation at individual keyframes until next keyframe.
#Setting individual interpolation points
import bpy
ob = bpy.data.objects['Cube']

frame_num = 0
bpy.context.scene.frame_set(frame_num)
ob.scale = (4,1,1)
ob.keyframe_insert(data_path="scale", index=-1) # "-1" sets values for all axis's
bpy.context.scene.frame_set(frame_num)
key = ob.animation_data.action.fcurves[0].keyframe_points[0]
key.interpolation = 'BEZIER'

frame_num = 10
bpy.context.scene.frame_set(frame_num)
ob.scale = (1,5,1)
ob.keyframe_insert(data_path="scale", index=-1)
key = ob.animation_data.action.fcurves[0].keyframe_points[1]
key.interpolation = 'LINEAR'

#And so on ............

#Setting all interpolations at once
import bpy

ob = bpy.data.objects['Cube']
scales = [(4,1,1),(1,5,1),(1,1,6),(1,1,1)]
frame_num = 0

for scale in scales:
   bpy.context.scene.frame_set(frame_num)
   ob.scale = scale
   ob.keyframe_insert(data_path="scale", index=-1) # "-1" sets values for all axis's

    for fcurve in ob.animation_data.action.fcurves:
        key = fcurve.keyframe_points[-1]
        key.interpolation = "BEZIER"
    frame_num += 10


Project mesh on surface (or clip face with rotation) Is there a way I can "project" a mesh on another mesh's surface?
I know clipping, but it doesn't align the faces that are touching and doing it manually can be very time consuming.

Is there an integrated function or addon to do such a thing?
In case not, can somebody please point me in the right direction to write a py script? (I regularly code in python, just never wrote anything for blender)

Here's a real-world example to explain things graphically:

I want to go from this

to this

To place cube onto the surface of torus in this case, you should:

Enable Snap during transform tool with Shift + Tab. Turn on Face snapping mode, along with Align rotation with the snapping target. Switch snapping part onto the target to Median:

Grab your object (cube) to the desired place. Switch Transformation orietnation to Normal (with Alt + space). Turn off snapping and grab your cube along normals so it moves out of the base mesh surface (in my case it was Z axis):


How to curve text upward? I'm attempting to create curved text at the bottom part of a circle. I am able to successfully create curved text around the circle and position it at the top of the circle and center it. But what I also need is to duplicate this same text at the bottom part of the circle while keeping the text readable without being upside down.

As the text is created it takes the two outside ends of the text string and bends then around the circle creating an arc with the CENTER of the text string being extended up and the ENDS extended down if viewed in top view mode.

I also need to create an additional arc of text where the ends of the string are extended up so I can then position it at the bottom of the circle and still read from the same perspective.

I can rotate the text around the circle but when it's rotated the bottom of the circle the writing is upside down. I've searched but can not find a solution for the problem.

It's pretty simple to set up text at the bottom of the circle. Just duplicate the top text and circle curve.

Then move the text down until it fits the inside of the bottom of the circle. At this point the text will be in the right place but will be reversed. You just need to scale with -1 on the axis the text is on (x axis in my screenshot).


Adding a Hook to a Nurbs Path with Python Python scripting
I would like to add a hook to an Nurbs Path while scripting
In Layout :
delete 'Cube'
Add Curve -> Path
change to Edit Mode
select a Vertex ctrl+h
all set and done
Scripting:
# Add Path
coords_list = ([[0,0,0], [1,0,0]])
path = bpy.data.curves.new('_path', 'CURVE')
path.dimensions = "3D"
spline = path.splines.new(type='POLY')
spline.points.add(len(coords_list)-1)
for p, new_co in zip(spline.points, coords_list):
    p.co = (new_co + [1.0]) # (add nurbs weight)
Path = bpy.data.objects.new('_Path', path)
bpy.context.scene.collection.objects.link(Path)

Setting bpy.data.objects['_Path'].modifers["....ID...."].vertex_indices[0] is read only.
Trying to add vertex_groups to the Path just returns a 'None Type'
any Ideas ?
THX
Martin

Avoid edit mode if you can.
Suggest this can be done via API calls with no operators. Have lazilly added the empties with the op, add them as you have other objects if so desired.
Test script adds an empty hook to each end of your poly.  Note have used NURBS as per question title. To have end points set the use_endpoints_u and v properties of the spline.
import bpy
from bpy import context

# Add Path
coords_list = ([[0,0,0], [1,0,0]])
path = bpy.data.curves.new('_path', 'CURVE')
path.dimensions = "3D"
spline = path.splines.new(type='NURBS')
spline.points.add(len(coords_list)-1)
spline.use_endpoint_u = True
spline.use_endpoint_v = True
path_ob = bpy.data.objects.new('_Path', path)
for i, (p, new_co) in enumerate(
        zip(spline.points, coords_list)
        ):
    p.co = (new_co + [1.0]) # (add nurbs weight)
    bpy.ops.object.empty_add(
        location=new_co,
        )
    hm = path_ob.modifiers.new(
        name=f"Hook{i}",
        type='HOOK',
        )
    hm.object = context.object
    hm.vertex_indices_set([i])

context.collection.objects.link(path_ob)


IK claw control with driver / controller I was doing a claw rigging and in-order to perform the claw to open and closing action I want to implement a driver or an object which will provide its translation data along the z-axis, unfortunately, whenever or whatever(bone or mesh) I have parented in whichever mode (edit or pose), it doesn't seem to work. please help me showing how to add a driver or controller.
I have already rigged the IK.
I am attaching the blender file>>>>>>>>
https://drive.google.com/file/d/1OVqLZrL3sAckov53J7lwJxv-1RktNYUr/view?usp=sharing
A screenshot is also attached.

I have solved this problem by recreating bones without segmenting, what I did is to create the bones in edit mode not by adding new object rather extruding the main one, whenever one creates new objects inside edit mode those would be treated as joined objects, but in my case, there were some issues I think, so I eliminated that step and extruded every bone one after another and at the claw level extruded and rotated by 120 degrees (3 claws for me, just divide 360 by the number of claws) and re extrude from each pole.
here is a brief guide..................................................................

Adding a controller bone at the claw and arm joint which can be done extruding the head of the last arm bone.

2.Adding controllers to each claw head (once you have placed the 3dcursor to the centre of claw joint geometry just pull it down along Z-axis >> using right-hand side properties bar (access it by pressing "N") go under view and you will find 3d cursor location options.
when the 3d cursor has been placed in the right location each claw head controller handle and fix their heads to the cursor by >> Shift "S" >> "selection to cursor"(you must be in edit mode with the bone selected.)
then when all of the controller's heads are conjugated select them all and extrude along Z-axis.
3.Select the geometry or mesh you want to attach with the bone, then selecting any of the bones,  (being extruded from one they are one object, so selecting any of the bones will work) press >> ctrl + TAB to go to pose mode
(****select the bone, at last, that should be the ACTIVE object in a yellow colour not orange, otherwise, The POSE MODE will not be available)
Inside pose mode select the exact bone you want to connect with the mesh, that will become blue, and you will notice that the geometry is already highlighted in yellow, so just selecting the bone press>> Ctrl + "P" >> select "Bone"
******** if you don't have segments like organic objects like a hand (not hand skeleton just skin) or sausage you have to use Weight paint or  Armature reform auto weight distribution or Vertex paint, just search this terms in youtube and you should get a comprehensive guide.***********

complete parenting (when you are doing bone parenting mesh parenting isn't necessary, but you should so mesh parenting if you don't have bones for trivial meshes>> like the arm end or claw head ball, I didn't add any bone for that but that is parented to the arm mesh.

now select the arm end/ claw head handle and assign "bone constrain"( you have to be in pose mode) select "Invert Kinemetice" if you don't specify chain length that will be assigned to the whole chain root, for claw select the controllers and do similar just adjust the chain length to the claw root (chain length is the no of bones connected to the way to Root, you will get a yellow dotted line indicating the root of that Invert Kinematic setup).

Go to edit mode selecting any bone and select individual bones except controllers and press >> "H" that will hide them.

I am adding  My new file Here >>>>>>
https://drive.google.com/file/d/1Rj--YtLs5Hwj2yXDrztZndAl2jFTj7Rt/view?usp=sharing
**press Alt + H to unhide bones.
*** there are 3 controllers of the claw are conjugated in one place so select all of the 3 when posing.
****if you want to change the orientation of the claw ARM controller bone you have to go inside edit mode with one of the bones selected and have to select the controller then press >> ALT + P >>> " clear parent" >> rotate/move/scale as your desire >>> select the controller then the head of the Arm bone (inside the ball)  the head must be the active object (yellow not orange) the press Ctrl + P >> "Connected" / "Keep offset"(parents but keeps distance).
I hope it helped.
New model image


Blender Cycles How to have hair not go through mesh *WITH HAIR DYNAMICS* I have been searching everywhere but couldn't find an answer, but basically I have a model and I added hair dynamics and a wind that has strength of 2, noise and flow of 1. The hair keeps going through the mesh and I don't know why, please help! Thanks!

In a newer version of Blender, this was fixed. Now all you have to do is add a collision modifier/physics property to the emitter object and the hair emitted will collide with the emitter.


Noob Question - Export Model From Blender then Animate with Python I'm new to Blender and 3D model stuff in general. I am attempting to build a python application that will have a 3d model of a face talk. I have a rigged face model that I have been working with in Blender, and my idea was to export it in a file format that would allow me to manipulate and move the rigged points on the face programmatically.
That way, I could make a facial position for every phoneme and interpolate between them to animate the face to "say" arbitrary sentences.
It's been a difficult process trying to ask questions to google, since I don't have the vocabulary to express the things that I want, so I thought I'd try asking humans on here:
Is what i'm trying to do possible?
What file format would meet the qualifications I'm looking for? I'm currently thinking that a .dae Collada file seems to fit the bill, though i'm unsure if i'm able to animate something while it is being rendered.
Thanks!

I think you would be better off leaving the model in blender. Blender has its own API, which I have considered using for just such a purpose (but I haven’t felt motivated to do the phoenome research neccesary). You could save mouth positions as poses, and then apply them with Python and set keyframes at the desired places.


Move along Line Path Not constantly How would I move an object along a line path in a non constant speed?

Like make the character take a step, then stay in the same spot for a few frames, then take another step and then repeat

I could animate the influence value but is there a way that I can simply loop the stop and go keyframes while he continues to follow the path?

Thanks

See the NLA editor capabilities for this.  Repeat Loop. Let N1 and N2 be positive integers. So action can be repeated N1 times.  Then a period of no movement.  Then again an action can be repeated N2 times.
Consider this as a quick note on NLA possibilities How to generate a full sprite sheet automatically
Tutorials on NLA can be searched here at BSE or yoootooob or similar site on your selected search engine. This is not a tutorial on NLA.
Insert keyframes for position on your Follow Path Constraint position. If the object moving happens to be an organic character then use keyframes on the motion of legs of character.


How do I snap one vertex to the position of another vertex in a different object? How do I snap one vertex to the position of another vertex in a different object?

Enable the Snapping Tool (click on a magnet icon and change the snapping type to Vertex). Enabling Snap onto itself function allows you to snap the vertices within the object.


Viewing clothbake during cloth bake I am performing a clothbake. The cloth baking is successful, however during the cloth bake, the current result is not being shown in the 3d-view window as the bake is being performed. So the 3d-view window always shows the cloth as it was at the start of the bake.
At the end of the bake I can see the final results by viewing the individual frames.

Is there a way or setting to view the cloth bake in action during the bake?

I've noticed that this is sort of flaky.  If the bake cache is empty, the current frame is 1, and I click the "play" button, it usually does what you're asking for: it bakes and shows the current state in the 3D View window.  Emptying the cache doesn't always work, though.  One way to quickly clear it is to click the "Pinning" checkbox off and on (or on and off, depending on how you have it set).

[Edit] I saw another post on here that said that playback has to be set to "No Sync" (which I think is the default).


Objects are not selectable since Blender 2.8 UI Freeze I hope someone can help me!

I was animating with Blender 2.8. Then, as I always do during animating I made all objects, such as the cloth or the skin and so on (except the rig) unselectable, to not click them accidentally all the time. In the builds of Blender 2.8 before the UI freeze, there were buttons in the outliner to do this, but now they are gone. I found an option in the object tab under the point visibility where I can make an object selectable or not, but hitting this button has no effect at all.

The objects are selectable in the outliner though and if do so I can go into edit mode as well. The problem is that I'm not able to select them in the viewport!
Another thing is that all the objects in my rig are gray, as if they were not to use.

Thanks for your help in advance!

In case anyone else comes across this, the selectability toggle is now filtered by default. What I mean by that is in the top right corner of the Outliner you'll see a filter icon:

Opening it will provide you with the various toggles and options for objects in the outliner. There you can enable the selectability toggle:

That should be all, hope this helps whoever comes by!


Is there a way to individually modify n objects with the same origin object in game engine? The problem:

I created a number of mesh objects with the Edit Object -> Add object actuator in the Blender game scene. I then modify the vertices in one of them, trying to change the vertices of only that mesh object. All of the copies of the object are modified as a result instead.

The question:

How can I make the mesh objects individually modifiable?

The problem is that each of these objects still has the same mesh, so modifying the mesh of one object appears to modify all the meshes. Two possible solutions are: make separate meshes for each object, difficult to do in the game engine; make all the objects in blender, then load them in the game engine.
I'd suggest finding a new way to do whatever it is you're trying to do.  If this hasn't changed your mind, these two threads give some hints at what I think you're trying to do.
moving and creating objects in the game engine
creating a new mesh in the game engine


What is the best way to scale UVs to fit an image? I was just wondering as it's something I often find myself doing, but is there a automated way to scale selected UVs to fit to the edges of the image boundary in the UV editor?

Currently I have a process which isn't too time consuming, but nonetheless a little bit more so than hitting a button. These images show my process and what I am trying to achieve.

Note: that I scaled everything by the same value, but if I wanted to fit the image square, I would have to do this process once for width and again for height.

Is there a built-in function to do this?

Grab to corner + Scale (not preserving proprtions)

With the Rotation/Scaling Pivot set to 2D Cursor and the cursor in the origin (0,0), activate the Constraint to Image Bounds option, grab the island in the corner and then scale:

Pack island+Scale (preserving proportions)

As stated by the Blender Reference Manual:

  The Pack Islands tool, shortcut Ctrl+P, will uniformly scale, then individually transform each Island so that they fill up the UV space as much as possible.

You can select multiple UV island to scale them while maintaining their relative proportions, or even just one as in the example to quickly scale every possible previusly unwrapped island to the bounds being sure it will not be stretched.

Notice that the box in the toolshelf is unchecked to prevent island's rotation.


Sculpting and custom axis? i'm using sculpt-mode for terrain meshes. I can lock x and y axis in order to only change the z-pos of the vertices when sculpting.

What I'd like to do is (bit hard to explain): use a 'rotated'(?) coordinate system when sculpting. I need the z-axis tilted a bit for some parts of the terrain map.

I wonder if that is possible ...

Many thanks

Edit:

I hope the following picture helps understanding my question.
You see 4 meshes. I can sculpt the selected one the way I want by locking the x and y axis so sculpting would only affect the z-axis. I'd like to do it in a similar way to the other 3 meshes and move the vertices perpendicularly to the (their!) plane (so in this case the plane would define that axis, but it would be fine as well if the axis could be defined in another way). It would be ok if the different meshes needed to be different objects. But it would not be ok if I had to rotate the meshes for sculpting.

I'm new to this board so I don't know why my previous attempt to answer was deleted. Maybe it was just to short last time so I'm trying to be wordier. Its a perfect solution to your issue because I use this same technique. Its a very simple but it works. and I'm being as clear as possible.
Instead of rotating the view to your object, rotate your object to the view, so that the plane you want to sculpt is aligned with the correct axis. That way you can still lock the x and y, and just sculpt along Z axis.
With the axes locked, you can see that the sculpted verts only move in Z axis.

You can rotate the object instead of rotating the view to keep sculpting only locked to Z axis. Rotated 90 degrees

Even if you dont rotate 90 degrees, you can rotate the object however you want and the sculpting is locked to one axis. The vertices are only moving up. Rotated 45 degrees.


How do I make a wheel to rotate around its own axis instead of around its parent object? I added a driver for the x axis rotation and set up the driver editor it's rotation is around the parent object I want it to be around its own axis I tried filling with the degree values in the rotation box but to no avail.

I think it is because the origin point of the wheel is in the wrong place.

Select the wheel in Object mode
go into the (T) panel->Tools->Edit->Set Origin to Center


How can I quickly find the collection an object belongs to? I'm building a complex model that has many collections. Sometimes I add a new mesh to my model and it gets attached to the last collection I was working with. I need to move it to the appropriate collection. But it's not easy to find in the outliner.. So, is it possible to find which collection an object belongs without having to trawl through the outliner to find it ?

In the 3d view-port sidebar panel - View type, there is a "collection" block to indicate which collection belong to the selected object.

(note that cube is in both collections, so both collections marks are filled)

You can also find it in collection block of object properties panel:

But careful about this Collection block, see here


Sculpting brushes other than the grab brushes aren't affecting most of my mesh All of the blue and red/orange brushes aren't doing anything when applied to the upper part of my hair object mesh. I've tried flipping the normals and recalculating them, didn't change it. Trying it with dynamic topology off also didn't fix it. The brushes seem to occasionally work on the bottom part of my mesh, and I went inside of the mesh once and the inflate brush worked from the inside out.
blend file uploaded to google drive

Go to object mode, select the mesh, press Ctrl + A, then choose Scale.
here more info: https://docs.blender.org/manual/en/2.79/editors/3dview/object/editing/transform/clear_apply.html#apply-object-transformations
Why is it important to apply transformation to an objects data?
this is the problem: negative scale (and not uniform)


Why is my model being resized every time I select the armature? I have a model from an FBX file that I've imported into Blender with an armature from Mixamo.
When the file imported, its scale was 0.010. I fixed that by scaling the whole "Armature" object back to 1.0 after the import.
But every time I select the model's armature, it automatically scales back down to 0.010.
Why? What could this be? Is this an FBX issue, or a bug in Blender? (My version is 2.83.1)
Here's what's happening:

The fields you are trying to change are green which means they are animated by corresponding keyframes. (These keep you from changing anything that is not part of the animation, unless you add or remove keyframes).
Most likely scale is not a part of your animation and you can delete these keyframes to regain control over the scale. Right click the fields and choose Clear Keyframes.


Understanding axis locking and local coordinate systems I'm having trouble understanding axis locking methods, specifically in regards to local coordinate systems. I have three questions about this topic.
In most explanatory threads on the internet its explained that, if you use any manipulation tool (i.e., move, scale, rotate, etc) and you use axis locking by pressing either x, y or z, the first time you press it will lock to the regarding global axis. You press the second time and it will perform the manipulative action you chose along a local coordinate system. This is also explained in the blender manual:
https://docs.blender.org/manual/en/latest/scene_layout/object/editing/transform/control/axis_locking.html#axis-locking-modes
...yeah well, it doesn't do that in my case. To figure out what's happening, I created a random object and tried extruding a face. When I extrude a face, it generally starts by scaling along some local Z axis:

When I press z for the first time, it extrudes along the global z axis. So far as explained. But when I press a second time, it doesn't extrude in the local direction again, but it releases it.
Now ok, I can see that, when faces are extruded, its kinda more intuitive if the first suggestion for the direction to extrude in is in the direction of the normal vector. This leads me to conclude that, with any selection (no matter if verticies, edges or faces) the local coordinate system is arranged in such a way that the average normal vector is considered the Z-axis.
First question to you:
Is that assumption correct?
Second question to you:
When I select a face on my random object (such as the one in the image above), I would like to see the local coordinate system, so that I get an idea where my manipulations are headed when I lock to a local axis. However, I never really get to see the local coordinate system. So, I have an idea where Z lies (by estimating the average normal vector of my selection), but I never really know where X and Y are going before I do anything. Is there any way to display a local coordinate system of a selection? How does blender determine how X and Y are oriented locally in the first place? Btw, if I choose "local" in the transformation orientation menu, no local coordinate system shows up either.
Third question to you:
Is there maybe a possibility to create a custom coordinate system which I can use to manipulate my selections? So that, for instance, I can customize where my Z-axis is oriented and lock to it?
Thanks for your help in advance.

You haven't been helped by a bit of outdated documentation (reported), or, IMO, by the interface.
First of all,though, the Local: orientation is the orientation of the Object axes. These can be displayed by checking Axes the Object tab > Viewport Display panel. Unfortunately the display is not 'In Front', so you may have to AltZ switch on X-ray mode, to see them. The Object is a vehicle for its mesh / curve elements, and carries all the object-level transforms.
Normal orientation reverts to Local in Object mode. In Edit mode, actually, it's not always predictable for modeling. Vertex normals may be calculated from adjacent faces, if there, or by projection from the object origin, if not. The useful, predictable normals, I think, are: from selected faces: Z will be along their mean normal. From 2 vertices or an edge, Y will be along the line between the verts. From 3 vertices, Z will be normal to the plane defined by them.
Contrary to your quote from the manual, a single tap on X, Y or Z will constrain a transform to the orientation displayed in the Transform Orientation dropdown. The second tap will revert to Global, (or from Global to Local, if Global is already selected). The third tap will release the constraint.
Custom Orientation
Following the above Normal rules, you can create your own orientation from a selection of elements by hitting the little '+' in the Orientation dropdown.
Extrude
Just to make everything more confusing, E Extrude behaves differently. You're right. The Normal orientation is assumed as the background behaviour, taking the place of Global in the transform tap-sequence described above, and the tool behaves as if you had tapped ZZ already, so the next Z releases, and the next puts you into the orientation in the dropdown.
If, in an extrude, you tap a constraint other than Z, the tool assumes you are starting the cycle from the beginning: Dropdown > Normal > Free.
The old behaviour of the constraints was as in your quote from the manual. It really seems to me that flipping the single and double-tap behaviour has opened up a can of worms. Personally I would rather have had consistency than 'convenience'.


Why are my textures being applied to objects that aren’t selected? I’m trying to add an image texture on a certain object, but when I connect the image texture node to the principled shaded node, other objects in my scene are having the texture being applied to them as well. I made sure my object was UV unwrapped, I tried separating the object by selection, and I just can’t seem to figure out what’s causing this to happen. It’s almost like Blender thinks those objects are part of the same node group. I’m rather new to Blender, so I’m not sure if this is a simple fix or not. Some help would be greatly appreciated!

I think all the objects have the same material, if yu add an object to the scene and instead of assigning new material sharing same material will result in this case
Or
Duplicating objects with ctrl + d instead of shift + d will also cause the same thing.


Make particles start their animations when they're emitted using Animation Nodes? I've asked at least a dozen questions on this same problem I've had, and pretty much managed to filter out every singe idea to solve it, now I'm 100% certain AN is the only option.

As I've already inquired about this issue, I'll paste parts of my older questions here to clarify what my issue is, so:

  I'm using an instantiated collection(!) with 4 meshes in it as
  particles, each of them with shapekey animations. The problem is that
  all of them play at the same time. I'd like each particle to start
  it's own animation when it's emitted, and not based on the timeline.

  Example: Let's say I modeled a piece of popcorn and have base shapekey
  as just the corn seed, and another shapekey as the actual popcorn
  itself. Now when I make a popcorn machine, I want each emitted popcorn
  to start as a seed when it's "emitted", and turn into an actual
  popcorn after however many frames it's born. With the default
  particle system, all popcorn would pop at the exact same time, meaning
  some would be emitted already popped, which makes no sense.

Now, I actually found the perfect video tutorial for this, it shows the solution to this exact problem, but it's for an older version of AN, and some particle related nodes have been removed, naturally. The nodes in particular that are needed that have been removed are the "get particles" node, the "particle list info" node, the "object list" node and the "float list" node.

You can see the full node tree here: (source) (I've also highlighted the missing nodes)

Now, what I actually need help with is to find a way to make this work for the latest version of AN, which is I think 2.1.6, in addition to make this also work with a collection of objects as the particle instance, because in the tutorial, only a single object is used. I'd like to know how to substitute those removed nodes, or, if you're really proficient with AN, maybe you can figure out a better way to do this, as I must say, this node tree is pretty nuts, and I really don't know how to use AN at all tbh. Either way, I'd be very grateful for help!

Thanks!

It has basically three steps:

1) Transform of the objects at the particle location.

2) Delay the shape key of individual objects based on the birth time i.e., shape key animation starts when the particle is born.

3) Then making objects visible only when they are alive.

============================================

Single Object:

Here is the complete note-tree:

Blend File:

============================================

Multiple Objects:

1) Here I have made a Group-Node which gives the instance amount per objects (say multiple ships) by keeping the total is equal to the total number of particles. We will use these amounts in the instancer node to generates the instances of the individual objects (or ships).

2) Here is the setup to instance individual objects (or ships),

3) Complete node-tree:

Blend File:

============================================

Multiple Objects with different materials:

For this, you need to install Animation Nodes + Extra Nodes which has the Material Instancer Node and Material Attribute Output node,

Blend File:

============================================

Multiple Objects with animated materials:

Blend File:


Unable to enter pose mode I'm new to Blender and have been following a video series on Udemy about this software. I'm in the section where we learn how to model and animate a lamp. In this section we've learned how to use pose mode. I was able to use pose mode in previous lectures before, but all of a sudden yesterday, pose mode seems to have disappeared from the drop-down menu in the top left corner. I don't know why it's vanished or how to bring it back, does anyone know how I can solve this issue? Thank you for your time.

The drop-down menu (top left) is context-sensitive. Select your Armature in the Outliner (on the right side). This will bring back the Pose Mode.


Import error: module not found I am working on an addon and when I test installing it it works just fine, but when I reopen the Blender I get a message saying "JARCH_materials" module not found, even though it is in the same folder. Also why is it when I install it I don't get a remove button on the addon?

It turns out that this seems to be an issue with importing bpy into JARCH_matierals. I changed around the code so that bpy is passed into the function instead of being imported and I got it all to work together fine. This might be since bpy is already imported into the module? I don't know for certain.


Material not displaying as expected I'm trying to make progress on a work project that needs completing as soon as possible. I'm new to blender (one week of solid tinkering/learning) and I need some help.

I've got a couple simple materials that are giving me trouble. See attached images for an example and material setup.

How do I get the rendered version of "white" to look more like it does in the 3D View: white with highlights, not the blown out white in the render?

The problem is because you are trying to use Cycles shaders with the Blender Internal render engine.

Each render engine has its own way of handling materials, and these ways are usually incompatible with one another. Because of this, designing a material in one render engine, and then trying to render it with a different render engine won't work.

You need to make materials in the same render engine that you are going to use.

Switch into Blender Render and create a new material there, and your problem should go away.


Would it be possible to improve camera_fit_coords in my zoom method with a generator? I'm trying to improve my zoom_to method for moving the camera towards an object in the scene:

def zoom_to(scene, camera, object):

    co_list = []
    for point_co in [point[:] for point in object.bound_box]:
        for co in point_co:
            co_list.append(co)

    loc_new_for_cam, foo = camera.camera_fit_coords(scene, co_list)

    camera.location = loc_new_for_cam

However I'm not quite understanding how camera_fit_coords works and I'm wondering if a python generator would improve the code by not having the double for-cycle build a useless list.

I tried with:

def gen_co_list(obj):
    for point_co in [point[:] for point in obj.bound_box]:
        for co in point_co:
            yield co

def zoom_to_g(scene, camera, obj):
    loc_new_for_cam, foo = camera.camera_fit_coords(scene, gen_co_list(obj))
    camera.location = loc_new_for_cam

But I get:

  ValueError: Object.camera_fit_coords(): error with argument 2, "coordinates" -  sequence expected at dimension 1, not 'generator'

Also, if there is a way of avoiding foo completely, this could be a one-liner even. It might not be as clear, though.

EDIT: found the true improvement thanks to @batFINGER

After using the tip from @batFINGER and some other minor modification (I was initially editing gen_co_list...), the method can become a still comprehensible one-liner:

 def zoom_to_g5(scene, camera, object):
    camera.location, foo = camera.camera_fit_coords(scene, [co for corner in object.bound_box for co in corner])

I wanted a faster method, so I'm using list comprehension instead of a generator. There shouldn't be a memory problem since there are only ever 8 corners in the bounding box.

The method is ~25% faster, clocking in at:

>>>print(min(timeit.Timer('cam.location=0.0,0.0,7.0; zoom_to_g5(scn, cam, obj)', setup=setup).repeat(7, 1000)))
0.007111115999578033

OLD

It seems it was a mistake in my comprehension of generators, and the code should have been:

def gen_co_list(object):
    for point_co in [point[:] for point in object.bound_box]:
        for co in point_co:
            yield co

def zoom_to_g(scene, camera, object):
    loc_new_for_cam, foo = camera.camera_fit_coords(scene, [co for co in gen_co_list(object)])
    camera.location = loc_new_for_cam

That said, trying to time the code yields different results than what I expected:

setup = """
import bpy
scn = bpy.context.scene
cam = bpy.data.objects['Camera']
obj = bpy.data.objects['Cube']
def zoom_to(scene, camera, object):
    co_list = []
    for point_co in [point[:] for point in object.bound_box]:
        for co in point_co:
            co_list.append(co)
    loc_new_for_cam, foo = camera.camera_fit_coords(scene, co_list)
    camera.location = loc_new_for_cam

def gen_co_list(object):
    for point_co in [point[:] for point in object.bound_box]:
        for co in point_co:
            yield co

def zoom_to_g(scene, camera, object):
    loc_new_for_cam, foo = camera.camera_fit_coords(scene, [co for co in gen_co_list(object)])
    camera.location = loc_new_for_cam
"""

>>>print(min(timeit.Timer('cam.location=0.0,0.0,7.0; zoom_to(scn, cam, obj)', setup=setup).repeat(7, 1000)))
0.009414574999937031
>>>print(min(timeit.Timer('cam.location=0.0,0.0,7.0; zoom_to_g(scn, cam, obj)', setup=setup).repeat(7, 1000)))
0.00963822900030209

run on blender's classic cube.

I will therefore stick with the first zoom_to version, even though I thought the contrary would happen.


Fill area behind animated line I'm animating lines.
Similar to this:  (Let text follow animated beziercurve)

Now I would like to fill in the area behind the curve.
Similar to this:

so that if I move my line than the filled area also moves.
(It would be ideal if there is a gradient that the color is stronger near the line and fades out to transparent when further away.).

any suggestions on how to start this?

if I got what you mean, you could toggle cyclic (ALT-C) on the 2D curve in edit mode, to get a fill. In Blender there's no concept of "object border" but you could use freestyle to obtain something usable maybe.

Here is the overall setup from which you could start...

for the fill, you should be able to use a "Blend" texture type using also transparency, see second image example


Selecting vertices within a box defined by exact coordinates I have a mesh with lots of densely packed vertices.

I want to select all vertices within a bounding box defined by (x1,y1,z1) and (x2, y2, z2) exactly without selecting other vertices outside. Is there anyway to achieve this? (Add-ons will be fine)

It's too tiresome to use the mouse in some circumstances.

You can do this using python.

Open up a text editor in Blender and paste the following script.

import bpy, bmesh
from mathutils import Vector

# checks if a supplied coordinate if in the bounding box created by vector1 and vector2
def IsInBoundingVectors(vector_check, vector1, vector2):
    for i in range(0, 3):
        if (vector_check[i] < vector1[i] and vector_check[i] < vector2[i]
            or vector_check[i] > vector1[i] and vector_check[i] > vector2[i]):
            return False
    return True

def SelectVerticesInBound(object, vector1, vector2):
    # get the mesh data from the object reference
    mesh = object.data

    # get the bmesh data
    if mesh.is_editmode:
        bm = bmesh.from_edit_mesh(mesh)
    else:
        bm = bmesh.new()
        bm.from_mesh(mesh)

    # cycle through all vertices
    for vert in bm.verts:
        # check if the vertice is in the bounding vectors
        # if yes, select it
        # if no, deselect it
        if(IsInBoundingVectors(vert.co, vector1, vector2)):
            vert.select = True
        else:
            vert.select = False

    # update bmesh to mesh
    if bm.is_wrapped:
        bmesh.update_edit_mesh(mesh, False, False)
    else:
        bm.to_mesh(mesh)
        mesh.update()
    # trigger viewport update
    bpy.context.scene.objects.active = bpy.context.scene.objects.active

# get the active object from the scene
active_object = bpy.context.scene.objects.active

# ensure that there is an active object
if (active_object != None):
    # call the method to select all vertices in bounding box vectors
    # object             the object to operate on
    # vector 1           the first coordinate of the bounding box
    # vector 2           the second coordinate of the bounding box
    SelectVerticesInBound(active_object, Vector((0, 0, 0)), Vector((1, 1, 1)))

The coordinates for the two vectors are supplied in the last line, which calls the method. Input your coordinates, select a mesh in object mode and press Run Script or ⎇ AltP to run the script.

I have included comments explaning the code. Additional resources.

Get Vertex Positions
Properly get and update Bmesh objects
Select Vertices

Note: Somehow vertices don't get deselected when the object is in object mode. Maybe an experienced python coder can help us out here.


Blender mouselook problem Intro:

Hello there! I am making an FPS, and I have deleted way too many good projects of mine due to this problem; I am sick of it and I want it solved. My other question about it got closed because it was unclear, so I'll make this as clear as possible.

Scene:

I have a simple scene with a plane. The plane is default, with no edits to it, not even a texture. It has only been scaled, that's all. After that, above the ground a bit, is my character. The collision bounds (rectangle) is basically just a collision bound to a model (character) that is set to "no collision" and is not an actor. The character has nothing to do with this. It does not affect anything. The only important part is the head. The head is part of the character and has Mouse (Movement) > Python. The Python is just the mouselook script. The head is the parent of the camera and just has ml.inherit along with some cap options (in the logic editor). There is also some basic lighting.

Problem:

Every time I look upwards with my mouse (moving my mouse forwards), just 1 degree above where the head normally faces, the whole scene just gets "ruined." However, this does not happen when I look down. What happens when I look up is that it seems that the lighting, first of all, is quickly, every millisecond, "flipped" where the ambient is more brown instead of blueish yellow. At the same time, the head keeps on flashing (going between visible and invisible). I think the head flashes once per second, but I'm not sure. How do I stop the "twitching" from happening? Here is my .blend, thank you!

As of 2.72, there is a new mouse actuator which you can use to rotate objects based on mouse movement.

By using this actuator instead of the python script, it seems to work fine:


Does Sculpting create any new Geometry? I am going to use some sculpting to give a better shape to a Game Character, so I would like to know if Sculpting may add more geometry, for an instance the F layer brush or the F blob brush.

Normally sculpting does not add any vertices or edges, it just moves them around. But when you enable the dynamic topology option in the left toolbar T of your 3d view it adds vertices depending on the given value and your zoom level.

You wrote that you want to create a game character? I recommend that you copy your existing object and add more and more details. Then you can bake the normals and save a lot of memory and rendering time.


How to apply clothes to an armature I have a modeled person that has an armature and I created a T-Shirt for it in rest position now I need to figure out how to put the shirt on the model in pose mode.

I followed Den Den's instructions and get this:

Select armature and enter pose mode;
Select bones that are close to your cloth - in your case chest, neck, collarbone, etc. No legs and such;
Press Ctrl + i, then H;
Select character mesh;
Select cloth;
Enter weight paint mode;
Push Transfer Weights and use options as below:


PyQt and Tkinter seem to not work with Blender 2.8 When importing PyQt5 blender throws this:

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
ImportError: DLL load failed: %1 is not a valid Win32 application.error.

I have double checked several times to ensure that everything is on 64 bit(OS, Blender and Python in blender).

I attempted to settle for Tkinter however that gives this error:

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "D:\blender-2.80\2.80\python\lib\tkinter\__init__.py", line 36, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

Has anyone else encountered these issues and had any success creating an external gui for blender?

Both are intentionally disabled since they may cause problems with Blender in certain situations (don't ask what situations, because I haven't run into an issue yet). You can install Anaconda on your system and then delete the contents of the "python" directory in your Blender install directory. And replace it with the contents of the "C:\Anaconda3\envs\py3" folder. This completely replaces the python version that runs Blender, so be careful to download the correct version that is compatible with your version of Blender:

Python 3.6 for Blender 2.79
Python 3.7 for Blender 2.80

You may still need to install TK and PyQT separately (I can't remember what is included with Anaconda), but they should work now.