text:
bpy.ops.armature.duplicate_move() not creating a duplicate
I am trying to programmatically add new FK rig controls to a character which is already rigged with deformation bones. To do this, I duplicate a deformation bone for which I want to add a new control, rename it, give it a custom shape, turn off deformation and add a copy transform constraint on deformation bone targeting this new bone. My problem is that when I use the bpy.ops.armature.duplicate_move() operator to duplicate, nothing happens - except that the selected bone is deselected. Here is an example execution on the blender console (I was in armature edit mode when I ran these commands):
>>> len(D.armatures['skeleton_human_female'].edit_bones)
67

>>> C.active_object
bpy.data.objects['skeleton_human_female']

>>> C.active_bone.name
'upperarm_L'

>>> len(C.selected_bones)
1

>>> C.selected_bones[0].name
'upperarm_L'

>>> bpy.ops.armature.duplicate_move()
{'FINISHED'}

>>> len(D.armatures['skeleton_human_female'].edit_bones)
67

>>> len(C.selected_bones)
0

As you can see, the number of bones in the armature doesn't change. I am using blender 2.78c. What could be wrong?
Thanks in advance!
edit: I found that duplicating using duplicate_move() operator is not my favourite way to create new bones in the same position. Instead I just create a new bone, and assign head and tail elements appropriately, using a function like this:
def createNewBone(object, new_bone_name, parent_name, parent_connected, head, tail, roll):
    bpy.ops.object.mode_set(mode='EDIT', toggle=False)

    bpy.ops.armature.bone_primitive_add(name=new_bone_name)

    new_edit_bone = object.data.edit_bones[new_bone_name]
    new_edit_bone.use_connect = parent_connected
    new_edit_bone.parent = object.data.edit_bones[parent_name]
    new_edit_bone.use_inherit_rotation = True
    new_edit_bone.use_local_location = True
    new_edit_bone.use_inherit_scale = False

    new_edit_bone.head = head
    new_edit_bone.tail = tail
    new_edit_bone.roll = roll

Running above code on a simple one bone armature (in edit mode) gives me a selected copy of the bone.  The original is deselected.  I'm wondering if it is a bone layer issue...??? can you post a sample file showing same behaviour or an image showing bone layers.

@batFINGER I somehow lost the actual code I was using which caused the issue, but I was changing selected and active bones using the bpy.context, unlike Tak's approach below, which I verified works as expected.

Try this:
import bpy

arm = bpy.data.objects['Armature']
bpy.ops.object.mode_set(mode='EDIT')
bone_to_duplicate = arm.data.edit_bones['Bone']
arm.data.edit_bones.active = bone_to_duplicate
arm.data.edit_bones.active.select = True
bpy.ops.armature.duplicate_move()


text:
Rotation of Child
i have made this soft body with some blobs parented to vertex, The problem is as the soft body moves, the blobs are rotating, like copying the parent rotation to their local rotation.
The child object is keeping looking up:

I have tried constrains, but no luck
Thanks in advance

As 0 dimensional objects, vertices do not really have rotation in the same way that other objects do.
When encountering problems like this, it's usually helpful to reduce the problem to simpler examples.  In this case, just use two cubes and vertex parent one cube to a vertex of the other cube.  Now try rotating the parent.  Notice how you can't get the child cube to change orientation?
If you need your children to acquire some kind of orientation, you need to provide them additional information.  In your case, consider giving your blobs a damped track constraint to a a bone or empty located at the location of your parent object.  This will keep the blobs facing outward.
At least, that's the easy version, but it's still flawed because you're leaving an axis of rotation undefined.  The ideal way to do this is to follow the damped track with a locked track to a single vertex vertex group to fully specify the orientation.  When quality is important enough to do this, you might as well specify the target of the damped-track on a per-vertex basis with single vertex vertex groups as well, so that your blobs will orient properly with local soft body surface deformations.

This seems to be expected: being a soft object, and having child blobs, the blobs inertia kicks in when you rotate the soft object, because their bodies suffer from lower acceleration than the parent.
If you don't want the blobs to 'fall behind' you need to create a 'harder' link between them and the parent, or make them more rigid.

Like?I created an empty, that gives the rotation, I also tried copy rotation but changed the origin, to the mass origin.Its not perfect, but it somehow works better

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Is there any way to optimize the performance of blender on my computer?
Quite some time back I had blender on this very computer and it worked great. Recently, my hard drive crashed and I decided to switch to SSD. I reinstalled blender on my computer and ran it. Now blender always lags seconds behind. It seems like the interface lags a lot.
Basically, if I perform an action, that action won't appear to have done anything until I've performed another action. I'm sure you can see how this makes it virtually impossible to work with blender.
I've looked every where for a solution and have found none. If anyone has a solution, I'd love to hear it.
I'm using a Toshiba laptop running Windows 7, 64-bit.
I'm currently downloading a display driver update.
Graphics card is an Intel.

Possible duplicate of Blender 2.78 with Windows 10 lags when interacting with the UI

Thanks for the link. I took a look at this but I don't believe I can do the same thing on windows 7. If so I'm not sure how. @Denis

If you have Nvidia graphics card, open Nvidia settings panel and there you can change individual program settings

My graphics card is an Intel.

Have you reinstalled graphics drivers after OS reinstall?

@DuarteFarrajotaRamos Yes.

Intel cards are known to cause trouble and yield poor performance. Try changing the Window Draw Method in the User Preferences > System, making sure you save settings and restart between changes.

Just tested every draw method available. No change whatsoever. @DuarteFarrajotaRamos

Found a new driver update and installed it. Blender now works great. Thanks for all the help!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Form a circular Mesh out of an object
Complete beginner here just three days experience.
I am creating a bottle water, picture below. and I want to achieve two things.

I want to have a circular mesh in the shape of the circle beside the bottle to cut all the 3 bottom swimming lines like as if it is part of the bottle on both sides.
I also have a vector logo which will go into the circle all meshed together with the bottle.

Like I said I am a complete beginner, and I will be glad if someone can point a very easy and straightforward tutorial to achieve this.
Thanks
Edit
Look at this plastic.

I want to achieve the annotated bump on the plastic below where the annotation is using the circular shape beside the plastic or any means possible.

Guide will be appreciated

Possible duplicate of How to cut an object along a curve?

I think the aim is to add a label on the bottle. Is that it?

No, please refer to edit

As @DuarteFarrajotaRamos said a possibility is to cut (but only the front part: there is an option for that), and once cut, model the interior. You can also try sculpting or editing with proportional edit mode.

Hi @lemon, DuateFarrajotaRamos duplicate suggestion did the trick. However, there were jaggy contours and the bottle face isn't smooth anymore, any suggestion. Perhaps you explain the 'sculpting or editing with proportional edit mode'

Hi Temitayo. The result and the way to do it, in any case, will depend on how is the bottle's mesh topology. Could you upload it or add a picture with the wireframe visible? A link to upload to BSE: http://blend-exchange.giantcowfilms.com/

@lemon here you go http://blend-exchange.giantcowfilms.com/b/2905/
Nice name by the way

Some tips concerning the circular cut, starting from the answer indicated by Duarte Farrajota Ramos in the comments.
The result is the following, and this answer is concerning the cut only and its cleanup, not the logo part (as the approach may be very depending on the logo shape itself):

Just to say, we can notice that the starting mesh is very clean and uses a subdivision modifier so that we have a reasonable amount of vertices to work on:

After the cut is done, we obtain some distortions, as the cutting circle geometry does not correspond to the bottle. This is particularly visible without the subsurface modifier:

So, the cleanup consists mainly on three actions (and this works because we know that we'll have the subdivision modifier after that):

Dissolving unwanted vertices
Merging vertices
Adjust cut position

Dissolving vertices:

Select them
Use X and choose 'dissolve vertices'
The aim is to do that 'everywhere' to make quads again around the hole (again, we know that subdivision surface modifier will compensate that)

Mergin vertices:
At some places this is easier to merge AltM, either at center or at the last selected.

Adjust cut position:
Select the wanted vertex and use G twice to move it along the edge:

Once all done, in this case, remove the inner part of the cut:

Now select the border, extrude E, and scale S a bit. The aim for that is to isolate the central part with a 'clean' edge loop:

Last steps, filling the hole:

Continue that as possible and finally adjust vertices in the same way as the beginning so that almost all faces are quads:

Link to the blend file

Thanks, but there is a problem, how do I get you a bottle of wine? :) . Thanks so much


text:
Given a rectangle (4 vertices), how to make ONLY ONE of the corner rounded

You can apply Subdivision Surface modifier to round all corners but it will result in all corners being rounded.

How do I make it such that only ONE corner is rounded?
Is it possible?

okay. but thats like rounding corner"s"  in general. This is specific to one corner. So for my case when I was searching for existing solution I didn't think that question, from the title, would answer my specific question. This may help quite a lot of people.

Well, it's always best to generalize the search criteria a bit. Else we might have questions for rounding exactly 2 corners, 3 corners, etc. The site would be a mess. Duplicates help to organize it and this is a textbook example of one - note the question does not go to waist and it's not a bad thing to happen, users are redirected to the general one where more solutions are answered. Grouping like that helps with site coherence and helps other people to get there when they searched a bit differently.

Use a bevel modifier defined by a vertex group with only one vert selected.

Haha, I literally learned how to do this yesterday :D


text:
Reducing in mesh stretch at bone junction
I'm new to Blender. I apologize in advance if the question is not clear, I will try to explain the problem as best as I can.
I have a mesh that represents a knocked-down box (think rigid, hard material) ans I'm trying to animate it into a folded box container. To do that I rigged my mesh as follow:

From a high-level overview, everything works fine. However, I notice that the stretch at the junction of the bone when folding 90 degree is too large.

This behavior causes undesirable hole in corner of the folded box because the stretching of the joint was too large.

How do I reduce this stretching.
File for reference:
https://drive.google.com/file/d/0B5PLUki5PE9sWHRuQUJQT1F4M2s/view?usp=sharing

Heads/tails of the bone should be at the exact location where the box is to be bent. Additionally vertex weights will matter, so please edit your question to see how are the weights or upload your file.

@lemon thanks for the tip, i will go investigate the weight - i think they are uniform. Additionally I updated the question with the file link.

In this case nearly all vertices (if not all) need to be linked to only one bone. So remove all weights, then assign the wanted vertices to the wanted corresponding group. Also, some of the bones articulations are misplaced. And probably, you have too much bones here each face which has 4 bones could have only one

And important too: when flat, bones and box are not on the same plane (did not saw it first, but maybe the main point here)

Bones heads here need to be placed on the exact place of the folding.
Here the bones and the box are not on the same plane. So when the bone rotates it stretches the box:

This is the main problem.
Make so all bones are well aligned with the wanted folds, in all directions.
When the bone is aligned:

hmm ok. good point thanks. bone pivot location seems to be very important


text:
Straightening out ALL uneven UVmap vertices in unison w/o overlapping?
Instead of tediously straightening all the edges to align perfectly vertical one by one by one, is there some way to straighten out ALL the UVmap vertices ALL at once (like on the left side all nice nice vertical) without having them mashup and overlap into one --as with happens when I select them all and type S + X + 0?

Cylinder projection - I tried almost every unwrapping option and that seemed to be the best, albeit still a little slanted as you can see.

try uvsquares


text:
How do I Fill a Subdivided / Smoothed Barrel's cutout With 2 Sided Right Angle Face?
I have a barrel that I need to make a shelf in. I need to fill the cutout section. The barrel has already been subdivided and smoothed. Preferably with a right angle corner fill.. or curved corner might work. The blender file is located here: http://www.aworkofmarc.com/1/Templeton Any pearls of wisdom are greatly appreciated.

I'd do this in several stages, to make sure the topology stays nice and works well with both the subdivision modifier and the smooth shading.
Start with filling the horizontal surface. Connect the two verts that delimit this part and join them into an edge with F.
Subdivide this edge 5 times with W --> Subdivide --> crank up to 5 in the tools panel.
Then fill this surface with a grid fill (Spacebar menu --> Grid fill), using 6 spans and an offset of 6.

Repeat this process for the upper cap (6 spans and an offset of 3 for the grid fill this time):

Add a loopcut in the perimeter of the barrel, at the same height as the edge we started with in the last step. Create faces for the rim at the left and right by selecting 4 verts and filling a face (F).

Now you can fill the last hole with another grid (see span and offset params in gif below). Add another cut by selecting the two verts near the bottom and creating and edge with join J, to maintain a nice flow of vertical loops. Select the loop above which is distorted due to the current topology, and straighten it this way: make the leftmost vertex, that representing the desired height for all the verts, active by deslecting and reselecting it (Shift + RMB). Change the pivot point to active element, then scale all verts to 0 on the Z axis (S --> Z --> 0).

Now, if you like, you can add more loopcuts or increase the crease value to control the curvature of the subdivided surface.

first of all, those are two separate object, the barrel has a top cover.
then, you can fill that "hole", by

disabling the subsuface modifier
in edit mode, activate edge selection (CTRL-TAB)
then select two opposite edges, facing each other from both sides
press F to create a face: this will create a face crossing the hole.
repeat until the hole is filled.

then you will get something like this

from here, you can re-enable the subsurf to find out that he surface just created is too smoothed, but selecting edges and using SHIFT-E (edge crease) you can get those edge sharp, as much as the topology allows you ( I tried and had mixed results, I feel something should be changed in the barrel to make that filled part completely flat with the subsurf enabled...)
but you asked for even just some "pearl of wisdom"... :D
here they are...


text:
How do I change the viewable boundary within camera 0
I can't seem to figure out how to enlarge the viewable area in Camera 0 in order to see how to position object I want rendered. Cntrl + B gives me  crosshairs to redraw but does not allow to redraw the viewable area larger.

Sorry, this is not about pointing a camera which the provided 'related' link explains, but rather how to ENLARGE that little viewable square into something I can actually see. I'll repost the picture to show a RED boundary of what I mean and how big it should be.

To enlarge it you should uncheck Lock Camera to View and simply rotate the mouse wheel up or use method which @cegaton provided.


text:
Transparent section of png causes unsightly / different refraction in glass
If you look at where the label's edges are notated in red, and then look at those same edge areas in the other bottles you'll see an unsightly / different refraction when rendered. Why causes this? How can I get rid of it?

If you want this answered you need to provide relevant information. Show us the shader and the image you used.

Re-uploaded new image with requested info.

It looks like these are the borders of the .png image which provides label on the bottle. This changing is even visible on the bottle on the right, which is rendered on grey background.

No, it's not just the borders... yes you can see borders but if you look you'll see the entire transparent area of the png is refracting differently. If it were just a line, border or edge I'd just fix it in Photoshop and be on my way. :)  But because it's refracting differently, that's not something I can 'fix' in Photoshop.

PNG are not a very good choice for alpha. Try tga or tiff that stores a physical copy of the alpha channel. Also have you tried separating the bottle and the label into 2 physical model instead of combining them in one material?

Ahhh.. ok. Good information on tga / tiff. Thanks. And I don't yet know how to "separate the bottle and the label into 2 physical models".


text:
Creating bottle using Blender Render for output to Blend4Web
All the tutorials I can find use Cycles render for creating bottles. Because Blend4Web does not support Cycles --where can I go now to find learn how to create clear bottle with uv wrapped label BUT using the older Blender Render?

it's not that Blend4Web doesn't support Cycles. It doesn't support Cycles's nodes for material. You can try addons to convert cycles materials to blender internal materials. Either way, Blend4Web as it's own nodes, that you can use: https://www.blend4web.com/doc/en/node_materials.html

Please see this model
https://www.blend4web.com/apps/webplayer/webplayer.html?load=../../assets/fridge/bottle/bottle.json
The source Blender file is only available in the Pro SDK though. Anyway, feel free to ask questions regarding this model on our forums.

I am new for blender so this may be not wery accurate but I think that you can only use nodes in cycles render and as far as I know you can't make glass without nodes.

first off, he is asking how to make glass in the BI, not cycles. Second all cycles materials are node biased, however for something simple like glass you do not have to use the node editor.


text:
Calculate surfaces thickness
I have two surfaces, representing the inner and outer surface of a skull.
To calculate the thickness, I thought about calculating the length of each inner surface's vertex normal for the vertex until it crosses the outer surface.
I'm trying to use these fantastic functions:
https://docs.blender.org/api/blender_python_api_current/mathutils.geometry.html
You can take a look at the surfaces here:

Any help will be most welcome!
Thanks,
Noam
***** Edit ******
I tried to use ray_cast as @batFINGER suggested. I might do something wrong, but it gives me strange results:
inner_skull = bpy.data.objects['inner_skull']
vert = inner_skull.data.vertices[0]
hit, loc, norm, face = inner_skull.ray_cast(vert.co, vert.normal)

I ran this code after making sure all the normals are pointing outside.
That gave me the same vertice pos as the hit location. So I tried to add the normal to the starting point:
hit, loc, norm, face = inner_skull.ray_cast(vert.co + vert.normal, vert.normal)

That gave me no hit at all. (I check and vert.co + vert.normal doesn't cross the outer skull)
Any suggestions?
***** Edit 2 *****
I ended up using the following code, which is really not optimized, but does work:
def check_vert_intersections(vert, surf_obj):
    for face_ind, face in enumerate(surf_obj.data.polygons):
        face_verts = [surf_obj.data.vertices[vert].co for vert in face.vertices]
        intersection_point = mathutils.geometry.intersect_ray_tri(
            face_verts[0], face_verts[1], face_verts[2], vert.normal, vert.co, True)
        if intersection_point is not None:
            return intersection_point, face_ind
    return None, -1

***** Edit 3 *****
I used @batFINGER solution and it's great! I've just changed the loop to go over the vertices and not the faces, because I needed the thickness to be calculated for each vertice.
You can see a video of the solution here:
https://www.dropbox.com/s/xik3ucmnc94qaba/skull_points_thickness.mp4?dl=0

think object.ray_cast is probably your best bet.  Use the vert.co and -vert.normal as ray origin and direction respectively, from inner to outer or vice versa.

Your check_vert_intersections will "work" as long as each objects matrix_world is identity (and maybe same) otherwise need to make compensation of local coordinate space of one to other.  Your attempt at ray_cast was from inner_skull out from a vertex normal to inner_skull.  Hence the lack of a result.

Raycasting from inner to outer
Code to shoot a ray from each inner object face centre along the normal, to the outer object.  Object.ray_cast(...) the parameters need to be in the local space of the object we are casting on.
Some notes. The code below gives expected result for a cube within a cube, or sphere within a sphere, as the face normal is the same direction (with origin at centre of geom) as face.centre - origin.   For your object, might want to have some test where normal isn't in the direction of closest point on outer.  For example on the slope of bumps. (hope that's not too confusing)
import bpy
context = bpy.context
scene = context.scene
show_hit = True # add empty at hit.

def draw_empty_arrow(loc, dir, draw_size=1):
    R = (-dir).to_track_quat('Z', 'X').to_matrix().to_4x4()
    mt = bpy.data.objects.new("mt", None)
    R.translation = loc + dir
    #mt.show_name = True
    mt.matrix_world = R
    mt.empty_draw_type = 'SINGLE_ARROW'
    mt.empty_draw_size = dir.length
    scene.objects.link(mt)

# check thickness by raycasting from inner object out.
# select inner and outer obj, make inner active
inner_obj = context.active_object
outer_obj = context.selected_objects[1]
omwi = outer_obj.matrix_world.inverted()

imw = inner_obj.matrix_world
omw = outer_obj.matrix_world
mat = omwi * imw
hits = [] # vectors from inner to outer
for face in inner_obj.data.polygons:
    print("face", face.index)
    o = mat * face.center
    n = mat * (face.center + face.normal) - o
    hit, loc, norm, index = outer_obj.ray_cast(o, n)
    if hit:
        print("hit outer on face %d" % index)
        hits.append((o, loc))

# test on cube, cylinder ok.
# print((outer_obj.dimensions.x - inner_obj.dimensions.x) / 2)
if hits:
    avge_thickness = sum((omw * hit - omw * o).length for o, hit in hits) / len(hits)
    print(avge_thickness)
    if show_hit:
        for hit, o in hits:
            draw_empty_arrow(omw * o, omw * hit - omw * o, draw_size=1)

Result of running on sphere within a sphere (the outer sphere is wireframe)  Empties drawn from inner face to outer hit.

Thanks so much! I've just changed the main loop to go over the vertices because I need the thickness to be per vertice. The arrows are amazing! Finally I can check if the solution makes sense or not...


text:
Blender script + EXCEPTION_ACCESS_VIOLATION
I have a script running in Pyside2 in its own thread, its persistent window that never closes and remain in that thread during the blender live cycle.
When I try to run a render via bpy.ops.render.render(write_still=1) there is 50% chance I get
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF765FF38B0
Module  : C:\Program Files\Blender Foundation\Blender 2.83\blender.exe

I’m guessing its due to some thread synchronization or something, as this "Addon" does not align too properly to blender addon guide as I’m using PySide2.
In any case, does any1 have any idea why I'm getting these crashes when I try to render? How can I tell blender to render from other thread? As far as I can tell when the render "works" the Qt GUI becomes frozen, but blender gui still remains "responsive" which tells me that I must be starting the render from Qt thread and not blender own thread & causing an error...
Any hints would be great
TIA.
edit. my render script goes as follow:
    for camera in cameraList:
        bpy.context.evaluated_depsgraph_get()
        bpy.context.scene.camera = bpy.data.objects[camera]
        bpy.data.scenes[0].render.filepath = self.mRootPath + "/" + str(camera) + "." + self.mFormat
        print("render", self.mRootPath + "/" + str(camera) + "." + self.mFormat)
        bpy.ops.render.render(write_still=1)
        print("pass render ")

error happens on bpy.ops.render.render(write_still=1)

do you test run only the bpy.ops.render.render(write_still=1)  line?

you should  see https://docs.blender.org/api/current/info_gotcha.html?highlight=thread at the end of page

or https://devtalk.blender.org/t/multithreading-support-please/13038

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Deselect items from select all
How would I deselect an item from the A keyboard shortcut to select all? Like if I wanted to deselect the plane (pic below)

Not entirely sure if this answers your question. To make an Object unselectable, you just have to toggle it in your Scene Collection. If you're asking how to deselect an object in general it's Shift + M1

thanks that works, but a shortcut or something would be even more helpful, like maybe right-click to deselect?

Shift + left-click in the viewport is deselecting the object again. CTRL + left-click in your Scene collection will deselect the object too.

Thanks a lot!!!!


text:
How to get Blender 2.78c and Yafray to play nice...?
I am trying to enable yafray in the latest blender release 2.78c. When I try to turn on the add-on I get the following...
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender\2.78\scripts\modules\addon_utils.py", line 330, in enable
mod = __import__(module_name)
File "C:\Users\Professor Black\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\yafaray_v3\__init__.py", line 70, in   <module>
from . import io
File "C:\Users\Professor Black\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\yafaray_v3\io\__init__.py", line 21, in <module>
import yafaray_v3_interface
File "C:\Users\Professor Black\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\yafaray_v3\bin\yafaray_v3_interface.py", line 28, in <module>
_yafaray_v3_interface = swig_import_helper()
File "C:\Users\Professor Black\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\yafaray_v3\bin\yafaray_v3_interface.py", line 24, in swig_import_helper
_mod = imp.load_module('_yafaray_v3_interface', fp, pathname, description)
File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified procedure could not be found.

I am not sure how I go about addressing this error. I have looked around and it is not clear, to me at least, what Python package I should be using with yafray.
Anyone have experience with this?
Thanks in advance.
UPDATE
I uninstalled blender and reinstalled blender using blender-2.78c-windows64.msi
when i launch the program i get
AL lib: (EE) UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead
found bundled python: C:\Program Files\Blender     Foundation\Blender\2.78\python

Then I downloaded yafaRay.v3.1.1-  beta.build.for.Blender.2.78.MinGW.Win7.Win8.1.Win10.64bit.zip
and installed from file as suggested, yielding
 reloading addon: yafaray_v3 1488561782.9271553 1489010961.1245487        C:\Users\Professor Black\AppData\Roaming\Blender    Foundation\Blender\2.78\scripts\addons\yafaray_v3\__init__.py
Modules Installed from 'C:\\Users\\Professor   Black\\Downloads\\YafaRay.v3.1.1-  beta.build.for.Blender.2.78.MinGW.Win7.Win8.1.Win10.64bit.zip' into   'C:\\Users\\Professor Black\\AppData\\Roaming\\Blender    Foundation\\Blender\\2.78\\scripts\\addons' ()

What if you exit Blender, run it again and try to activate the addon?

Windows or Mac machine? I cannot reproduce the issue on Linux - downloaded the latest version > User Preferences > Install from file without any errors... @TheCodeNovice

@poor I am on a Win10 64bit version. I do not get any errors when i try and click install from file, only when i try to enable the yafray addons.

@lemon I get the same error each time i open blender and try and enable the addons

The missing file may be "c:\users<your account>>\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\yafaray_v3\bin_yafaray_v3_interface.pyd. Do you have this file?

it's the "compiled" version of bin_yafaray_v3_interface.py at runtime (when enabling the addon) @lemon, I guess the error comes from a "wrong", perhaps 32bit version of yafaray

@brockmann, yes. What is not clearly confirmed by TheCodeNovice is the exact version of the addon. Could you indicate it?

The thing is that all versions of it marked as "unstable" (beta) and they recommend using the latest so I'd definitely do that (don't see any reason switching to the old 1.2 versions, you can convert old materials within the new one). Also tested the latest addon on linux to confirm poor's comment, except one negligible color managment issue, no madness @lemon

i will confirm when i get home and update my post. Thanks for the help everyone.

We can indeed enable or disable the addon only once per session (should be reported here: http://www.yafaray.org/development/bugtracker/yafaray).
Apart from that the Addon working fine on Windows (64 bit) :

First remove all the previous Add-ons and Versions of Yafaray, then download Yafaray 64bit from here, go to User Preferences, Addons, Install from File, select the zip file and enable the addon, done.
If the error message comes up restart blender and enable/disable the addon.

thanks for your answer, can you update it with what python version are you using, the packaged one or a different one.

It's just the default version that comes with blender 2.78c (otherwise I had mentioned that). In case your python versions messed up, I recommend downloading blender as zip archive. Also make sure you are downloading the correct version of yafaray for your system @TheCodeNovice

Do i need to get rid of other versions of python on my computer. Like clear out my environment variables etc...

Blender comes with it's "own" python, no need to setup environment variables (in general) so I doubt there is a python version error, if it were the wrong version blender wouldn't come up at all. However I don't know your system and again blender's ".zip" variant is very handy (in such cases) @TheCodeNovice

ok I will give this a shot when i get home thanks for the help!

not sure where I went wrong but following your steps worked. Many thanks!

@TheCodeNovice phew. I'm glad that it's working now...


text:
Matcap shading on blender 2.76
How can I get Blender to show Matcap shading for object on blender 2.76?

Same as in 2.71 - http://blender.stackexchange.com/questions/16339/how-to-apply-matcap-materials-for-sculpting-in-blender-2-71

In the Properties side panel, Shortcut key N > Shading menu ...

thanks but my problem is nothing happen when i apply the matcap.


text:
Belly deforming when moving hand!
For some reason moving the hand deforms the belly:

However, there are no weights in that area, or at least none strong enough to cause the deformation I see:

This is how it appears normally (at rest position):

How would I go about fixing this? I am completely stumped.

Related: https://blender.stackexchange.com/questions/76715/while-moving-arm-leg-mesh-messes-up

@PaulGonet Doesn't work, weights are already cleared, yet it still deforms like this.

Uploading a .blend file would definitely help.

It's always weights... always. Hard to spot, yes.

@ScottMilner Added the .blend file.

@m.ardito Checked those already.

Diagnosis first, solution second:
Problem

From the looks of it you used automatic weigthing (probably heat-based) and in the bind pose the IK bone finger1.L.IK is very close to both the belly and the finger, so both places are automatically weigthed to the IK bone.
Anything you move that moves the IK bone will therefor will move the belly.
This problem exists for all of your IK bones, they all have weights when they really should not deform anything, they are just helpers to move the real deform bones like finger1.L, finger1.L.001.
Solution
Your IK targets generally should not have any vertices weigthed to them if you only want to use them to drive your real deform bones. To make sure automatic weighting doesn't use helper bones, select them and switch off the deform option by clicking Armature>Bone Settings>Deform in the 3d View menu bar or by pressing SHIFTW and selecting deform (just unchecking the checkbox only changes the setting for the currently selected bone!):

Notice that I did not switch deform off for the IK targets of the feet, because you are using those as both an IK target and deform bones for the feet!
When you are done with this you have to redo the weigths.
Select the mesh ALTP then select Clear Parent and finally you can parent the mesh to the armature again like you did before and create automatic weigths again.
I've attached my result as a .blend file, so you can have a look if you have any further problems.

Additional Infos on Rigging
If you want a really incredibly great and thorough introduction to rigging, take a look at 'Humane Rigging' in the Blender Shop or on Youtube. It's not for the current version of Blender, but it is the best I know of (my knowledge of Blender rigging is dated too, I should add).

Thanks! Didn't know those control bones were the problem! Will keep that in mind! ^^


text:
Locating automatically my addon original folder
I've created a small addon, which wrap a much bigger addon. In the execute code, I want first to get the addon' path, add it to python path, and then import my main class and call its main function:
user_preferences = context.user_preferences
addon_prefs = user_preferences.addons[__name__].preferences
addon_root = os.path.abspath(addon_prefs.addon_folder)
sys.path.append(addon_root)
import main_addon
main_addon.main(addon_prefs)

As you can see, for now I've let the user to set the addon's path in addon_prefs.addon_folder, but I want to find it automatically.
Can I get the full path of my wrapper addon (both the wrapper addon and my main addon exist in the same folder), and get the folder from there?
When I've tried
os.path.dirname(os.path.realpath(__file__))

I got the ".../config/blender/2.76/scripts/addons" folder, which isn't the original folder.

If the code above is in __init__.py in its own subfolder of the addons dir, (ie with the folder as a module)  then os.path.dirname(__file__) will give you that subfolder, eg "/blender/2.77/scripts/addons/sound_drivers".  Have a look at how some of the folder addons are set up using __init__.py


text:
How to change an operator's icon from a timer event
I have a panel with a play button, which starts a timer. Every time I click on the button, it changes from play to pause and vice versa:
class PlayPanel(bpy.types.Panel):
    is_playing = False

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

def play_panel_draw(context, layout):
    row.operator("Play", text="", icon='PLAY' if not PlayPanel.is_playing else 'PAUSE')

Now, I want to change the icon also when the timer stops. How can I do that? In the draw function I'm passing the context and the layout. How can I pass them from the timer class?

The correct way to add a property to a class in blender is by using bpy.props, in your situation that doesn't help as adding bpy.props doesn't work with panels.
The solution would be to add your is_playing property to the scene and use that for your operator icon choice.
def play_panel_draw(context, layout):
    scn = context.scene
    row = layout.row()
    row.operator("scene.play", text="", icon='PLAY' if not scn.is_playing else 'PAUSE')

Here is a sample addon to demonstrate.

Your timer object should be None after removal. So you can add a test to your condition that checks if the timer object is False (None checks as false in an implicit condition):
row.operator(
    "Play",
    text = "",
    icon = 'PLAY' if not PlayPanel.is_playing or not timer else 'PAUSE'
)

timer is of course the arbitrary name I chose for your timer object, replace if needed.

Maybe I wasn't clear (I've just edited the question), in the draw function I'm passing the context and the layout. How can I pass them from the timer class?

@NoamPeled Could you paste more of your code? It's pretty hard to answer this kind of question without the broader picture.


text:
Snappping the 3D cursor to the surface and find the surface's face it was snapped to
To snap the 3D cursor to the surface of my object, I set the "Cursor Depth" to True in the interface user preferences. How can I know exactly to which face/vertice the cursor was snapped (in code)?
Do I need to use object.closest_point_on_mesh?
object.closest_point_on_mesh(bpy.context.scene.cursor_location)

Or maybe this data is stored somewhere? Isn't is the whole purpose of Cursor Depth? Also, how can I know which object was it snapped to, in the case of multiple objects in the scene?
Thanks!

As far as I know Cursor Depth uses the opengl depth buffer for approximate distance. It is not aware of any object geometry or mesh topology, since it may not even be a mesh object it was "snapped to".

I'd go for scene ray cast , as shown in my answer, you could (with depth picking on) loop thru and compare globalized object.closest_point_on_mesh to cursor loc for scene mesh objects.

Using Scene.ray_cast

Can shoot a ray into the scene using Scene.ray_cast from the cursor location, in the direction of the converted view matrix's z axis.  Test code, prints the ray hit (if hit) of each 3d view in the context screen.
import bpy
from mathutils import Vector
context = bpy.context
screen = context.screen
scene = context.scene
areas3d = [a for a in screen.areas if a.type == 'VIEW_3D']
for a in areas3d:
    r3d = a.spaces.active.region_3d
    vm = r3d.view_matrix.transposed().to_3x3().to_4x4()
    norm = vm * Vector((0, 0, 1))
    norm.normalize()
    ray = scene.ray_cast(scene.cursor_location, norm)
    hit, loc, norm, face, obj, matrix = ray
    if hit:
        print("hit object", obj, "on face:", face)


text:
Delete parent object hierarchy in code
How can I delete hierarchy of objects in code?
When trying to delete the "parent_obj", it's written in the GUI tooltip:
bpy.ops.outliner.object_operation(type='DELETE_HIERARCHY')

I tried to select the "parent_obj" using this code:
context.scene.objects.active = bpy.data.objects['parent_obj']

But got this error:
File "~/blender-2.76-rc2-linux-glibc211-x86_64/2.76/scripts/modules/bpy/ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.outliner.object_operation.poll() failed, context is incorrect

Edit
Ok, I've found how to bypass this problem. Instead of using bpy.ops.outliner.object_operation(), I first select the objects hierarchy, and then used bpy.ops.object.delete():
bpy.data.objects[obj_name].select = True
for child in bpy.data.objects[obj_name].children:
    child.select = True
bpy.ops.object.delete()

Have you searched for "context is incorrect" on this site yet?

One should deseleted all the objects, select and remove the animation data from all the objects in the hierarchy, and call bpy.ops.object.delete():
def delete_hierarchy(parent_obj_name):
    bpy.ops.object.select_all(action='DESELECT')
    obj = bpy.data.objects[parent_obj_name]
    obj.animation_data_clear()
    names = set()
    # Go over all the objects in the hierarchy like @zeffi suggested:
    def get_child_names(obj):
        for child in obj.children:
            names.add(child.name)
            if child.children:
                get_child_names(child)

    get_child_names(obj)

    print(names)
    objects = bpy.data.objects
    [setattr(objects[n], 'select', True) for n in names]
    # Remove the animation from the all the child objects
    for child_name in names:
        bpy.data.objects[child_name].animation_data_clear()

    result = bpy.ops.object.delete()
    if result == {'FINISHED'}:
        print ("Successfully deleted object")
    else:
        print ("Could not delete object")

[setattr(objects[n], 'select', True) for n in names] doesn't work in 2022, and the code can not delete the parent_obj right now.

@tac pls don't change the answer as this one works perfectly for the blender version 2.76 it was intended. consider adding another answer for what works in the newer versions.

@HarryMcKenzie Thank you for your advice. I have post a new answer for what works in the newer versions.

@Tac cool thanks! :)

Your own solution probably works fine in your case, but the general case where the hierarchy is a bit more nested (children of children) might still deserve a solution.
perhaps something recursive:
import bpy

def delete_hierarchy(obj):
    names = set([obj.name])

    # recursion
    def get_child_names(obj):
        for child in obj.children:
            names.add(child.name)
            if child.children:
                get_child_names(child)

    get_child_names(obj)

    print(names)
    objects = bpy.data.objects
    [setattr(objects[n], 'select', True) for n in names]

    bpy.ops.object.delete()

delete_hierarchy(bpy.context.active_object)

This function assumes no objects are currently selected, and accumulates the names of the hierarchy starting with the main object ( i used active_object, but you can pass any object reference there ). Then it selects all the found names, then runs the object_delete operator.

I found that bpy.ops.object.delete() doesn't delete a nested animation objects. I inserted keyframes to the parent objects, and they weren't been deleted. Any ideas?

you want to remove all keyframes from each object in this hierarchy.?

Yes. In my case, only the parent obj has keyframes.

I dont have a file at hand with any complicated animation, perhaps share one on http://blend-exchange.giantcowfilms.com/ - can be a trivial one to show what you mean, before and after.

Please find this example. I removed everything else and left only the parent obj with the animation.

Apparently, one should first call parent_obj.animation_data_clear()

If you've solved your own question. we encourage you to write your own answer and even accept it :)

@p2or and @Noam Peled have given a good idea, but [setattr(objects[n], 'select', True) for n in names] doesn't work in 2022, and their code can't delete the parent_obj right now.
So I modified their code to work with Blender 3.0 and higher.
def delete_hierarchy(parent_obj_name):
    bpy.ops.object.select_all(action='DESELECT')
    obj = bpy.data.objects[parent_obj_name]
    obj.animation_data_clear()
    names = set()
    # Go over all the objects in the hierarchy like @zeffi suggested:
    def get_child_names(obj):
        for child in obj.children:
            names.add(child.name)
            if child.children:
                get_child_names(child)

    get_child_names(obj)
    names.add(parent_obj_name)
    print(names)
    objects = bpy.data.objects

    # Remove the animation from the all the child objects
    if names:
        for child_name in names:
            bpy.data.objects[child_name].animation_data_clear()
            objects[child_name].select_set(state=True)
            bpy.data.objects.remove(objects[child_name])
        print ("Successfully deleted object")
    else:
        print ("Could not delete object")


text:
Smoothing vertex_colors values
I'm coloring a mesh using vertex colors:
mesh = cur_obj.data
vcol_layer = mesh.vertex_colors.new('Col')
for ind in indices:
    vcol_layer.data[ind].colors = colors[ind]

I don't have values for all the vertices. Can I get values for these vertices by smoothing?
****** Update **********
Let me be more clear. Here is the code I'm using to color objects:
mesh = cur_obj.data
scn = bpy.context.scene
valid_verts = np.where(np.abs(verts_values) >= threshold)[0]
verts_colors = calc_colors(verts_values)
scn.objects.active = cur_obj
cur_obj.select = True
vcol_layer = mesh.vertex_colors.new('Col')
for vert in valid_verts:
    x = lookup[vert]
    for loop_ind in x[x > -1]:
        d = vcol_layer.data[loop_ind]
        d.color = verts_colors[vert]

Where the lookup table was created using the following function:
def calc_faces_verts(verts, faces, out_file):
    _faces = faces.ravel()
    faces_arg_sort = np.argsort(_faces)
    faces_sort = np.sort(_faces)
    faces_count = Counter(faces_sort)
    max_len = max([v for v in faces_count.values()])
    lookup = np.ones((verts.shape[0], max_len)) * -1
    diff = np.diff(faces_sort)
    n = 0
    for ind, (k, v) in enumerate(zip(faces_sort, faces_arg_sort)):
        lookup[k, n] = v
        n = 0 if ind < len(diff) and diff[ind] > 0 else n + 1
    np.save(out_file, lookup.astype(np.int))
    if len(_faces) != int(np.max(lookup)) + 1:
        raise Exception('Wrong values in lookup table! ' +
                        'faces ravel: {}, max looup val: {}'.format(len(_faces), int(np.max(lookup))))

This is working great when I have a value per vertice. The problem starts when this isn't the case. For example, I have an object with >100k vertices, where only ~4k have values. Currently, I'm smoothing those values on the surface outside Blender and saves the result to a numpy array (verts_values). The question is whether I can do the smoothing inside Blender (which hopefully will be also faster), without the necessity of a pre-processing step.
**** Update ****
You can find here some example files:

vertices.npy - An array of vertices indices that I have values for
data.npy - values for vertices.npy
lh.pial.ply - The object I want to color
lh.pial.npz - Same as 3, but in here the vertices and faces are stored in a npz file (faster and easier to read)

To calculate the colors, I just pick a colormap (jet for example), and do something like this:
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.cm as cmx

def array_to_color(x, color_map):
    x_min, x_max = np.min(x), np.max(x)
    cm = plt.get_cmap(color_map)
    cNorm = matplotlib.colors.Normalize(vmin=x_min, vmax=x_max)
    scalar_map = cmx.ScalarMappable(norm=cNorm, cmap=cm)
    return scalar_map.to_rgba(x)

**** Update ****
I've used both suggested solutions, and added another option to set a threshold for the values. Here is the code:
import bpy
import numpy as np
from collections import defaultdict

def color_vertices_rgb(obj, vert_colors, fixed_vertices, vert_links, verts_to_loop, loops_num=25):
    """Merges the colors assigned to the FIXED vertices across the rest of the mesh"""

    obj.update_from_editmode()

    mesh = obj.data
    scn = bpy.context.scene

    # check if our mesh already has Vertex Colors, and if not add some... (first we need to make sure it's the active object)
    scn.objects.active = obj
    obj.select = True
    mesh.vertex_colors.new()

    print("Captured.")
    for ind in range(loops_num):
        new_colors = {}

        for vert in obj.data.vertices:
            vertidx = vert.index
            if vertidx not in fixed_vertices:
                new_colors[vertidx] = average_color(vert_colors, vert_links, vertidx)

        # Copy new colors back to vert_colors
        for vert in obj.data.vertices:
            vertidx = vert.index
            if vertidx not in fixed_vertices:
                vert_colors[vertidx] = new_colors[vertidx]

    print("Storing colors...")
    for vert in obj.data.vertices:
        vertidx = vert.index
        set_vertex_color(obj, vertidx, vert_colors[vertidx], verts_to_loop)

def set_vertex_color(obj, vertid, color, verts_to_loop):
    for loop_index in verts_to_loop[vertid]:
        obj.data.vertex_colors[0].data[loop_index].color = color

def make_verts_to_loop_lookup(obj):
    verts_to_loop_verts = defaultdict(list)
    for li, l in enumerate(obj.data.loops):
        verts_to_loop_verts[l.vertex_index].append(li)
    return verts_to_loop_verts

def average_color(vert_colors, vert_links, vertid):
    r = 0.0
    g = 0.0
    b = 0.0
    num_verts = 0

    for linkedvertid in vert_links[vertid]:
        col = vert_colors[linkedvertid]
        r = r + col[0]
        g = g + col[1]
        b = b + col[2]
        num_verts += 1
    return (r / num_verts, g / num_verts, b / num_verts)

def get_linked_verts(obj, vertid):
    verts = []
    for edge in obj.data.edges:
        if edge.vertices[0] == vertid:
            verts.append(edge.vertices[1])
        elif edge.vertices[1] == vertid:
            verts.append(edge.vertices[0])

    return verts

def create_linked_verts_lookup(obj):
    verts_lookup = defaultdict(list)
    for ind, edge in enumerate(obj.data.edges):
        verts_lookup[edge.vertices[0]].append(edge.vertices[1])
        verts_lookup[edge.vertices[1]].append(edge.vertices[0])
    return verts_lookup

def get_vertices_colors(obj, fixed_vertices_set, fixed_vertices_data, default_color=(1, 1, 1)):
    fixed_vertices_colors = calc_colors(fixed_vertices_data)
    vert_colors = {}
    fixed_verts_ind = 0
    for vert in obj.data.vertices:
        vert_ind = vert.index
        if vert_ind in fixed_vertices_set:
            vert_colors[vert_ind] = fixed_vertices_colors[fixed_verts_ind]
            fixed_verts_ind += 1
        else:
            vert_colors[vert_ind] = default_color
    return vert_colors

def calc_colors(data):
    # todo: Calc the colors according to the data
    colors = None
    return colors

def get_fixed_vertices(fixed_vertices_data, threshold=0):
    fixed_vertices = np.load('vertices.npy')
    fixed_vertices_set = set()
    for ind, fix_vert in enumerate(fixed_vertices):
        if abs(fixed_vertices_data[ind]) > threshold:
            fixed_vertices_set.add(fix_vert)
    return fixed_vertices_set

threshold = 1
default_color = (1, 1, 1)
loops_num = 250
object_name = 'my_object'
obj = bpy.data.objects[object_name]
fixed_vertices_data = np.load('data.npy')
fixed_vertices_set = get_fixed_vertices(fixed_vertices_data, threshold)
linked_verts_lookup = create_linked_verts_lookup(obj)
verts_to_loop_verts = make_verts_to_loop_lookup(obj)
vertices_colors = get_vertices_colors(obj, fixed_vertices_set, fixed_vertices_data, default_color)
color_vertices_rgb(obj, vertices_colors, fixed_vertices_set, linked_verts_lookup, verts_to_loop_verts, loops_num)

The calc_colors function implementation is out of this scope, so I left it empty. Outside Blender I've created colormap numpy array (cm: 256x3) from matplotlib, and I'm using this function to calculate the colors:
def calc_colors(vert_values, data, cm):
    data_min, data_max = np.min(data), np.max(data)
    colors_ratio = 256 / (data_max - data_min)
    colors_indices = ((np.array(vert_values) - data_min) * colors_ratio).astype(int)
    verts_colors = cm[colors_indices]
    return verts_colors

Thanks for your help! I wish I could split the bounty...

What do you mean by "smoothing"? Is it that you have a harsh transition between colored and uncolored areas and you want a more gradual transition?

I think the question is very unclear for the following reasons: 1. As said @TLousky what do you mean by smoothing? 2. calc_faces_verts does not refer to any bpy types: what are the parameters? 3. By which way is it possible to not "have a value per vertice"?

In smoothing, I mean smoothing the colors for vertices (or faces) without values, so all the faces in the mesh will be colored, something like 2D interpolation.
calc_faces_verts is being called offline (outside Blender). I'm sending the verts and faces of a given mesh, which I, reading from a ply file.

OK, it's a bit more clear, I think. But other questions: you are referring to an outside of Blender process. In this process (for an unknown reason?) some vertices have no colors (we don't know why and how, and also we don't know how these colors are chosen, but ok). From that, it seems you can identify colored vertices and non colored. The calculation could be a barycentric attribution considering the edge lengths connecting each non colored vertex to its (colored) neighbors. Is that the kind of thing you are looking for?

Yes, exactly, barycentric interpolation looks promising!
If you are interested, the mesh is a brain's hemisphere, and I'm doing source reconstruction from EEG/MEG sensors to the cortex. To make this process faster, I'm calculating the values only for ~4k vertices, and now I want to interpolate the values for the rest of the vertices. The colors are defined using a colormap.

FYI, numpy crashes Blender when I try to load the npy files. No exception given.

This is very weird. I'm using 2.78a on Linux. btw, I'm using faulthandler, and set its output to a file (not the stdout), so sometimes I can catch exceptions when Blender crashes.

I was developing a script for a similar purpose and it should be applicable to your situation.

The script is as follows :
import bpy

def color_vertices_rgb(obj):
    """Merges the colors assigned to the FIXED vertices across the rest of the mesh"""

    obj.update_from_editmode()

    mesh = obj.data
    scn = bpy.context.scene

    #check if our mesh already has Vertex Colors, and if not add some... (first we need to make sure it's the active object)
    scn.objects.active = obj
    obj.select = True
    mesh.vertex_colors.new()
    vert_cols = mesh.vertex_colors[0]

    fixed_vertices = []
    vert_colors = {}
    vert_links = {}

    print("Capturing data...")
    for vert in obj.data.vertices:
        print(str(vert.index))
        vertidx = vert.index
        if  vertex_in_group(obj,vertidx, "FIXED"):
            fixed_vertices.append(vertidx)
            vert_colors[str(vertidx)] = get_vertex_color(obj, vertidx)
        else:
            vert_colors[str(vertidx)] = (0.5,0.5,0.5)

        vert_links[str(vertidx)] = get_linked_verts(obj, vertidx)

    print("Captured.")
    for p in range(1,250):
        print("Pass "+str(p))
        new_colors = {}

        for vert in obj.data.vertices:
            vertidx = vert.index

            color = average_color(vert_colors, vert_links, vertidx)
            red = color[0]
            green = color[1]
            blue = color[2]

            if vertidx in fixed_vertices:
                red = vert_colors[str(vertidx)][0]
                green = vert_colors[str(vertidx)][1]
                blue = vert_colors[str(vertidx)][2]

            new_colors[str(vertidx)] = (red,green,blue)

        #Copy new colors back to vert_colors
        for vert in obj.data.vertices:
            vertidx = vert.index
            vert_colors[str(vertidx)] = new_colors[str(vertidx)]

    print("Storing colors...")
    for vert in obj.data.vertices:
        vertidx = vert.index

        set_vertex_color(obj, vertidx, vert_colors[str(vertidx)])

def vertex_in_group(obj, vertidx, group):
    """Looks for the named vertex 'group' on the specified 'obj'
       and returns true or false depending on whether the specified
       'vert' is in that 'group'"""

    groupindex = obj.vertex_groups[group].index

    for v in obj.data.vertices:
        if v.index == vertidx:
            for g in v.groups:
                if g.group == groupindex:
                    return True
    return False

def get_vertex_color(obj, vertid):
    for loop in obj.data.loops:
        if loop.vertex_index == vertid:
            return obj.data.vertex_colors[0].data[loop.index].color
    return (0.0,0.0,0.0)

def set_vertex_color(obj, vertid, color):
    for loop in obj.data.loops:
        if loop.vertex_index == vertid:
            obj.data.vertex_colors[0].data[loop.index].color = color

def average_color(vert_colors, vert_links, vertid):

    r = 0.0
    g = 0.0
    b = 0.0
    num_verts = 0

    for linkedvertid in vert_links[str(vertid)]:
        col = vert_colors[str(linkedvertid)]
        r = r + col[0]
        g = g + col[1]
        b = b + col[2]
        num_verts += 1
    return (r/num_verts, g/num_verts, b/num_verts)

def get_linked_verts(obj, vertid):
    verts = []
    for edge in obj.data.edges:
        if edge.vertices[0] == vertid:
            verts.append(edge.vertices[1])
        elif edge.vertices[1] == vertid:
            verts.append(edge.vertices[0])

    return verts

#Invoke it
color_vertices_rgb(bpy.context.scene.objects["Icosphere"])

The script processes each vertex in turn and sets its color to the average of its neighbours. The result of this is to smear the colors over the surface. Putting a vertex in a vertex group named 'FIXED' causes that vertex to be excluded from the process so that its color contributes to its neighbours but it not itself updated. This means that those 'FIXED' vertices remain unchanged and their colors are spread over the rest of the mesh.
For example, starting with an Icosphere I placed 3 vertices in the FIXED vertex group as shown :

I manually painted those vertices with specific colors.

Running the script produced the following result :

Hopefully this will help with your situation - place your vertices with 'known' values in the FIXED vertex group and ensure they are set to their initial colors and run the script, generating a new set of vertex colors.
Note that the last line of the script needs to be amended to run the function on the relevant object (in my case this was named 'Icosphere'). Also, if you need more or less 'passes' to get a smooth result you could amend the 'Range' line ('for p in range(1,xxx)') to something other than '250'. More passes will take longer. Less passes will spread the colors over a shorter range.
NOTE : The average is currently calculated based purely on the connected vertices - rather than taking each edge length into account. This should be fine if your mesh is fairly evenly distributed. However, if you need shorter edge links to have more influence on its neighbours then it should be a simple matter of enhancing the 'average_color(...)' function to retrieve the edge length between two vertices to vary each neighbour's influence on the resultant color.
Blend file attached

EDIT : The above script does not work on newer versions of Blender (eg, 2.79.6) due to the Vertex Colors now apparently including the alpha channel. I've developed an add-on that provides this functionality available on a menu option in the Paint menu. See this answer and download the add-on from Vertex Color Blend Add-on

Here is a solution considering the performance issue.

For test purpose I've used 3 meshes with 10 smoothing iterations using lengths barycentric smoothing (considering the lengths is an option and it is faster if you don't use them):

happy.ply, 540k vertices: 50s
bunny.ply, original, 36k vertices: 3s
bunny.ply, decimated, 8k vertices: 0.6s

(I'm using a gamer laptop PC)

The program is calculating things following these steps:

Precalculation of a lookup table from each vertex to its corresponding loop vertices
Precalculation of a lookup table from each vertex to its neighbors via its edges
Precalculation of the lengths weighting ratios
First calculation of the base colors: as we don't know how you're obtaining these colors, I've chosen to use the colors of the vertex colors. By default it is white (considered as not colored), so non white vertices are considered to be initially colored
Smoothing: the smoothing is done by edges direct proximity (so the more vertices, the less the propagation is done, in absolute distance point of view: this is visible in the above image)
Affectation of the calculated colors to the vertex colors

Here is the commented script, including the options description (it applies on the selected mesh considering the vertex colors exist as created before):
import bpy
import time
from collections import defaultdict
from mathutils import Color, Vector

#Create a look up table that creates the correspondance between each vertex and its corresponding faces vertices
def MakeVertsToLoopVerts( obj ):
    vertsToLoopVerts = defaultdict( list )
    for li, l in enumerate( obj.data.loops ):
        vertsToLoopVerts[l.vertex_index].append( li )
    return vertsToLoopVerts

#Create a lookup table which allows to follow edges connected vertices
def MakeVertPaths( verts, edges ):
    result = defaultdict( list )
    #Add the possible paths via edges
    for e in edges:
        result[e.vertices[0]].append(e.vertices[1])
        result[e.vertices[1]].append(e.vertices[0])
    return result

#Create a lookup table wich contains the lengths for each vertex to its neighbors
#If not, length may be calculated for each smoothing iteration
def MakeVertPathLength( obj, vertPaths, useLength ):
    if useLength:
        result = defaultdict( list )
        vertices = obj.data.vertices
        for v, path in vertPaths.items():
            vCo = vertices[v].co
            lengths = [(vCo - vertices[n].co).length for n in path]
            total = sum( lengths )
            amount = len(lengths)
            if total == 0:
                lengths = [(amount - 1) * (1 / amount) for l in lengths]
            else:
                lengths = [(1 - l / total) for l in lengths]
            result[v] = lengths
        return result
    return {}

#Determinate if a vertex loop set corresponds to a non neutral color and averages the color including not neutral
def AvgInitialColor( vColors, vColIndices, neutralColor, baseColor ):
    nonNeutral = any( vColors.data[li].color != neutralColor for li in vColIndices )
    if nonNeutral:
        return True, sum( [vColors.data[li].color for li in vColIndices], Color() ) / len(vColIndices)
    else:
        return False, baseColor

#Determinate if a vertex loop set corresponds to a non neutral color and averages the color which is not neutral
def AvgInitialColorNonNeutral( vColors, vColIndices, neutralColor, baseColor ):
    nonNeutral = [li for li in vColIndices if vColors.data[li].color != neutralColor]
    if nonNeutral:
        return True, sum( [vColors.data[li].color for li in nonNeutral], Color() ) / len(nonNeutral)
    else:
        return False, baseColor

#Calculate base colors for both initially colored vertices and not colored verticles
def AvgColorForNonNeutral( vColors, vertsToLoopVerts, neutralColor, baseColor, useNeutral ):
    isColored = {}
    colors = {}
    if useNeutral:
        for v, lvs in vertsToLoopVerts.items():
            isColored[v], colors[v] = AvgInitialColor( vColors, lvs, neutralColor, baseColor )
    else:
        for v, lvs in vertsToLoopVerts.items():
            isColored[v], colors[v] = AvgInitialColorNonNeutral( vColors, lvs, neutralColor, baseColor )

    return isColored, colors

#Average the vertex color with its neighbors colors
def AvgColor( v, colors, vertPaths ):
    linked = vertPaths[v]
    return sum( (colors[i] for i in linked), colors[v] ) / (1 + len(linked))

#Average the vertex color with its neighbors colors and using lengths ponderation
def AvgColorUsingLength( v, colors, vertPaths, vertPathLengths ):
    linked = vertPaths[v]
    lengths = vertPathLengths[v]
    return sum( (l*colors[i] for i, l in zip( linked, lengths )), colors[v] ) / len(linked)

#An iteration of smoothing
def AvgColorsOneIteration( isColored, colors, vertPaths, avgInitialColors, useLength, vertPathLengths ):
    newColors = {}

    for v, info in colors.items():
        #If initially colored and option is not to average it
        if isColored[v] and not avgInitialColors:
            newColors[v] = colors[v]
        elif useLength:
            newColors[v] = AvgColorUsingLength( v, colors, vertPaths, vertPathLengths )
        else:
            newColors[v] = AvgColor( v, colors, vertPaths )

    return newColors

#Make n iterations of smoothing
def AvgColorsIterations( iterations, isColored, colors, vertPaths, avgInitialColors, useLength, vertPathLengths ):
    for i in range( iterations ):
        colors = AvgColorsOneIteration( isColored, colors, vertPaths, avgInitialColors, useLength, vertPathLengths )
    return colors

#Set the calculated colors to the vertex colors
def SetToVertexColors( obj, vColors, colors ):
    for l in obj.data.loops:
        vColors.data[l.index].color = colors[l.vertex_index]

print( '--------------' )

startTime = time.time()

obj = bpy.context.object #The object we want to use (selected one)
vColors = obj.data.vertex_colors['Col'] #The vertex colors (create via the UI before)
neutralColor = Color( (1,1,1) ) #Neutral color indicates if a vertex is colored or not. A vertex is not colored if its initial color is this color (convention)
baseColor = Color( (0,0,0) ) #The base color to set for non colored vertices
useNeutral = False #Indicates if we keep neutral color for the eventual loop indices that are not colored for a colored vertex
useLength = True #Indicates if the lengths between vertices is to take into accound, if not simple average
avgInitialColors = True #Indicates if the initial colors are smoothed or not
iterations = 10 #Number of smoothing iterations

#Precalculation: get a lookup table that associates each vertex to its corresponding per face vertex index
vertsToLoopVerts = MakeVertsToLoopVerts( obj )

print( 'elapse0', time.time() - startTime )

#Precalculation: get a lookup table that contains for each vertex its neighbors considerings edges
vertPaths = MakeVertPaths( obj.data.vertices, obj.data.edges )

print( 'elapse1', time.time() - startTime )

#Precalculation: lengths ponderations
vertPathLengths = MakeVertPathLength( obj, vertPaths, useLength )

print( 'elapse2', time.time() - startTime )

#First color calculation: determinates if each vertex is initially colored and its starting color
isColored, colors = AvgColorForNonNeutral( vColors, vertsToLoopVerts, neutralColor, baseColor, useNeutral )

print( 'elapse3', time.time() - startTime )

#Smoothing iterations
colors = AvgColorsIterations( iterations, isColored, colors, vertPaths, avgInitialColors, useLength, vertPathLengths )

print( 'elapse4', time.time() - startTime )

#Writes the calculated colors to the vertex colors
SetToVertexColors( obj, vColors, colors )

print( 'elapse5', time.time() - startTime )

The file provided here does not include the big meshes because it was over 170MB and giantcowfilms allows at max 30MB:

edit: the updated question contains data file that I'm unable to use (load the npy files crashes Blender).
But from the above code, simply replace:
isColored, colors = AvgColorForNonNeutral( vColors, vertsToLoopVerts, neutralColor, baseColor, useNeutral )

By
isColored, colors = GetInitiallyColored( obj, baseColor )

where isColored is a dictionary vertIndex/Boolean indicating for each vertex if it is initially colored (from your data) and colors is a dictionary vertIndex/color for each vertex based on your data if the vertex belongs to it or set to 'baseColor' if not.

Thanks! You solution look very promising. My only problem with your solution is that I the vertices with the initial colors have many colors, and can't be defined as "neurtral" only by their colors. My initial data is a list of vertices, and a list of values which I transfer to colors according to the colormap, and the min and max of these vertices data. So I can only identify those vertices by their indices.

@NoamPeled, yes I guessed that kind of thing. But could you give me a formalized input for that (so, I'll replace the needed parts of the code using it)?

'vertex_colors' is a per face data. It is related to what is called 'loop' in the internal data.
'Per face' means that a vertex is represented one time per face it contributes to in this kind of loop data.
The base loop is 'in obj.data.loops'.
For instance:
[(li, lv.vertex_index) for li, lv in enumerate(obj.data.loops)]

will give the following result which is a list of pairs '(vertex loop index, vertex index)'
[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 7), (6, 6), (7, 5), (8, 0), (9, 4), (10, 5), (11, 1), (12, 1), (13, 5), (14, 6), (15, 2), (16, 2), (17, 6), (18, 7), (19, 3), (20, 4), (21, 0), (22, 3), (23, 7)]

The previous list is obtained from a simple cube. So we have 8 vertex indices and 24 (6 faces x 4 vertices per face) loop vertex indices.
You can index:
obj.data.loops[vertex loop index]
and
obj.data.vertices[vertex index]
So for your program, you can:
mesh = cur_obj.data

vcol_layer = mesh.vertex_colors.new('Col')

for li, lv in enumerate(obj.data.loops):
    vcol_layer.data[li].color = colors[lv.vertex_index]

This main loops in obj.data.loops also contains information about per face vertex normals.
Vertex colors is a loop.
UV or texture layers are loops too.

Considering the update/edit of the question, this answer means 'nothing'... but it may contain information that interest others... so I don't delete it.


text:
Cycles hair and scaling the object?
If I set a hair particle system and then scale the object for some reason,
all the settings I have put in PS are lost.
It does not resemble to original look I've set.
How to scale the object so that PS hair scales along with it ?
EDIT: hair.blend

Can you add an image/gif/video?

@JohnRoper , I've updated the post. PS hair is on Plane object. Try to scale it up, down, rotate along z and you'll see it does not retain the shape.

Scale the mesh in edit mode


text:
Material and Texture to Achieve an appearance
How to do this in Blender render:
https://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Every_Material_Known_to_Man/Light_Effects
Settings are there but I couldn't recreated it because some of them were replaced with new ones.
I need B.render because I'm using halo material specific in the scene.
Thanks
I want to look like this

EDIT:
Still need a bit of tweak. How to get this white color on top of the wave ?
https://dl.dropboxusercontent.com/u/13451287/bsphere.blend

It would be useful for you to place an image of your work with the question.  Yes the manual you mentioned is not fresh.  Please create a sphere with lots of vertices and add a displacement modifier with a noise texture, to achieve a bumpy shape.  Show the image of your work in the question so we can help with you from there.  Your work need not be perfect but it allows quicker help if you can provide the image.  If you do  not understand those two suggestion please say so in a comment.  The lights simple, better or advanced can come later.

I don't know how to make this transparent water surface annd below blue. On the page there was some NOR variable. This is not anymore in 2.75. Probably IOR. Btw, will there be integrated in BR material nodes as in Cycles? Then would be easier to make this complex material.

Very nice. So your question is now how do I achieve a certain color effect?  I need a few moments

On the page there were 3 textures involved on material in the description

Please show a render with transparency if that is a concern.  Please show the Text Mapping Coordinates.

Here is a modest sloppy facsimile at the end of the post.
You must adjust to taste and artistry.
I am trying to show a technique and you can run free from there.
I am not using the exact same settings as the old manual.
I am not using Fresnel.
Blender Render. Please note there are no lights in the image below.
Shadeless Material and Texture Mapping Coordinates [Normal] with an Radial Gradiant Image.
Here is a material setting
Note the shadeless and transparency

Here is a texture setting. Note the coordinates are [Normal].  The circular image with transparency. The color ramp to threshold color.

Note that the alpha is modified.

Note the circular image which is transparent in middle.
This can be created in GIMP or Blender.  The color ramp modifies the intensity of this image.  Modify all to suit your tastes.

Some experiments to show some use of the color ramp.

Below we see transparency.  The Mapping Coordinates is (Geometric Surface) [Normal].  Exaggerated white colors.
Note the color ramp with the Red Marker.  You may change that to blue.

Please experiment and know my circular image could be simplified by you.

Thanks, I'll get on it. Btw, I'm creating a larger scene. I don't know how to make some animation with another procedural texture. Could you look into it when I'll post it ?

Please progress with this work or discard. Mark the answer positive or negative.   Questions should have a single focus.  Lets be present.

I did. Thank you. I edited first post. Still the image needs some white color on top.


text:
Symmetric procedural material
I've modelled a shape which is symmetric along z axis. I used material and some texure with generated coordinates plugged in displacement node. Everything is distributed evenly on the mesh.
I would like that material is also mirror image along z.
So that a procedural texture on one side of z axis
is the mirror image of other side of z axis.
How to achieve this with nodes?

An image of the material you are working on would be helpful, different textures (wood, stone, etc.)can be manipulated differently.  Have you tried using a geometry input node? Try using the position output.

It's noise and magic texture in that order. Where to plug geometry node to get symmetry along z ?

@Timaroberts , I've added the image.

Mix Color
First step is to mask out the surface's point that be affected by the flipping of the coordinates.
In order to get the reference needed we should start by adding a Texture coordinates node and pick the Object coordinates
   type (if you are interest in the local Z)
Then add a Separate XYZ to get the Z component of the coordinates and filter out the values greater than 0 with the help of a Math node

If the origin of the object belongs to the simmetry plane, all we have to do is to flip the input coordinates (Generate type in the shown example) with a Mapping node (notice the -1 value for the Z scale parameter) and mix them with a Mix node whose inpuct factor is the mask we created before.

Thank you, I'll try but on the first read I didn't get the logic of it. I have to learn the nodes.

How to make this extra circle before mapping node?

By pressing Shift and left-dragging with the mouse over the wire. Or you can find it in the Add menu in Layout. It is called Reroute node


text:
Blender model adds extra materials when imported to Unity
My model is made up of a few other models I made before, I combined them using Ctrl + J, in Blender it tells me I have 1 Material, but once I import it into Unity It gives me extra Materials from those models I joined together.
How do I keep it as 1 Material when I import it into Unity?

Please give an example picture

Without files hard to say for sure, but my guess would be that this is because of blender's way of storing a set of polygon texture references separate from materials and in some cases also exporting that. This happens usually when you select texture in uv view while having faces selected; blender links the texture to only selected faces.
There's (at least) two ways to fix this:

Blender way: select your object, while in edit mode hit A to select everything, go to uv view and select everything there as well. Then at bottom of the view select texture. (this way every face has the same texture and as result there should be only one material named after texture you selected)
Unity way: I prefer this way and am pretty sure this would be the better for your situation as well: in unity, open model import settings, find second last item Material Naming and set it to From Model's Material. This way should make sure no other than explicitly created materials are imported.

I've tried the Unity way and it's still Screwed up. I'll take a look at the Blender way and see if that helps.

What is "polygon texture references"? From your description looks like you mean way of assigning textures which works based on face textures, only ones selected get the texture. Note that this works that way only in Blender Internal. Also there isn't UV view, most likely you mean UV Image editor window.


text:
I am having trouble with the Meadow scene tutorial on Blender guru
I got the grass essentials pack, and followed the tutorial, but every time I put the grass in as the tutorial shows, it is a grey color and does not change.  I also cannot change the density, it seems like there is very little grass there that is all grey.  Am I missing some button or something from the tutorial? The link for the tutorial in question is: http://www.blenderguru.com/tutorials/make-grassy-meadow-scene/

Please let me know if I have something wrong here. I have tried going through the tutorial several times and it continues putting the grass part in as grey.  If I just add the grass in to blender by itself, it appears as expected, and multi-green color.

We will need a lot more information to be able to help you at all, please update your question with screenshots of the viewport, your particle settings and other relevant things. Also consider uploading your .blend file and posting the link to that in your question as well. Make sure you clarify exactly what you want help with too.

I do not know how to upload the blend file, and I will update the question. thanks for letting me know that it needs more info

You can visit this meta question for details on ways to include .blend files.

I uploaded the blender file, and at least on my computer the grass appears grey, and on the plain, I do not even see it.  Hopefully with the blend file, someone can se the settings I had it on, and figure out if I did anything wrong or tell me how to fix it.

AFAIK the grass essentials pack is designed for cycles, but you are using BI. Try switching to cycles: http://blender.stackexchange.com/q/6352/599


text:
"borehole" sink edge workflow

Here you can see how i cut some holes using the boolean mod.

My goal is to sink all holes.
I came up with a very step inconvenient procedure on my own but my question is how the pro's would apply this common finish. Thank you for the wisdom!

As the answer suggests, since you're already using the Boolean modifier, why not make the cutter so that it gives the desired result? You're not working in the real world where you have to take one step after another ;) But now that you've already got the holes, you could select the edges and bevel them with the Bevel tool in Edit mode (Ctrl + B) using one segment.


text:
Reassigning Automatic weights on single bone not working properly
I'm new to blender and I'm trying to make my character move properly
let me explain my problem image by image:-

let's say this is the default armature assigned weight when making parent

now let's say I messed up my weight painting
and want ONLY THAT VERTEX group to go back to default

So I follow the steps on this question
and this is the result I get:

Where as I thought that the result should be the same as the first picture
Can someone please tell me what I'm doing wrong? and how to achieve the desired results?

You might have Automatically Normalize checked in the weight settings in the side panel.

@MartyFouts incredibly sorry for the late response but yes I have auto normalize checked


text:
My keyframes get disappeared
I am animating a gaming movie (Minecraft ) movie. When I started to use blender I used a character rig and I turned on auto key frame button and I selected a bone and bended it and I took the key frame pointer and placed it at 50. I took another bone and suddenly all key frames get disappeared and when I click the play button there are no key frames not in dope sheet. Please help so that no key frame get disappeared.
Thanks

If all keyframes disappeared after you selected another bone and you have Dope Sheet to display only keyframes for selected objects then it's just because all the keyframes are on the unselected object. Select the first bone you animated before, make sure Dope Sheet is selected in the editor's header for displaying keyframes for objects and not something else.


text:
Why is my object mirroring this way--possible camera issue?
I'm following a blender tutorial and it was explained how to mirror my object.  I put the origin in the center and then applied the mirror modifier, but rather than the leg mirroring across to the position of the opposite leg, it mirrored right next to the original leg, like so (ignore my amateur sculpting):

Could anyone explain what I might be doing wrong?
Thank you so much for reading!
EDIT:  Thank you Mr Zak for your response.  I am still having problems however, and I think it's something to do with how my object is placed in relation to my reference image.
When I'm zoomed far out like shown below, the leg appears like it's in the wrong place, misaligned to the right.

Zoomed in to where it was on the first image I posted with the mirroring, it appears to align with my reference image.
Finally, When I zoom in more closely the leg is misaligned again, this time misaligned to the right (I would post a picture of this, but I have not been a member long enough to have the permissions to post another link).
I feel like I must be going about things the wrong way in terms of camera angles.  I am constantly having to readjust my camera to align properly with the reference image.  To get to a front angle, I generally click View>Right and that orients me looking at the image, but it's never at a consistent distance/panning, if that makes sense, and I have to readjust so that my object is lined up with my reference.  I feel like the guy working in the tutorial I'm watching does not have to readjust the way I do, so I feel like I must be making errors there.

Welcome to the site. If I understand correctly what happens on the screenshot, it's either rotation is not applied to the mesh (Object mode > Ctrl+A > Rotation) or origin point is located in wrong place. Take a look at related question - http://blender.stackexchange.com/questions/353/how-can-i-make-the-mirror-modifier-work-right. If needed [edit] your question to add more info about your setup if that answer doesn't help,

First thing, you should setup the reference image correctly. If modeling with background image use orthographic viewport mode and use either image empty or actual background image, see http://blender.stackexchange.com/questions/118/how-do-i-set-a-background-image-while-i-am-editing. It's still unclear how object is placed according to the reference as the viewport is in perspective mode now (but it looks like origin point is placed properly so Mirror should work).

@MrZak Changing to an orthographic viewport mode completely changed things and I think my problem is fixed.  Thanks so much for your time and for helping me out! I appreciate it a lot.


text:
Grease Pencil Clipping Through Objects?
I've been using the grease pencil to create lines around my objects in Blender 8.2 with Cycles.  I'm really happy with the results for the most part,  but I'm having problems with some of the lines clipping through my meshes.  It seems to happen most often in areas that also have grease pencil lines.
If you look at the picture below, you'll notice that you can see the white grease pencil lines of the bottom of the dresser clipping through on the green lines.  The problem is also particularly present in the bottom left corner.  This worsens when the blur effect is applied.  Without the Blur effect, I still have problems as seen in the bottom left corner of the dresser, but I do not experience the problems with the white clipping through to the green areas until the blur filter is applied.
I've tried switching the stroke depth order between 2D and 3D layers and the problem is still there.  I've tried moving the lines around and that doesn't seem to help either. Are there other options I should look into?


text:
How to fix noise in a face mesh
I've created a head surface out of an MRI scan. Due to noises in the scan, some parts of the surface are noisy, mostly around the chin:

Any idea how I can fix that? I'm trying different smoothing modifiers, meanwhile without a success. Here is the result of Smooth Vertex with Smoothing factor of 1.0 and 30 repeats:

Thanks!

it looks like you can have good results if you select the parts then W > Smooth and put the Smooth factor at 1 on the bottom of the T panel, do it several times (or increase Repeat factor)

Thanks @moonboots, it helped a little bit. I've added a screenshot of the results.

You are probably better off smoothing it by hand using sculpt mode. Enable dynamic topology, use the snake hook brush if needed.

Probably it would be more efficient to remove noise formed with unnecessary vertices from the point cloud prior to converting to mesh, however that is out of Blender scope. Given mesh above there are several ways to smooth it, dynamic topology might be indeed the best one


text:
How can I find all the vertices/faces inside a 3D sphere in script
**** The original post wasn't clear enough, so I've edited it ****
Is there a way for finding all the vertices/faces of objects that their coordinates are inside a given 3D sphere via script?

How do you handle with the face that intersects the boundary?

Well, it depends. For the private case I'm trying to solve, I can include also all the intersected faces

Thanks for clarify
Computing the distance requires a square root. However, both sides of the inequality can be squared so you lose the square root and end up with basically this:
r = radius of sphere
distance = (x - x0)² + (y - y0)² + (z - z0)²
where x, y, z are the coordinates of one vertex IN the sphere
and x0,y0,z0 are the coordinates of the vertex that you are looking for.
distance = radius  -> vertex in the edge of sphere
distance < radius  -> vertex inside sphere
distance > radius  -> vertex outside sphere

please use this code as example
import bpy
import bmesh
import random
from math import sqrt

def create_uv_sphere(name, u, v, d):

    #https://github.com/zeffii/BlenderPythonRecipes/wiki/bmesh_ops_primitives
    # bmesh.ops.create_uvsphere also accepts a matrix keyword argument,
    # which i've dropped from the example.
    bm = bmesh.new()
    bmesh.ops.create_uvsphere(bm, u_segments=u, v_segments=v, diameter=d)

    # create new empty mesh and fill with uvsphere
    mesh = bpy.data.meshes.new(name + "_mesh")
    bm.to_mesh(mesh)
    bm.free()

    # create object and link to scene
    obj = bpy.data.objects.new(name, mesh)
    bpy.context.scene.objects.link(obj)
    return obj

def calc_distance(v1, v2, radius):
    distance = sqrt( (v2.x - v1.x)**2 + (v2.y - v1.y)**2 + (v2.z - v2.z)**2)

    if distance < radius:
        inside =True
    else:
        inside =False

    return inside

#############################3

name = "my_uvsphere"
u=30
v=30
d=1
create_uv_sphere(name, u, v, d)
bpy.data.objects[name].select = True
bpy.context.scene.objects.active = bpy.data.objects[name]
bpy.ops.object.mode_set(mode='EDIT')

obj = bpy.context.edit_object
me = obj.data
bm = bmesh.from_edit_mesh(me)

vs =bm.verts

if hasattr(bm.verts, "ensure_lookup_table"):
    bm.verts.ensure_lookup_table()
v1 =vs[0]

number= 500
counter = 0
a=-d
b=d
while counter <=number:

    v2 = bm.verts.new((random.uniform(a, b),
                       random.uniform(a, b),
                       random.uniform(a, b)))

    inside  =calc_distance(v1.co, v2.co, d/2)
    if inside:
        v2.select = True

    counter+=1

bmesh.update_edit_mesh(me, True)

Doesn't it take only the verts and faces from obj? What I mean is finding all the vertices/faces of objects that their coordinates are inside a given 3D sphere.

@NoamPeled I update the answer

distance = (v2 - v1).length

Multi mesh, object mode, version.

Define your sphere via a global coordinate sphere_co = Vector((1, 1, 1)) and radus. sphere_radius = 1  Script loops through selected mesh objects and selects vertices on each within the sphere.
For each mesh the sphere is converted to the mesh object's local coordinates, as well as a point on the surface of the sphere, the difference of the two being the radius vector in local coords.  If the distance from vertex (BMVert.co)  to local sphere coord is within the length of the local radius vector, it is selected.
import bpy
import bmesh
from mathutils import Vector

context = bpy.context

# sphere at global coords
sphere_co = Vector((1, 1, 1))
sphere_radius = 1
# global point on surface
radius_vec = sphere_co + Vector((0, 0, sphere_radius))
# selected meshes and their inverted world matrix
meshes = [(o.data, o.matrix_world.inverted())
        for o in context.selected_objects
        if o.type=='MESH']

bm = bmesh.new()
for me, mwi in meshes:
    # put sphere in local coords.
    lco = mwi * sphere_co
    r = mwi * (radius_vec) - lco
    # load mesh
    bm.from_mesh(me)
    # select verts within radius
    for v in bm.verts:
        v.select = (v.co - lco).length <= r.length
    # flush selection, update mesh
    bm.select_flush(False)
    bm.to_mesh(me)
    bm.clear()
bm.free()

I used vector inner and outer product for the evaluation of inclusion evaluation.
Limitation:

Coordinate transformation to world-space is omitted.
Use in edit mode and set a border_obj_name by yourself.

Bug Fixed code is shown below (Nov 4, 2017)
border_obj_name = 'Sphere'

import bpy
import bmesh

# Setting boundary object
me = bpy.data.objects[border_obj_name].data
bm_border = bmesh.new()
bm_border.from_mesh(me)

# Setting target object
bpy.ops.mesh.select_mode(type='VERT')
bpy.ops.mesh.select_all(action='SELECT')
me = bpy.context.edit_object.data
bm = bmesh.from_edit_mesh(me)

v_list = [v for v in bm.verts]

for fb in bm_border.faces:

    # Get the normal vector(vn) of the border face(fb)
    l = fb.loops[0]
    vo = l.vert.co
    va = l.link_loop_next.vert.co - vo
    vb = l.link_loop_prev.vert.co - vo
    vn = va.cross(vb)

    # If the inner product of v and vn is positive, the vertex is outside the face(fb).
    for vert in v_list:
        v = vert.co - vo
        if vn.dot(v) > 0:
            vert.select = False

    v_list = [v for v in v_list if v.select]

# Finalize
bm.select_flush_mode()
bmesh.update_edit_mesh(me)
bm_border.free()


text:
How to do a shadeless vertex color material in Blender 3.2.2 with Eevee?
I'm trying to do a shadeless vertex color material in Blender version 3.2.2. using Eevee.
I tried to connect an emission shader but the material renders pink.
There is two screenshots bellow for reference:

You can also download the .blend with the setup for vertex colors in Eevee here:
https://drive.google.com/file/d/1rn_IpVwCIsqQG7t3-TQ85ks6PPvBl8It/view?usp=sharing

Send a screenshot using an emission shader? That should work.

Additional screenshot added! ;)

Your problem is that your are trying to use Principled BSDF and the emission shader together. Delete the Principled BSDF and replace it with an Emission Node.
If you also want the white to be true white, go to the Color Management Tab (Inside render properties) and select Standard for View Transform.
Here you can download the .blend file with the solution:
https://drive.google.com/file/d/1leb8NHDufGeyWuh5nW81RKzS13MQTQ51/view?usp=sharing

Thank you so much @Bloop! I made some edits to your post trying to make it even clearer. I hope you like it. All the best for you. :)


text:
How to change shapekey value and add keyframe with one button with Python?
I am trying to make a script that changes the value of 5 shapekeys, four of them to 0 and the fifth to 1, then add a key frame to all of them. I am new to python. I had been searching and looks like I need to make a operator for that and then attach the button to it..I'm confused.

All required functionality in here: https://github.com/p2or/blender-shapekeyextras


text:
Text fractured with cell fracture add-on doesn't resemble text object on first layer
I'm wanting to use the cell fracture add-on with text converted to mesh, however I'm finding that when I run the add-on, what is generated in the second layer is not what I am expecting, meaning it does not resemble the text object on layer one.. When I run the add-on with a uv-sphere (as an example), I will have a fractured sphere that correctly resembles the object on layer one. Here's a couple pictures after running cell fracture.Both with the default settings. What might I be doing wrong outside of the default settings that could fix this? Or does text not work well with cell fracture?
.

Probably that object wasn't manifold prior to applying Cell Fracture.

Cell Fracture Preparation

Converted extruded text to Mesh.
Edit Mode.  Select All Vertices. Vertex remove doubles.
Object Mode. Add a Remesh Modifer to prepare your mesh for Cell Fracture.  Apply.
Now Begin Cell Fracture.
Warning
The text format conversion to mesh does [not] guarantee a conversion appropriate for cell fracture.

What I would recommend is to convert to mesh befores the extrusion. Then apply the remesh modifier and do a little bit of retopo. After that solidify and beven modfifer. Then apply the fracture modifer.


text:
I have to double every command? (V 2.76)
Recently, my PC crashed after I upgraded from Windows 7 to 10. I was able to restore my PC back to Windows 7, but since then I have had an issue with having to repeat everything within Blender. A perfect example would be with the text tool. If I add a text object that should say "Blender", when I'm done typing as such, I have an end result of "Blende". The same goes for loopcuts. I have to stop one short, or I have one too many. However, and this is the weird part, if I use the screencast keys addon, problem solved. No need to repeat anything, everything is as it should be. I have refreshed defaults, and gone so far as uninstalling and reinstalling Blender. Any ideas?

@Zeffi, sorry for the delayed reply, I didn't see a notification on this thread. I'm using Windows 7 home. I had been using 10 when my PC went down (before the upgrade all was perfect). I did try refreshing Blender with factory defaults as suggested, but I still have to enable screencast keys to work smoothly which can be distracting at times.

Hi Timaroberts, the best practice on this site is to answer our follow-up questions directly by editing your original Question (plentty of room to elaborate). I see you have edited the question a little bit, that's great. You can then delete the comments here below by hovering over the end of the comment and you'll see a small X .

@Italic_'s answer covers the most likely remedies, but if there are things about that answer you don't understand you can add a comment to his answer and he will probably elaborate.

The loop cut example sounds like normal behavior, so I don't know what you're experiencing. If you could upload a video demonstrating the problem, maybe that could help us diagnose.
Until then, try refreshing blender with factory defaults. You can do this by removing your user prefs. By default, these are stored in:
Windows

C:\Users\%USER%\AppData\Roaming\Blender Foundation\Blender\%VERSION%\config\

Linux

~/.config/blender/%VERSION%/config/

Remove or rename config folder and blender should start up with factory defaults.
A simpler way is to start blender from the terminal (CMD) with the --factory-startup flag to bypass any and all config files (there are multiple locations blender searches for user prefs).
Windows blender --factory-startup
Linux ./blender --factory-startup