Why do colours display differently in texture and solid view? (3D scan) I did a scan of a face which I want to print. It's 4 scans merged together. When I set my interaction mode to texture paint, and my view mode as texture, I see this...

However, When I change my view mode to solid, Fiona of shrek appears like this....

Not a huge problem. The main problem is, when I want to 3D print in colour, it wants to print the green coloured 1. Why is it green?

I am adding these images to the question due to an answer that was given...
Below is object mode texture view

Below is Texture paint mode, texture view....????
Below is Texture paint mode, solid view....
Below is when I zoom in on the grey 'Patch'
I imagine it's the grey scratches giving it the discoloured look. I have no idea how or why.

The bottom picture is possibly what the texture actually looks like, and the texture in the top is affected by the lights in the scene if it is not set to Shadeless in the material. Might want to look at the corresponding texture in the UV Image Editor and check for the green there.


Exporting as obj and texture problem I exported y design as obj file. Here is the render view. Then when I try to run my obj file in another program ( Vizard), its dark and looks horrible. I attached the screen shot. What am I doing wrong?

My personal experience has been that exporting objects between programs is a huge pain, especially exporting obj's and expecting the texture to remain intact. I would suggest rebuilding the texture in the program you are exporting it to, as exporting the mesh is fine but exporting a uv map texture can be sort of a bother.


What is network renderer? There's this addon called network renderer, and I have no idea what it does. I can't find it on the web.  So what is it?

Blender's network renderer allows you to link to other PCs -- Apple, Windows, Linux -- and distribute your render job to many computers... speeding up the job overall... It is a job management tool to make rendering many frames faster, by spreading the work across multiple platforms.

Here's a good video on using network render and in setting up a render farm  in your office:
https://cgcookie.com/archive/setting-up-a-render-farm/


Controlling saturation on scene referred data As troy_s mentioned in his answer about CDL node, Saturation is part of ASC CDL, but blender doesn't incorporate it in the CDL node. And

  to control saturation on scene referred data a custom node group needs
  to be created to operate after the CDL node.

So, I searched about it on internet and found that:

  A fourth parameter “Saturation” is achieved by converting the out.rgb
  data in a Luma and Chroma component. The Chroma Signal is then
  multiplied by the “Saturation” parameter.

I created this nodes and they seems work, but I'm not sure about math, is it the right way to control saturation?

The sample code for the ASC-CDL Saturation component looks like this:

/* compute the fully desaturated grey value */
luma =  rgb[0] * sat_coef_709[0] +
    rgb[1] * sat_coef_709[1] +
    rgb[2] * sat_coef_709[2] ;

/*
output rgb is a weighted average between the input rgb and
the fully desaturated grey value with "sat" as the weight...
*/

for (c=0; c<3; c++)
    rgb[c] = rgb[c] * sat + luma * (1.0 - sat);

The coefficients for any given RGB colourspace will differ. The coefficients for REC.709, are RGB 0.2126, 0.7152, 0.0722

Should be easy to sort out.

And yes, as per @cegaton, avoid the horrible use of (the also equally incorrectly labelled) YUV.

Technically, the RGB to BW node should work and honour the luma coefficients in the OpenColorIO configuration as well.


Makeclothe->Makehuman tr Our designer creates clothes for Makehuman, using Blender+Makeclothes.

A few weeks ago we updated to Makehuman 1.1.0, and also MakeClothes and find a problem: in many upper part (eg tee shirts) the export from MakeClothes is OK (no error) but while opening in MakeHuman, the border of the clothes (especilly necks) has very big triangle distortion.

If we import these clothes in the older version of MakeHumain, everythings' OK.

Have you heard about that and do you have any idea to solve?

Note: I've found a king of similar question:
MakeHuman is destorting my MakeClothes clothing (Blender)
But with no reply...

We've find explanation about this strange effect.
If we open the file in an old blender version (before 2.77), export it using "old makeclothes" into "old makehuman" (1.0); everything's OK.
If we update Makeclothe we have strange triangles at neck level and if we update makeclothes, we loose texture (file not found).

In order to solve that:
1) update everything (Blender, Makeclothes and MakeHuman)
2) open a new project in Blender
3) Append the clothes in Blender (so don't "Open" but "Append")
4) Export using Makeclothes
5) Open in MakeHuman 1.1.0
And everything's OK!


Bevel vertices on a flat plane I imagine there’s an easy fix but at the moment I just don’t have any idea how to do that.

I made a flat plane, made some loopcuts to divide it and now want the corners to be round. It works for the corners which are "outside" but for the corners which lie "inside" the form it does not work. My aim is that the bevel looks like the red marked curve in my example.

How can I solve that?

Edit:
To make it more clear: when I try to bevel the "inside" vertex I get something like that, but not a curve.

It's dependent on the internal edges.

Starting as shown
X > Limited Dissolve (selected) internal edges
CtrlShiftB Bevel (selected) corner vertices


How do I make a UV unwapped image visible on only one side of the object I UV unwrapped a label and applied a texture.  However,the back side needs be a solid color. I applied the following suggestions
How to apply a texture to only one side of a plane. As you can see from the screen shot it is not working for me. Why?

Jaroslav Jerryno Novotn answered my question in the comments section. I did indeed have a solidify modifier on the object and as suggested, I enabled the Only Rim option in the solidify modifiers panel. This worked for me.


How to combine Meshes created with python I have a "good practice" question. I am importing multiple meshes as Mesh objects with python. Before assigning them to an object and linking them to a scene, I would like to join certain meshes.

The only way I find to do this is to create objects, select them and then join them.

Is there a way to join the meshes without making them into objects?

Thanks a lot.

(Edit: Sadly I can't use bmesh for this operation, because i'm using custom split normals)

You can use the bmesh module to do this. You start with creating a new, empty bmesh object with bm = bmesh.new(), then every time you want to add a mesh to this bmesh, you can use bm.from_mesh( mesh ):

import bpy, bmesh

# Reference to existing meshes, replace these with your code generated meshes
m1 = bpy.data.meshes[0]
m2 = bpy.data.meshes[1]

bm = bmesh.new()

bm.from_mesh( m1 ) # Add mesh 1 to bmesh
bm.from_mesh( m2 ) # Add mesh 2 to bmesh

m3 = bpy.data.meshes.new( "newMesh" )
bm.to_mesh( m3 )

o = bpy.data.objects.new( "new", m3 )
bpy.context.scene.objects.link( o )


Blender 2.8+, How to execute an operator in another window? Some operators are global. Some are not. Transform for example is bound to the window where it gets executed in. As an example let's say i want to perform the transform.rotate from the UV Editor in the UV menu of the 3D view?
All I found so far was some advice in the manual regarding execution context. This example maximizes the screen in all open 3D Views, from: https://docs.blender.org/api/current/bpy.ops.html
# maximize 3d view in all windows
import bpy

for window in bpy.context.window_manager.windows:
    screen = window.screen

    for area in screen.areas:
        if area.type == 'VIEW_3D':
            override = {'window': window, 'screen': screen, 'area': area}
            bpy.ops.screen.screen_full_area(override)
            break

But how would transform.translate fit in here? I'd like to get a button in 3D View .
To make it a bit more complicated, I don't only want to transform actually, I'd like to add back the old transform by 90 degrees back into its location. Which was:
layout.operator("transform.rotate", text="Rotate Minus 90").value = math.pi / -2

Do I still would have to write my own operator here? Or is there an easier way meanwhile?

The method from brockman. It shows one of the operator buttons. For the other direction simply use bpy.ops.object.simple_operator(val=math.pi/-2)
import bpy
import math

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"
    bl_options = {'REGISTER', 'UNDO'}

    val: bpy.props.FloatProperty()

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    @classmethod
    def description(cls, context, properties):
        return properties.arg

    def execute(self, context):
        for area in bpy.context.screen.areas:
            if area.type == 'IMAGE_EDITOR':
                override = bpy.context.copy()
                override['area'] = area
                bpy.ops.transform.rotate(override, value = self.val)
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.object.simple_operator(val=math.pi/2)

Buttons:
    #buttons with separated tooltips. Put it in a menu or a panel
    myvar = layout.operator(SimpleOperator.bl_idname, text="Rotate Counter Clockwise").arg = 'Tooltip for Rotate Counter Clockwise'
    myvar.val=math.pi/2

    myvar = layout.operator(SimpleOperator.bl_idname, text="Rotate Clockwise").arg = 'Tooltip for Rotate Clockwise'
    myvar.val=math.pi/-2


Skinning A Simple Tank Track For Unity3D this is my first post and I am relatively new to Blender so bare with me..

I'm designing a tank track for a 3D game in the Unity engine - And I'm trying to configure the armature and bones of the tank track + wheels so that I can rotate the wheels and apply suspension to the wheels AND track in Unity using the WheelColliders. I am currently using the texture offset to TRANSLATE the IMAGE that is applied to the tracks for animation - therefore I don't have a bunch of chain-linked tread objects connected together that I am ANIMATING - and instead am just adjusting the image to give the illusion that the tread is moving - the 3D object that said texture is applied to is stationary and does NOT rotate.

My plan from the beginning was to add bones and simply weight-paint the track so that when I move the wheel bone up and down on the Z-Axis, it would deform the track underneath so that it moves STRONGEST directly underneath the wheel, but was weighted less and less the further it gets from the wheel - that way when suspension is applied in Unity, the bone would move up and down with the wheel and deform the track. What's happening is that (despite the weight paint) the track all moves up and down at the same rate.. so I get a very undesired effect when the suspension moves in the game-engine (it looks the same when I move the bone around in pose mode as well).

I feel like there's simply a checkbox I have to check/uncheck to get this to work properly - because I feel like weight-painting is specifically designed to apply WEIGHT to the amount the bone deforms the skinned mesh.. however I am open to the idea that I might have a fundamental error in my approach to the concept.. either way - any help here would be THOROUGHLY appreciated! I'm really stuck on this and I've spent way too much time on it. I will include in this post an image of the desired effect, and a visualization of the effect I'm getting currently (sorry about the crappy image - I really hope it get's the point). PLEASE FEEL FREE to ask me for more info - I have no problems exporting my .blend, making another image, making a screen capture video, etc etc

Thanks in advance!

weight is 100% if more than 0 and no other weight. To limit the effect, you have to use another bone (static or another wheel) with the resulting weight on it to counter the no-other-weight effect.


Render panel changed? Where did everything go?
No "Feature Set" dropdown
No "Device" dropdown [CPU/GPU]
No Motion Blur, Light Paths, etc

Blender supports different render engines and these can have quite different options. In this case you seem to have selected Blender Internal renderer while you actually intend to use Cycles. Simply change the drop-down at the top of the window to Cycles.


Python 2.8 - forcing the correct instance of the image/uv editor BACKGROUND  I have code (below) that scales a texture on the Y-axis to eliminate distortion from unwrapping a very deep cylinder.

The code performs successfully on a standalone basis (as a test), but when I drop the code into a bigger app it throws an error because setting an area to IMAGE_EDITOR does not behave the same way as in the test.

Stand alone performance: the texture image appears correctly when I set an area to IMAGE_EDITOR; from there the code scales the UV map correctly by selecting all the uv vertices and scaling.

Within big app performance: a blank appears when I set an area to IMAGE_EDITOR.  The code throws an error because there are no uv vertices to select.  However, the image/uvmap exists and can be found when I switch the workspace from "layout" to "uv editing"

QUESTIONS ON HOW I CAN FIX THE CODE SO THAT IT WORKS IN THE BIG APP

(a) If the correct texture image/uvmap appears in IMAGE_EDITOR, can I assume the code will work as well when included in big app as in the test?

(b) How can I force IMAGE_EDITOR to perform in the big app the same way it performs as a standalone?

SCREENSHOTS AND CODE

On a standalone basis, the code successfully resizes the UV map and eliminates the texture distortion:

import bpy

bpy.ops.mesh.primitive_cylinder_add(vertices=32, radius=0.2, depth=30, enter_editmode=False, location=(0,0,0))
TextureFolder='G:\\Blender\\Textures\\'
TextureFilename='wildtextures-zinc-galvanized-metal-sheet.jpg'

def obj_material_texture_UVscale(objname,filename,Xscale,Yscale,Zscale):
    path=TextureFolder+filename
    materials = bpy.data.materials
    material = materials.get('mat')
    if not material:
        material = materials.new('mat')
    material.use_nodes = True
    if material.node_tree:
        material.node_tree.links.clear()
        material.node_tree.nodes.clear()
    nodes = material.node_tree.nodes
    links = material.node_tree.links
    output = nodes.new(type = 'ShaderNodeOutputMaterial' )
    diffuse = nodes.new(type = 'ShaderNodeBsdfDiffuse' )
    imgTex = bpy.data.images.load(path)
    node_texture = nodes.new(type='ShaderNodeTexImage')
    node_texture.image = imgTex
    node_texture.location = 0,200
    tex_coord = nodes.new(type = 'ShaderNodeTexCoord')#NEW
    links = material.node_tree.links
    link=links.new(tex_coord.outputs["UV"], node_texture.inputs["Vector"]) #NEW
    link = links.new(node_texture.outputs[0], nodes.get('Diffuse BSDF').inputs[0])
    link = links.new( diffuse.outputs['BSDF'], output.inputs['Surface'] )
    obj=bpy.data.objects[objname]
    obj.active_material=material
    bpy.ops.object.select_all(action='DESELECT')
    bpy.data.objects[objname].select_set(True)
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.mesh.select_all(action='SELECT')
    bpy.ops.uv.smart_project()

    original_area = bpy.context.area.type

    scene = bpy.context.scene
    for count, ob in enumerate(bpy.context.selected_objects):
        if ob.type == 'MESH':
            #scene.objects.active = ob
            bpy.context.view_layer.objects.active=ob
            #+ switch to the image editor to perform transforms etc
            bpy.context.area.type = 'IMAGE_EDITOR'
            bpy.ops.object.mode_set(mode='EDIT', toggle=False)

            bpy.ops.mesh.reveal()
            bpy.ops.mesh.select_all(action='SELECT')
            #+ select the uvs
            bpy.ops.uv.select_all(action='SELECT')

            bpy.ops.transform.translate(value=(0, 0, 0), constraint_axis=(True, False, False))
            bpy.ops.transform.resize(value=(Xscale,Yscale,Zscale))

            #+ return to the original mode where the script was run
            bpy.context.area.type = original_area
            bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

obj_material_texture_UVscale('Cylinder',TextureFilename,1,30,1)

You do not need to mess around with the UI or change the layout at all if all you want to do is update a piece of data within an object.

You can dig down into any variable's type interactively in the scripting console without even having to look up the documentation. Autocomplete via ctrl-space, or calling dir(obj) and type(foo) describes just about anything.

So all you need to do is dig down to find where the UV coordinates are stored, and multiply them directly.

Here's how that would look for your script.

import bpy

bpy.ops.mesh.primitive_cylinder_add(vertices=32, radius=0.2, depth=30, enter_editmode=False, location=(0,0,0))
TextureFolder = 'G:\\Blender\\Textures\\'
TextureFilename = 'wildtextures-zinc-galvanized-metal-sheet.jpg'

def obj_material_texture_UVscale(objname, filename, Xscale, Yscale, Zscale):
    path = TextureFolder+filename
    materials = bpy.data.materials
    material = materials.get('mat')
    if not material:
        material = materials.new('mat')
    material.use_nodes = True
    if material.node_tree:
        material.node_tree.links.clear()
        material.node_tree.nodes.clear()
    nodes = material.node_tree.nodes
    links = material.node_tree.links
    output = nodes.new(type = 'ShaderNodeOutputMaterial' )
    diffuse = nodes.new(type = 'ShaderNodeBsdfDiffuse' )
    imgTex = bpy.data.images.load(path)
    node_texture = nodes.new(type='ShaderNodeTexImage')
    node_texture.image = imgTex
    node_texture.location = 0,200
    tex_coord = nodes.new(type = 'ShaderNodeTexCoord')#NEW
    links = material.node_tree.links
    link = links.new(tex_coord.outputs["UV"], node_texture.inputs["Vector"]) #NEW
    link = links.new(node_texture.outputs[0], nodes.get('Diffuse BSDF').inputs[0])
    link = links.new( diffuse.outputs['BSDF'], output.inputs['Surface'] )
    obj = bpy.data.objects[objname]
    obj.active_material = material
    bpy.ops.object.select_all(action='DESELECT')
    bpy.data.objects[objname].select_set(True)
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.mesh.select_all(action='SELECT')
    bpy.ops.uv.smart_project()
    bpy.ops.object.mode_set(mode='OBJECT')

    # Just directly scale the UVs!
    cyluvs = obj.data.uv_layers[0].data
    for cuv in cyluvs: # each is a bpy.types.MeshUVLoop
        cuv.uv[0] *= Xscale
        cuv.uv[1] *= Yscale

# len(o.data.uv_layers['UVMap'].data) -> 192
# Each of these is a bpy.types.MeshUVLoop
# which has .uv, .select, .select_edge, .pin_uv.
# item.uv is a Vector. We can just scale its Y 30 times!

obj_material_texture_UVscale('Cylinder',TextureFilename,1,30,1)


Material sidebar isn't displaying default options I'm new to blender but I'm trying to add eyebrows etc onto a mask I've created. The problem is following videos when going onto materials they get options such as specular and diffuse all in separate tabs when they create a material. I don't. I do when I create a new blender and with the cube selecting materials I get all of those different drop down tabs so it's not a version issue.

But with my mask at the moment under materials I only get - diffuse, surface, volume, displacement  and it also doesn't display the color I select onto my object.  I know its a probably a silly little thing I've done but I can't figure it out.

Sounds like the render engine is set to Cycles, but the tutorial is using Blender Internal.

You can change the render engine in the info header at the top of the window:


Is it possible to pause and later resume a fluid sim bake? I have a pretty heavy fluid sim bake going on... by pretty heavy I mean I estimate it will take two weeks to complete! It is likely that during that time I will sometimes want to use Blender for something else, then resume the fluid bake. I understand mesh data for each frame is stored in bobj.gz files, but can Blender use the file from the last frame to pick up where it left off baking?

Thanks

Two weeks for Fluid bake seems a bit extreme. While there is no way to pause and resume in Blender, have you considered renting a render farm to do it? Render.st now supports baking on their servers.


Are UI Color Ramps Possible through Python I looked around in the source and other places and I found the code that creates a Color Ramp is as follows:

layout.template_color_ramp(tex, "color_ramp", expand=True)

Does this work for addons because I can't find any documentation or anything on it and whenever I try it doesn't draw in the panel.

I would like to use this in-panel ramp to control a color ramp that is in the Node Editor.

While I don't think you can add a new property to an object that can hold the colour ramp data you can display a duplicate of an existing colour ramp in your own panel if you want to. As you want to display the colour ramp that exists within the nodes of an existing material, this can be done with -

cr_node = bpy.data.materials['Material'].node_tree.nodes['ColorRamp']
layout.template_color_ramp(cr_node, "color_ramp", expand=True)

As the name of the colour ramp node may change you will need a way to choose which colour ramp to display, or show all colour ramps in the current material.


UV mapping with strange distorted texture The following image hopefully illustrates my problem better than a textual description:

A part of the mesh which is selected in the UV/Image Editor on the left is bent (the rim of a wooden wheel).
I would generally expect textured faces to contain the part of the albedo-texture that is also displayed in the corresponding faces of the UV/Image Editor.

Consequently, from the way the texture is displayed in the UV/Image Editor, I expect the texture to have the wood grain aligned with the curve.
On the top-right Rendered Preview however, you see that the grain is radially aligned towards some vertex at the bottom of the rim.

Here is a Link to the Model:

What am I missing or misunderstanding here?

Your normal map is set to sphere mapping. Switch it to flat and you should be good to go. The albedo texture is fine, it's just that the normal map is so strong it makes it very hard to see.


I can't see faces on every model Every time I enter edit mode, I don't see faces at all, just vertices. And that happens on every object/model. How can I fix that?

Btw I'm an absolute beginner.

You've just gotta switch to face select by  clicking on it or pressing the number 3, but not numpad 3.


Vertex Weight Issues I have been working on a character to animate and I have encountered a problem with my weight paniting. (See Image)

I've gone through in edit mode and removed all the problem vertecy form the vertex groups, and I can't think of any other solutions. (Ignore the chicken)

Any help is appreciated!

Here is the .Blend: https://drive.google.com/file/d/0BwmWa-IlNzrzUmx3alR1Q0dmeWc/view?usp=sharing

This behavior of a mesh is almost ever an issue of either "zero weighted" vertices or "ungrouped" vertices. To clarify:

Zero Weighted Vertices

Vertices which have entries in one or more Bone Weight maps, but the sum of all weights is 0. This can happen when all weights for a vertex have been painted to a value of 0 (blue).

Ungrouped Vertices

Vertices which have no entries in any of the Bone weight maps. This can happen when you manually removed weight entries from some of the weight maps, or when you cleaned up your weight maps with the limit weigths tool.

Finding the locations of problematic vertices

when you are in weight paint mode, then you can open the tool shelf, locate the Options vertical tab, and set the value of Show Zero weights to All
Then all areas with unweighted vertices or with vertices with a weight sum of 0 will be rendered in black.

Note: You can change the color from black to something better visible. I changed the User Preferences -> Themes, in the 3D View Section: set "Vertex Group Unreferenced" to your favorite color (i used Magenta):

Selecting ungrouped Vertices

In edit mode, in the Footer of the 3D View: Select -> Ungrouped
Then all vertices will be selected which are not mentioned in any vertex group:


Subdivide faces of Object to a minimum distance of vertices I have the following shape:

I need all vertices of the shape to have roughly the same distance to each other (lets say 2 Units), without changing the shape. So basically using vertices like Pixels.

currently, as seen in the following picture, the faces are very irregular in size and thus the vertices are in very different distances to each other:

My approach was to subdivide the surfaces for like 10 times, until the biggest distance between vertices is below my minimum distance (2 units). I then need a method to remove vertices in such a way, that there are no vertices closer to each other than the minimum distance.

The result would hopefully be that the vertices are all about in the same distance to each other ()

Also any other approach to achieve this would be great!

Thanks

Using "remove Double" after subdivinding multiple times did the job, thanks @Jaroslav Jerryno Novotny!


Does 'Inverse Kinematics' override other bone constraints? Rig is for a quadruped, I have IK applied at second bone, but I want to place a limit on the to the toes, so that they can't go below 0 on the Z axis. Selecting  the Limit Location bone constraint doesn't appear to be honored when striking a pose.

Any ideas?

I think I found the issue. My active 'Copy Location' constraint was overriding my "Limit Location" constraint. Priority in the constraints appears to flow up to down.


Creating a tileable mesh I'm trying to model a simple curtain, which will need to be tiled horizontally. How can I make sure it looks well when tiled?

Here's a video about the problem:

https://youtu.be/51uqrzNm0Q8

Been trying this on and off for some time. For this particular mesh, if the shape is that simple, you can just copy the mesh, and flip it the other way, whichever axis it goes across, scale it to -1


Is there a way to keyframe a modifier to turn on or off? I'm trying to fracture an object after it hits the ground.  Basically, it's falling and hits the ground, then another object smashes it.  I don't see any way to keyframe the execution of a fracture from the fracture modifier, so I'm wondering if I could simply turn the entire modifier on or off with keyframes.

Thanks

To achieve this effect you can use the Dynamic Fracture Mode for the object to be fractured. Note that the Dynamic threshold will cause the object to fracture on impact after falling if set too low. Make adjustments between this and the mass of other objects that interact with the simulation so that things work as desired.

The object that will fall onto this object needs to have a sufficient amount of mass in order for the fracture to work. Here, the sphere has a mass of 25, the rest of the rigid body settings are at defaults.

You may need to increase steps per second in the scene properties if the simulation seems to be unstable, just be sure that all transforms (rotation, scale) are applied.


What is this weird thing when i'm trying to merge the head with the body on a sculpt and how do i fix it? i'm new to blender and sculpting in general and well as you can see i don't know how to merge the head mesh with the body mesh

but i found a way to do it with the boolean modifier but when i use it this happens

i don't know how to fix this or if i'm doing it wrong or is there another way to do it. ALL answers all welcome ! (Feedback,and tips too)

That weird thing is basically the second object you're boolean with overlapping the boolean result. When you use the boolean modifier on an object, this object becomes the result of the boolean operation. But the second object you use in that operation is still around in the scene, overlapping with the first. It's easiest to see if you turn on Random Color Shading:

Now you should be able to see the boolean result overlapped with the second one:

To fix this, you need to hide the boolean target. One way of doing this in an elegant fashion is to use Blender 2.80 collections:

Suzanne is the object that has the boolean on it. Sphere is the object I join with. I put the sphere under a new collection which I called HideMe. Now, I exclude it from the View Layer using the checkbox in front of the collection:

And as a result, the boolean object is not overlapping any longer:


Blender 3d NURBS Path objects move I was trying to create train tracks using NURBS path and everything looks to be great till I press play.

As soon as I play it in Blender Game Engine, the objects are no longer merged and have a clear separation (making it unrealistic).

I believe the problem is that one of the object moves till it reaches the other ones edges, but what I want is that they should not realign themselves.

Here is the blend file.

It finally worked! I was trying to recalculate normals of the base but I was not recalculating for the tracks which were being duplicated. So the steps are the same for all objects and related objects to the curve

View 3D > Edit Mode > Toolbar > Shading/UVs > Recalculate Normals


How to map a texture to a distorted quad? First, a picture to show my question:

As you can see in the second picture, when I scale two vertices of a quad the texture gets distorted wrong. Because a quad is basically two triangles, when I distort the quad only one triangle is being stretched, so the texture warps badly revealing the hidden edge.

I want to map the texture as in the 3rd image (I've done that subdividing the quad multiple times). Is there any option to map the texture so I get the same result?

If you distort the quad, the UV-map must be distorted the same way to keep the texture undistorted. I suspect you will not like this answer. :)

UV is distorted same as quad.

Distort texture in image editor. Or bake from the subdivided mesh to the lowpoly.


What is the reason that this material makes rendering smoke simulations take so much longer? I created a big smoke simulation and wanted the smoke to have rainbow colours. One of the later frames (600) using a single colour took me about 2 minutes to render while using the "rainbow material" it took me about 16 minutes.

Can someone explain to me where this big increase in render time comes from because I can't get my head around it but I want to understand it better.

My relatively uninformed guess is that it is likely caused by Cycles shader optimization, or in this case the lack thereof.

Textureless volumes are probably assumed to have constant color or density, and as such optimized to render disregarding variations across the smoke depth.

This probably saves considerable processing power by skipping color or density checks at every depth step, as the rendering rays traverse the volumetric shader.

It may also be the case that by using heat as input into your shader, Cycles requires more data that either consumes more (system or GPU) memory, or requires uploading CPU computed data from the smoke simulation into the video memory (when GPU rendering using CUDA or OpenCL) at every frame, which is generally a slow process.

After a simple test I'd go with the theory of shader optimization. Just having a simple color input like texture coordinates on a basic volume shader almost duplicates render time.

Constant color about 15 seconds

Simple color variation about 30 seconds

I guess a smoke simulation with varying density and heat based colors will only worsen the calculation.


Help converting from tessface in old addon in Blender 2.8 I have been using this addon for years and it has prevented me from moving to 2.8 till now, but I thought I would try my best to convert it

I managed to convert almost all of the script and am just commenting two sections out, the faces and UV

I have spent a couple of days googleing and reading through every post but I just cant get it to work, I know tessface has been depreciated, but everything I try fails

The commented lines below are the ones I cant get to work.

I think i would be happy if I could just get the faces to work at least!

Help me Obi-wan you are my only hope!

def make_mesh(verteces, faces, normals, uvs, global_matrix):
mesh = bpy.data.meshes.new('name')
mesh.vertices.add(len(verteces))
mesh.vertices.foreach_set("co", unpack_list(verteces))
#mesh.tessface.add(len(faces))
#mesh.tessface.foreach_set("vertices_raw", unpack_face_list(faces))

index = 0
for vertex in mesh.vertices:
    vertex.normal = normals[index]
    index += 1

#uvtex = mesh.tessface_uv_layers.new()
#uvtex.name = "UV"

#for face, uv in enumerate(uvs):
#    data = uvtex.data[face]
#    data.uv1 = uv[0]
#    data.uv2 = uv[1]
#    data.uv3 = uv[2]
#mesh.update(calc_tessface=False, calc_edges=False)

obj = bpy.data.objects.new('name', mesh)
# apply transformation matrix
obj.matrix_world = global_matrix
bpy.context.collection.objects.link(obj)  # link object to collection

Got the faces with one line

def make_mesh(verteces, faces, normals, uvs, global_matrix):
mesh = bpy.data.meshes.new('name')

mesh.from_pydata(verteces,[],faces)

obj = bpy.data.objects.new('name', mesh)
# apply transformation matrix
obj.matrix_world = global_matrix
bpy.context.collection.objects.link(obj)  # link object to collection
```


Mirror an object feet away from parent object instead right next to it? How can i get this chunk of geometry to mirror to the other side of the room instead of right next to the object mirroring it?. Also are there any camera settings that would benefit me doing the exterior then working on the interior instead of vice versa?. I ended up pulling up the back wall starting the wood work on that wall then i'm going to pull up a side wall when that's done and start it's wood work i.e trim and inlays etc.because the camera becomes unresponsive otherwise there has to be way to build a structure then work on the guts of it.

In object mode choose your wall and go into edit mode. Select the front face of your wall and then shifts. Choose Cursor to selected. It will place the 3D cursor at the centre of the face (the front of your wall).

Go back into Object mode and select your door (the pink cube in my case). Right click and select Set Origin > Origin to 3D cursor.

The pivot point of the cube will move to the centre of your wall (front face).

Add a mirror modifier to the cube and set the axis (in my case the Y)

The mirrored cube will mirror across the pivot point.

For your walls if they are planes (single faces) then make sure your normals are facing the interior of the room and turn off backface culling. This means you can work inside your room without the faces (walls getting in the way).


Why is my mirrored object in blender lighter/darker than the original object? Even with a simple cube? EDIT: I Figured it out!
I just hollowed out part of the mesh, on the side that would touch the mirrored object.

Hopefully this can help others having the same problem.

Dunno how that worked, but it did.

Original post:

Whenever I try to mirror an object, the mirrored object is always lightor or darker than the original.

For example...

Is there a way to fix this? Originally I was using this mirror method to create a lightbar (below):

But as you can see, one side of the triangular bit is CLEARLY different from the other in terms of shading..

However this only seems to be the case on smooth shading, flat shading looks just fine.

However, when I export it, to be used in a game, it reverts to smooth shading and looks awful.

Figured it out! I just hollowed out part of the mesh, on the side that would touch the mirrored object.

And basically just went, delete / faces on that part.

Hopefully this can help others having the same problem.
Here is an image showing what I mean.

http://imgur.com/a/7PIHf


How to find an object's locational displacement in Blender using Python? I'm trying to find displacement of animated objects between the first and end frame of an animation and then changing the color of objects based on their displacements. How can I do this?

I'd use a driver based approach

Define a function interp which maps a value from one range to another, in this case the displacement range to 0,1 used for color.  Copy this script and run it in the text editor.

import bpy
def interp(value, f, t):
    m = (value - f[0]) / (f[1] - f[0])
    return t[0] + m * (t[1] - t[0])

#register it in the driver namespace

bpy.app.driver_namespace["interp"] = interp

Now if we look at an object that moves from (1.0, 0.0, 3.0) in frame 1 to (100.0, -199.0, 0.0) in last frame. Add a driver into the red color field field by typing

#interp(frame, [1.0, 100.0], [0.0, 1.0])

straight into the field, the # tells it to interpret it as a driver.  Could do this for r, g, b for x, y, z.  If you use object.color then you can do this quickly on each object, otherwise you will need  to create a material for each object.

Once you have made a driver it can be copied and pasted to other fields, requiring only to edit the location range. If you have zillions of objects probably pay to write a script, or request help on writing one to automate the creation of drivers.


Rotate an image in the image viewer? For some reason this image I imported is sideways, I think my phone glitched when I took the picture.
Can I rotate it within the image viewer?

I would rotate the image in an external program like paint or Photoshop.
CORRECTION

https://i.stack.imgur.com/R0Y5Y.png

you can rotate it here.


What is the difference between an Active animated rigid body and a Passive rigid body? In the Rigid-body settings, there are two options, Active and Passive.

My question is, What exactly does the Passive setting do? how is it different than Animated Active?
(I know what Active and Passive are,
just not what the difference between Active Animated and Passive Animated is)

Thanks

Active objects are the core part of the physics simulation, with dynamic movement, gravity, etc. By checking Active, you are essentially telling the Physics simulator that those objects should experience forces, and it has to figure out where they go over the course of the simulation.

Passive objects, on the other hand, are fixed in place--are static. For the purposes of the simulation, they essentially act as rigid-bodied, static, collision objects. The Animated option allows you to control its motion with keyframes, but it still does not experience the forces modeled on Active objects.

For example, if you're making a simulation of a ball falling onto a table, the ball would be an Active object, since it is affected by gravity, whereas the table would be Passive, since it is fixed in place.


Computing a scalar from UV coordinates in Cycles nodes I have a .obj mesh loaded with given UV coordinates. I'd like to color the mesh using its UV coordinates, similarly to this image. I think the correct way is to first compute a scalar out of the uv coordinates, something like u*v, and then connect that scalar to the hue value of a HSV node. Thing is, I don't know which module can I use to take the UV Map's output and turn it into a scalar.

You can get the UV coordinates from a Texture Coordinates or from an Attribute Node, separate the three components of the vector using a Separate RGB node, and use this to map colors to your BSDF.


How do I distribute hair particles evenly using guiding curves? (Ponytail with Hair Dynamics) I tried increasing the steps under both the viewport and render tab, messing with the guiding curves, and amplification under the Children tab. No method I've tried so far has been able to simultaneously keep the ponytail form and cover my character's entire head with hair. In order to get the shape I wanted, I made the two different particles systems and connected both systems under one guiding curve.

Hair Dynamics are enabled for the ponytail and the main hair, with interpolated children.

Combine a Short Hairstyle with a Dynamic Ponytail
Since the main hair doesn't move, but only the ponytail, you can leave the main hair static and make only the ponytail dynamic (plus dynamic bangs, and another layer of fly-off hair if you want more realism.) It's like a hair extension and fairly easy to do.

Turnaround of the ponytail hairstyle
Preparation

create a little cylinder or "ring" (it's more a disc). It will be the emitter for the ponytail. I've added a Torus object (12 major, 8 minor segments), deleted the inner faces, and grid-filled the hole.

Ponytail hair emitter ("ring")

place this ponytail emitter ("ring") behind the head where you want to have the ponytail
Important! Apply the scale to the "ring" and the head because a lot of the hair settings are relative to the emitter's size. You will get weird-looking results in the simulation and in Cycles renderings. Eevee is more error-tolerant.

Create and Comb the Main Hair
Note: The main hair is on a haircap/scalp emitter. The head is a separate object and is bald. All objects have real-world size.

add a Hair Particle System to the haircap/scalp. 500 particles, 8 segments are fine. You can increase/reduce the number of segments in Particle Edit mode (menu Particle → Rekey; particles must be selected.)
Comb the hair. Select the lower hair (everything at the level of the ears in front view, box select) and comb it up in the direction to the "ring". Tighten the strand of hair guides and try to pull them through the ring.
at the front of the head, pull the hair gently back so the children can't accidentally disappear inside the head (bald spots!)
when you're finished, cut all hair particles (guides) behind the ring.
repeat the combing for the side parts, then for the back top, and finally for the bangs (if you want a parting)
try to layer the hair parts
don't forget you can hide combed parts of the hair so it gets not messed up by further edits. You also can select the roots (menu) and select more segments (keys) with Numbpad++ to easily select single hair guides and comb them.

Create the Ponytail

select the "ring", in Edit Mode, select the inner faces, and assign them to a Vertex Group "Ponytail" (Ctrl+G). This is where the ponytail will grow.
assign material for the hair ("Ponytail" group) and another material for the outside of the ring (inverted selection)
add a Hair Particle System to the ring emitter, 500 particles, 26cm, 8 segments
use the created Vertex Group "Ponytail" in Particle Properties → Vertext Groups → Density so the hair grows "through" the ring and not on the outside of the ring.
enable Particle Properties → [X] Hair Dynamics, in section Hair Dynamics → Structure increase the random value (0.422). This widens the ponytail a little
Note: the values for Vertex Mass and Stiffness have an effect on the stiffness but I left them at the default settings and just did a little weight painting.

Weight paint of the ponytail

in Particle Edit mode, weight paint the keys (black dots) a little, see screenshot. This spreads the ponytail somewhat, makes it fluffy and it doesn't look completely flat from the side.
run the animation. In about 60 frames the ponytail should have fallen down nicely. It should neither sap off nor stick out.

Simulated hair dynamics of the ponytail
Tweak the Hair Particle Settings

Children, select Interpolated, amount: 80. For the ponytail only: Length: 0.959, Threshold: 0.306. It makes the end of the ponytail a little more shaggy.
adjust the values for Clumping, Roughness, and Kink as you like.
use a small number for Roughness → Random, like 0.021
if the children of the main hair try to overgrow the ring emitter then try to increase Clumping → Clump a bit, e.g. 0.479
Kink works well for the ponytail (used Wave in the example) but select a small Amplitude like 0.02 m so it doesn't "explode"
for Hair Shape use values like Strand Shape: -0.9, Diameter Root: 0.03, Tip: 0.01, Diameter Scale: 0.01 (default). These values are important for Cycles if you don't want to have super fat hair particles.

Animation test:


How Can I Use a Procedural Bump Map to Replicate a Natural Pattern? So I have tried for up to five hours to try to use the nodes to make it so that the 'veins' on the image are shown on the model with a bump map.
Any insights on having the 'veins' run parallel to the shape of the antlers?
Bonus would be to remove the seams between the different regions of the geometry.

To align the texture along the direction of the mesh requires a UV map and this needs to be unwrapped in such a way that each face is oriented along the line of the antler. Further, to avoid a 'seam' along the length of the mesh requires that a seamless texture is used and that the UV map unwrapping ensures that the edges of the UV map align. The right UV map and a seamless texture can produce the following :

Manually unwrapping such a mesh while keeping the faces correctly aligned and joined at the seams would be quite complicated and time consuming - unwrapping the splits while keeping the orientation and the seams would be particularly difficult. Fortunately, Python can do the unwrapping for us.
Starting with a mesh created using the Skin modifier :

The 'texture' needs to run from one end of the antler (the 'root) to the tips. Create two new vertex groups (one for the 'start' and the other for the 'end') and assign the relevant vertices to each. For the example above I marked the vertices around the 'root' of the antler as 'START' and those at the tips as 'END'. The texture will be spread over the mesh using those points as anchors.

Next, create another vertex group ('seam') and assign vertices along the length of each 'branch' to it. This will be the 'seam' of the texture as it's wrapped around the mesh. You can experiment with different seams to get twists and different patterns for the split but the pattern shown below works quite well.

To give further control at the boundaries of branches you can allocate vertices to a 'crease' vertex group. This will effectively block the influence of the 'seam' to prevent one branch's seam from affecting the next. You may need some experimentation for this - depending on your geometry and chosen seam. In my case I simply 'capped' the end of each seam.

Open a Text Editor window and paste the following code (Blender versions prior to 2.80 - for later versions, see EDIT further down post) :
import bpy
import bmesh

group_vertex_cache = []

def color_vertices_rgb(obj, numpasses, target_delta, grp_start, grp_end, grp_seam, grp_crease):
    """Uses the Vertex Groups to assign each vertex UV coordinates, blended across the mesh"""

    bpy.ops.object.mode_set(mode='OBJECT')
    bpy.ops.object.select_all(action='DESELECT')
    obj.select = True
    bpy.context.scene.objects.active = obj
    bpy.ops.object.mode_set(mode='EDIT')

    obj.update_from_editmode()

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

    scn.objects.active = obj

    start_vertices = []     # Start RED
    end_vertices = []       # End RED
    seam_vertices = []      # GREEN
    crease_vertices = []    # Block influence
    vert_colors = {}
    vert_links = {}

    global group_vertex_cache
    init_group_vertex_cache(obj)

    # Get a count of loop verts and create an array to hold the details
    loopvert_count = len(obj.data.loops)
    loopverts = [0] * loopvert_count

    print('Capturing...')
    # Process each loop vert and collect all the data we require
    for polygon in obj.data.polygons:

        loopidxpos = -1
        for loopidx in polygon.loop_indices:
            loopidxpos = loopidxpos + 1

            loopvertrec = {}

            # Determine which loop verts are to the left and right of this one
            if loopidxpos == 0:
                left  = polygon.loop_indices[len(polygon.loop_indices) - 1]
                right = polygon.loop_indices[loopidxpos + 1]
            elif loopidxpos == (len(polygon.loop_indices)-1):
                left  = polygon.loop_indices[loopidxpos - 1]
                right = polygon.loop_indices[0]
            else:
                left  = polygon.loop_indices[loopidxpos - 1]
                right = polygon.loop_indices[loopidxpos + 1]

            loopvertrec['left']  = left
            loopvertrec['right'] = right
            loopvertrec['left-dist'] = get_edge_length(obj, loopidx, left)
            loopvertrec['right-dist'] = get_edge_length(obj, loopidx, right)

            # get list of loops verts that make up the same vert as this one
            loopvertrec['shared-loop-verts'] = get_loop_verts(obj, loopidx)

            #...get whether it's in each of the 'groups' (ie, start, end, seam, crease) - and the associated weight (assume weight 0 if not in group)
            loopvertrec['start-weight'] = get_group_weight(obj, grp_start, loopidx)
            loopvertrec['end-weight'] = get_group_weight(obj, grp_end, loopidx)
            loopvertrec['seam-weight'] = get_group_weight(obj, grp_seam, loopidx)
            loopvertrec['crease-weight'] = get_group_weight(obj, grp_crease, loopidx)

            #loopvertrec['color'] = get_loopvert_color(obj, loopidx)

            loopverts[loopidx] = loopvertrec
            print(str(loopidx))

            vert_colors[loopidx] = [0.5,0.5,0.5]

    print('Captured.')

    new_colors = {}
    print('Processing....')
    for p in range(0, numpasses):
        print("Pass "+str(p+1)+" of "+str(numpasses))

        maxdelta = 0

        for v in range(0, len(loopverts)):

            loopvertrec = loopverts[v]

            start_weight  = loopvertrec['start-weight']
            end_weight    = loopvertrec['end-weight']
            seam_weight   = loopvertrec['seam-weight']
            crease_weight = loopvertrec['crease-weight']

            # Generate Red, Green, Blue based on weights and spread over mesh. Red will be used to generate U, Green/Blue to generate V

            # Average colors with neighbours
            r = (vert_colors[v][0] + vert_colors[loopvertrec['left']][0] + vert_colors[loopvertrec['right']][0]) / 3
            g = (vert_colors[v][1] + vert_colors[loopvertrec['left']][1] + vert_colors[loopvertrec['right']][1]) / 3
            b = (vert_colors[v][2] + vert_colors[loopvertrec['left']][2] + vert_colors[loopvertrec['right']][2]) / 3

            average_this_loop = [r, g, b]

            for v2 in loopvertrec['shared-loop-verts']:
                r = r + (vert_colors[v][0] + vert_colors[loopverts[v2]['left']][0] + vert_colors[loopverts[v2]['right']][0]) / 3
                g = g + (vert_colors[v][1] + vert_colors[loopverts[v2]['left']][1] + vert_colors[loopverts[v2]['right']][1]) / 3
                b = b + (vert_colors[v][2] + vert_colors[loopverts[v2]['left']][2] + vert_colors[loopverts[v2]['right']][2]) / 3

            average_all_loops = [r / (len(loopvertrec['shared-loop-verts'])+1),g / (len(loopvertrec['shared-loop-verts'])+1),b / (len(loopvertrec['shared-loop-verts'])+1)]

            # CREASE
            r = average_all_loops[0]
            g = average_this_loop[1] * ( crease_weight ) + average_all_loops[1] * ( 1.0 - crease_weight )
            b = average_this_loop[2] * ( crease_weight ) + average_all_loops[2] * ( 1.0 - crease_weight )

            r = r * (1.0 - end_weight)                          # END
            r = r * (1.0 - start_weight) + 1.0 * start_weight   # START

            # Determine the left/right side of the seam based on direction of 'red'
            if (vert_colors[loopvertrec['left']][0] > vert_colors[loopvertrec['right']][0]):
                leftness = 1.0
            elif (vert_colors[loopvertrec['left']][0] < vert_colors[loopvertrec['right']][0]):
                leftness = 0.0
            else:
                leftness = 0.5

            g = g * (1.0 - seam_weight) + leftness * seam_weight

            # store it
            if len(new_colors)>v:
                vertdelta = abs(new_colors[v][0]-r) + abs(new_colors[v][1]-g) + abs(new_colors[v][2]-b)
            else:
                vertdelta = abs(r) + abs(g) + abs(b)

            if vertdelta > maxdelta:
                maxdelta = vertdelta

            new_colors[v] = (r,g,b)

        print(maxdelta)
        if maxdelta < target_delta:
            break

        #Copy new colors back to vert_colors
        for i in range(0,len(loopverts)):
            vert_colors[i] = new_colors[i]

    # Generate UV map - must be in EDIT mode for this

    bm = bmesh.from_edit_mesh(obj.data)
    uv_layer = bm.loops.layers.uv.verify()
    bm.faces.layers.tex.verify()

    for f in bm.faces:
        for l in f.loops:
            luv = l[uv_layer]

            r = vert_colors[l.index][0]
            g = vert_colors[l.index][1]
            b = vert_colors[l.index][2]

            luv.uv = (r, g)

    bmesh.update_edit_mesh(obj.data)
    bpy.ops.object.mode_set(mode='OBJECT')

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

def get_edge_length(obj, loopidx1, loopidx2):

    vert1 = obj.data.loops[loopidx1].vertex_index
    vert2 = obj.data.loops[loopidx2].vertex_index

    for edge in obj.data.edges:
        if (edge.vertices[0] == vert1 and edge.vertices[1] == vert2) or (edge.vertices[0] == vert2 and edge.vertices[1] == vert1):

            OWMatrix = obj.matrix_world
            v1Pos = OWMatrix * obj.data.vertices[vert1].co
            v2Pos = OWMatrix * obj.data.vertices[vert2].co

            dist = (v1Pos - v2Pos).length

            return dist

    return 0.0

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

def get_loop_verts(obj, loopidx):
    loopverts = []
    vertidx = obj.data.loops[loopidx].vertex_index

    idx = -1
    for loop in obj.data.loops:
        idx = idx + 1
        if loop.vertex_index == vertidx and idx != loopidx:
            loopverts.append(idx)

    return loopverts

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

def get_group_weight(obj, group, loopidx):

    groupindex = obj.vertex_groups[group].index
    vertidx = obj.data.loops[loopidx].vertex_index

    global group_vertex_cache

    for v in group_vertex_cache:
        if v.index == vertidx:
            for g in v.groups:
                if g.group == groupindex:
                    return g.weight

    return 0.0

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

def init_group_vertex_cache(obj):

    global group_vertex_cache

    for v in obj.data.vertices:
        if len(v.groups) > 0:
            group_vertex_cache.append(v)

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

#Invoke it
color_vertices_rgb(bpy.context.scene.objects["Antler"], 1250, 0.0001,'START', 'END', 'SEAM', 'CREASE')

Note the last line of the script which invokes the function on your mesh. This should be amended to specify the name of your mesh and the other arguments as follows :
color_vertices_rgb(bpy.context.scene.objects["<meshname>"], <iterations>, <mindelta>, '<start>', '<end>', '<seam>', '<crease>')

Where meshname is the name of your mesh, iterations is the number of steps to run the 'average' spread algorithm, mindelta is the minimum acceptable change in UV coordinates (if it reaches that then it will decide it's finished regardless of iterations - if unsure, set to 0), start, end, seam, crease are the names of the 4 vertex groups mentioned above. Run the script - it might take a while depending on the complexity of your mesh and the chosen number of iterations (more will produce better results but will take longer). If you have a command-line console window open it will output progress and diagnostics.
This works by allocating UV coordinates (which can be represented as 'colors' - Red being equivalent to 'U' and Green being equivalent to 'V') to each of the vertices in the groups and spreading them across the mesh by averaging them with their immediate neighbours.

Note that the Red is strongest at the root and fades out towards the tips while the green is strongest at the left-hand edge of the seam and fades around the circumference of the mesh.
Once the processing is complete you should have a UV Map that you can use for your texture and this can be used with a seamless image texture if desired - although depending on the texture used, this isn't strictly necessary if the texture is already quite linear since it effectively hides the seam. For example, here's a simple Musgrave texture, scaled in one direction using a Mapping node.

Combine multiple textures at different scales for a more interesting surface.

This can now be used to drive the Bump node and adjusted to get the desired effect.

Blend file attached

EDIT for Blender 2.80+ (changes to API): At later Blender versions the API function calls for some operations has changed. Here's an updated script that works at later releases (tested on 2.91).
import bpy
import bmesh

group_vertex_cache = []

def color_vertices_rgb(obj, numpasses, target_delta, grp_start, grp_end, grp_seam, grp_crease):
    """Uses the Vertex Groups to assign each vertex UV coordinates, blended across the mesh"""

    bpy.ops.object.mode_set(mode='OBJECT')
    bpy.ops.object.select_all(action='DESELECT')

    #For 2.80+, changed API for selecting object
    #obj.select = True
    obj.select_set(state = True)

    #For 2.80+, changed API to set active object
    #bpy.context.scene.objects.active = obj
    bpy.context.view_layer.objects.active = obj

    bpy.ops.object.mode_set(mode='EDIT')

    obj.update_from_editmode()

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

    #2.80+ this isn't necessary (already made it 'active')
    #scn.objects.active = obj

    start_vertices = []     # Start RED
    end_vertices = []       # End RED
    seam_vertices = []      # GREEN
    crease_vertices = []    # Block influence
    vert_colors = {}
    vert_links = {}

    global group_vertex_cache
    init_group_vertex_cache(obj)

    # Get a count of loop verts and create an array to hold the details
    loopvert_count = len(obj.data.loops)
    loopverts = [0] * loopvert_count

    print('Capturing...')
    # Process each loop vert and collect all the data we require
    for polygon in obj.data.polygons:

        loopidxpos = -1
        for loopidx in polygon.loop_indices:
            loopidxpos = loopidxpos + 1

            loopvertrec = {}

            # Determine which loop verts are to the left and right of this one
            if loopidxpos == 0:
                left  = polygon.loop_indices[len(polygon.loop_indices) - 1]
                right = polygon.loop_indices[loopidxpos + 1]
            elif loopidxpos == (len(polygon.loop_indices)-1):
                left  = polygon.loop_indices[loopidxpos - 1]
                right = polygon.loop_indices[0]
            else:
                left  = polygon.loop_indices[loopidxpos - 1]
                right = polygon.loop_indices[loopidxpos + 1]

            loopvertrec['left']  = left
            loopvertrec['right'] = right
            loopvertrec['left-dist'] = get_edge_length(obj, loopidx, left)
            loopvertrec['right-dist'] = get_edge_length(obj, loopidx, right)

            # get list of loops verts that make up the same vert as this one
            loopvertrec['shared-loop-verts'] = get_loop_verts(obj, loopidx)

            #...get whether it's in each of the 'groups' (ie, start, end, seam, crease) - and the associated weight (assume weight 0 if not in group)
            loopvertrec['start-weight'] = get_group_weight(obj, grp_start, loopidx)
            loopvertrec['end-weight'] = get_group_weight(obj, grp_end, loopidx)
            loopvertrec['seam-weight'] = get_group_weight(obj, grp_seam, loopidx)
            loopvertrec['crease-weight'] = get_group_weight(obj, grp_crease, loopidx)

            #loopvertrec['color'] = get_loopvert_color(obj, loopidx)

            loopverts[loopidx] = loopvertrec
            print(str(loopidx))

            vert_colors[loopidx] = [0.5,0.5,0.5]

    print('Captured.')

    new_colors = {}
    print('Processing....')
    for p in range(0, numpasses):
        print("Pass "+str(p+1)+" of "+str(numpasses))

        maxdelta = 0

        for v in range(0, len(loopverts)):

            loopvertrec = loopverts[v]

            start_weight  = loopvertrec['start-weight']
            end_weight    = loopvertrec['end-weight']
            seam_weight   = loopvertrec['seam-weight']
            crease_weight = loopvertrec['crease-weight']

            # Generate Red, Green, Blue based on weights and spread over mesh. Red will be used to generate U, Green/Blue to generate V

            # Average colors with neighbours
            r = (vert_colors[v][0] + vert_colors[loopvertrec['left']][0] + vert_colors[loopvertrec['right']][0]) / 3
            g = (vert_colors[v][1] + vert_colors[loopvertrec['left']][1] + vert_colors[loopvertrec['right']][1]) / 3
            b = (vert_colors[v][2] + vert_colors[loopvertrec['left']][2] + vert_colors[loopvertrec['right']][2]) / 3

            average_this_loop = [r, g, b]

            for v2 in loopvertrec['shared-loop-verts']:
                r = r + (vert_colors[v][0] + vert_colors[loopverts[v2]['left']][0] + vert_colors[loopverts[v2]['right']][0]) / 3
                g = g + (vert_colors[v][1] + vert_colors[loopverts[v2]['left']][1] + vert_colors[loopverts[v2]['right']][1]) / 3
                b = b + (vert_colors[v][2] + vert_colors[loopverts[v2]['left']][2] + vert_colors[loopverts[v2]['right']][2]) / 3

            average_all_loops = [r / (len(loopvertrec['shared-loop-verts'])+1),g / (len(loopvertrec['shared-loop-verts'])+1),b / (len(loopvertrec['shared-loop-verts'])+1)]

            # CREASE
            r = average_all_loops[0]
            g = average_this_loop[1] * ( crease_weight ) + average_all_loops[1] * ( 1.0 - crease_weight )
            b = average_this_loop[2] * ( crease_weight ) + average_all_loops[2] * ( 1.0 - crease_weight )

            r = r * (1.0 - end_weight)                          # END
            r = r * (1.0 - start_weight) + 1.0 * start_weight   # START

            # Determine the left/right side of the seam based on direction of 'red'
            if (vert_colors[loopvertrec['left']][0] > vert_colors[loopvertrec['right']][0]):
                leftness = 1.0
            elif (vert_colors[loopvertrec['left']][0] < vert_colors[loopvertrec['right']][0]):
                leftness = 0.0
            else:
                leftness = 0.5

            g = g * (1.0 - seam_weight) + leftness * seam_weight

            # store it
            if len(new_colors)>v:
                vertdelta = abs(new_colors[v][0]-r) + abs(new_colors[v][1]-g) + abs(new_colors[v][2]-b)
            else:
                vertdelta = abs(r) + abs(g) + abs(b)

            if vertdelta > maxdelta:
                maxdelta = vertdelta

            new_colors[v] = (r,g,b)

        print(maxdelta)
        if maxdelta < target_delta:
            break

        #Copy new colors back to vert_colors
        for i in range(0,len(loopverts)):
            vert_colors[i] = new_colors[i]

    # Generate UV map - must be in EDIT mode for this

    bm = bmesh.from_edit_mesh(obj.data)
    uv_layer = bm.loops.layers.uv.verify()

    #Removed for 2.80+ since no longer valid and not needed
    #bm.faces.layers.tex.verify()

    for f in bm.faces:
        for l in f.loops:
            luv = l[uv_layer]

            r = vert_colors[l.index][0]
            g = vert_colors[l.index][1]
            b = vert_colors[l.index][2]

            luv.uv = (r, g)

    bmesh.update_edit_mesh(obj.data)
    bpy.ops.object.mode_set(mode='OBJECT')

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

def get_edge_length(obj, loopidx1, loopidx2):

    vert1 = obj.data.loops[loopidx1].vertex_index
    vert2 = obj.data.loops[loopidx2].vertex_index

    for edge in obj.data.edges:
        if (edge.vertices[0] == vert1 and edge.vertices[1] == vert2) or (edge.vertices[0] == vert2 and edge.vertices[1] == vert1):

            OWMatrix = obj.matrix_world

            #In 2.80+, use the '@' operator for matrix mulitplication
            #v1Pos = OWMatrix * obj.data.vertices[vert1].co
            #v2Pos = OWMatrix * obj.data.vertices[vert2].co
            v1Pos = OWMatrix @ obj.data.vertices[vert1].co
            v2Pos = OWMatrix @ obj.data.vertices[vert2].co

            dist = (v1Pos - v2Pos).length

            return dist

    return 0.0

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

def get_loop_verts(obj, loopidx):
    loopverts = []
    vertidx = obj.data.loops[loopidx].vertex_index

    idx = -1
    for loop in obj.data.loops:
        idx = idx + 1
        if loop.vertex_index == vertidx and idx != loopidx:
            loopverts.append(idx)

    return loopverts

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

def get_group_weight(obj, group, loopidx):

    groupindex = obj.vertex_groups[group].index
    vertidx = obj.data.loops[loopidx].vertex_index

    global group_vertex_cache

    for v in group_vertex_cache:
        if v.index == vertidx:
            for g in v.groups:
                if g.group == groupindex:
                    return g.weight

    return 0.0

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

def init_group_vertex_cache(obj):

    global group_vertex_cache

    for v in obj.data.vertices:
        if len(v.groups) > 0:
            group_vertex_cache.append(v)

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

#Invoke it
color_vertices_rgb(bpy.context.scene.objects["Suzanne"], 1250, 0.0001,'START', 'END', 'SEAM', 'CREASE')


Sub Surf looking weird how do I invert the curve direction Weird inverted curve from what I want

How I want it to curve

Why is my subsurf "cage" curved in the opposite direction of what I want? How can I flip the curve the other way to create the edge of this car window? I want it like the second image!

Merge and weld these four edges.

To make it completely smooth, you will have to add a supporting edgeloop on the outer side.

This is the resulting loop.


How to draw circle or rectangle or arrow in blender video editor? I am creating a tutorial and i want to create for example a rectangle to attract the viewers attention

Here is what I do (or something similar, as I use this tactic to position more videos for people to click on), you can create a simple box with transparency around it (though make sure that the image format you save it as has support for alpha, png should work):

Get your image onto your sequencer (drag in the image, or Shift + A).

Select your image (Right click), and press Shift + A , then choose Effect Strip, and then Transform.

Select the Transform block/strip, then over on the right, choose
Alpha Over instead of Replace.

Change the position and scale settings on the right, in the Effect Strip


Stripes appearing on rendered objects? I just started out learning Blender and when I tried to render my images, a pattern of stripes appear on my objects. What causes this?

Just to note I used 1000 sampling in this render since I before I encountered a noise issue.

The image I used in the UV editor is this one:

As you can see there are no white stripes in the image that I used.

BlendExchange did not work for me so here is Wetransfer

what am I doing wrong?

I'm assuming you sent the real texture.

Your texture is a png in a particular case: it is an index image.

The index image has a short Color Table, only 256 colors.

You have a pink gradient using a too limited number of colors.

I'm sending an image showing the problem when I changed the Color Table. Note the stripes are only affecting the pink colors.

To solve it, use the original file in RGB mode.

You cannot use the index file to conver to RGB, because you cannot bring back the colors you lost when you converted it to Index Mode.

Extra info:

This particular case was caused by converting from Illustrator to PNG.
Illustrator does not render gradients properly when exported.
It's a good practice using a raster-based program to make gradients.


Is it possible to reload an image directly in the 3d view? I am trying to reload the image i use to my 3d model directly in the 3d view. From what i can understand so far you can reload bu putting the mouse pointer over the material panel and pressing alt+R or press"reload current image from disk", however that is very frustrating to be forced to open that panel everytime,especially since i worked with maximized 3d view and my custom made pie menu, is it possible to write your own shortcut for this, or is it some kind of script that can fix this?

An ugly method (but possibly enough for your needs)
If you just have a few images and they aren't giant. You can reload all images, (The update becomes visible after moving 3dview around a little)

import bpy

bl_info = {
    "name": "Refresh Images",
    "version": (0, 1),
    "blender": (2, 76, 0),
    "description": "Refresh images",
    "category": "3D View"
}

class SimpleImageUpdater(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "view3d.refresh_images"
    bl_label = "Image Refresher"

    def execute(self, context):
        for img in bpy.data.images:
            img.reload()
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

Auto updating version of the execute function

def execute(self, context):
    for img in bpy.data.images:
        img.reload()
    bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
    return {'FINISHED'}

it should look like this: https://gist.github.com/zeffii/6189c3be154ad67f1592


What is the correct 'data_path' to animate the colour of a Principled BSDF node with Python? Version: 2.83
I want to change the colour of a material during animation - via python script.
I can create a cube wherever I want, called myobject and attached to it an appropriate material:
        material.use_nodes = True
        principled_bsdf = material.node_tree.nodes['Principled BSDF']
        principled_bsdf.inputs[0].default_value = colour
        principled_bsdf.inputs[5].default_value = 0
        myobject.active_material = material

I can then move the object for each i and use myobject.keyframe_insert(data_path = "location", frame(i)) to insert frames appropriately. What is the correct data_path channel to insert keyframes for different colours, so I can change principled_bsdf.inputs[0] for whichever keyframes I want.
This question asks the same question, but doesn't have any answers: Change the color via python script
Note that using data_path = "color" doesn't give an error, but also doesn't work.

Keyframe the default value of the socket
Animating by keyframe  the base colour of the bsdf node
To the python console.
From material "Material" get the bsdf node
>>> mat = D.materials['Material']
>>> bsdf = mat.node_tree.nodes['Principled BSDF']

What color is it now?
>>> bsdf.inputs['Base Color'].default_value
bpy.data.materials['Material'].node_tree.nodes["Principled BSDF"].inputs[0].default_value

>>> bsdf.inputs['Base Color'].default_value[:]
(0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0)

Make it red and insert a keyframe at frame 30
>>> bsdf.inputs['Base Color'].default_value = (1, 0, 0, 1)
>>> bsdf.inputs['Base Color'].keyframe_insert("default_value", frame=30)
True

Same for blue at frame 50
>>> bsdf.inputs['Base Color'].default_value = (0,  0, 1, 1)
>>> bsdf.inputs['Base Color'].keyframe_insert("default_value", frame=50)
True

True above is indicating the success of adding the keyframe.  To keyframe a single channel (r, g, b, a) -> index 0, 1, 2, 3.  To keyframe just the green channel
input.keyframe_insert("default_value", index=1)

One material.
See this answer, https://blender.stackexchange.com/a/185314/15543
Could instead consider using one material and animate the object color.
ob.keyframe_insert("color", frame=33)


Box rigging with empty groups does not work I'm trying to create an animation of folding a box. I have a model of unfolded box and armature. But when set parrent with empty groups, trere are vertex groups for only two bones of twelve. There are no doubles on model. Model is in one mesh.
When I make my own vertex groups for every bone (with bone names), it does not work too.
What am I doing wrong?

Try using automatic weights instead. That will create the groups for you.


BGE : Stop Animation at an arbitrary point and return to frame 1 I am working on my Boss character for a project in the Blender Game Engine. He has an attack animation that plays when he gets within range of the player (detected via a near sensor.) However, I would like the attack animation on the boss to stop playing and return to the first frame if the player exits the near sensor's range. Is this possible to do with logic bricks, and if so, how?

(Sorry if I´m doing this wrong)

 I did this because I could not get the Near Sensor to work. (I replaced it with a Message, (called the "stop" where "Not Near" was and "Start" where the "Near" was)
And so I add  2 new Property one with -1 frame if Start was False. and one with if frame# was less 0 then Assing 1. so it was always 1 if it gos back to zero.
and added to a sensor where the boss is. So if I leave the area then it send the stop message and then Boss goes back to the starting position.

The only problem now is that if I leave the area and if the Boss is on Frame 30
And I go back then he starts on frame 1. But I will solve it.

Yes. You can do this with logic bricks. You can actually do quite a bit with logic bricks. (I've made entire games only using logic just to prove it is possible to do so)
You'll need to start with two properties, a Boolean to control when the animation is playing, and an Integer property to control what frame the animation will display.
You'll need an always sensor (with true level triggering enabled) connected to an action actuator set to property - this will make the selected action display the frame of that action that correlates to the property that is set in the actuator.
You'll need your boss object's near sensors detecting the player, and assigning the Boolean property true or false.
Then, when the Boolean property is true, it will rapidly add 1 to the integer property controlling the animation's display frame, making the animation play. The moment the Boolean property turns false, it will assign the animation's frame to 1, resetting your boss object's attack.
You'll also want a property sensor waiting till the animation is done playing, to allow looping. to do this, set the value in that property sensor to however many frames is in your animation. When testing, I used a 40 frame animation, so I put 40 in that field. This property sensor can connect to the same actuator as before that assigned the frame number to 1, as it has the same function (resetting the animation.)
Or, if you do better with pictures:


How to merge two weightpainted meshes with two separate armatures? I have two meshes, both weightpainted to their separate armatures.

I have a body mesh with an armature and I have a glove mesh with an armature.
I want to replace the hand part of the body armature with the glove armature - so I will keep the weightpainting on the glove.

However when i try to join them, it seems that one of the armatures just disappears. I have already checked the naming, and it is not the same on the two armatures.

Thanks!

After joining the two objects,

To use more than one armature

i) Set up so the body rig is the parent of the mesh and the first armature modifier (armature parent) ... standard setup for one armature.  If you select your body last you will still have this setup on join.

ii) Make the body armature hand pose bones the parents of the glove armatures, arranged to appear as thought it is one rig.  If you have another face rig make the head bone the parent etc.

iii) Add another armature modifier to the modifiers stack for the glove armature.  (One for a face rig etc)

PS. good practice to apply scale to your rigs and meshes so they are all (1,1,1).  Not doing so can cause problems later.


Panel locations moved Opened my project today and the panels were in different places. Very uncomfortable to use. How do I move them back to the default location?

This will return all settings, including UI, to those you had when you downloaded Blender.... this will also reset any changes you have made to the Blender start-up file, too.

and this will allow you to load files containing alternate UIs without loading the UI changes... (just in case that is what happened...)


2.8 freestyle modifiers animation not works Why does any animation not work for Freestyle Style Line modifiers?

Blender 2.80 and 2.81

Blender 2.79 works fine


Bone rotation quaternion issues I am attempting to make my character do a backflip. I rotate the hips 360º in the X axis with a couple of keyframes, then watch the animation. It doesn't work. Either it doesn't seem to move at all, or it rotates in all the wrong directions.

I believe this is due to quaternion rotation vs. Euler rotation. In extremely simple terms, what is the difference, and how would I use Quaternions efficiently in solving this issue?

I can't say about how to fix the rotation but might I suggest just adding an object like a circle and setting it's origin to the center of mass of your character then parenting the armature and it's hierarchy to that object and just going from there.


rotate an object while it follows a path I am trying to rotate the moons and Planets as they orbit their parent bodies. In a way that does not require the setting up of key frames –  jwktrucker

You guys have been very helpful and Thanks to all of you.

On "Cyclic orbit animation" you showed me how to get an object to orbit another so using the follow path method how can I make the object rotate on its own axis as it orbits the other object. This project is to complex to clutter with key frames so if you can

Oh and the orbit speed and rotation speeds of objects will not be related to each other

Object 1 "Sun" stationary
Object 2 "Planet 1" orbits sun at 300 frames rotates in 26 frames
Object 3 "Moon 1" orbits planet 1 at 100 frames rotates in 15 frames

above is Just an example of project requirements The system I am building has 37 objects in it one of witch is an Asteroid Belt

One way to do this is with an empty following the orbit. This way you can parent an object to the empty and rotate it independently:

Add an empty and make it follow a path (e.g. with the Follow Path constraint). Clicking Animate Patch will automatically add an fcurve modifier which endlessly moves the empty along the path:

To control the orbit speed, set the total number of frames required for an orbit by adjusting the Frames value in Properties > Object data > Path Animation with the curve selected:

Parent your object to the empty (⎈ CtrlP):

Now the object's transforms will be relative to the empty. You can rotate the empty to tilt the object's axis of rotation if you like.
Make the planet object spin. To do this, insert a keyframe on the Z rotation of the object ( RMB > Insert single keyframe). You'll only need this one keyframe. You could use drivers instead, however that may cause issues if you plan on using a renderfarm such as sheepit.

In the graph editor, add a Generator fcurve modifier. Note that internally blender stores rotations as radians, so to make the planet rotate once every 26 frames, you'll want the X multiplier to be 6.28318531/26 (6.28318531 radians = 360°).

Result:


makeclothes not showing up in blender I have installed the makehuman blender tools and the only one that is showing up is makewalk I'm not sure if I stuck the tools in the wrong folder or what is going on someone please help?

If you by "not showing up" mean that you were able to install and enable them in the user preferences but then don't find them in the toolshelf section in blender, this is because MakeTarget and MakeClothes end up on the properties panel, not the toolshelf. Press "n" in blender to show the properties panel.


How do I fill a room with mist (smoke) in blender cycles? I'm trying to fill a room with humid mist, and cannot get the smoke domain to change from grey to any color. I also tried to just use volume scatter within the world nodes and it requires too much ram for my computer. Any advice on just making really minor, atmospheric mist?

Here's my new node setup. It works, but cannot get the color to change from grey to transparent white. Any ideas?

Add a big cube that surrounds the room (there is no need to set it as domain of a smoke simulation) and use a Volume Scatter node connected to the Volume output of the Material output Node. Unplug anything that is connected to the surface socket.

like in this example:

and this post:

Low lying fog bounding object rendering as solid


Materials have no color when put in unity So I am just adding a sphere that has just 1 material to unity and when I add it to the asset folder there's no material, When I extract material its just a blank material. I have tried EVERYTHING what am I doing wrong? (using blender 2.8)

you have to bake the whole material. unity otherwise you do not recognize the materials of blender.
look at this exhaustive answer to my question that is similar to yours


How to upload videos from Blender to Youtube (and other things) Yes, I have checked the other threads. Yes, I looked at the online tutorials. Yes, I tried converting it to an AVI file, but instead of getting what I want, I got either a very slowed down version of my video with no audio, or one with normal speed except my video is only 3 seconds long.

I even downloaded ffmpeg to try to "convert" the video, but I can't find any of the saved copies of my videos that I have.

I posted some of my settings down here.

Also, the video is showing up on a weird 90 degree tilt. So, how do I rotate it?

(from the .AVI one, to the .blender one, to the five other formats that I tried saving it under).

There seem to be several problems in your project:

File format is not the right one for YouTube
The frame rate is set to 32767
The camera might be rotated by 90°

Regarding 1): You probably want to use FFmpeg video as output format, with the Container set to MPEG-4, Video Codec set to H.264 and Audio Codec to AAC. This will create a lossy compressed video file. This seems to be one of the standard configurations that YouTube recommends.

Regarding 2): The frame rate should likely be 24/25/30/60 fps depending on the speed of your animation and the desired output frame rate.

Regarding 3): It could be that your camera is rotated 90° or it's because another setting in the video export was causing the issue. Check in the viewport that the camera perspective is correct by pressing Numpad 0.


Blocking the camera without blocking lights In cycles, how can I make an object opaque to the camera, but transparent to light?

I know this can be done in compositing, but is there a way to do it at render time.

You can do the same as you would if you wanted to make the object invisible to the camera yet still cast shadows etc, only in reverse:

This is equivalent to disabling Shadow ray visibility as NoviceInDisguise answered, but with nodes instead. Note that disabling the ray visibility in the object panel helps rendertimes a little more than using nodes, but if you want to use it inside a larger setup it may be necessary to use nodes.


Having some trouble with Grease Pencil I'm not entirely sure whats happening but every time I try to use Grease pencil on my mesh it comes out all scrambled and weird. Posting pic for more information,.

So apparently I had bsurfases added twice. I just had to delete one of the installations. Now everything works fine


Calling a method from a string I am trying to execute a line of code, such as: bpy.ops.object.modifier_add(type='SUBSURF') from a string of text.

My code is:

import bpy
import math

print("~~~Separator~~~")

obj_list = []
task_list = []

class ExportSomeData(bpy.types.Operator):
"""Test exporter which just writes hello world"""
bl_idname = "export.some_data"
bl_label = "Export Some Data"

filepath = bpy.props.StringProperty(subtype="FILE_PATH")

@classmethod
def poll(cls, context):
    if not obj_list:
        return False
    else:
        return True

def callMethod(o, name):
    getattr(o, name)()

def execute(self, context):
    global task_list
    file = open(self.filepath, 'r+')
    for line in file:
        task_list.append(line)
        callMethod("I don't know what to put here", line)
    print(str(task_list))
    file.close()

    return {'FINISHED'}

def invoke(self, context, event):
    context.window_manager.fileselect_add(self)
    return {'RUNNING_MODAL'}

class SelectOperator(bpy.types.Operator):
"""Adds """
bl_idname = "scene.select_option"
bl_label = "Multi Select Operator"

@classmethod
def poll(cls, context):
    if not bpy.context.selected_objects:
        return False
    else:
        return True

def execute(self, context):
    global obj_list
    obj_list = []
    for obj in bpy.context.selected_objects:
        obj_list.append(obj)
        print(str(obj))
    print("Objects in the active list: " + str(obj_list))
    return {'FINISHED'}

class TaskOperator(bpy.types.Operator):
"""Subdivide and scale a mesh."""
bl_idname = "scene.task_option"
bl_label = "Multi Task Operator"

@classmethod
def poll(cls, context):
    global obj_list
    if not obj_list:
        return False
    else:
        return True

def execute(self, context):
    global obj_list

    return {'FINISHED'}

class SelectionPanel(bpy.types.Panel):

bl_label = "Multi Selection Options"
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'

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

    row = layout.row()

    split = layout.split()

    col = split.column(align=True)

    'row.operator("mesh.primitive_uv_sphere_add")'

    col.operator("scene.select_option", text = "Set Objects", icon = "MESH_CUBE")

    'row.operator("scene.task_option", text = "Do Task", icon = "LONGDISPLAY")'

    col.operator("export.some_data", text = "Open And Do Task", icon = "FILE")
def register():
bpy.utils.register_class(SelectionPanel)
bpy.utils.register_class(SelectOperator)
bpy.utils.register_class(TaskOperator)
bpy.utils.register_class(ExportSomeData)

def unregister():
bpy.utils.unregister_class(SelectionPanel)
bpy.utils.unregister_class(SelectOperator)
bpy.utils.unregister_class(TaskOperator)
bpy.utils.unregister_class(ExportSomeData)

if __name__ == "__main__":
register()

Below is what is causing me trouble:

def callMethod(o, name):
    getattr(o, name)()

def execute(self, context):
    global task_list
    file = open(self.filepath, 'r+')
    for line in file:
        task_list.append(line)
        callMethod("I don't know what to put here", line)
    print(str(task_list))
    file.close()

    return {'FINISHED'}

line is bpy.ops.object.modifier_add(type='SUBSURF'), but I don't know the object to put for the first parameter. If I am going the wrong direction with this, please correct me.

It looks like you are passing a whole function call to the getattr() function as a string.

getattr() takes an object as first argument and a string a second argument.

What you should do is isolate the object, the function and the params

Once you isolated your object string (ie. str="bpy.ops.object") you can isolate the object with a quick but unsafe myObj = eval(str) or use a safer

import sys

def str_to_class(str):
    return getattr(sys.modules[__name__], str)

myObj = str_to_class("bpy.ops.object") #line added from original code

(Code from https://stackoverflow.com/questions/1176136/convert-string-to-python-class-object)

After that you should call getattr in this fashion:
getattr(myObj, 'myFunction')(params)

In the specific case you presented it would look something like this in explicit form
getattr(bpy.ops.object, "modifier_add")(type='SUBSURF')

Note:
eval() is a very unsafe to use if there's some kind of user input, since the user could inject malicious code in eval()'s parameter string.

Edit: if security is not a concern, for any reason, you could also just eval() the whole string. Just make sure not to share your code without a proper warning.
If security is a concern, in both of the cases described above, you might want to apply a filter on the strings you pass to the converting function. Something like if str[:3]=="bpy": str_to_class(str) #or eval(). It makes things a little safer.


ZBrush sculpting brushes equivalents in Blender I'm sculpting a lot recently and most of the sculpt-related tutorials on Youtube are for ZBrush, nevertheless human anatomy knowledge contained therein is universally applicable.

To get more out of those tutorials it would be nice to have a list of brush equivalents, for example when they are talking about "clay buildup" brush in ZBrush, should I use clay or clay strips brush in Blender? Is "clay tubes" in ZBrush Blender's "clay strips"? Does "standard brush" equal "sculpt/draw"? It takes lots of effort and experimentation to find those equivalents with trial and error.

As for the list of Blender's sculpt brushes, I'm using this page:

https://blender.stackexchange.com/a/21622/1621

During months afetr I asked this question I was able to piece together some experience from various sources that now allows me to answer it, at least partially. I'll probably be editing this answer in the future and adding new items to the list.

The goal was to be able to use gazillion of ZBrush sculpting tutorials from Youtube and use them as a learning tool in Blender Sculpt mode. The conclusion is, in order to understand them, you have to learn ZBrush, there is no way around it. But you don't have to download and use the program itself, you can simply watch a few beginner tutorials. The best way to familiarize yourself with ZBrush basics is the latest playlist by Pixologic, published on 24.06.2016:

ZClassroom - How to Start with ZBrush

Another source that confirmed you can find some equivalents is a book "Blender 3D By Example":

https://books.google.pl/books?id=gtdOCwAAQBAJ&printsec=frontcover&vq=zbrush#v=onepage&q=zbrush&f=false

Here is my list:

    ------------------------------------------------------------
ZBrush                      Blender

Standard   ------------->   SculptDraw
Dam Standard  ---------->   Crease
Clay Buildup  ---------->   Clay Strips
Move      -------------->   Grab
hPolish   -------------->   Flatten
Trim      -------------->   Scrape/Peak [1]
Pinch     -------------->   Pinch
Smooth    -------------->   Smooth
Layer     -------------->   Layer
Inflate   -------------->   Inflate/Deflate

Some equivalent settings and keystrokes:

ZBrush                      Blender
------------------------------------------------------------
Z-intensity (U)   ------->  Strength (Shift+F)
Draw Size (S)   --------->  Radius (F)
Focal Shift   ----------->  Curve (submenu in the Toolshelf)
Rectangle Mask (Ctrl+LMB)   Box Mask (B)
Erase Mask       -------->  Clear Mask (Alt+M)
Inverse Mask (Ctrl+I) --->  Invert Mask (Ctrl+I)
Polygroups (Ctrl+W) ----->  Face Sets (Draw Face Sets brush in 2.83)

[1] see video by Gleb Alexandrov https://www.youtube.com/watch?v=YKPrGh1HTog


How to automatically join stripped pieces of video? I'm using Blender for non linear video editor, I'm simply removing dead times (times in which nothing happen) in my video using hard cut (Shift + k) after this process I've got something like this:
At the moment I'm using  g for moving the pieces of video one by one next to each other for removing the black scene interruption is there an automatic way to do the same thing?

Keep the cursor (the green vertical line) on the left hand side, then ShiftBackspace to remove all gaps. (If pressing Backspace once, it will only remove the first gap to the right of the current frame, which can be operate continously. This operation can be found at Strip > Remove Gaps)

P.S.:

Here, Gap means frame durations that don't hold any strips. So, in case of multiple channels, you may want to first select strips on particular channel, then CtrlG to make them as a temporary meta strip, then Tab into that Meta strip, do what you want to do. Then Tab again to exit meta group, AltG to ungroup it.


Merging verts by distance breaks smooth shading (Blender 2.8) I created a wall piece from a cube, applied smooth shading to it and then used the array modifier, but after merging the verts by distance, it mixes up the normals in a random fashion, while for the simple, unmodified sphere there are no issues.

Assuming your weld (or merge by distance) is setup correctly, just define a sharp edge and then add an auto smooth


How to align duplication correct way With the reference image attach. Im making the sandals and im the way to plug the diamonds in that. I have remove the center edge from the mesh. With the duplication im making the diamond to rotate around the curve. From side view it looks good but when i rotate and see the diamond going upper side and some diamond gone inside the mesh and only 1 diamond ring is visible. How correct align with the reference image the diamonds.

With the curve selected, under the Curve tab of the properties area, activate Follow.

Go into Edit Mode and change the curve's Tilt so that the curve's arrows are perpendicular to the shoe geometry. With a control point selected use Curve > Control Points > Tilt or Ctrl+T to do that. I suggest enabling Proportional Editing to achieve a smooth transition. (The tilt can also be changed after the diamonds are aligned, which probably will make errors more obvious.)

Change the diamonds' Rotation so that the diamonds are aligned with the surface.
XYZ angles of 0°, -15° and -90° seem to work fine.

To make sure that the curve is running at the surface of the shoe, add a Shrinkwrap Modifier with the shoe as target, mode being Nearest Surface Point and enable Apply on Spline.

You might have to move some of the curve's control points outwards so that the shrinkwrap modifier doesn't snap the diamonds to the inside of the shoe.

Final blend file:


Ocean modifier and foam data export? It is there any way to export the foam data generated from ocean modifier to use it in other render engine, like LuxRender? The manual says that the foam data is stored as vertex color data, but there isn't a way to access the vertexColor data. I know that can be accessed from Cycles from attribute's node. LuxRender supports vertex color and I tried to bake the texture to vertexColor and an image but only get a plain black texture.

Finish settings for ocean such as wind, choppiness, etc.

Set resolution in ocean modifier. For example, 16 will result in a baked image 256x256 pixels. 64 is the largest, final baked image is 4096x4096.

Check the boxes for generate normals and Foam,

Set cache path anywhere you want (should be an empty folder) and bake.

After a while you get images like this one in your cache folder:


Problems with assigning dimensions through python script I don't know how to put this, as a bug or error in code. Anyway here is my code,

bpy.ops.mesh.primitive_circle_add(vertices=5, radius=1, location=(0, 0, 0))
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.select_mode(type="VERT")
bpy.ops.mesh.extrude_region_move(MESH_OT_extrude_region={"mirror":False},
TRANSFORM_OT_translate={"value":(0, 0, 30)})
bpy.ops.object.mode_set(mode = 'OBJECT')
bpy.context.object.dimensions[0] = 0.7  // Does not work
bpy.context.object.dimensions[1] = 0.7

The code as you can see creates a mesh circle and extrudes its vertices and then set its dimensions for X and Y axis as 0.7. Well the code executes fine, but the dimension for X does not change. It remains at some 1.902.. . I need help in rectifying this problem.

Note: I am using Blender 2.75.

The core of this question is

import bpy

bpy.ops.mesh.primitive_circle_add(vertices=5, radius=1, location=(0, 0, 0))

# this doesn't produce expected results
bpy.context.object.dimensions[0] = 0.7
bpy.context.object.dimensions[1] = 0.7

versus

import bpy

bpy.ops.mesh.primitive_circle_add(vertices=5, radius=1, location=(0, 0, 0))
# this does
dims = bpy.context.object.dimensions
bpy.context.object.dimensions = 0.7, 0.7, dims[2]

Plugged into your sample code:

import bpy

bpy.ops.mesh.primitive_circle_add(vertices=5, radius=1, location=(0, 0, 0))
obj = bpy.context.object  # might need it later

bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.select_mode(type="VERT")
bpy.ops.mesh.extrude_region_move(MESH_OT_extrude_region={"mirror":False},
TRANSFORM_OT_translate={"value":(0, 0, 30)})
bpy.ops.object.mode_set(mode = 'OBJECT')

current_x, current_y, current_z =  obj.dimensions
obj.dimensions = [0.7, 0.7, current_z]

Why?

There is a bug report about it here https://developer.blender.org/T31760

it's a known error/limitation, and down to the property being intended to be used on the UI only.

For now either use obj.scale (with some extra manual calculation) or set the obj.dimensions all three at once (as shown).


Creating a grid of tubes following a mathematical surface I am creating a 3D mathematical surface using the "Add Mesh: Extra Objects" plugin, resulting in the mesh surface below:

Ultimately, I would like to convert this surface into a grid of Paths, so I can have a circle trace each Path, and recreate the surface above as a grid of tubes.
My first thought was to use the Bridge function of the LoopTools Add-on to create a grid of vertices that describe the surface, as shown:

then collect each row and column of vertices into a Path or curve that I could follow with a circle to create the grid of tubes. However, I do not know how to collect a number of vertices into a Path or curve.

Is there an easier way to create a grid of tubes from a mathematical surface? Or,
How can I create a Path or curve from a collection of vertices?

This first thought was not bad. This can be done with hair particles, e.g tiny uv spheres, put at vertices, but you need to know their exact number first. Then convert particles to mesh, remove the surfaces' interior deleting vertices inside or remove the whole surface and you're done.