Python to switch visibility between multiple objects (game engine) Let me begin by saying I'm okay in python in general (and a half-decent programmer in some other languages), but I am very very new to python in Blender.

What I want to do

I have multiple objects all right on top of each other - say, a cube (1), a sphere (2), and a cone (3). When the game begins, only the cube is visible. The player can cycle through the objects by using the M and N keys, as in, when you cycle forward the cube becomes invisible and the sphere becomes visible. The player hits M to cycle forward, N to cycle backwards. When you hit the cone (the third object) you can't go forward anymore. Similarly, when you hit the cube (1st object) you can't go backwards anymore.

If you're curious, the application is I'm making a scientific visualization tool where you can step forward and backward through time while looking at datasets.

My hypothetical approach

I believe (but may be wrong) that I want to have some integer variable V that begins at 1; when you hit M it counts up; when you hit N it counts down; a statement checks if it goes below 1 or above 3 and corrects it back to 1 or 3 if so.

So here's a sort of code skeleton, which is incomplete and doesn't work yet, that gets at what I imagine the solution to look like:

V = 1 #initialize the variable V as 1 at game start

#Here would be some code to use the keyboard tap controllers M and N to
#increment/decrement the value of V, INCLUDING a check
#that if V < 1 you set it back to 1, and if V > 3 you set it to 3

#I think it would look something like this
#except I know I'm missing something:
if cont.sensors['m_key'].positive:
    V += 1
elif cont.sensors['n_key'].positive:
    V -= 1

if V < 1:
    V = 1

if V > 3:
    V = 3

#Now we check the value of V and set visibilities accordingly
#(which I also don't know how to do)
if V == 1:
    #set cube visible
    #set sphere invisible
    #set cone invisible
elif V == 2:
    #set cube invisible
    #set sphere visible
    #set cone invisible
elif V == 3:
    #set cube invisible
    #set sphere invisible
    #set cone visible

The tricky parts (for me)

All I know how to do so far in Python is scripts that only affect the parent object (the controller's owner) like so

import bge
cont = bge.logic.getCurrentController()
own = cont.owner

if cont.sensors['space_key'].positive:
    own.visible = not own.visible

This script, connected to a keyboard sensor called space_key with spacebar in tap mode, will toggle the visibility of the object in which the keyboard sensor resides. That doesn't help me handle multiple objects though.

I also don't know how to initialize V as 1 just at game start, and have it count up and down. Just for fun I tried this code fragment:
    import bge
    cont = bge.logic.getCurrentController()
    own = cont.owner

V = 1
print(V)

if cont.sensors['m_key'].positive:
    V += 1
    print(V)
elif cont.sensors['n_key'].positive:
    V -= 1
    print(V)

and the output looked like "121" when I hit m once, and "101" when I hit n once

So I guess my main questions are:

How do I change the visibility of multiple objects (perhaps using the object name) from one script?
Where should this script reside, along with the M and N controllers? Should it be attached to the cube, or to some empty object somewhere? Or is it going to have to be multiple scripts?
If it has to be multiple scripts, how does the variable V get initialized properly, and how does it get globally recognized by all the different scripts?

Lets dig a bit deeper in the requirements and look how it fits your design (or find a better one):

You have a set of (ordered) objects = a list.
You want one and only one object be (lets say) "selected" at any moment
You want be able to select the next while deselecting all others.

Open Question: What should happen when the last object is already selected?

As there is always one object selected I suggest to use a token that indicates what object is selected.

This means you need a separate object as token. When you want to know what object is selected ... ask the token. If you want to select another object ... request it at the token.

This answers your question 2

  Where should this script reside, along with the M and N controllers? Should it be attached to the cube, or to some empty object somewhere? Or is it going to have to be multiple scripts?
  -> the token does that.

Token

So lets have a closer look at the token.

It needs to know what object is selected.

We need a storage for a single game object at any time.
We need to be able to provide the selected object when asked

It should be able to select the next object in a list of objects

We need an ordered list of selectable objects (when performing this operations)

Lets look at a possible implementation of the token.

How you get your list of objects is up to you (e.g. you could look for objects with a specific property and order by property value). So I assume you implemented a function called getSelectables(). The following snippet contains a dummy implementation:

selection.py

import bge

#--- BGE callables
def next():
    if not allSensorsPositive():
        return

    deselectAll()

    next = findNext()
    select(next)

This is indeed not much. First (as any BGE code) check the sensors' status.
Then deselect all selectable tokens. If you load them unselected, you can just deselect the current selected object deselect( getSelected() ).

Then find the next object and select it.

I hope you find this is what you want.

How to use it:

First you should select one object at startup. There is no special operation for that (you could if you want). So we simple call next():

Always sensor [no level triggering]
   ---> Python controller Module: "selection.next"

This will deselect all selectable objects and select the first one after loading the scene.

To select the next selectable object we call next() too:

Event sensor [no level triggering]
   ---> Python controller Module: "selection.next"

Please note, next() does not do anything when not all sensors are positive. Therefore you can't connect both sensors to the same controller.

Why is it that way?
Imagine you want to deactivate the ability to call next(). In this way you can connect another sensor that controls the activation:

You tried that? I hope you noticed the code is not complete. If you want you can try to implement your own version. But here are the details that can help you.

selection.py continued ...

#--- internals

INTERNAL_PROPERTY_SELECTED_OBJECT = "_internal.selectedObject"

def deselect(object):
    object.visible = False

def select(object):
    getOwner()[INTERNAL_PROPERTY_SELECTED_OBJECT] = object
    object.visible = True

def deselectAll():
    for selectable in getSelectables():
        deselect(selectable)

def findNext():
    selectables = getSelectables()
    selected = getSelected()
    try:
        nextIndex = selectables.index(selected) + 1
    except ValueError:
        nextIndex = 0

    return selectables[nextIndex % len(selectables)]

def getSelected():
    return getOwner().get(INTERNAL_PROPERTY_SELECTED_OBJECT)

def getSelectables():
    'Implement your own object list'
    objects = bge.logic.getCurrentScene().objects
    return [objects[name] for name in
            ["Cube", "Sphere", "Cylinder"] ]

#--- internal utilities
def allSensorsPositive():
    for sensor in bge.logic.getCurrentController().sensors:
        if not sensor.positive:
            return False
    return True

def getOwner():
    return bge.logic.getCurrentController().owner

Here you see that selection/deselection actively changes the involved objects (setting visibility). When selecting the object running this code will store the selected object in a property replacing any previous selection.

Finding the next selectable object is simply looking at the list and grab the next one by index. If the current selection can't be found, it the first one gets picked. If the last one is selected ... it starts with the first one again nextIndex % len(selectables). If you do not want that you change that code to min(nextIndex, len(selectables)-1).

As said earlier you should implement your own version on getSelectables().

The utility functions are often used and would live happily in a common module. They are here to complete this snippet for you.

As homework you might want to implement a previous() function.

I hope it helps you

Edit: I forgot to answer your other questions:

  How do I change the visibility of multiple objects (perhaps using the object name) from one script?

Either each object doe it by itself (e.g. via Visibility actuator), or you let the object do it by itself via KX_GameObject.visible (see snippet above)

  If it has to be multiple scripts, how does the variable V get initialized properly, and how does it get globally recognized by all the different scripts?

Variables are always local to the code. You could create a module variable that is a singleton with the module. The above solution uses a property of the selecting object. This means you can have different selecting objects each with own selection (I guess this is not what you want).

If you want to know if an object is selected or not you have to ask the selecting object. Alternative, you can check if the selectable object is visible or not.


How to make particle instances the same size as the dupli object? If I create an object and assign it as the dupli object of a hair particle system on another object, the size of the particles is much smaller than that of the actual dupli object.  I then have to change the length to compensate.  How can I make the particles "life size"?

Here is an example, the big box is used as the dupli object for the particle on the plane.  All particle settings are left as default except type: hair, number: 100, and render > object: Cube.

I completely forgot that there are actually two separate values which affect the size of the particles.  There is the hair length (found at the top of the settings), but there is also a size spinner under the physics rollout.

It turns out that the actual size of the particles is the product of these two values.  I.e. actual_size = length * size.  So if both these values are set to 1 the particles will be the same size as the dupli object.

The size defaults to 0.05, while length defaults to 4, so the actual size of the particles by default is 0.05 * 4 = 0.2, which is one fifth the dupli object's size.

I have no idea why there are two separate values which control particle size, or why one of them is under the physics rollout, or why they have such strange default values.  If someone could explain this I would greatly appreciate it!


Quickest way to create panel buttons with quick functionality I need to create buttons in a custom panel to run some simple commands in python. For example toggling subsurf on and off with this script:

if bpy.data.objects["Cube"].modifiers["Subsurf"].show_viewport:
        bpy.data.objects["Cube"].modifiers["Subsurf"].show_viewport = False
    else:
        bpy.data.objects["Cube"].modifiers["Subsurf"].show_viewport = True

I need to create a bunch of similar buttons to toggle different things about the mesh. For example toggle display wire on the object, shade smooth/flat etc.

Is there a more practical way to do this than creating a dozens of separate operators for each of these commands. And using layout operator?

layout.operator("my.toggle_subsurf", text="Toggle Subsurf", icon="MOD_SUBSURF")

Main concept is that Operators executing something based on given data (e.g. convert all polygons of object xy to triangles). Properties on the other hand can either store the actual 'state' of something (e.g. Wireframe ON/OFF) or any 'value' (e.g. Subdivisions=3 or Crease=0.0001).

In fact, Operators like OPS.object.delete() can be called because these are 'functions' (note the parentheses at the end). However, a Property like Object.wireframe just stores True or False so it can not be called (it's basically not a 'function').

Means that you have to write an Operator if you want to change/toggle any Property.

Another way which you might not think of, is expanding each property to make it look like a 'Button', which also gives instant feedback to the user whether the property is ON/OFF.

import bpy
from bpy.types import (Panel, Operator)

# ------------------------------------------------------------------------
#    Operators
# ------------------------------------------------------------------------

class SimpleOperator(Operator):
    """Print object name in Console"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

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

# ------------------------------------------------------------------------
#    Panel in Object Mode
# ------------------------------------------------------------------------

class OBJECT_PT_CustomPanel(Panel):
    bl_idname = "object.custom_panel"
    bl_label = "My Panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Tools"
    bl_context = "objectmode"

    @classmethod
    def poll(self,context):
        return context.object is not None

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

        layout.label(text="Properties:")

        col = layout.column(align=True)
        row = col.row(align=True)
        row.prop(obj, "show_name", toggle=True, icon="FILE_FONT")
        row.prop(obj, "show_wire", toggle=True, text="Wireframe", icon="SHADING_WIRE")
        col.prop(obj, "show_all_edges", toggle=True, text="Show all Edges", icon="MOD_EDGESPLIT")
        layout.separator()

        layout.label(text="Operators:")

        col = layout.column(align=True)
        col.operator(SimpleOperator.bl_idname, text="Execute Something", icon="CONSOLE")
        col.operator(SimpleOperator.bl_idname, text="Execute Something Else", icon="CONSOLE")

        layout.separator()

# ------------------------------------------------------------------------
#    Registration
# ------------------------------------------------------------------------

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

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

if __name__ == "__main__":
    register()

You should definitely read: How to create a custom UI?


Texture Paint: Color shows different on the mesh I just started painting a mesh and for a while it worked OK, but now when I paint on the UV map, the color doesn't show as I chose.

Before:

After I painted on the door:

Try changing the viewport shading type to Material.


my model is much bigger than the 3d and 0-1 space I am new to blender and 3d. i have a model i'd like to UV map with a custom design. However the model is huge compared to the 3d space and 0-1 space. what do I do or where do I go to get an answer? I asked Lynda.com and the response was they didn't know and couldn't help me, any assistance would be appreciated.

Remember, size in the computer is a relative, mathematical construct (it's not real) Size becomes an issue when you are stressing the the limits of the math engine. examples: If you build a model of a cup and you have the scale very large, relative to the programs space you'll have a crazy time detailing it, likewise an intricate model of a ship built "very small" will give you fits. You are translating the mathematical construct in the computer to a reasonable size for mapping pixel information to parts.

You should try to work in those "units" that make sense for the object: cup in inches, ship in meters. It's all about your modelling space. Then use reasonable UV mapping for the object. (don't try to use a single UV map for an entire ship model) So it's all about the scaling, bounds, mapping....

Then this link might get you going?
https://www.blender.org/manual/editors/uv_image/texturing/unwrapping.html

Hope this helps.
Kevin


Blender Cloud texture settings: How to get from 0 alpha partial transparency in render? My aim is to get the leaves-object of a tree to have some transparency generated by the preset cloud texture from blender.  I cannot use cycles render. Is there a way to get that possible though?Here's a testrender to show my current result
Things I already tried so far:
- set material settings up with a mask-transparency (alpha on 90%)
- texture settings like following:  type: clouds  colors-> ramp enabled,  left side on white with 0 alpha.  right side a color at position 0.771, full alpha. blending method 'ease'.
mapping is generated, flat (since it's a bunch of single planes)
influencing (diffuse) alpha, color and some geometry settings.
bump mapping is set as best quality and texture space.

[A thing that might happen is a not fitting size of the texture for the objects.]
If anyone out there has got some experiences with a working method, I'd be happy to get some help here.
Thanks^^

You can use the Value from the cloud texture to get transparency.
Enable nodes, and in material nodes connect the value of the cloud texture to the Output's Alpha.
You can fine tune the amount of transparency by adding a color ramp in between .


How to speed up a video in the VSE? I'm making a tutorial, after a little work of strip I would like to speed up the video the seconds seems last longer (maybe because I've use video of different qualities) so I would like to increase the velocity at which the video is played even at a velocity greater than the original one.

You can do this by adding a Speed Control effect strip to the selected strip.

There are two methods for controlling the speed:


Rig does not move the mesh I'm new to Blender so not sure what I'm doing wrong.  I've tried at least a 100 times to rig a human like character using Rigify but in vain.  Can someone please help me and let me know what I've missed...  You're help will be really appreciated.

I've uploaded the rigged and non-rigged model and uploaded here -

Non-Rigged model NON Rigged Cyclops model
Rigged model Rigged Cyclops model

Thanks.

Try Joining the Meshes Before Parenting to Rigify

The reason why parenting may not have worked is because your mesh is in multiple parts.

Joining the meshes together before parenting to the rig should fix your problem.

For your cyclops file, here's what I did:

Select one mesh, press 'SHIFT+G' choose 'type'

Join your meshes. 'CTRL+J'

Press 'Tab' to go to edit mode

Remove doubles. press 'A' until everything is selected > 'W' > 'remove doubles'

Delete all vertex groups from the vertex groups panel

Delete all armature modifiers from the modifier in modifier panel

Select your armature and set it to pose mode. CTRL + tab

Select the mesh, then the armature, press CTRL+P, choose 'automatic weights'

Now your mesh should deform when you pose the armature in pose mode.

If and when you edit the weight values for each bone/vertex group, the deformation bones are on layer 29 of the bone layers ( not the regular layers )

Good Luck

Btw, cool model, where is it from?

Here's a link to your working file:

Here's a general video about setting up rigify in general :

https://www.youtube.com/watch?v=dYiAd_08-0k&t=140s


Invert the rotation value in all keyframes on X and Y axis I'm trying to find a way to invert all the the rotation values on the X and Y axis on all the keyframes on certain bones.

Is there any scrip/function that would allow me to do it all at once?

I have for example X -350 and Y 50 on the hand bone I would like to change them to X 350 and Y -50 and do the same in all keyframes without having to do it manually one by one but only on that bone.

In the graph editor set the 2D cursor in a Y loc equal to 0, turn the pivot point to be 2D cursor, select all keyframes you want to invert and press S Y -1 Enter.


Cloth physics : drop/unroll a cloth sheet from the top of a building I'm working on a project and I have a video shot where I would like to drop a cloth sheet through the top of a building - Well, it's not exactly a sheet, it's a banner, but that is the idea.

At the start of the animation, I would like the banner to be "rolled" or something (not deployed), then that it deploys itself using gravity.
There should be pins at the top (to fix it) and a weight at the bottom (so the banner doesn't "fly" to much).

I started to work on it: I have the cloth, I have 3 vertex groups (topPins, bottomPins, allPins), the topPins are attached to the top cylinder and the bottomPins to the bottom cylinder; which has rigid body enabled.

But I guess there is other things to do since... It doesn't work : the bottom cylinder keeps falling - and instead it should remains attached to the cloth, depending of its physic resistance/elasticity, I guess.

Also, I don't know how to handle the start situation.

Could someone help with some advices ?  Here's the .blend file if you want to check.

If this is too complex, I think i'll end up with a simplier idea (just wind on the deployed banner)

Thanks a lot !

I found out this on Youtube.
It looks like a great idea (roll the cloth curtain before unrolling it).

Tutorial for Blender - Curtain Call - Rolling up Material

I had several attemps but cannot reproduce its setup; maybe because of the Blender version ?

My actual .blend here if anyone wants to try...

Here is another way to go.  Instead of using pinning to connect the bottom vertices of the banner to the bottom cylinder, parent the bottom cylinder to the bottom 3 vertices of the banner.  (Keep the pinning to the top cylinder so the top of the banner stays put.)  That way, as the bottom of the cloth naturally falls due to gravity, the cylinder will fall with it.  You would need to adjust the mesh of the banner to a staring position where the bottom vertices are near the top ones, and probably "bunch up" the rest of the flag so it's all up at or near the top.

Here is a quick and dirty implementation of that idea:


Is it possible to render an armature? I'm using blender 2.72b x64 on windows 7.

I need a quick way to render armature using f12 button. With shadows and everything. "render armature" means render geometry that is visible in viewports - boxes/octahedrons/sticks, depending on chosen visualization.

I only need to render still frames, no animation.

"OpenGL render image" is not an option, because OpenGL render does not produce raytraced shadows.

As I understand it, this can be done by either somehow turning armature into renderable geometry or generating mesh from it via script.

Is there a built-in way to do it or ready to use script somewhere?

Blender doesn't support rendering armatures directly.

This is intentional and there is no plan to add support for this feature. ~ @ideasman42

However, I've come up with script to convert armature into mesh or skin.

Implemented as blender addon, only BBone armature style is supported (bezier bones, subdivided bones etc are untested).

Creates mesh if armature in "pose" mode. Creates SKIN if armature is in "skin" mode.

armature_to_mesh.py

bl_info = {"name": "Armature To Mesh", "category": "Object"}

import bpy
import mathutils

class ArmatureToMesh(bpy.types.Operator):
    """Armature to mesh/skin conversion script"""
    bl_idname = "object.armature_to_mesh_skin"
    bl_label = "Armature to Mesh/Skin"
    bl_options = {'REGISTER', 'UNDO'}

    def decomposeMatrix(self, matrix):
        return [x.to_3d() for x in matrix.transposed()]

    def processArmature(self, context, arm, genVertexGroups = True):
        print("processing armature {0}".format(arm.name))

        if genVertexGroups:
            #because setting pose_position ot 'REST' manually doesn't work for some reason.
            genVertexGroups = arm.data.pose_position == 'REST'

        meshName = arm.name + "_mesh"
        meshData = bpy.data.meshes.new(meshName + "Data")
        meshObj = bpy.data.objects.new(meshName, meshData)
        meshObj.location = arm.location

        scene = context.scene
        scene.objects.link(meshObj)

        armMatrix = arm.matrix_local.copy()

        verts = []
        edges = []
        faces = []
        vertexGroups = {}

        for bone in arm.pose.bones:
            poseBone = bone
            boneName = bone.name
            armBone = arm.data.bones[boneName]
            #print(poseBone.matrix)
            #print(armBone.matrix)
            #print(boneName)

            boneMatrix = poseBone.matrix
            boneStart = poseBone.head
            boneEnd = poseBone.tail

            decomposedMatrix = self.decomposeMatrix(boneMatrix)
            #print(decomposedMatrix)
            xSize = armBone.bbone_x
            zSize = armBone.bbone_z
            #print(xSize, zSize)
            xSizeAdd = bone.x_axis
            zSizeAdd = bone.z_axis
            xSizeAdd = decomposedMatrix[0]
            zSizeAdd = decomposedMatrix[2]
            ySizeAdd = decomposedMatrix[1]
            origin = mathutils.Vector((0.0, 0.0, 0.0)) * boneMatrix
            xSizeAdd *= xSize
            zSizeAdd *= zSize
            ySizeAdd *= bone.length

            baseIndex = len(verts)

            verts.append((boneStart - xSizeAdd + zSizeAdd)*armMatrix)
            verts.append((boneStart + xSizeAdd + zSizeAdd)*armMatrix)
            verts.append((boneStart - xSizeAdd - zSizeAdd)*armMatrix)
            verts.append((boneStart + xSizeAdd - zSizeAdd)*armMatrix)
            verts.append((boneEnd - xSizeAdd + zSizeAdd)*armMatrix)
            verts.append((boneEnd + xSizeAdd + zSizeAdd)*armMatrix)
            verts.append((boneEnd - xSizeAdd - zSizeAdd)*armMatrix)
            verts.append((boneEnd + xSizeAdd - zSizeAdd)*armMatrix)

            base = baseIndex
            newFaces = [
                (base+0, base+1, base+3, base+2),
                (base+5, base+4, base+6, base+7),
                (base+1, base+0, base+4, base+5),
                (base+2, base+3, base+7, base+6),
                (base+3, base+1, base+5, base+7),
                (base+0, base+2, base+6, base+4)
                ]
            faces.extend(newFaces)

            if genVertexGroups:
                vertexGroups[boneName] = [(x, 1.0) for x in range(baseIndex, len(verts))]

        meshData.from_pydata(verts, edges, faces)

        if genVertexGroups:
            for name, vertexGroup in vertexGroups.items():
                groupObject = meshObj.vertex_groups.new(name)
                for (index, weight) in vertexGroup:
                    groupObject.add([index], weight, 'REPLACE')

            modifier = meshObj.modifiers.new('ArmatureMod', 'ARMATURE')
            modifier.object = arm
            modifier.use_bone_envelopes = False
            modifier.use_vertex_groups = True

        meshData.update()

        return meshObj

    def processObject(self, context, obj):
        if (obj == None):
            return False
        if (obj.type != "ARMATURE"):
            print ("invalid type {0} of object {1}: armature expected".format(obj.type, obj.name))
            return False
        self.processArmature(context, obj)
        return True

    def execute(self, context):
            scene = context.scene
            selected = context.selected_objects
            processedAnything = False
            if len(selected) > 0:
                print ("selected objects present, processing selection")
                for obj in selected:
                    processedAnything |= self.processObject(context, obj)
                pass
            else:
                print ("processing active object")
                obj = context.active_object
                processedAnything |= self.processObject(context, obj)

            if not processedAnything:
                print ("no objects processed")

            return {'FINISHED'}

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

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

##register()


Where can I download b°wide NodePack? All links I`ve found are dead as for now. Lost this pack during setting a new PC=(

Here you go: https://www.blendswap.com/blends/view/70570
It's from bashi, the links on his homepage don't work anymore. But he uploaded it to blendswap as well.


Show transparent viewport image (via script) [blender 2.8]

I'd like to show a transparent image on the viewport (similar to the axes gizmo) and came up with two different approaches:

1) GPU image shader - which works in principle, but doesn't seem to support alpha (which I need)

2) Script a object lock to the viewport. Basically what "Lock camera to view" does, but with an object that does not move relative to the viewport. With an image plane and the proper viewport shading, this might be a viable workaround. Can "Lock view to camera" be misused for that?

Any thoughts?

Your second idea works!

Use the "Import images as planes" option (activate addon in preferences) or make Empty and set display as image.
Then make a dummy camera and parent it (keep transform) to you image plane
Activate textured view and make sure that in Materials -> Settings you set Blend mode to "Alpha blend" (or use alpha is activated if you used an Empty as Image)
You can use +/- to zoom camera border, so its no longer in view. (changing the zoom here works only while camera not locked to view)
Make the plane "unselectable" (by clicking cursor symbol in Outliner) otherwise you will always select the plane if locked to view ;)
Finally activate "Lock Camera to view"

And you're done!
Here is my implementation:

+

Here is the same procedure in Code:
PS: However there is a small TODO section for setting the 3d view to the Camera view in script, which i havent quite figured out how to do yet

import bpy
from mathutils import Euler ##For Rotations

######Deletes all Objects in default blender startup
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)
######
########### Make Objects you need: Camera-Dummy and Empty as Image (and set it as parent)

imgEmpty = bpy.data.objects.new("myImgEmpty", None)
scene = bpy.context.scene
bpy.context.collection.objects.link(imgEmpty)
imgEmpty.location = (0, 0, -1.5)
imgEmpty.rotation_euler = Euler((0, 0, 0), 'XYZ')
imgEmpty.empty_display_type = 'IMAGE'
imgOverlay = bpy.data.images.load("C:/Users/robert/Desktop/Installers/2019/blender-2.80.0-git.d30f72dfd8ac-windows64/TestOverlay.png", check_existing=True) ##### CHANGE PATH !!!
imgEmpty.data = imgOverlay

bpy.ops.object.camera_add(location=(0, 0, 0), rotation=(1.5708, 0, 0)) ##90deg in radian
dummyCamera = bpy.context.view_layer.objects.active
layer = bpy.context.view_layer
layer.update()

imgEmpty.parent = dummyCamera

###########
################ Set 3d view to Camera view and Zoom

   #TODO ;)

################
##################### Set camera to Lock camera to view and Set 3d View to Textured view
for area in bpy.context.screen.areas:
   if area.type == 'VIEW_3D':
      for space in area.spaces:
         if space.type == 'VIEW_3D':
            space.lock_camera = True
            space.shading.type = 'MATERIAL'
#####################

Happy Blending!


Corrupt faces when extruding cylinder So, I created a cylinder and extruded one of its ends a couple of times in one direction (right in image 1). Works fine. But when I extrude the other end in the other direction, the faces become "corrupt" (see the part to the left in image 1). I see no logic in this, and since I am following a very basic tutorial, I understand that this is not expected behaviour. Note in image 2 that the problem part is kind of darker in wireframe shading.

Can someone give me a clue? Many thanks.

it seems you have overlaping faces on the left size. so maybe, you have extruded 2 rings together.
You have 220 vertices but only 9 rings... that doesn't match. And also you have 40 vertices selected.


How can I save and close and reopen a blend file with a script? How can I save and close then reopen a blend file using a script, so that all data blocks are removed?

Just call save_as_mainfile() and open_mainfile() operators:

import bpy

bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath)
bpy.ops.wm.open_mainfile(filepath=bpy.data.filepath)


How can I fix the non-stitched seam that is present after applying mirror modifier? I've followed the same tutorial I mentioned in the question I asked yesterday and my boat hull looks pretty good.  The process is to make 3D B-Splines increase the resolution and then convert them to Mesh Elements.  Then you make a plane and cut it in half along the "Y" axis.

I followed through the process and see a couple issues that I would like one of you to address.  First, I see that the normals are not correct.  The inside of the hull is not important but the outside needs to show materials.  Also the hull is not stitched together along the keel.  I don't know how to do that on a mesh that has had the Mirror Modifier applied to it.

Anyone care to help?

The normals issue can easily be solved by selecting all the vertices in edit mode and pressing Ctrl+N (You may need to select the Inside option as well, depending on your mesh). You could also add a solidify modifier if you want to have the normals correct on the inside and outside.

The edge loops can be merged together by selecting both edgeloops, and scaling to zero along the Y axis. All you then need to do is to remove doubles.


How to create a cube from two planes? I am looking for a method to automatically join the vertices of two meshes that are stacked one upon the another. To be specific, how to create a cube from two planes, that are stacked one upon another with small distance in one of the axis.

Based on the information given, I think that the loop tools addon should help you. If you don't have it enabled then go to your user preferences and enable it.

This will require both planes to be a single object, so start by joining them with Ctrl+J.

Now, in the tool shelf, go to the loop tools section and with both opposing faces selected (which will be the inside of the 'cube') click the bridge tool (highlighted in yellow). If you have missing faces after the bridge operation then tick the remove faces option (highlighted in red) so it is disabled and the faces will come back.


Advice or workarounds to use Nvidia Drivers in Mac OS Mojave I am a newbie who has just (re-)begun using Blender, version 2.8, on a retina Macbook Pro from around 2014 with MacOS 10.14.2 ("Mojave").  GPU is (selectable) an internal discrete NVIDIA GeForce GT 750M (2048 MB) and an on-board Intel Iris Pro (1536 MB).  Neither of these are recognised by Blender when I try to select them.

So I visited the NVIDIA site, hoping for a CUDA driver update, but no suitable "Latest drivers" are listed there for MacOS, only for other operating systems (Windows, Linux, Solaris).

As far as I can tell, this situation is the result of a debacle between Apple and NVIDIA, where Apple is (currently?) not authorising NVIDIA drivers under MacOS Mojave.

Especially annoying, since I had specifically selected a Macbook model that came with a NVIDIA GPU, with use of Blender in mind.  At the time I bought it (2016), AFAIR, Blender had either more or only support for NVIDIA CUDA.

I can only hope that this apparent inter-company situation will eventually be resolved.

Currently my Macbook has NVIDIA CUDA Driver version "410.130", GPU Driver version "355.11.10.50.10.103".  Latest in the NVIDIA drivers archive for "All Mac products" is "418.105". I hope to install (and use) that one, as an unapproved download, if Mojave will let me.  Following a system backup (via Time Machine) that is...

Any constructive advice / workarounds welcome.

Blender developers have indicated (Dec 2018) two  main obstacles to Blender using GPU on a Macbook:
1) Apple have not been properly supporting OpenCL (in addition to not supporting CUDA).  Consequently Blender had been crashing when attempting to use GPU on MacOS-Mac.  Outside Blender developers' control.
2) Macbook GPUs are not sufficiently powerful - not designed for intense long-duration usage as required for big renders (GPU gets so hot its lifetime may become shortened) - and also they found no overall speed advantage over CPU-only (possibly in part another consequence of poor support by Apple).  In that case, I doubt there is any hope at all in trying to use linux (on same machine) as a workaround.


Text doesn't show up in zoomed section I've made a zoomed still frame in my sequence, but I want to display text at the exact same relative position as in the unzoomed sequence. This isn't working. At first I thought that I must change the position of the text strip accordingly, because it uses the unzoomed, absolute positions. But when I changed it to 0.5 0.5, where it definetly should have showed up, I couldn't see it. I tried adding the text strip to the zoom transform, not the original video strip, but that didn't help. Maybe it's important in which order I added my effects and which is attached to which? I use both a speed strip as well as a transform strip at once. Is there a certain order of adding strips on top of each other I have to keep in mind?

Ok so seems blender's interface is a bit unintuitive for newcommers, because after I put the text strips to the top, the main strips at the bottom and the effect strips in the middle, everything worked perfectly and as expected.

You really have to keep in mind the order (top to bottom) of your strips since they determine the layering of your, I guess, masks? It is also important which effects are applied to which strip, because similarly my speed effect (speed to zero for a freeze frame) didn't work with my transform if I applied both to the main sequence.

So top to bottom order and effect attribution are pitfalls as far as I can tell.


How to create trigger for character to switch scenes in BGE? Blender v2.71

So working on a game in BGE, I can switch from main menu scene to game scene but how do I get the character to get near an object and that object switches to a new scene?

I tried using the near sensor and adding property: player > and controller > scene actuator/ mode: set scene/ scene: scene

But every time my character (property player: float) gets near the object nothing happens

The "property" actuator on it's own only senses the value of a property. This is useful if you want to make sure something is at a certain value (i.e. Money = $250--> AND--> buy laptop) but it really has no direct sense of the physical world. The sensors that do are called the physics sensors.

Near: senses when a object is within a certain range.
Collision: senses if an object is being touched.
Radar: works like "Near" but not Omni-directional.
Ray: sends an invisible "beam", sense if something touches or obstructs the beam.

As you can probably see, the sensor you want to use is "Near", since it will sense if your player is near a certain object in the game.

Put the sensor on the object that you want to sense the player and set its property value to "player". play with the distance values till you get a result you like, make sure "reset" stay a tad higher than the "distance".


Failed to render in blender on Mac OSX When i tried rendering in blender a message says :"could not initialise streams probably unsupported codec combination"

I tried rendering with different files.
I'm using a macbook, what can I do?

Not all video output options work on OSX. I'm assuming you're using a video format? You'll have to experiment to see which ones work on your machine.


Weird normals after applying baked normal map I created a sculpt, then retopologyzed it via Poly Build Tool and Shrinkwrap-Modifier. Now I'm trying to bake a normal map for the low-poly object but its really not looking like it should. The normal map looks ok to me, but every island of the uv-mesh looks totally diffrent in viewport and render. It looks to me a little like the normals were partially flipped, but I already recalculated them. So that should not be the problem, I guess. Maybe it is a Blender 2.8 problem. What do you think?
Here are some images:

Overlapping Objects

Normal map

The strange result of the normal map. Note that these are exactly the seams of my unwrap.

High-poly (left) and low-poly (right)

Material nodes
Thank you for your time! :)

Well, now it works. The only thing I did differently from the other times was to disconnect the Image Texture Node and changing the Color Space to Non-Color before the baking. I can't change the Color Space afterwards, this is new in Blender 2.8.


Small detail problem I am trying to model a katana: I got everything to a point where I am satisfied with it except small details on hilt, I just want those white parts to be little extruded but unsure on how to do it.

I've tried boolean modifier and knife tool but both breaks the mesh.

This is indeed a very complex geometry to create.

Create the base without the diamondshaped details as a reference.
Create a new mesh and enable Snapping to Surfaces.
Create the diamond shape from the top view. Subdivide it, add supporting edgeloops, then snap it to the reference hilt's surface.
Extrude the remaining loose edges guide them around to the back of the hilt. At this point, I removed three quarters of the geometry and added an XY mirror modifier.
Extrude the concave detail as the last step.


How to prevent timeline position moving when I click stop? In the timeline I push alt-a to play and again to stop.

But the timeline position jumps ahead when I stop! So I keep having to drag it back to play again from the same place.

How do I make it stop moving around every time I play, so it is fixed, like in a DAW like Reaper or FL Studio?

Edit:
Press Esc to stop the animation on the frame you started from.
Old:
As @moonboots suggests, you can easly set the starting point by pressing S before playing the animation.

You can use an alternative frame range.
You can switch between the main frame range and the temporary one by pressing the clock icon.

Once you set the starting point, you can jump to the first frame (Shift + Ctrl + Down Arrow) without pausing the animation.


Free 3d character models to edit in Blender Rocmen here, a newbie. I was wanting to import 3d character model like a man
and modify it and then animate it. Is that possible in Blender?

Thanks for any help

Rocmen

short answer : yes
look at https://www.blendswap.com/ you find lot of character to play with, some even rigged. Your at the beginning of your journey :) Welcome!


Blender fails to start at all (version 2.80, Windows 10 x64) - why? I tried uninstall-reinstall, tried 2.79b, and tried the portable version. Also tried running Blender.exe as Administrator, and checked for display drivers.

I am running Windows 10 x64 Enterprise. Have never installed Blender before.

I am using the built-in Intel graphics, on a i7-6700K CPU on an Asus Maximus XIII Extreme motherboard with 32GB of RAM.

What it does is show a terminal-window for about 5 seconds. I've tried capturing it to see what text it's showing but it's too brief.

Why does this program not run?

Feeling very discouraged. Any helpful help is appreciated - thank you.
James

same OS + memory 32GB, close down all other non-essential programs that are running in background. I had the same issue, nothing but a black screen for 15-30 secs,, but finally the blender main screen came up. I had to close it, then close some stuff running in the background ( had some downloads going, watching a video, but once I shut those down, it started without issue & didnt stop responding..


Weight paint doesn't work in weight paint mode I can't get the weight paint to work?

http://prntscr.com/mpmq13

i am in weight paint,i have the bone selected, and it doesnt let me paint. am i doing something wrong with the vertex groups?

I was having this same issue. I realized I was trying to paint onto a mirrored section without having actually "applied" the mirror modifier. I am very new at Blender, but thought I'd share in case anyone else falls in the same hole.


Why is my entire smoke domain white Im trying to make the sun, however when trying to give it flares my entire smoke domain turns like this

I'm also using Eevee as a rendering engine
Edit:
and this is baked

The color is comming from Flames Color Ramp. The last color (left side) of ColorRamp has to be Black to get Transparency in Domain.

Also you have disabled Sphere from calculation. To let it participate as Inflow you have to click on Monitor icon.


How to make one sharp edge in subd modeling? Like picture below i want to make a sharp edge same way Crease does.
I tried to make one sharp edge with loop cut, inset, and bevel tool.
I can't figure it out how to do it in organic way.
Is there any technique?

It seems to me that you just need to add more vertical loop cuts if what you're looking to do is to emphasize the top mesh line.

I'm not sure what shape you're looking for by only sharpening the top edges, but try using the knife tool to cut in topology only where you need it. Use "K" to activate the knife tool, and "C" to cut in straight lines.


Which programming language is used in Blender? As a guy that ALWAYS loved and still loves C++
Does Blender use C++ ?
Some people says Blender and other people says Python

Blender is written in 3 languages: C, C++, and Python.

C - for Blender's [startup/main-loop/shutdown] and most internal functionality, tools, drawing, GUI and editors.

C++ - physics, audio, game-engine and Cycles render engine.

Python - The interface definitions, addons, most format import/export and some tools.

More information can be found here: https://wiki.blender.org/index.php/Dev:Doc/FAQ


Python outputs different colors from GUI I wrote a Python script to automate my rendering workflow (run from command line with --background).
The problem is that the resulting colors are different from the desired colors that are rendered in the GUI. Python result appears washed-out. Same incorrect result when the script is executed in Blender GUI.
Files are saved as .png. Blender 2.91.2.
GUI result (correct):

Python (incorrect):

Relevant Python code (simplified):
scene.frame_set(0)
bpy.ops.render.render(use_viewport=False, write_still=False)
bpy.data.images["Render Result"].save_render('./example.png')

A similar but not identical result is reached by changing:

Render Properties -> Color Management -> Display Device -> None
Render Properties -> Color Management -> Gamma -> 1.2 instead of 1.0

then saving the file and running the script.
It seems that there is a difference between settings in GUI and in Python. I've played a lot with different configuration values inside the Python script prior to rendering but this brought me no closer to the desired result.
This is as far as my competence goes, but I would like to better understand the issue and achieve an identical result in my Python script.
Edit: the rendered model is imported from an .fbx file

Gotcha!
My script would pull a HEX color value and try to set it onto an RGB material node primitively without adjusting for gamma correction. The following answer helped me:
How set Hex in RGB Node? (Python)


How to set grease pencil general default properties across scenes I'm working as a storyboard artist on a project, with Blender, more specifically Grease Pencil. As I'm trying to optimize the workflow and remove regular, unnecessary step, I wish to set defaults value to my tools, which are basically : a specific brush, and a specific vertex color, as well as a specific eraser parameter.
When I set all of this up in a default scene, it works fine if I create a new GP Object : the correct brush, color and eraser are on. But, if I create a new scene within the same file, it's all reset. Back to the default pencil brush, back to the green vertex color (but inactive as it sets material color as default), and overall, my "default settings" are bypassed.
In the scenes I'm supposed to work with, this quickly become nightmare-ish. Every shot is a different blender scene within a file, and for every shot, I have to yet again, for the same GP object that was already painted on in another scene, pick a brush, pick a color, etc. I've looked everywhere online, I can not figure out how to set an actual default brush other than the pencil, another color, etc.
This is quite upsetting as it is an immense waste of time. Has anyone figured this out, and are there solutions?
Thank you very much

MTKay,
I am just going to make a suggestion,
But have you tried to make a full copy of the Scene.
Scene > New

Scene > New > Full Copy

I would certainly learn about the concept of linking and appending Libraries. I believe these might be the missing piece to your adventure with Blender.
https://docs.blender.org/manual/en/latest/files/linked_libraries/index.html
I think after you make it over this issue....your time will much more fun!!
Happy Blendering!
We all learn by sharing what we know!
Smartdog


object appearing black in edit mode i have tried removing doubles and recalculating normal. Also when i go in edit mode with other object there is no such problem.
it is difficult to see mesh is such darkness. please suggest how to overcome this problem.

Other than what said in above comments, you can customize the color used for unselected vertices (black by default), to whatever you wish:


Do something after user moves a marker I'd like to update a list of markers [name,frame] everytime the user moves or deletes a marker. Yet, I couldn't find a solution using Handlers, but I have the feeling that it is possible...

The user's actions I'd like to monitor appear in the top info window.

For example :

  bpy.ops.marker.move(frames=-1512)

Any hint ? Thanks a lot !

Currently there are no callbacks in bpy.app.handlers to catch these events. The api we have own isn't well suited to adding callbacks into 100's of operations which would be needed to support customizing the behavior of any tool.

Probably it would be better if we just have some way to update marker names built into Blender.


How can I tear two bones and their skinned mesh apart during animation? I'm trying to create a stylized version of the black knight sketch from the movie Monty Python and the Holy Grail. Two characters are engaged in a sword fight, with one of them ultimately loosing a few limbs.

I set up a prototype character, rigged and skinned it and got to the point where I need to tear two bones of the armature (including the mesh) apart, which is causing me a bit of a problem.

I already tried to set up the parent-child relationship between the two bones that need to be seperated by using a modifier and decreasing its influence to 0 during animation. But this still leaves me with the weird deformation of those vertices skinned to the seperated bone.

Another idea might be to use different versions of the character model and swap them during animation. But first I'd like to ask if there is a less time-consuming option?

If you wanna tear a bone chain in a specific joint, you can't just break the parenting of those bones, as this will break the skinning as you noticed.

You need 2 chains to overlap in the location of the tearing (exaggerated with a gap):

The amount of overlapping depends on how your bone weights overlap on the mesh.

You skin the bottom piece to the green armature and the top piece to the red one. To tear the limbs/parts apart you just separate the armatures.

The only problem is mesh smoothing in the area of tearing. You can fix that with normal mapping or with custom split normals that blender now supports.


Volumetric lighting in Eevee goes through mesh I created a fog in my scene to get the beam of my light in Eevee. I deactivated the shadow produced by the lustre mesh so as not to break my lighting. This option active or not, my light passes through my mesh. Do you have any idea where this might come from?

In eevee go to your volumetrics tab and crank up samples and light clamp.

BEFORE:

AFTER:


Can I change the view(pan/rotate) while performing an action? As an ex-C4D user I often need the function to zoom in and out, pan or rotate during or while I'm editing a vertex. When I use the vertex snap over an DWG drawing, I had to snap an intermediate point, pan my view to the point I want to snap to, because it's out of the display view, and then make a second final grab action to snap onto the point I wanted.

Is there any function (with its respective shortcut) to do this in Blender?

You can't move the 3D view while editing something, even with a 3D mouse, at least in Blender 2.67b, from what I know.
For your "snapping" problem, I suggest you the use of the 3D cursor, by doing the following:

place the 3D cursor at the exact point you want your vertex's final position (with left click in the view, or directly by entering the coordinates in the properties panel - shortcut N - or with the snap menu, see below)
select your vertex
hit shift S to display the "snap" menu
choose "Selection to cursor"

You'll notice that there is also "Cursor to selected" option available in this menu, allowing you to position the 3D cursor accurately at the selection's position.
Hope this helps.


How can I smooth an edge from a cut-out? I have a rounded "onion looking" shape and have used a Boolean modifier to cut a hole out of it:

Now I'm trying to smooth out the edges so there are no harsh corners on the shape. How can I do this?

Here I have highlighted the area I'm trying to smooth out:

Once you've applied the boolean, rearrange the topology so that it's a good one, then bevel the edge:


Texture baking is not in sync I applied several materials to my mesh, and when I tried texture baking by reorganizing pressing ctrl + p, the islands are well deployed but as those moves, the texture which is supposed to be shown on the mesh also moves. If I want to keep them still, I can't bake. What am I supposed to do?

You can achieve this using a second UV map (Cycles).

Use the "+" button in the UV map list: this will create a copy of your original (selected) UV map.
Arrange the UVs as you need in this second UV map.
Keep the first UV map as rendering target (the camera button on the right is still active for it)
Select the second UV map (this selection will indicate this second UV map will be used as bake target, the same way the target image node needs to be selected)
Bake


How to control the force of the fluid onto object? I'm creating a simulation in which flow of water is impacting on an object. problem is it's not impacting the object as strongly as i want it to. The water is just setting on the object and dripping down the sides. I want it to hit like water does to a spoon when it's being washed. Is there any way of controlling the force of the liquid so that it hits the object more strongly, thus creating a big splash?
Ref: https://www.facebook.com/LADbible/videos/every-time-i-wash-a-spoon-in-the-sink/4464864986893990/
sorry if this has already been asked before or it's a dumb question.

Rather than using Geometry or Inflow behaviour and allowing gravity to give the fluid momentum you can set the Initial Velocity of the fluid as it enters the simulation to give the fluid more of a 'punch' as it hits the obstacle. Simply enable Initial Velocity and adjust the Initial X,Y,Z components to give it more push in the required direction.


Is there a way to create a seamless image in the compositor? Can a rendered frame be made seamless, by some compositor tricks? What I'm looking for is something similar to the GIMP filter Make seamless.

Here's an example
Original (downloaded from Pixabay):

After Make seamless applied:

I could, of course, do this in GIMP, but I'd like to avoid post processing in external applications, and get a ready made image directly out of Blender. My goal is to have a repeating background and composite non-repeating text on top of it, and I'd like to be able to do it with two render layers or, if necessary, two scenes in the same .blend.

When searching Blender.SE, I found several questions about seamless images, but they all seemed to want to know how to use pre-existing seamless images, or how to get a texture to repeat seamlessly on an object. The ones I actually opened, did not answer my question, since I'm aiming to create a seamless image from a render.

The question depends on the nature of the source image. In the Fireworks example the edge is already seamless (black). So you can use the compositor. Otherwise you would prepare the edges as the other answer suggests with a blending mask.

Import image
Add a Translate node, turn on "Wrap Both Axes"
Alter X and Y offset
You can add the original image back over the top with an "Add" mix
node.


Fireflies for my burning earth I watched this blender guru tutorial on Making Fire. Around 34:00 he starts explaining how to use a particle system to create "fireflies". The result is something like this

Now I have this idea to create a "burning earth". For this I have a UV sphere inside the earth as an emitter of fire and smoke. And the smoke domain is placed like this.

This results in an image like this.

So far so good. But when I add a particle system to my "emitter sphere" the whole sphere is emitting fireflies and I want only fireflies around my fire. I thought to solve that by creating a circle under the fire and add a particle system to that circle. But how to get this working like that the circle emits fireflies that are driven upwards by the smoke domain ??

I guess (with hindsight) this question is a possible duplicate for this question How can I control where smoke and fire are emitted from? but I think because my question is specific for the Particle System it adds new knowledge to Blender SE

You should either define a vertex group on your sphere and change the particle settings (also for your fire and smoke) to limit emission to that vertex group or, seeing that you seem to be using this sphere for nothing else, simply delete the parts of the mesh that should not emit particles or smoke.

Quick explanation of vertex group approach:

Select your mesh,
go into Edit mode,
then select the vertices/faces that you want to emit particles/smoke,
then go to the object data tab and create a new vertex group by clicking the "+"-button in that area. You should give the  group a meaningful name.
Then click the "Assign"-button beneath the list of vertex groups while your new group is selected and the selected vertices will be assigned to that group with a weight of 1.0.
Next, go to the particle settings under Vertex Groups and select your new group for the Density setting.
For smoke, look at the Smoke Flow Advanced section of the emitter object's smoke settings. You can select the vertex group there.


How do i display the Lengths of an object in 2.8 How do i show the lengths of objects in 2.8?. For example in 2.79 i could scale a wall or floor and it would display the length on the edges.

In Edit Mode, press the little arrow at the top of the window to show the Viewport Overlays.

Under Measurement in the menu that opens, enable "edge length.


Material: imitate a glossy ceramic tile I'm trying to imitate the material (and glossiness) of a ceramic glossy tile as shown below:

The following picture is where I have gotten to now, but I'm not satisfied at all with the results.

I've tried many things in blender cycles, including normal maps, displacement maps, etc. I guess I need some more professional guidance.

To get the best result you should sculpt the highpoly surface, bake the displacement, paint the surface and build a shader. This is a lot of work so when you have a reference texture you can do following in your favorite 2D app:

Remove any lighting from the texture. I used cloning-brush to remove the gloss and dodge-tool to re-light the shadows. You should get diffuse like this:

Paint a displacement map. Go into 32-bit depth as you don't want mini-stairs on your mesh from not enough precision.

Always blur your displacement a bit.
Create a glossy mask:

And finally a detail bump map. This will be only noticeable in close ups so otherwise skip it:

Now for the geometry: Simple-subdivide a plane enough-times and apply displacement:

The ceramic tile itself is matte bumpy colored surface with clear glossy smooth coating on top:

The Glossy shader takes gloss mask as color through curves to adjust the glossiness intensity. Do it like this and not with the mix shader slider - you want to keep the diffuse part constant in the shader.
Pick a nice HDR environment or setup some area planes around to give the tiles something to reflect. Here's a render with the reference for comparison:


Weird outline image with sculpting I'm new to blender and am trying sculpt mode. All its giving me, though, is an outline with a glitched out static backround inside. Is this a bug?

SOLVED: I toggled the viewport shading and it was fixed. Not sure what it was, but that did the trick.


FLIP fluid simulation does not detect collisions anymore Sorry for such question, but someone is getting dumber by the second (me or blender): fluid collision stopped working completely (worked before by some miracle)
Domain is set, fluid set as Geometry, cube is set as Effector-Collision.
Collision does not stop liquid at all.
.blend file attached:

Sorry for false alarm-question.
It seems that was an issue with effector(for some reason it was changed accidently). Effector's Surface Thickness was set to 0
Just now tried same file with reinstalled Blender, and changed only this option and collision worked.


How can i shade foam along a coastline, together with a sea shader? I want to make a procedural texture for terrain, with water, sea foam, sand, moss, and rocks.
I have managed to make them all except for the water foam, which i cannot fix along the shoreline.
Basically, the sea line starts at z=0, where i want to put a few meters of foam shader and the rest will be water, but i did not yet find a way to do it.
Can somebody give some suggestions? Thanks.

It looks like you're doing something like this to generate the terrain.

Regardless, with whatever method you've used it should be possible to identify the handle that affects the coastline.

So in my case I could duplicate this Color Ramp and use the current position of that handle to mark the coast, and then create a new mask on the other side of it for a foam shader mix factor.  This does have the unfortunate side-effect of catching a bunch of the terrain.  I don't know if this happens with every method, but regardless we'll fix that next.

You've said that the water is at Z = 0, and I've made sure mine is the same.  To isolate only the coast, we can take Object Coordinates and separate out the Z axis.  Run this through an inverse operation and Clamp the result.

This has given us a mask for the islands.  The jaggies are down to the level of subdivision.  I was using Adaptive so I set my Dicing Scale really low to make them go away for this screenshot.

We can subtract this mask from our Color Ramp output, also Clamping, and get the coast, at that point we can go back to the Color Ramp and adjust the threshold to taste.


Is there a way to create per-face/per-vertex normals? Is there a way in Blender to create per-face/per-vertex normals?

All I can find for now, is per-vertex normal. If, with a bmesh, I'm going into a face and then the loop. But for each item in the loop, I can't find a normal. There's a "vert" property, which has a normal. But that vertex is shared with adjacent faces. So, if I modify that normal, it changes the normal of this vertex on the other faces it's on.

Is there a way to achieve this? Or maybe it's like Max and it has a sort of layer of it!

It is possible since 2.74 release (see the release notes). Upcoming 2.75 release will include some rather important fixes for them too.

You can only manipulate them in 'Object' mode though (i.e. not in BMesh), and there are several other limitations that may be addressed in future - in a few words, they are mostly procedural currently (through modifiers), and you should only use them on final topology, any topology change (adding/removing verts/edges/faces, or even applying negative scaling) will more or less break them.


How do I install the new cloth brush I recently saw that the cloth brush is now open for people to use, but I don't know how to get it?

Click on the following link to download Blender 2.83 Beta from the official website (It's still experimental).

Download link: https://builder.blender.org/download/blender-2.83-ff1040c6fefc-windows64.zip

After downloading, Open blender and go to sculpture tab and you will find the brush in the left menu (T menu).


How can I export and import ID property as json? (to make preset file) I think it should be simple, but could not find correct way ore related document then hope to know way.

Now I have active armature as "amt" , and it have many ID properties for shape keys and drive some bones.  eg  amt["prop1"] = 1.0, amt["prop2"] = 0.2 etc,,

by bpy, I can get amt ID property keys and values of current frame,  which I only need to export, as python dictionary.

eg  preset = {"prop1":1.0, "prop3" :0.2,,,}

Now I hope to export the dictionary as json,
then import the saved json , and apply these ID property values for current active armature, when I need. (of course it have same ID property keys)
 (I prefer to export as json,,)

This code get some data from Blender scene, save them as Python dict and write a JSON file. Then read that file and uses the inner data:

import bpy
import json
import os

# 1 - Export data as JSON file

# dict with all your data
dict = {
    "name": "Cube 1",
    "material": "Cube MAT"
}

# encode dict as JSON
data = json.dumps(dict, indent=1, ensure_ascii=True)

# set output path and file name (set your own)
save_path = 'E:\\'
file_name = os.path.join(save_path, "export_data.json")

# write JSON file
with open(file_name, 'w') as outfile:
    outfile.write(data + '\n')

# 2 - Import data from JSON file

# read JSON file
with open(file_name, 'r') as fp:
    data_file = json.load(fp)

# get data
cube_name = data_file['name']
cube_material = data_file['material']

print(cube_name + ', ' + cube_material)


Editor Window Missing - Only seeing timeline Sigh, every time I try to figure out Blender, I lose an hour because of something nutty. I'm a Lightwave user, but giving Blender a go. I tried to set up 4 views for Top/Front/Side/Perspective viewing, like in Lightwave Modeler, but after watching tutorials, I decided to reduce the windows down to one view again.

Well, I only made about 5 more tiny views, and eventually learned how to join views. Now that I've done that, I wound up with one large view with ONLY the timeline.

No matter what I try, I can only expand the console at the top, or move the boundaries between what you see. How do I get the default view back?

Okay, found it after much clicking, there is a small control on the bottom menu of a view which allows selecting a number of different elements. In my screenshot, it is in the lower-left. Clicking it and selecting 3D View returned the 3D editor.

I'd still like to know, though, if there is a reset to default.


What are the benefits of Quaternion rotation over Eulerian rotation? What are some practical uses for the Quaternion? Why not just use the Euler X, Y, and Z axis rotation values?

It's not intuitive how one should manipulate Quaternions. Can someone explain this?

Quaternion has the advantage that it gives better interpolation between keyframes for arbitrary rotations, compared to euler or axis-angle, this is often used for character animation and why its default for armatures.

It also avoids the gimbal lock problem.

You make a good point that the f-curves are hard to control. Typically you wont manipulate each axis them directly, and instead pose the rig in the viewport.

So for walk cycles and arbitrary motion, quaternions are fine, Euler's are better if you want to control each axis and are animating something which inherently has separated axis you would want to apply in order (robotic joints for example - a gun turret where you might want to control 2 axis directly).

For more general info on this topic see:
https://stackoverflow.com/questions/8919086/why-are-quaternions-used-for-rotations


Blender parent problem I used Blender2.79 and I think I just find the problem.

I have two objects and I want to make parent relations to each other,

when I used CTRL + P, the child's transform location still relate to the world's location.

However, when I manually use (properties -> object -> Relations: Parent) and select the object that I want to set it to parent. It used the parent's transform.

I belive those two ways are doing the same things and I miss the setting or this is a bug??

This is from wiki:

  At the very moment of establishing a hierarchical relationship between
  objects (parenting), the transformation coordinates of the child
  object remain unchanged, and yet this object doesn't change its global
  transforms visually (location, orientation or scale), though its
  reference "world" has changed from global origin (zero transforms) to
  the global transforms of the parent.

  Origin of unparented objects is the global origin: global (0,0,0)
  location, zero rotation, and unity scale. After being parented, the
  new origin should be that of the parent. And it is. But a correction
  matrix is applied to the child, so that the new reference point is not
  the global transforms of the parent, but the global origin. This
  correction matrix is applied to the global transforms of the parent
  before applying them to the child.

This correction matrix called Parent Inverse

You can do this operations with Parent Inverse:

Alt + O (clear origin) - this operation clears Parent Inverse and makes object go to the parent location.

Ctrl + Shift + P (Make parent without Inverse) - it's like what you do in properties -> object -> Relations: Parent. Or like Ctrl + P and Alt + O and Alt + P Clear Parent Inverse in one comand

Alt + P Clear Parent Inverse - Like Alt + O but for rotation and Scale.

Why Blender using Parent Inverse?

Let's try 2 objects  with Parent Inverse:

and without:

As you see, transform matrix, applied on parent object without inverse, makes child object distorted. If you want this effect - you are welcome, but mostly, we don't want it


Is it possible to bind mesh to armature using its current pose? I am looking for solution where i can import premade clothes which might be in

t-pose, A-pose
slightly out of the bone's default state
or use cloth sim to get a good resting pose with wrinkles and cloth not going inside the body

and get them to follow my main rig without using proportional editing.
I need to export the models with the rig as glb with default pose but would like to use the resting pose cloth sim as it looks the most normal.
python suggestions welcome . Maybe something like :

make the resting pose as default pose
bind mesh rig
revert back to original default pose

 dummy test file used in above screenshot

You can apply the armature modifier, go into pose mode on the armature and set its current pose as the default (idk what menu, use the search system if need be but pretty sure it’s Pose), then re-create the armature modifier.


How to keep gizmos visible when moving objects? I was wondering if it's possible to keep the axes gizmo visible while moving objects. I know it would be easier to learn was color is axis X and what color is Y, but having the gizmo visible would help and it would also help to visualize if we moving positive or negative along those axis.
Is there any reason for the gizmos to go away in the first place?
Hopefully there is a seting to prevent this.

PS: I'm talking when pressing "G" to move.

You cropped the solution out of the posted image. Use the move tool.

Or you can enable the move tool overlay:


How to Model a Mushroom shape? Is there any good way to make a half decent mushroom?

I'm specifically trying to make the mushroom on the back of Parasect for an animation. How can you make a rounded cone? Is there an addon for that, or do I have to make it myself?

Specifically, I'm thinking of a cross between an ovoid three-dimensional shape and a cone.

(It's also a good question when you are making rounded nose cones for objecs such as rockets)

If a Screw Modifier isn't already enough, simple Polygon modelling will be surely.

add a 5 (or more..) sided circle
extrude up and scale to give hints of the shape
then stick a subsurf modifier on it
(optional) then use a lattice or a curve modifier for deformation. Deform to taste.

The lattice:

The Curve Modifier:


Entire set of objects snapping to rotation instead of single object I have a problem and I'm not too well versed with blender.

I would like to rotate each individual wing to a certain degree during animation. However when I rotate one wing and then move to a different frame, the body and other 3 wings snap to the same location. The wings and body are each separate objects and they follow a bezier curve path.

![From individually rotated wings to any next/prev frame](https://i.imgur.com/Ejhe7fz.png]

EDIT: Whoops sorry forgot to attach the file, I do believe it is up:

To be specific I'd like the wings to rotate open at around frame 150-160

A friend had told me that the body and wings were sharing one animation so I had to make a new action and key frame the wings separately.


Some part of mesh won't deform First of all know that I am fairly new to Blender and 3D creation in general.

I got the mesh of an arm, I've done all the rigging and all but I have one problem.

When I parent the mesh and the armature (with automatic weight) all of the fingers armature deform their respective finger of the mesh correctly, except for the index, when I move the index bones the mesh just stays in place.

Someone knows how to fix it?

Thanks

The automatic weight feature in blender isn't perfect, pretty much every time you use it you will have to go back and manually perfect some weights.

How to fix it:

Hop into to weight paint mode (Click on the UI button that currently says either object or edit mode in the 3D Viewport, and select the Weight Paint Feature)
Open up the current object info tab (The box tab on the same 'tab group' as the render tab) and click on the index finger vertex group.
Use the weight paint brush to change the the effect the bone has on the mesh (Red is full parent and blue is no effect)

Happy Blending!


Issue with particles in blender donut tutorial I have been recently doing the blender donut tutorial and ran into a problem regarding the sprinkle particles. The particles (hair) keep appearing on the underside of the icing. As seen in the image below, most of the hair particles only come out from the bottom of the icing.
I tried to readjust the normals but I realised the normals were already correct. (Blue colour donut in image)
Someone suggested following through the weight painting part of the tutorial. However, the sprinkles still remain on the underside of the icing.
What is the actual problem and how do I solve this?

Particle settings below

Edit: @moonboots Thanks the hair particle problem has been solved. How do I prevent the submersion of the sprinkle particles?

It has to do with the Solidify modifier, I guess if you leave the Solidify on top of the modifiers stack and don't activate the Emission > Source > Use Modifier Stack (which would make the object emit both on bottom and top, it's not what you want) it considers that one side must be the emitting one and not both, and it may not be the one you want. In that case maybe simply flip the normals in Edit mode and the particles will be displayed on the top, or put the Solidify modifier on the top of the modifiers stack


Can't thicken parts, slicers don't recognize said parts I'm trying to 3D print a statue of a character that has a thin skirt. Problem comes in when I export and load it into a slicer, both Cura and S3D, it doesn't recognize sections of the skirt and won't print said sections. I'm trying all the print thin wall tricks I know, and even with a 0.25 nozzle on my Ultimaker 2, I'm still not getting anywhere. I also attempted to scale up in the slicer and rotate so the model would print on it's back, or tilted at 45 degrees.

On the Blender side of things, I've searched up and down trying to figure this out, and so far, nothing worked. I tried Solidify, Displace, Subsurf. I tried separating the skirt to conduct its own modifiers, and reattaching. I tried scaling the model as the first thing I do in Blender, but that caused major distortion when I copy over the pose data. I've played around with each modifier options at each step. Still can't really figure anything out.

Since the model seems alright in Blender, I go and export model as OBJ, and run it through MS 3D Builder to correct anything. I tried Netfabb for correction, but the model is too much for Netfabb to handle. I'm out of ideas, and I've asked on a FB group, and all I got was everything I found on my own and tried already. I really don't know where to go from here, and tbh, I don't even know if its a Blender problem or not, but any help is appreciated. Willing to share model if need be.
Thank you!
UPDATE: Added model for anyone kindly enough to help- https://drive.google.com/open?id=1XijAr2Aowmr-zLuCmdM8pEiTsomrhuQK

What you are asking for is professional help to make the model printable. The problem with your model is that your 3D Printer (No matter which kind you have) is not able to print that thin clothing. Actually thats not even the real problem. The real problem is that Slic3r or Cura can not know what shape that is because is has no inside. It is just flat. Thats why it doesn't appears when sliced. I dont know if you had a look at some other dressed character figurines, but they have usually quite thick clothing. For example habe a look at models of ballerinas on thingiverse. Thats why you tried Solidify right? But wait there is more! Not only has your object to be manifold (closed) it also needs to be one non-intersecting object to be sliced correctly. Usually when the Remesh Modifier works fine on your mesh its printable. It didn't for you right? Thats because you had intersecting geometry. As I am here writing, I am not writing this to make you go: "Oh thats impossible to do for me", so I have a quick solution for you which might actually work. If it isn't perfect enough, just make it perfekt in sculpt mode. So here is what you need to do:

Make a Proxymesh of your Character in his/her posed position. What that means is: Make a mesh that surrounds your character and is really simple when it comes to the polygons. Around 200 or 300 Faces will work well I think. You should use the Mirror Modifier to make the symmetry perfect if you can (I dont know your Pose)
Add a Subdivision Surface Modifier, a Shrinkwrap Modifier and a Remesh Modifier
Tweak the Settings. Most Important is the Shrinkwrap Modifier. You have to set the mode to either Nearest Surface Point or to Project. In Case you set it to Project, which I think will work much better on your model, you have to make sure negative and maybe positive is checked and none of the X,Y,Z checkboxes are checked. The Modifier will then move the vertices of your mesh along their Normals until they hit the Surface of your model (obviously you have to specify which model in the box Target)
Apply everything, go into Sculpt Mode (use symmetry if you can) and fix everything thats not quite there
Print it!


Why can't i get my undo history back? This has got to be my most frustrating moment while using blender! Whenever i use blender for a long time (without saving too!), i happen to change the current mode i am in when i try to undo an action blender undoes the action that took place while i was in that specific mode (object, edit, sculpt).

And heres the super annoying part, i try to undo to the changes that where done in that mode and a huge change in my mesh occurs, then i switch to the mode that i had previously been doing my legit modeling, and still i can't manage to restore my previous session(Come on now!).

So(sigh) i look througth the history in the tools menu for every mode i was In, and NOPE, i just can restore my previous session.

Now i realise that blender store only a certain amount of actions in its history, so my previous action was deleted while i searched for last my session.

Is there any way to avoid this problem? It would be very appreciated :)

No, there is no way around this currently.
This is a limitation in Blender's undo stack. Each mode has its own undo history.

See: https://www.blender.org/manual/interface/undo_and_redo.html


Baked Texture is Darker and uglier than the render I'm new in blender and searching for the answer of my problem anywhere but I got nothing
heres my problem, when im bake the object, the result seem ugly, darker, and dissapointing. dosnt even close with my render, here the screenshot

and here when i put the image texture and see it in the material viewport (it should look same with the render view)

and here when I put the baked texture wall in unity

what did I do wrong guys?? ty for your respond
(sry english is not my first language).

I think you did it right, but rendering is not the same as the viewport material preview. If your baking and your textures are large enough (not to loose detail because of that) increase the sample rate. Baking will take a while then too (maybe a hour or longer). Try a sample rate first double current then try 400 or 1000

PS perhaps you should take a look what 2.8 eevee can do for your kind of work.


How to move multiple vertices like subdivide? What I want to do is to move multiple vertices(upper picture) along the edges and all the other vertices appropriately like subdivide create new vertices(lower pictures). I hope I can move all the vertices along the lines at once where subdivide create vertices if you select more "Number of Cuts" in Subdivide submenu.

In short,
I want to Move vertices along the line between inner and outter vertices(upper picture) like subdivde creates vertices along the line. Lower picture is a sample of "subdivde" between inner and outter vertices

P.S.:curved shape

To move vertices precisely along edge normals, you can use an addon called Offset edges.
Installation
Once you download the addon, go to user preferences, install addon from file, and select the downloaded file. Then make sure to tick the chckemark button to enable the addon, and save user preferences.

Usage
Once you have it loaded, in edit mode, in the left-hand toolbar, there is a new sub-tab called offset edges. There are three commands - offset, extrude, and move. In your case, you would select the move command, after which you can specify the width.

A sidenote - it's best to model in quads whenever you can in order to be able to subdivide your geometry efficiently with loop cuts.


Modelling grooves on a cylinder How can I model the grooves of a ventilation pipe?

Thanks

You may do it fast using the Array Modifier and some basic modeling tools.

Add a cylinder with no fill, then subdivide it in the middle with Ctrl+R. Bevel the loopcut with Ctrl+B and set its thickness. Next inset the faces with I to create extra loopcuts for subsurf creasing. Then extrude the loop of faces (E) and scale it along Z and Y axis only (S,Shift+X). Repeat it twice, then inset the faces again. Finally add a Subsurf Modifier and apply the smooth shading. One segment is ready.

Add the Array Modifier and set it above the Subsurf. Set the Count number as you like and check the Merge checkbox.

To change the angle of the carvings select one in Edit Mode with B, then press Shift+Ctrl+Alt+S to shear it.

Finally you may apply the Array, add the Solidify Modifier (to give the pipe a thickness) and add loopcuts (Ctrl+R) at the edges of a pipe.


It's possible to create a 360 Video in blender? like this one http://www.airpano.com/360Degree-Video.php?3D=Video-Bromo you can turn around...If I draw a scene how can I render a video like that? and wich format is it?

There is a great App VRAIS which uses Blender and they provide a tutorial of how to render stereoscopic panoramas for this App:

  Render dimension: 2048x1024 for starters, and for final rendering 4096x2048 (just type in 200% in the render percentage).
  In the Render Layers Panel, enable "Views"
  Set your camera to Panoramic. Choose "Equirectangular" from the dropdown menu
  Enable "spherical stereo" (Only available in Dalai's version)
  set the pivot point to „Center“

Or you could watch some not so static 360° Videos on YouTube. Pedro Gaspar made a tutorial of how to create them in Blender. Blenderrendersky already created some videos in the BGE with this method.


it's possible to save materials in cycles node editor to reuse them in other project? instead of copy and paste them from other projects I'd like to store them somehow and load them directly

You can create a .blend file that is a master collection of your finished materials, and then Link (not Append) this to your various other .blends.

Be cautious with this kind of workflow though, because if you change anything in this master file it means your materials in all other .blends may render differently - so for example, re-rendered frames of animation may look different.

It's generally best to work with Linked files on a project basis, not a global basis.


Importing VRML/X3D objects with their original file name I'd like to batch import multiple VRML 2.0 files using a script.
However, in contrast to other importers (i.e that for .obj files) the X3D importer add-on rename the imported objects as ShapeIndexedFaceSet.(increasing numbers).

I succesfully modified a script originally doing a batch import of .obj files but since the file names are not specified, this is completely unuseful for me!

Any help to give the object the name of the file from which it was imported will be greatly appreciated!

here is the script

import os
import bpy

# location to the directory where the wrml are located
# if you are using windows style backslashes, you need to cancel one with    another
path_to_obj_dir = os.path.join('C:\\', 'prova')

# get list of all files in directory
file_list = sorted(os.listdir(path_to_obj_dir))

# get a list of files ending in 'wrl'
obj_list = [item for item in file_list if item[-3:] == 'wrl']

# loop through the strings in obj_list and add the files to the scene
for item in obj_list:
    path_to_file = os.path.join(path_to_obj_dir, item)
    bpy.ops.import_scene.x3d(filepath = path_to_file)

To start added a little script to make accessing the folder easier, we can now set the folder from the UI, Scene properties Scene panel.

import bpy
from bpy.props import StringProperty

bpy.types.Scene.wrl_dir = StringProperty(name="X3D Dir", subtype='DIR_PATH')

def x3d_path_draw(self, context):
    self.layout.prop(context.scene, "wrl_dir")

bpy.types.SCENE_PT_scene.remove(x3d_path_draw)
bpy.types.SCENE_PT_scene.append(x3d_path_draw)

Ok with that done, I can use scene.wrl_dir rather than hard coding the folder.  Here I simply deselect all objects (equiv of bpy.ops.object.select_all(action='DESELECT')) before calling the import op,
then rename the selected objects to the file's name as the newly created objects are selected after the import.

import bpy
import os
context = bpy.context
scene = context.scene

# get list of all files in directory
file_list = sorted(os.listdir(scene.wrl_dir))

# get a list of files ending in 'wrl'
wrl_files = [f for f in file_list if f[-3:].lower() == 'wrl']

# loop through the strings in obj_list and add the files to the scene
for f in wrl_files:
    print("Processing %s" % f)
    # deselect all objs
    for o in context.selected_objects:
        o.select = False
    path_to_file = os.path.join(scene.wrl_dir, f)
    bpy.ops.import_scene.x3d(filepath = path_to_file)
    # rename them to file name, change to basename for instance.
    for o in context.selected_objects:
        o.name = f

Other methods would be to add an empty for each file, name the empty after the file and parent to it.  Or import each to a new scene.


Normal map on mirrored model I have mirror model, that I made to save the size of textures. But in testing I see, that part of model, that must be flat, has a visible seams:

Normal map is configured to non-color, so it isn't a problem.

The problem, as I see, that there is no color in RGB that corresponds to 0.5, 0.5, 1. #8080ff is bigger than this value, about 0.503, 0.503, 1 and #7f7fff is less (about 0.498, 0.498, 1)

So now I found only one method to solve this problem - create a mask and mix them this way:

Less then value is 0.00001

So is there a suitable  method for using normal map on a mirror model?

It's a great shame 128 isn't half of 255.

This isn't an answer to your question, but it does what you do to fix it without having to construct a second map as a mask.

This node tree compares the map-encoded normal to (0,0,1), and if it's close enough, sets it to (0,0,1)

How close 'close enough' is, is set in the 'Less Than' node. The color in the 'Color' node is RGBA 0,0,1,0. (Is there a better way of entering a fixed vector?)


Bevel a Procedural Texture? Is it possible to bevel the outline of a procedural texture?

This would be the desired effect (result prepared with an image editor):

For example, we have the default Brick Texture, and its Mortar Size can be thickened, but there is no built-in parameter to taper off the edge with a bevel to give it a more rounded look.

Bricks with the default settings (left) and thickened mortar (right)

The best idea I can think of is to stack Brick Texture nodes of different Mortar Sizes to create a stepped gradient. That however has resolution limitations, plus using that many nodes may negatively impact render time.

So I am wondering if anyone with a bit more vector know-how than myself knows of a way to generate a vector curve that transitions between two mortar sizes to achieve the result more elegantly. Any ideas?

Here is a concept image - the blue curves representing the vector transition:

Based on a modified version of this OSL bricks shader, I added a smoothness parameter that generates a smoother transition from the mortar color to the brick color (Currently will work in the desired manner only with values ranging from 1-10. Will probably improve algorithm tomorrow).

# include "stdosl.h"

shader brick(
    float BMWIDTH = 5,
    float BMHEIGHT = 5,
    float MORTARTHICKNESS = 0.1,
    point Vector = P,
    int   smoothness = 1,
    color Cbrick = color (0.5,0.15,0.14),
    color Cmortar = color(0.5, 0.5, 0.5),
    output color Col_Out = color(0.7)
)

{
    color Ct;
    point Nf;
    float ss;
    float tt;
    float th;
    float sbrick;
    float tbrick;
    float w;
    float h;

    float x = Vector[0];
    float y = Vector[1];

    float smoothnessFac = 0.1;
    for ( int i = 0; i < smoothness; i++ ) {
        float MWF = MORTARTHICKNESS * ( 1 + i * smoothnessFac ) * 0.5 / BMWIDTH;
        float MHF = MORTARTHICKNESS * ( 1 + i * smoothnessFac ) * 0.5 / BMHEIGHT;

        ss = x / BMWIDTH;
        tt = y / BMHEIGHT;

        if (mod(tt * 0.5, 1) > 0.5)
        {
            ss += 0.5;
        }

        sbrick = floor(ss);
        tbrick = floor(tt);

        ss -= sbrick;
        tt -= tbrick;

        w = step(MWF,ss)  - step(1-MWF,ss);
        h = step(MHF, tt) - step(1-MHF, tt);

        if ( i == 0 ) {
            Ct = mix(Cmortar, Cbrick, w*h);
        } else {
            color current = mix(Cmortar, Cbrick, w*h);
            Ct = mix( Ct, current, 1 - i * smoothnessFac );
        }
    }

    Col_Out = Ct;
}


Eevee thin glass surface I am experimenting a bit with Eevee to get used to it but I can't render correctly objects with a thin glass surface (a sphere with solidify modifier for instance). Instead Eevee renders an object filled with glass (a ball with the same example). And it is the same with non closed surfaces.

Is there any way to make Eevee interpret it as a hollow object instead of a plain one ?

Here is a scene rendered both with Cycles (which renders it correctly) and Eevee to illustrate :

Thanks for you answers !

Give your material a small refraction depth.

From the manual

If Refraction Depth is not 0.0, all refraction BSDFs in the shader will act as if the object is a thin slab of the refraction material having this thickness. This will model a second refraction event that will double the absorption color and start the refraction ray after this second event.
This option greatly increases the quality of thin glass objects.


Layout selector missing I was toggling between layout views (Default, Animation, etc) and I accidentally got this:

I don't know how to simply restore the "Default" layout... or any layout. Many of the interface elements are gone and I was able to bring back some by clicking "maximize area" in one of the tool bars

So, anyone knows a way of restoring the default layout without using the layout button?
thanks in advance!

(I've tried searching and apparently no-one had this problem before...)

You have toggled the 'current' space (whichever part of the interface the cursor was in) to be full screen (Ctrl+↑).

Press Ctrl+↓ or the Back to previous button that has appeared in the top toolbar (next to Render, Window, Help etc) to restore the space to it's previous size.


What is causing pinching artifacts in this mesh? So, I just was trying to get back into blender, and I made a cup.  Unfortunately, this cup has some issues right at the bottom of the inside, and I can't figure out why.

You can download the blend file here.  And just for good measure, here is a screenshot of the problem.

That is caused from the triangle fan at the bottom of your cup, and the subdivision surface modifier.

To fix it delete the vertices at the center of the bottom of the cup.
Select the edge loop along the bottom, press E to extrude then S to scale it smaller. Repeat that three times, and for the last time scale to 0. Then remove doubles.

This is how it will look after extruding and scaling three times. This will give  acceptable results when using a subdivision surface modifier.


Lattice Modifier not listing available objects I am just trying to use a lattice deformer but somehow I can't see any available objects in the objects property.

Using Blender 2.79b under macOS High Sierra.

You have to add a lattice object to the scene (Shift+A> Lattice). Then, after selecting the object you want to add the lattice to then the lattice (the order matters), you can do Ctrl+P> Lattice deform.


Emission: Red glow while the object itself is white I want to make something like this in Blender:

So I created a Torus and I created two emission materials for it (one for the right side and one for the left side) with two different colors and increased their strengths. And then I added a Fog Glow filter (Glare) and a Volume Scatter to the World. But this is the result:

I want the material to be white and a nice green (for the left side) and purple (for the right side) glow around it (like the reference photo). How to achieve this effect? (Blender v2.82 and Cycles)

If you really want to use Cycles: Add a box which encloses the entire scene, add a principled volume shader to the box and play with Density and Anisotropy:

In comp you can add a Denoise node to save render time and a Glare node to introduce a soft glow:

If the volume takes forever to render, a few blur nodes with various blur amounts can introduce a 'colorful blur' in comp as well:


Arms scrunch and lose volume when armature moves I have a simple humanoid armature: no IK rigging yet and it worked fine until the arms started messing up when I try to move them.  As far as I can tell there is nothing wrong with the weight painting, I even cleared all the weights off of all the vertex groups in the arms but when I repainted them the same thing happened.  The mesh doesn't follow the bones at the same speed and deforms wrong and I have no idea why or how to fix it.

The only modifier I have active is the armature so its not a stack order problem, and none of the other bones have any weight on any part of the arm so I really just have no clue what is wrong here and any help would be greatly appreciated.
EDIT: Here is the .blend file

Your arm is affected by two extra bones:
Spine.2

Spine.1

That's why your mesh only follows the arm at "one-third speed"; the other two-thirds of the influence comes from these two Spine bones.
If I quickly clean up the Spine bone's influence, the arm moves correctly.

Btw, one quick way to check what bones influence a vert is to select the vert in Edit mode and look in the sidebar under the "Item" tab. You can see a list of all groups the vert is assigned to and their weights. See the extra Spine.1 and Spine.2?


Cant change animation action from move to hit With blender an 3D artist made me an unit with 6 animations. When I downloaded the file I was able to change all animations. But now I cant. Even if I select the shield and after that I cant change animation to another.

My unit walks, but when I change animation to hit , it still walks. No idea how to fix it.

On my Dope Sheet I see "a collection of F curves for animation" with the namings "walk, stay, hit..". When i change them and press Alt+A (to start animation), it still walks, no matter what I do. I am weak in blender, forgot everything so long ago. And I try so many buttons, but still cant change the character to hit. Please help with suggestions (in noob talk please).

It might be possible that you have some action strips stuck in NLA editor (thus not giving you an opportunity to change the action). Go to NLA editor (it's a panel type) and see if there is anything besides your desired action. In any case, try to remove any NLA layers/strips related to the armature.

I hope it helps.