How to morph a sphere into a torus in blender I'm new to Blender and want to morph a sphere (or cube, cone, cylinder) into a torus.

Thanks for any help.

Modeling & shape keys

You can somehow fake the effect with shape keys.

It's just a matter of grouping vertex in the target position. The way about how to approach a similar problem could be various, and they really depends on the shapes.

Start by creating two shapkeys and enter edit mode to start changing the vertices position:

If we for example consider the morphing from a sphere, you could start by selecting the inner faces of the thorus and then scaling everything toward the center and then on the Z axis:

Invert the selection and start running alternatively the command "smooth vertex" and "to sphere".  The purpose would be to better distribute the edge loops to mime a UV sphere topology (at least outside). Then scale the whole selection to match with the lower and upper vertex.

Result:


How can I control the size (Diameter) of a ring that is made with the simple transform / Bend? I start with a 1 x 1 x 1 cube set at -9.5 Y units from the origin. I use an empty at the origin as my Center of Deformation. I use the simple deform modifier / Bend with 360 deg as the deform parameter.
The resulting radius of the ring is about 10.159 and the diameter of the ring is about 20.318.
Yes, I can scale the ring in X and Y back to the desired Diameter=20, and recenter the ring at the origin. But this introduces a slight error in the inside diameter of the ring that is a challenge to correct.

Is there any way to predict what this dimensional difference is before I begin and adjust for it in either the mesh center, cube size, Center of Deformation, or anything else that is predictable?

The Bend Deform is simple, but the outcome is imprecise. Is there a more precise way to construct the ring?

Different, slightly quicker approach -

Add a cylinder and change the radius and depth in the last operator panel to match the desired values:

Then in edit mode, select the top and bottom faces, extrude in place (press E, then immediately after Enter before the faces had a change to move anywhere), then change the pivot point to individual origins:

Now scale the top and bottom faces to match the desired radius. Since we change the pivot to individual origins, each face will scale around its own origin, and in effect both faces will be inset.

Now the only thing left is to bridge the two faces to create the inner hole and geometry (see answer above to explain how to activate the looptools addon if youre not familiar with it):


error passing a property to a function (name not defined) I am fairly new to python scripting, so getting into blender is a uphill battle at the moment. I want to pass a property into the REDO panel that, when checked, tells the operator to take effect only to the active object. But I keep getting an error message saying that the property is not defined (it is my understanding that it should be, because of the self argument in the function).
Any help is very much appreciated!
    "name": "Snap Origin to selected",
    "author": "Juan",
    "version": (1, 0),
    "blender": (2, 90, 0),
    #"location": "View3D > Mesh > Snap > Snap Origin to selected",
    "description": "snaps the origin of the object to a selection",
    "category": "Mesh",
}

import bpy

class MESH_OT_snapOrigin(bpy.types.Operator):
    """It has to begin with a selected element in edit mode"""
    bl_idname = "mesh.snap_origin_to_selected"
    bl_label = "Snap Origin to selected"
    bl_options = {'REGISTER', 'UNDO'}

    only_active: bpy.props.BoolProperty(
        name="set only active",
        description="set only the origin of the active object",
        default=False,
    )

    @classmethod
    def poll(cls, context):
        return context.area.type == 'VIEW_3D'

    def execute(self, context):
        bpy.ops.view3d.snap_cursor_to_selected()
        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
        if only_active.value is True:
           bpy.ops.objects.active.origin_set(type='ORIGIN_CURSOR', center='MEDIAN')
        else:
           bpy.ops.object.origin_set(type='ORIGIN_CURSOR', center='MEDIAN')
        # bpy.ops.object.origin_set(type='ORIGIN_CURSOR', center='MEDIAN')
        print("updated!")
        return {'FINISHED'}

# Registration

def set_origin_button(self, context):
    self.layout.operator(
        MESH_OT_snapOrigin.bl_idname,
        text="snap origin to selected",
        icon='PIVOT_CURSOR')

def register():
    bpy.utils.register_class(MESH_OT_snapOrigin)
    bpy.types.VIEW3D_MT_edit_mesh.append(set_origin_button)

def unregister():
    bpy.utils.unregister_class(MESH_OT_snapOrigin)
    bpy.types.VIEW3D_MT_edit_mesh.remove(set_origin_button)

I also don't know if bpy.ops.objects.active.origin_set(type='ORIGIN_CURSOR', center='MEDIAN') is going to work, given that I get an error before that, just so you know...it is probably also wrong.

ok, so...I just had to add self. before the property for the function to recognize it (and lose the .value, since it is a boolean, but that's a different error). Like so:
if self.only_active is True:
I still don't know how to get the active object. The whole context part is particularly confusing to me. But I guess I'll get it eventually.


Shooting Star blender render How i can do this in blender render...

https://www.youtube.com/watch?v=NATgpZNYPSY

my particles go all crazy,

I have a empty that is the father of the star and planes that drop particles that makesthe tail of the star... following a path... but the tail of the shooting star is baaaad
its posible to do this in blender?

Thks for ur help

Final result:

Particles settings:

In this example Particles Emitter is small IcoSphere following spiral Curve.

Brownian - will scatter particles.

Damp - will keep them together.

Gravity - well, will make them less influenced by gravity :)

IcoSphere.001 - is our Particle Object.

Try them out to get desired result.
(Constant rewinding video on YouTube is not my strong side.)

Particle Object material:

To the Particle Object (in this case IcoSphere.001) you will want to assign Particle Info node and change color of them by their Age, or read more here: How do I get particles to change color over time?

Math node > Divide allows you to change how quickly this change will be and ColorRamp gives you colors.

Blend file:


How to place objects on the center of the ground plane via python? I put a model at the center of the scene using this method:

bpy.ops.object.origin_set(type="GEOMETRY_ORIGIN")

but I can't put model over the scene after this command. Because it is not at the center of Z axis.

e.g.:
when comman is executed model location looks like this.

I thought that command

bpy.ops.object.origin_set(type="GEOMETRY_ORIGIN")

will put model to the center about all axis, and I can just pick it up at half height

obj.location[2] += obj.dimensions[2]/2

but after this I had:

How can I find this offset value?

The position of the object is defined by it's origin point. If you import a model from another 3d package by using an exchange format like .obj or .fbx, the origin is typically at (0,0,0):

In order to align an object directly to the ground plane:

Move the object to the origin (to make sure the object is perfectly centered)
Iterate through the geometry to find the minimum z location value of all verticies
Place the 3d Cursor to the minimum z location value
Set the Origin to 3d Cursor
Move the object to (0,0,0)

Suzanne aligned to the center of the ground plane

import bpy

# get the current object
current_obj = bpy.context.active_object

# get the scene
scene = bpy.context.scene

# set geometry to origin
bpy.ops.object.origin_set(type="GEOMETRY_ORIGIN")

zverts = []

# get all z coordinates of the vertices
for face in current_obj.data.polygons:
    verts_in_face = face.vertices[:]
    for vert in verts_in_face:
        local_point = current_obj.data.vertices[vert].co
        world_point = current_obj.matrix_world * local_point
        zverts.append(world_point[2])

# set the minimum z coordinate as z for cursor location
scene.cursor_location = (0, 0, min(zverts))

# set the origin to the cursor
bpy.ops.object.origin_set(type="ORIGIN_CURSOR")

# set the object to (0,0,0)
current_obj.location = (0,0,0)

# reset the cursor
scene.cursor_location = (0,0,0)


Compiling Blender as a Python Module Windows I'm trying to compile Blender as a python module on my windows machine so I can use an external IDE. In the tutorial on the blender site. I've tried to follow it, however, the instructions are pretty confusing. The first step says to copy bin\bpy.pyd C:\Python36\Lib\site-packages\. I can't find the bpy.pyd in the blender directory or the blender source. How can I do this?

You missed the build step in this tutorial. The install part refers to the bpy.pyd you have just built, and can be found in the "blender-git/build" directory. There is a tutorial on building blender on windows. Just don't forget the cmake options: WITH_PYTHON_INSTALL=OFF, WITH_PLAYER=OFF, WITH_PYTHON_MODULE=ON


Fire not rendering in 2.78? I was following the camp fire tutorial on the blender guru YT channel, and i've run into a problem when I try to render my scene. In the tutorial, it says to switch from GPU to CPU for rendering. I can't even see that option in rendering tab though. The fire works just fine otherwise, and i followed the tutorial exactly. Any ideas why the rendering won't work? Thanks in advance!

That tutorial, as you can see here, is for 2.73, and since then the Blender UI changed a bit, you can find that option in "file=>user preferences=>system" now (it's called "compute device").

You could also download an old 2.73 from the Blender website, to make it easier to follow the tutorial.

Anyway, remember:

be sure to use "cycles" render before creating the "quick smoke" setup.
save the file in order to enable the cache settings
before rendering, run the simulation from the start (frame 1) since it could need recalculations
if something in the simulation seems to be stuck after some settings change, try also to delete (and thus rebuild) the cache

Also, on the above page you can download a "finished" .blend which could help you understand better.


Loop cut stops at quad How come this loop won't connect all the way around? The direction and topology seems to be correct. There are 6 vertices selected here with a box select, and I've done "Merge by distance" to make sure there are no odd vertices

Thanks for the pointers in the comments. Turns out I screwed up during retopo.
This was one face. The edge across was not connected to the faces, i.e. splitting them.
Found the issue by selecting faces and comparing the count to what I was seeing. I suppose this is exactly what @susu meant with "disconnected faces", so cheers

I solved it by deleting the face and filling in between the edges to create the two faces I expected


Help! Bone Heat Weighting: failed to find solution for one or more bones im trying to rig the character of Lol Ahri in Blender 2.9, i want her to walk and wave. I downloaded the object(ahri), and used the basic human armature.

But when i try to parent the model with the rig, it shows me the error "Bone Heat Weighting: failed to find solution for one or more bones". I tried to use automatic weigths

So i started looking for solutions, this is what i tried:
MERGE BY DISTANCE (or remove doubles), scaled up, decimate geometry, delete loose, remove all modifiers, any of the bones are showing off, just using a single bone, changed the merge distance to 0.002, and placed the root bone at the center of the model.

the link to the project is: https://pasteall.org/blend/af6843868fb648748cb9687925586701
if you could help me i would be very grateful :)

Thanks to  batFINGER! Im going to post the solution in photos, maybe helps someone who was a little lost like me :))
Select only the object and choose edit mode, there click in select, and then select all by trait. There select non manifold.
In the box that apears in the bottom, deselect Vertices
Still in edit mode go to mesh, select merge and click in By Distance

Now try parenting in object mode

And for me it worked :)


how to make each pixel the same setting color in the rendered image? I have a problem. And it will be a great help to me if you have a solution.Thanks a lot!I need to render a image of a model, and I need every pixel of the model the single color.
I want to render a image using Cycles engine and GPU Compute(these two are necessary). In Material, I set the model surface type "Emission" and a single color(e.g.RGB(255, 0, 0)),and in Render-Film, I set the Gaussian Width is 0.01(it can not be set 0). Then I render the image. Almost each pixel is (255,0,0),but there is still several pixels whose color are different.

We can see when we enlarge the picture,  some pixel's color is not the setting color(255,0,0). I need to calculate the pixels of setting color accurately, so I need every pixel is the setting color. I am new about the blender. And is there any solution to my target? Thanks.

If it is an identification of the rendered part you want (where every object has its own colour), use the ID render pass. In the object properties, set the "Pass Index" to a unique number. In the Render Layer properties, enable the Object Index pass.

Then use the IndexOB slot of the Render Layer node to render the colours. For each pixel, this slot will give you the value of the "Pass Index" property you set on the object. You can use a ColorRamp node to map from a number to a colour; however, that accepts only numbers between 0 and 1, so you have to divide the IndexOB by the highest number you used. In my example the background has index 0, the cube has index 1, and the sphere has index 2, so I divide by 2.


Rotate polygons around edge (animation nodes) Polygon offset node (AN v2.1) has an advanced option of rotating around custom pivot point.

How can I tell polygons to rotate around an edge instead of poly's center? Does it require recombining mesh data, indices and so on?

The Extract Polygon Transforms node can be used to generate transformation matrices that can be used as the pivot of the Offset Polygons node. In which case, the first edge in the polygon is used.

Note that you should switch to local axis transformation in the advanced node settings of the Offset node.


All i want to do is scale an image vertically I want to scale a background image vertically so it matches my object height, (it's a 2d side view).

I have the length correct but was hoping for something easy like corner boxes like in Photoshop so I can stretch the image vertically.

I don't want to move it around / offset it but want to stretch it down but the top stays in the same position.

Using blender 2.79.

If you introduce a reference using the 'Background Image' mechanism, I'm fairly sure you can't scale it non-uniformly, or about a chosen origin.

You can, though, by introducing the image as an object, either by creating an  'Image' Empty, or by importing 'Images as Planes'. In both cases you could snap the cursor to your desired stationary point on the model (Edit Mode, ShiftS, > Cursor to Selected), then switch to the image, and, say, SY, with the Pivot Center set to the cursor.


How can I get some of the metallic (gold) colors on a piece of paper? I want to receive such an effect as on angel wings.

You can just mix between two shaders. Turn your wings into a all black image to use as a mask as I have below.

EDIT:
This is a cleaner solution thanks to CEGATON:

These were the two images I used.


How do I access the glTF Metallic roughness shader node with Python? I am currently working on a little script that takes a bunch of obj, imports them into blender with their textures, plugs the textures in the right places of the GLTF Metallic Roughness shader group, and then exports everything into GLTF.

I have arrived to the part where I have to add the GLTF Metallic Roughness Node. As those who use that plugin (https://github.com/KhronosGroup/glTF-Blender-Exporter) know, to access the node and plug your textures manually, you first have to link your blender scene to the GLTF2.blend scene, and especially to the pbr node tree and the Metallic Roughness group there.

I have tried a couple of things... First I tried this:

GLTF = matnodes.new(settings =[{"value" : "byp.data.node_groups['glTF Metallic Roughness']"}], type= "ShaderNodeGroup")

Yet Blender doesn't seem to like this and says that it expects only one argument for the function "matnodes.new()"...

So I have tried this:

GLTF = matnodes.new("ShaderNodeGroup")

There it spawns a gorup shader node, but it is empty and displaying ("Missing Data-Block"... On the menu dropdown, I have tried selecting "glTF Metallic Roughness", and it turns the node into the right node, but in the info console there's no command I can use... Basically I don't know how to do that in Python.

Does anyone have an idea :/?

I haven't put the entire code because I think the rest is kind of irrelevant but don't hesitate to ask if you want to see it.

Thank you all!

Find your node group:

group = bpy.data.node_groups.get('glTF Metallic Roughness')

Assign it to the node:

GLTF = matnodes.new("ShaderNodeGroup")
GLTF.node_tree = group


Practicing modeling and noticing unintended black lines in render I just followed a modeling tutorial of this treasure chest.
I think I may have done something a bit wrong.
Does anybody know what's causing the black lines in this render?
Are they shadows?
Or some normals direction problem?
I think I did calculate all normals outside.
I removed all doubles.
No modifiers.

Edit: Since it turns out the "black lines" are indeed shadows, as mentioned in below answer, I looked into softening shadows, so they don't get me thinking there may be a problem in cases like this one.
For some reason I had the lamp properties size: 0.1, so the small size light source was creating sharp shadow lines. I changed it to size: 1.0, and now the "black lines" shadows are softened nicely, and thus no longer look like problems to me in this case. I thought I'd mention that for any others whose black line issues may in some cases be resolved by softening shadow lines in this way. (Note that I also adjusted the lamp strength here up to 2222 (was 1111) to compensate for the the what seems like a spreading out of the light in the scene due to increasing the size of the light source.)

Yes, those are just the shadows from the edge of the chest.

The light is prevented from entering the chest because of the protruding edges.

The shadows seem so dark because they are created from the harsh spotlight you aim at the chest.


Control Fly Mode With Joystick? Is it possible to control the camera movements when in fly mode in Cycles with some external device, preferably joystick to get a smooth movement?
Instead of using keyboard keys W,D,S,A? Did anybody try that?

I just started doing research on this subject. I would try a program like "Gopher360" you can do custom keyboard and mouse binds with a Xbox controller. It's not through Blender but it should get the job done in theory.


Fixing non-manifold edge for 3d printing I need to print out a toothed ring but it prints out as a disk, ie with the ring filled in.  On checking the stl file in blender it has non-manifold edges and I think these confuse the printer.
I can see that the inner part of the ring is non-manifold in Edit Mode using CtrlShiftAltM.

The file is at:
https://drive.google.com/open?id=0B3_qq9691bVuSEduM3Y5bWdRY0k

While removing  doubles with a high merge distance of 0.1 or more will remove some of the problem, fixing the non-manifold issue manually will take a very long time as you need to fix each and every errant vertex.

However, if you don't need to maintain the exact same mesh and can live with a very very close reconstruction of it, you can fix the non-manifold issue automatically by using the remesh modifier, and then the decimate modifier to reduce the polycount back to sanity.

Here's the setup:

After adding the modifiers with the parameter values specified above, you can either directly export to STL (File --> Export --> Stl) or apply the modifiers and then export.


How to get the end node of a tree in python? From a given node tree, what is the most reliable way to get the end node being used for output, if any?

My current approach is to check for the correct output type for the tree (OUTPUT_MATERIAL, OUTPUT_WORLD...) and for is_active_output:

nodes = node_tree.nodes

for n in nodes:
    if n.type == 'OUTPUT_WORLD' and n.is_active_output:
        return n

return None

However, I see no guarantee that there is only one node with is_active_output (I can set this to True in multiple nodes).

The ShaderNodeTree has an active_input field, but the value is -1.

I have experimented with it and this is what i come up with :

The active_output is not a node type so it will not contain the active output node, it is NodeSocketInterface ( i don't know what this is )
as you have found you can set multiple nodes is_active_output to true and this will be misleading, but apparently this is handled automatically by blender like this : the last selected output node (in the UI ) is set to be the active output and all other output nodes get their is_active_output property cleared.
if you set is_active_output to True for multiple nodes the first one in the node_tree.nodes list is the active one.
if you clear the is_active_output of all nodes then the first output node in the list node_tree.nodes is the active one.

to handle this in code i have two functions to get/set the active output :

def set_active(my_node):
        nodes = my_node.id_data.nodes
        for node in nodes :
            if node.type == 'OUTPUT_MATERIAL' :
                node.is_active_output = False
        my_node.is_active_output = True

def get_active(nodes):
        for node in nodes :
            if node.type == 'OUTPUT_MATERIAL' and node.is_active_output :
                    return node
        for node in nodes :
            if node.type == 'OUTPUT_MATERIAL' :
                    return node


Copy AN nodes to another file Since the last releases of Blender, there is no more the possibility to copy/paste nodes between files (that was hyper-useful). Now the only solutions is to Group/Append Group.
But I can't group AN nodes neither... so the question is not "how to group AN nodes", but "how to move them to another file", if there is another way to do that.

PS: About grouping AN nodes, I think I'll open another question,
as you see on the screenshot - the group options are grayed out...

The only way I know of it's importing (appending in blender terms) the entire node-tree :/
File->Append->select the blend file to copy from-> click NodeTree-> click the tree of interest.
Definitively not user friendly considering the more common case to import into your current tree, but you can invoke the subprograms inside the newly imported node-tree and use it in your main tree.
Another way would be to add the code to recreate to the templates dir and repackage-reinstall the addon (or just add them directly in your addon's  installation directory) for example:

    [...]
    sourceObjectNode = self.newNode("an_DataInputNode", x = 0, y = 0, label = "Source Object")
    sourceObjectNode.assignedType = "Object"

    timeInfoNode = self.newNode("an_TimeInfoNode", x = 0, y = -200)
    [...]

See here for the full explanation of how to take advantage of multiple node-tree


Black lines in imported UV layout I exported the UV layout as an svg file with a resolution of 2048 by 2048. I chose export all UVs and set the fill opacity to 1. I then applied colors to the UV layout in Inkscape and saved the file as a png. I then imported the UV layout as a diffuse texture and saw black lines along the edges of my model:

I would like to get rid of the black lines in my model. I am using Blender version 2.82a. Any help would be appreciated. Thanks.

UV layout is just a visual guide for texturing and there is no reason to keep it for the actual texture.

Basic UV layout workflow

The principles are the same for all editing tools on how to use the uv-layout no matter it is Inkscape, Photoshop, Affinity Designer, Gimp or whatever:

Export your UV-Layout out of Blender (UV Editor > UV > Export UV Layout), either as vector svg or image file (png)
Open up the file in your favourite editing tool
Create a new layer and give it any meaningful name like 'UV-Layout'
Place your UV-Layout onto that new layer and drag it on top of the stack
Set 'Blend-Mode' of the UV layer to 'Multiply' which basically allows to "see trough" the 'unfold geometry' and having the layout as reference in place:

To avoid moving the layer by accident lock your 'UV-Layout' layer by clicking the little lock-icon
Create your textures somewhere below that layer eg. in another layer called 'texture'
When done with texturing: disable your 'UV-Layout' layer by clicking the eye or stack icon left to the lock icon and export it as image file (eg. png, exr or jpg)
Back in Blender, load up the image in the Image Editor (Image > Open) to check for issues:

UV Editor vs Image Editor
Final step is to assign the image texture to the shader and set the viewport shading to Material Preview or even to Rendered to see the actual result:


apply ocean modifier to existing face/plane I have a plane with a specific shape (made by many vertices).
This shape represents the sea.

If I add an Ocean modifier but that generates a new plane.
I thought by adding a boolean modifier on that ocean square, this works and has now the shape of my plane, but the waves are gone.

(I did not apply the modifer of the ocean because I want to animate it over time).

how to do this?

On the image you can see the ocean (via modifier) and my plane which represents the sea.

OK I found out according to this answer: can I use ocean modifier on any custom shape?
You need to subdivide your plane as much as possible otherwise it will have no effect. and then you set the Geometry to Displace.
I used the knife tool to first make a rectangle and do some loopcuts and after this I manually took the knife tool to subdivide the parts that were near my "curly" edges.

My mistake was the subdivide (I tested the Displace but thought it didn't work because the waves were gone).

Hopefully useful for others!


Substance B2M to Blender Workflow I have decided to work with Substance B2M en use the texture maps in Blender. I want to work with the PBR shaders of Cynicat Pro and connect the Substance maps into the input nodes of the PBR Shaders. I especially want to know which texture maps of Substance (base, normal, height, specular, metallic, ...) are relevant for Blender and if they have the same meaning (like the specular and metallic map) and how to connect these maps to the input nodes.

I am mostly interested in the definitions of the texture maps in both packages and whether or not they match.

After reading the blog of Jason alias @Jtheninja, I set up a node group using the Metallic Shader of Cynical Pro and connect the Substance texture maps.

Would this make sense for a rusted metal?

Cynicat Pro really helped me out with explaining how you can connect the Substance bitmaps to his PBR node groups.

In the material node group you may notice that :

when importing a DirectX normal map you have to convert it to Open GL normal map
the roughness is corrected with power node before connecting it to the shaders (according to JtheNinja" The other thing we need to do is square the roughness value to match the range between SP and Cycles. To do that, add a math node, set it to “power”, connect your roughness map to the top slot, and set the bottom slot to “2.0”."
the metallic map is a sort of mask that tells blender what is metallic and what is not

This seems a very elegant setup with little fuss and very reusable. Comments ?

Now I also learned that you can download compiled Substance files from Textures.com and open these in Substance Player (free) and tweek the maps before exporting the bitmaps. This next to importing images in B2M and creating your own bitmaps. Apart from some issues with the displacement map it seems to work fine


Smoke in Blender game shows as block I am  trying out blender Game and I am making an earth smash animation where there
is dust impact in circular  shape .. it works fine but in blender game mode nothing shows but a square block ...
BTW I am using bledner 2.78
thanx

Blenders Game Mode does not support smoke simulations. Or Fluids.


How to make the camera rotate while tracking the target I need to make an animation with a camera around the target

At the same time The camera Angle needs to be tilted

But I couldn't rotate the camera when I tried to use “follow path” and “track to” it

"

Just tried this and you can rotate the camera using 'Damped Track' instead of 'Track To'.


How to display the "animate property" diamond keyframe insert button (2.8x) I am making a custom panel for a rig and I would like to be able to easily insert keyframes on my rig properties the same way we can already do in the default properties panel.

I'd basically like to add these buttons:

As you can see, I already tried to implement them but I can't get them to work properly:

Q: How to implement/draw these buttons for custom properties?

UILayout.use_property_split and UILayout.use_property_decorate

Setting UILayout.use_property_split  in conjunction with  UILayout.use_property_decorate  to True, marks down the animation button. (Currently not over-documented)  My understanding is the split makes room for it, and the decorate draws it.

With developer extras on, right click > view source. Found this in bl_ui.properties_space.py giving a big hint

    layout.use_property_decorate = False  # No animation.

Quick demo with object location, using the Text Editor > Templates > Python > UI Simple Panel template

import bpy

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

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

        col = layout.column()
        col.prop(obj, "location")

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

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

if __name__ == "__main__":
    register()


Make an add-on with multiple python files I was looking through some add-ons that ship with blender so I could better understand how to use multiple files for an add-on.

I tried running the add_curve_extra_objects plugin's init.py however when I do I get this error:SystemError: Parent module '' not loaded, cannot perform relative import

So how do I specify the parent directory or get this to work?

Organize your folder structure like this:

myaddon/
├── __init__.py
├── operators/
    ├── first_operator.py

In the __init__.py do this:

import bpy

from .operators.first_operator import FirstOperator

bl_info = {
    "name": "MyAddon",
    "description": "A demo addon",
    "author": "myname",
    "version": (1, 0, 0),
    "blender": (2, 7, 9),
    "wiki_url": "my github url here",
    "tracker_url": "my github url here/issues",
    "category": "Animation"
}

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

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

In the operators/first_operator.py file, do this:

import bpy

class FirstOperator(bpy.types.Operator):
    bl_label = "First Operator"
    bl_idname = "myaddon.first_operator"
    bl_description = "A demo operator"

    def execute(self, context):
        print("hello world")

        return {"FINISHED"}

You'll have to install the addon to use it. You can't just run the __init__.py from the text editor in Blender to make it work.


What are the valid types for the type parameter in bpy.context.scene.node_tree.nodes.new(type)? I'm trying to use python to create nodes in the compositor.  Right now I want to create an ID Mask node, but there will eventually be others.

If I create an ID Mask node via the UI and ask the python console what is C.scene.node_tree.nodes.active.type it tells me 'ID_MASK', but if I C.scene.node_tree.nodes.new('ID_MASK') I get an error

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
RuntimeError: Error: Node type ID_MASK undefined

How do I learn the proper values for the type parameter for node_tree.nodes.new(type) ?

The correct type for this would be: 'CompositorNodeIDMask'.

Too create a new ID Mask node the line would be :  C.scene.node_tree.nodes.new('CompositorNodeIDMask')

If this is confusing, at least they have a pattern so you have 'CompositorNode'or'ShaderNode'or'TextureNode' plus the node type like 'ShaderNode'+'ObjectInfo'.

For the full list of node types see these links: shader nodes, compositor nodes and texture nodes


Material animations not working with property? I've used material animations and they work fine, even with properties. For some odd reason, the following construction doesn't work:

"hit_frame" works just fine. I don't know why, but the material animation does not follow it. It seems that it keeps displaying frame 1 instead of 0-10 even though the property is 0-10. How can I fix this? Thanks!

You need to activate the action actuator after changing the property. The above image shows you activate it only when setting the property to zero.

I suggest you connect the fourth controller with the action actuator too.


How to move assets with a button click in BGE I just strated using blender game engine. I m making a game in which a ball or sphere move but i want to move it by the button on the screen. Which i made in another scene by overlay with main game screen. Can any one give me idea how do it. If i press the button with mouse ball should move in any dirction.

Possible example: This will move the ball in one direction, if you press the button.
Welcome to the Blender StackExchange!

To detect the click on your button add a mouse over sensor and a left button sensor to your button. Combine them with the default AND controller and use a message actuator to send a message e.g. "moving" to your ball.
Make sure that one of the Sensors has true-level-triggering enabled, so your ball keeps moving while you keep pressing.

Catch that message to your ball with a message sensor (set right subject) and connect it with the motion you want.


Create constant length object for manipulation I am looking for a way to create a very long cylindrical object that maintains a specific length (and volume/radius) at all times.

But I want to be able to deform that object by bending it, and looping it, and so forth.

Basically a piece of string is what I'm trying to model.  I want the string to be X units in length. But I want to be able to pick it up from the middle, or the end, or loop it or even tie it up.  And have it remain the same length.

Is there any way to to do this in blender? To manipulate an objects shape, but keeping some of its basic physical size constant?

If you are looking for a mathematically perfect solution that keeps the exact length and volume of the geometry then I don't know how to achieve that. AS far as I know Blender might not even be the right tool for that job.

For a relatively accurate from a visual point of view you may use the usial Array + Curve modifier duo.

Just model a small cylinder-shaped section of your string (or whatever detaild shape you want to have) and add an Array with a fixed count of items, this will ensure the length is kept approximately constant.

On top of it add a Curve modifier, that will deform it so you can controll bending and knots without affecting length too much.

Bending will however affect lenght and the distortions will inevitable change the volume, but visually it will roughly behave as a tring


Is there a hot-key to jump between markers in the timeline? I want to be able to cycle through the frames I set markers on (I have cameras bound to each marker so these are usually the first frame in a shot). Is there a hot-key for this?

While @gandalf3's solution worked, I found it a little awkward to set up (user preferences that rely on scripts that need to be in your project, if I understood correctly), and I found that there's now a built-in shortcut adding feature on the menu:

In the timeline viewport menu, click Marker
Right-click on "Jump to Previous Marker"
Click on "Add Shortcut"
Hover over the pop-up "A" box, so that it turns into "Press a Key"
Hit your target combination, eg "Alt-Left"
(repeat for "Jump to Next")

I might be missing something the scripts in @gandalf3's answer provide, please let me know if so!


How to see the bones through the mesh? Bones are on layer 9:

I already turn X-Ray on "Bones", but bones didn't appear...

How can I make the bones and mesh become together likes this:

This came from this site.

If you want to download the file. (You have to create an account to the site in order to download it, so I upload it on Google Drive if you want to download it. The size is 2 MB.)

In 2.8, it is now called In Front. It can be found at Properties > Object Data tab > Viewport Display section > In Front.


When should I use multiscatter GGX? One of the new Cycles features in 2.78 is Multiscatter GGX.

When should I use it instead of the default? (Bonus question: and when sould I use the other possibilities in the Glossy, Glass and Anisotropic BSDFs?)

So far I found only the following

  Essentially, the improvement is that unlike classical GGX, which only models single scattering and sets
  the contribution of multiple bounces to zero, this new model performs a random walk on the microsurface until
  the ray leaves it again, which ensures perfect energy conservation.
  In practice, this means that the "darkening problem" - GGX materials becoming darker with increasing
  roughness - is solved in a physically correct and efficient way.

  The downside of this model is that it has no (known) analytic expression for evalation. However, it can be
  evaluated stochastically, and although the correct PDF isn't known either, the properties of MIS and the
  balance heuristic guarantee an unbiased result at the cost of slightly higher noise.

This sounds too technical to me. I understand the not-darkening part, but that's all...

What is it?

This is based on this paper.

  Modeling multiple scattering in microfacet theory is considered an
  important open problem because a non-negligible portion of the energy
  leaving rough surfaces is due to paths that bounce multiple times.

This effect can be clearly seen in high roughness glass, where a lot of light rays were killed because they happened to reflect on the glass itself rather than reflecting or refracting away, which you can see it the images provided by them:

Their model enable the sample (light) to bounce multiple times before being killed, Which result a more relastic and lighter result. It is also worth mentioning that this model enable more efficient energy conservation because the light will bounce till it loose all its energy.

This can be seen here, where the alpha represent the roughness of the diffuse and the glass shader:

However it doesn't really matter when the shader has low roughness since it is nearly imposible for the light to bounce on itself again, this can be seen in this shader with varity in roughness, you can see that the rough parts have a greater impact while smooth ones have almost no impact.

As for the speed of the rendering, using the multiscatter model will result only 2.5% slowdown which is pretty acceptable if you asked me.

When to use it?

Well it is pretty obvious that you should use it when you have shaders that have high roughness to avoid the dark areas. notice that the amount of darknening is directly proportional to the roughness of the shader, so if you have a semi low roughness you don't have to use multiscatter.


Why is my rendered image back? I am trying to render a model that I didn't make myself, and the result is a black shape, while the 3D view is presenting the textures correctly.

(is this is considered NSFW, let me know, I'll blur something!)

Here's what the Object Data panel looks like:

I've seen similar questions, but the Object Data textures weren't the same as what I have here.

You could have no lights in the file (and in the layer).


bright squares showing up when rendering I want to render something, but these random squares show up:

Here are some of my render settings:

(If you want to know another setting, just comment and i'll post it)
Thanks
Daniel
EDIT: I fixed it by rendering using CUDA instead of OPTIX and now there’s no random bright squares.

Light clamping when done incorrectly can be problem sometimes, I have tested different values, and 500 for both Direct Light and Indirect Light worked best.


Smoke-like transparent material How do I make a material that looks like the surface surrounding the helical objects in the image below in Cycles? It looks like smoke on the edges, but is transparent in the middle. It is important that the helical object doesn`t get distorted like if it was placed inside a glass bubble. This image was made in Cinema4D.

Original image link

Mix with Fresnel

To make an undistorted see-through effect, I'll suggets to use a Transparent shader. It will basically just make the surface transparent, without any addictional effect.

The edges looks bright despite the very dim lighting, so I'll use an Emission shader to give them some light to show indipendenly from scene's lighting.

In order to make the faces whose normal are pointing toward the camera transparent, I would suggest to use a Fresnel node in conjunction with a Mix shader node. As said in the manual's page:

  The resulting weight [of the Fresnel node] can be used for layering shaders with the Mix Shader node. It is dependent on the angle between the surface normal and the viewing direction.

The math node is used for achieve a better control of the appearence.

This is the basics of the shader. The appeareance could be obiuvsly be improved by adding, for example, a different palette to the Emission shader with the help of the Fresnel node (again!).

Here's one of the many possible shader acting in a scene similar to the one pictured in the question:


How to scale by increment? I have snap turned on and it works just fine when I'm moving an object. But is there a way to have my object snap to grid increments when I am scaling?

Just turn on "Affect Scale" in the snapping settings.

Now just hold left Ctrl and your scale should snap.


Cloth animation weird shelf The top has been pinned and cannot move. From where does this shelf at the top of the skirt come from? I guess there is some form of repulsive force. How can I reduce it? Repel is set to 0. The shell remains throughout the entire animation.

EDIT: the effect remains even if I increase the mass to 10. The skirt does not fall over, so down is down.

I changed the cloth collision parameters on the collision object that the cloth collides with from 0.008 and 0.003 to 0.002 and 0.001.

This solved the problem.


Armature shifts between Pose mode and Edit mode I'm using s Spline IK system to create the spine for a creature I'm making, but when I activated the Spline IK, some parts of the same seem to shrink or shift a bit. Which slitghly deforms my mesh a bit without even moving any bones.

Here is a GIF showing what I mean: https://www.dropbox.com/s/kmycz5s1ddka5cu/IK%20shift.gif?dl=0

Any idea on what might be causing this?

Summary

Make sure

Align origins of curves with Snap the first vertex position of curve.
you have not  repositioned the bones when you want to see standard rest position.

I believe you should either have

Separate Back spine concept and Separate Tail concept for Control concept. Fresh Start. Clear preference.
Switch direction of spine bones.  Less Preference.

The neck bones are reasonable.  The spine/tail bones are Blender Bites Ya.  Your current spine/tail is like the undesirable metaphor about the tail wagging the dog.  Note that I do not want address unrelated topics if possible, but this issue appears large.

Make sure you have not moved any bones in pose mode for the particular frame.    The point of pose mode is to place bones in different positions.

You may need to use Menu ... Pose Clear Transforms Location.  You may need to delete any keyframes.

Use the setting

Chain Offset enabled in the Bone Constraint Panel.  This will maintain the position of the root of the first affected bone.  The first affected bone will be the bone further up the parent chain as determined by chain length.

Successful use of Spline Constraint. Image above.

Additionally
For Precise placement in a different manner be very aware of your origin on the curve.

Align origin to first point on curve. Snap is used for precision. Image above.

Curve origin should be first point on curve. Be precise with the use of [Snap].  Edit mode curve, Select first point, snap cursor to selected, object mode, Transform Origin to Cursor.

It seems seems you made an effort to align with eyeball which is semi precise.  Snap is 100% precise.


Blender Cycles shows object in viewport render but not in final render I'm following a really great forest tutorial.
This is a picture of my render in the viewport. In the bottom left and right corners you can make out a little dirt texture that I've added onto the ground.

Here is the image in the final render.

In the bottom left and right corners you can see a transparency texture which means that Cycles is not rendering my ground object. The object is enabled for rendering in the outliner.

It is also checked for "show in renders" in the object properties panel

As always, help is greatly appreciated and thank you for reading my post.
Here is the blend file.

Your DirtGround object does not have the Show Emitter checkbox checked under the particle system render settings, only under the viewport settings:

If you check that checkbox, your ground object should appear in renders as well.


Keying two armatures at the same time I'd like to select and put keyframes on two armatures at the same time.
In maya I'd drag select,  and hit S to keyframe on both rigs.
In blender I'm currently having to exit one armature, enter the other, switch to pose mode and set a key.

Any animators out there that have solved this one?
Tried google searches but no luck so far

In the top header menu > Edit > You need to disable the Lock Object Modes option and you'll be able to work on the 2 armatures, both in Pose mode.


Path constraint switching and timing I am working on my character animation project.
I want to create multiple paths for my character to follow, (do action).
For Example, follow the first path from frame (x) and (do action) until the end of the path and SWITCH path instant/ delayed time and do another one.

I don't know what makes it so difficult but the Start/ End in F-curve Modifier doesn't work, is that i have wrong concept on the workflow or something else?

I recommend you for using bake animation. The follow step :

First, you set the object to follow the path by adding it on the "Add Object Constraint"
Then, you set the thing, like control the speed (actually just control the frame), direction etc
Bake animation
The switch to another path using dope sheet.

How to bake steps you could check this link :
How can a path animation be used as an action in the game engine?

Hope this help :)


How do I make this twisted surface on a bottle? I am trying to replicate the attached image, but I am stuck on the twisted pattern on the surface of the bottle. I have tried a displacement modifier with a texture with no luck. Maybe I am just doing it wrong. Or is it best to make this a part of the geometry? Keep in mind that I want to fill the bottle with some water later, so the geometry should preferably not make this impossible to get right.

What would be a good way to go about this?

I would do it this way:

Create a plane, rotate it 90° on the X axis, apply the rotation, mirror it, create your slot.
Give it an Array modifier with a Count of 8, enable the Merge option.
Give it a SimpleDeform modifier / Bend mode, with an Angle of 360°. Now it's a cylinder.
To make it twist give it a SimpleDeform modifier / Twist mode, create an empty to give it a correct origin and choose it as the Axis, Origin. Choose your Deform Angle (probably 180° and not 120° though).
Now, as you want the shape to reduce at its top, and as a simple scale with Proportional Editing risks to mess up your topology, you should use a Lattice: Create a Lattice that contains your object, subdivide it in the Properties panel > Data > Lattice, then in the same panel > Shape Keys, create 2 shapekeys, one basic, and a second that you will model in Edit mode.
Back in Object mode, give your object a Lattice modifier, select the lattice you've created as Object, select the lattice and in the Properties panel > Data > Shape Keys, put second shapekey at a value of 1. Now your object will deform according to the lattice second shapekey.
Give your object a Subsurf modifier, press Shading > Smooth in the Tools panel of the 3D view.
Once you're glad with the shape, apply all the modifiers except the Subsurf, go in Edit mode and remove the doubles to join at the 360° junction.


How to declare global variables for use in an addon that aren't stored in the blend file How can i cleanly declare and edit variables for use in an addon the don't need to be registered like a PropertyGroup but also aren't stored in the blend file?

I'm working off of the basic addon structure like so:

def boolPropVarAccess(self, context):
    # Test accessing a 'global' variable declared at some other point in the addon structure

class MyProperties(PropertyGroup):

    my_bool: BoolProperty(
        name="Enable or Disable",
        description="A bool property",
        default = False,
        update=boolPropVarAccess
        )

class OBJECT_PT_CustomPanel(Panel):
    bl_label = "My Panel"
    bl_idname = "OBJECT_PT_custom_panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Tools"

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

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

        # Declare some 'global' addon variable like an object reference

        layout.prop(mytool, "my_bool")

        layout.separator()

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

classes = (
    MyProperties,
    OBJECT_PT_CustomPanel
)

def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    bpy.types.Scene.my_tool = PointerProperty(type=MyProperties)

def unregister():
    from bpy.utils import unregister_class
    for cls in reversed(classes):
        unregister_class(cls)
    del bpy.types.Scene.my_tool

if __name__ == "__main__":
    register()

The window manager

If you set up properties on the window manager using bpy.props they are available globally for the session, are not saved and revert to defaults on next.  PRO: simple to add a UI, a lot of UI for operators uses wm.

The driver namespace

The driver namespace can be leveraged.

class Foo:
    def __init__(self, x):
            self.x = x

dns = bpy.app.driver_namespace
dns["var"] = Foo(3)

then anywhere

global_var = dns.get("var") # None if not set

Make a module

from my_module import my_global_variable

Declare a global

max_something = 10000

def update(self, context):
    global max_something

Using lists and dictionaries here often removes the need for the global declaration.

Getter Setter on bpy.props

In example in question code, if using a global instead of using update would set up properties with a get set method. See docs.

As in this example, Internal "get/set" function of property?

let the get or set methods retrieve or set your global respectively.  The set method is akin to an update in this scenario.


Access skin modifier radius data With Skin Modifier, we can "weight" a vertex (in Edit Mode) so that the resulting Skin mesh is bigger or smaller - similar to Curve objects which has "Scale Feather" adjustable.

Manually, we can hit Tab, go to Edit Mode, select Vertices, then CtrlA and drag.

However, I would like to be able to do this using Python. Does anyone know anything about it?

Reading and writing these values from Python must happen in Object mode. I added a plane and deleted one vertex, added the skin modifier and decreased the radius of one vertex.

>>> obj = bpy.data.objects['Plane']
>>> for v in obj.data.skin_vertices[0].data:
...     print(v.radius[:])
...
(0.25, 0.25)
(0.25, 0.25)
(0.08836718648672104, 0.08836718648672104)

Each element in skin_vertices[0].data has radius, use_loose, use_root to read and write. Radii can be any two element iterable (tuple, list).

import bpy

obj = bpy.data.objects['Plane']
for v in obj.data.skin_vertices[0].data:
    v.radius = 0.2, 1.2

I just realized that CtrlA lets you constrain the effect on radius per axis with ShiftX,Y.


What do this color difference stand for? I think that there must be reason for dividing tools by colors. What do each colors(green?, violet?) stand for?

Green Tools are tools that add new geometry to your model, like poly build, spin, extrude, ...

Violet tools modify existing geometry, so most of the time they change vertex locations. Smooth is a good example of that category.


Why can't I merge two vertices? I have modelled half of character and added Mirror modifier to it.

Now there are 2 vertices in the bottom that refuse to connect.

First, I can't move them by X axis towards each other for some reason. Also, I've tried every option that Alt+M has to offer but it didn't do anything.

P.S Also if anyone knows why the shading is so massive, that would be helpful too.

Merge wont work because you are selecting only one vertex, that shows up as two because of the mirror modifier, and if you try to merge it it will merge itself = nothing will happen. To join them properly just select one of the vertices and move it toward the center using the red arrow(x axis).

The blue/dark shading in your object is probably because of inverted normals, to fix it select all the vertices, press space and type "flip normals" then hit enter


Blender rendering is grey and black hello . how to get rid of this grey plane that hides my interior. in 3d view it doesnt appear but when i rendered it shows. I try to make some changes in render then camera setup.  please can anybody tell what to do.

It sounds like your object is hidden in the viewport, but not in the render. Press ⎇ AltH in the viewport to unhide all hidden objects, or examine the outliner for objects with their eye icon disabled:

The eye icon controls object visibility in the viewport and preview render, and the camera icon controls object visibility in the final render.


Importing Images as Planes I am attempting to create an image transition that appears like a "morphing" effect to use for an age progression video of my granddaughter. I found a video tutorial online that shows exactly what I am trying to do, however one aspect of his instruction does not work in my Blender (v.2.79).  He is using v.2.77.
He first imported the first image as plane (shadeless, in top perspective orthographic view). Then he added the second image in the same manner.
Next he sets the material transparency to check and Z-transparency.
In the next step, he sets the alpha to 0.5 to make the top image partially transparent so that he can see what he is doing when using shape keys to transform the image.
This is where I have the problem.  The alpha transparency does not work on my images.  I have tried png, tiff, and jpg images.  I have also changed the plane shading from texture to GLSL and enabled X-ray but nothing has worked.

I did find a work around by adding mesh planes and then using the image as a material and texture but it takes a lot longer to get to the end result. Does anyone know why my images do not respond to the change in alpha setting?

The original instructions found here enter link description here says not to check the transparency on the object panel, however if I do, it still doesn't help'

1) make sure that you are in material viewport shading mode:

2) Maybe you create material with transparency drived by texture. So goto texture tab and make sure that Influence -> Alpha is turned Off.


I made something on blender and pressed something and now I don’t know how to get back to what I was doing please help! I was working on a 3d character and I accidentally pressed something and idk what it was but now all it shows is this and idk how to get out of it and I worked on this for a long time and I would hate to have to delete it

Sometimes there are situations were it is hard to fix a UI state by hand.
In those extreme cases my favourite way is:

Save current blend-file
Open second blender instance (on OSX via Terminal https://blender.stackexchange.com/a/102862/68710)
click: File>Open
Open your first blend-file but uncheck "Load UI" (on the left panel) before doing so

now you got your first file but with startup-file-ui


Composite for shadows Works for One object but 2nd object is semi transparent (Edit: I figured it out. See last screen shot)

I set this up in Blender 2.78c but am using Blender Guru's video (blender guru for the basics for the composite.

The bottom lady bug renders great and I catch the shadow. The top lady bug renders semi transparent.

Both lady bugs are on layer 1 and are in pass 1. The cyclinders are on layer 1 and 2 and are on pass 2.

The Rendered passes look great. But, when they hit the divide mix node, it all goes wrong. The bottom lady bug is fine but the top one gets the transparent treatment.

I tried a render with the bottom cylinder moved so that the lady bug hangs off the edge to see if the bug would go transparent. It didn't. It stayed solid. The shadow shifted but I was expecting that.

So the shadow catch works on the bottom bug but the top bug is screwing up somehow.

What am I doing wrong?

Update: So, the problem was the last mix node before the composite/viewer nodes. It was set to multiply and it should have been set to Mix.


Detect and fix holes in an object (not mesh holes) I have a complex mesh that I have imported from a .obj file. I would like to check whether it is genus-0, i.e. whether there are any holes in the object. If there are such holes I need to fix them. I have tried searching by eye but it appears there must be rather small holes that are not obvious on inspection.

When I search for things like "Blender fill holes" the results appear to relate to holes in the mesh itself, i.e. involving edges that only have a single adjacent face. This is not what I am trying to do. For example, the standard mesh "Torus" has no holes in its mesh, but it has a big hole in the object itself, which is the kind of thing that I need to be able to fix.

Assuming you do have a closed, clean, manifold surface, and you're looking for the number of genuine topological holes, you could use the surface's Euler Characteristic? (You'd better get Math SE to check me up on that one) .. anyway...

Object mode, select the object, run this snippet..

import bpy

ob = bpy.context.object
me = ob.data
v = len(me.vertices)
e = len(me.edges)
f = len (me.polygons)
g =  1 - ((v - e + f)/2)

print(g)

.. and the genus is returned in g.


How to make character that can be dissolved I'm making robot for my game in Unity. Robot is based on human body and it is also rigged. Main problem is that I want to dissolve parts of the robot when it's shot, but only arms and legs.. And for example when it is shot to left leg, only left leg is dissolved and body is intact.

So model structure in unity should look like body, left arm, right arm, left leg, right leg.

Anyone can help what's the best way how to do this and rigging part?

Thanks

I think I have figured it out. Just separate the model to make objects of body parts. Rigging still works.


How do you make a lot of noise in Cycles? I have a scene where I want a lot of noise, but noise generated by cycles, so it is coherent with the colors behind. Thus, I want to generate a lot of noise in cycles without using things such as noise textures. Can someone give me tricks to have a lot of noise naturally created by cycles for a scene with a relatively small object count?

To have more cycles noise just render with less samples and have glossy materials. Make sure reflective caustics are on, that will give you fireflies.


Bone not able to be named? I have a quick question: when I was making some adjustments to my weapon, I removed a vertex group because the bone was lost (I don't know how), and I basically made a new bone. I used weight paint and set it all up, and tried to finish it by naming it the previous bone's name. It keeps adding .001, .002 (, etc) every time I try to name it. Why?

The old bone is still there it is on another layer to see all armature layers go to Properties_Editor->Data->Skeleton and select a layer (or hold shift and select multiple) :

to move the bone to another layer you select the bone from the view(if visible) or from the Outliner ,then go to Properties_Editor->Bone->Relations->layers and select a layer :


Why are video proxies faster than raw clips in the sequencer? Proxy files can be generated with downsized resolutions. Is this the only reason why they work faster? In my experience, even lower resolution videos tend to lag before being replaced with their proxies.

I think this is because of the codec the images are stored in. Compare replay speed from a video with replay speed from an image sequence. It doesn't go that fast, but at least faster than video. A video codec makes random access of certain frames that is needed for playback harder: if the compression uses data from precedent or following frames to reduce file size, Blender will need to load and decode a whole segment to read one frame. If some complicated math is used, it will slow down further.

When generating proxies, they not only have a lower resolution, but they are also in a codec that Blender can load at a decent speed (jpeg images or jpeg avi). The smaller file size allows for faster loading and keeping more data in RAM.

I think there are many reasons for proxy files being faster at playback, but to me, it's the random access to individual frames Blender gets that matters the most unless your video is 4k or your hard drive is at the other end of the world.


How can I get vertex painted .obj files to import into Blender? I have an .obj of a model that was polypainted (vertex painted) in ZBrush. I would like to import it into Blender and see the vertex painting in the 3D Viewport. Instructions for doing this in Blender Render and Cycles would be appreciated.

I have already discovered how to export a .wrl file from ZBrush and import it into Blender following the following workflow:
-Export the model from ZBrush via Zplugin>3D Print Exporter>VRML.
-Enable “Import-Export: Web3D X3D/VRML2” plugin.
-Import the .wrl file, set Shading Mode to GLSL, enable Textured Solid and set the 3D Viewport to Solid shade mode.
This can also be accomplished with the ZBrush PLY import-export plugin.

I would like to know (if it is even possible) what the workflow is for doing this with an .obj file so that I can see the vertex colors like I can see them when opening the .obj in TopoGun or 3D-Coat. In either of those programs I don't have to set up materials or nodework (if it were possible) in order to make vertex painting visible and so that is what I am seeking here, just as it works with a .wrl file but using an obj.

june 2015:

Vertex Colors are not part of the .obj file type specification - see section on Geometric Vertex.

However some programs use an unofficial extended format for inter-change and add r,g,b information on the same line as the vertex coordinates.

# standard format (v: x y z)
v 1.0 1.2 0.3

# extended format (v: x y z r g b)
v 1.0 1.2 0.3 0.5 0.2 0.2

Blender's .obj importer ignores everything after the x y z, therefore at this moment vertex colors are not parsed in any form.

If there was a color map (vertex colours) associated with the mesh, you'd  see it listed in

menu: Properties -> tab: Data -> subheading: Vertex Colors

If there's nothing there then there's nothing to show.


How do I rig this so the wings are symmetrical? How do I rig my flying machine so the wings can be flapped symmetrically? I'd like to have it so that when I move one side, the other moves as well.

Video

In Edit mode, copy your "wing_L" bone with the Symmetrize function to automatically create a "wing_R" bone.
Switch to Pose mode, select the right wing and give it a Copy Rotation constraint.
Copy the exact same setup as the one on the screenshot: Enable X, Y and Z axis, enable the Invert option of Y and Z, choose Space > Local Space / Local Space.
It should work.

You could also simply, in Pose mode, copy the left bone pose with ctrl and paste to the right bone with ctrlshiftV. Just don't forget to insert a keyframe for the right bone (i).


How to get smooth & low-density wireframe Hi guys I'm trying to constrcut a web using the wireframe modifier. I hope to get a smooth contour so a subdivision modifier was added before wireframe modifier, and this is the result:

However I don't need such a high density of the wireframe. So is there any method to selectively solidfy some of these wires?

OR how can I smooth the wireframe below (without subdivision modifier)?

Hope my question is clear...
Any relavant suggestions or solutions are appreciated! Thanks ><

If you throw a "Decimate" modifier in "Un-subdivide" mode (shown here: 2 iterations) in-between the Subdivide and Wireframe Modifiers, I think that gets roughly what you described.


how to make mesh faces look smooth? I am a amateur to Blender but I want to make a model for my sims game. However, I want to know how I can make faces smooth? As in not have them look blockish / crinkly... if that makes sense. I need a smooth interior and exterior (excluding the shelves). I tried subdivsion surface but that just makes the mesh look all doughy... anyways, thanks in advance!

Right click to access to Object Context Menu and Shade Smooth (or header menu > Object > Shade Smooth). You can change the angle threshold of smoothness in the Properties panel > Object Data > Normals > Auto Smooth. But the whole shape will still look angulous on its borders, if you need to round it for real you need to give it a Subdivision Surface modifier (and apply it if you want to import into a game engine).


Rocket engine thrust. Point density node? I'm trying to create a futuristic missile/rocket seen where a missile is flying with exhaust spewing from it's tail. I thought I figured out how to make a cool looking blue exhaust by using a particle system coupled with a point density -> emission -> volume node setup on a pyramid shaped domain, but I'm having some odd behavior.  When the missile is flying straight up it looks great:

However, when the missile continues to fly and turns to the side this exhaust/particle system setup looks funny.. almost like a cardboard cutout, and only takes up a portion of the needed volume:

My node setup for this material and particle system is as follows:

Has anyone stumbled across similar issues? I want this exhaust to be full and uniform across the entire domain instead of this half volume weirdness.  I have tried increasing the particles and messing around with other particle settings to no avail.

This is most likely a problem with Vector space. From your screenshot you are using 'Object' space but this will move along and distort with the location, rotation, scale of the domain object. As the missile moves and drags the domain (I presume it's parented to the missile) the coordinates will change. To resolve this try changing to World coordinates as shown :


Japanese in text object I can't seem to type or paste Japanese characters into a text object. Is there a way or is is this just a known deficiency or bug? ありがとう。 Thanks!

It seems like you just need to select a font that has japanese characters. I downloaded NotoSansJP-Regular font and it seems to work just fine. With Text object selected in Object Data Properties (The a tab) under Font you can select the font you want to use.


Limit the selection to the visible object (in object mode) If I have one object hidden behind another, clicking the visible one multiple times in Object mode alternates the selection between the two. Is it possible to turn this behaviour off, and make the selection stick to the visible object regardless of how many times I click it, similar to Limit selection to visible in Edit mode?

You're talking about this button in edit mode?

No, I don't think there's an object mode equivalent. I don't see how it would be very useful, however, what's the problem?


camera different position/view on render I position my camera close to my object. In "Camera Persp" I see my object very close. This is what I want.
Now when I hit F12 to render my object, but it always renders from a wrong distance/position further away.

What setting might I have accidentally enabled?

F12 always renders the active camera. If you want to move active camera to current viewport position, press Ctrl+Alt+Numpad 0.

After that, you may want to press Shift+F to fine tune the camera view.


2.8 sculpt sphere creates stars? I'm using the grab tool in sculpt mode on a sphere in the latest 2.8 build. I'm trying to stretch out the top but for some reason it automatically stretches out in 5 directions, creating a star shape. what is this and how do i turn this off?

At the top right corner, you have a topdown menu called "Symmetry/Lock". In that menu you should have three options called Radial X Y Z like on that picture

From what I can see on your screencap, you should have Radial X set to 5 like on the picture, try setting it back to 1 and you should be able to sculpt normally

Hope this helped


How do I use shape keys and bones for a Facial Rig? I want to try my hand at a more professional style facial rig but I am not sure how to go about it.

This is a fairly broad question, So I'll just outline the overall workflow and the reasoning. I also assume you are already familiar with basic rigging concepts including bones, shapekeys, drivers, constraints and weight painting.

Firstly you need to understand the pros and cons of bones vs shapekeys:

Bones generally create better intermediate shapes as they generate a curved path for the vertices to follow and the maths for blending between each other is already built in. However, they are much trickier to create very specific shapes as you have limited control of how a bone moves vertices.
Shape keys can create any shape that you can model, but you have to manually specify how to combine them using drivers, and the vertices move in a linear path between the basis and the shape, so intermediate poses can look often odd (although sometimes this is desirable).

In general you want to create a rig to support your basic movement with bones, and then use shapekeys to correct the pose in various positions. These shapekeys should then be controlled using drivers based on the bones positions.

To create a bone rig for a face you will probably want to add the following:

A bone to control the jaw motion, this can be a simple bone that you rotate to open and close the jaw, or a much more sophisticated setup as you become more advanced
A bone for each eye to control the direction that they are looking. These bones should pivot around the center point of the eyeball. The damped track constraint can be used on these with a target object or bone to give a controller that you can drag around as the position of the eyes' focus
Bones for each eyelid that rotate around the pivot of the eye bones. These allow the eyelids to follow a curved path so that they don't clip through the eye.
Various bones simulating facial muscles using the stretch to constraint to provide volume effects. These can either point to controller bones and/or be parented to other bones to allow posing and accurate movements. Making these bendy bones can get better curving effects like real muscles. Setting these up is fiddly, so I suggest you look at some other facial rigs for examples.
A chain of a few bones to control the tongue.

For shape keys you will probably want at least the following:

Corrective shapes for the eyelids opening and closing, as just bones generally won't give quite the right shape at the extreme poses
(corrective) shapes for mouth expressions and phonemes. The number and setup of these will depend on what you have done with face muscle bones previously, and it is possible to do these poses with only shapekeys and no bones if you wish.
(corrective) shapes for eye and brow expressions. The number and setup of these will depend on what you have done with face muscle bones previously, and it is possible to do these poses with only shapekeys and no bones if you wish.

There is plenty more details about each step and small tips and tricks to achieve different effects, however they are all better off as their own specific questions.


Should i clear the seams? When I go to texture models I sometimes notice small black lines from the seams I created during the process of UV unwrapping, I figure the logical course of action would be to clear the seams, but I'm not sure, Should I?

I would advise against it. In the case that you need to adjust your UV map, you would have to start from scratch. If it is distracting you, you can toggle the visibility of seams.


Object Appering in preview mode but not in renders I'm Trying to render a box on top of a video that ive tracked in the 3D viewport everything looks fine but when I render the frame using f12 the geometry is missing from the rendered image.

I'm Pretty new to blender especially 2.8 so if there is anything missing please ask me and im going to put it in the post.

Per my comment above, you should first check if the Disable in Renders toggle is Enabled or Disabled. You can find this in the Outliner, which will appear in this area (circled in red) of the default workspace:

If the Disable in Renders toggle indicates that the object should be rendered, then the problem may be more complicated. This seems like the most likely problem, though.


Speeding a video by 5x and triming it I want to

A: trim a section out of a video (the jitter when I pressed record) and delete the trimmed section.

and

B: speed the remaining part of it up by 5x

Any help would be appreciated. I can add more details if required.

First of all, I can really recommend mikeycalmeyers videos on youtube. He has a whole series exlaining how to do video editing with Blender.

To answer your question, there are multiple ways to trim:

Option 1) Select your video and audio by holding shift and right clicking on them. Then put the green marker at the moment in time where you want to make a cut. From the menu just below your video sequence editor (the one with the tracks) choose Strip > Cut (soft) at frame, or press the shortcut key K. This will split it into separate parts, so you can delete the parts you want to remove.

Option 2) Select the arrows on the left side of both your video and audio tracks by holding down shift and right clicking them. Then you can move them by pressing G and moving your mouse. For precise control use your arrow keys. When you moved it to the right location press enter.

To speed up your video:
Select (only) your video track with a right click. Then go to the menu in the video sequence editor and choose Add > Effect strip > Speed Control. Then on the right side uncheck Stretch to input strip length, set speed factor to 1 and multiply speed to 5 (or any other speed you like). You will need to drag the arrow on the right side of your original video track (so not the speed control) to match the new duration of your video track. Changing the speed of audio does not work this way, so I would use Audacity to change the speed and then import it into Blender.


What's the best way to extrude and expand complex objects? I would make this mesh's extrusion be at about a 45° angle instead of a 90° angle.

Taking the bottom vertices and scaling them kind of gets what I want, but many vertices go the opposite direction that I want them to go, because every vertex is moving in relation to the center of the object:

How can I make the bottom vertices go like this?

To scale something in the direction of the normals, you can use Alt + S

Using this tool, you can fatten a model or make it more slender.

For a model that has many thin parts that are close together like this one, there will likely be some overlapping parts when you fatten it so a bit of manual work will be needed to clean it up.

Using a LICEcap screen-capture .gif I show an easy way to clean up the overlapping edges.  I'm using the circle select tool C to select all the edges then with the selection tool still active use MMB to deselect the surrounding edges leaving only the one which is not visible.  That one edge  is not visible because it's facing directly in and out of the screen and the display cannot handle that situation but the line is still selected even though we can't see it.


Light issue when joining two objects? I'm fairly new to Blender (and modeling in general), and I have an issue that occurs when trying to join two objects! I'm trying to attach a weapon to the hand of a human, but when I do so, the lighting for either object messes up completely!
I've done this before with similar models without this issue ever happening, so I can't figure out why it does so in this case! I would really appreciate it if I could get some help on this matter! :)

Lemon and Aoradon, you solved my problem! It appears it was the mirror transform I had used that somehow caused this problem to occur! Flipping it back and applying all modifiers/scales/etc. before copying it in and joining it with the other mesh, completely solved my issue!

Thank you guys very much :)


Controlling volume density How can I control the volume density values at different locations in a mesh with volume shaders?

I know that noise textures can be plugged in to the density factor slot of a volume shader (producing a sponge-like effect as in the example below) for instance, but what other ways are there to control the density pattern inside a mesh? Are there ways to achieve more controlled/less random patterns?

Yes, you can use any set of 3D values (e.g. procedural texture) you want (note that this means you can't use image textures. This is because you need the texture to be defined in 3D, and of course a image texture is 2D.
See the wiki for a list of cycles textures with descriptions.

The density is controlled by the value (brightness) of the texture.
Consider this node setup:

Where the texture is white (1), the density will be 1. Where it is black (0), the density will be 0.

Because a density of 1 is still very faint, I have added a multiply node to scale the white portions of the texture to 20 instead of 1:

As an example for non-procedural texture information, this setup will make the density based on the global X location of the object (with some math nodes to avoid volumes with negative density):


How do I resize nodes in the node editor? How do I make my nodes smaller? My nodes currently look like the top one, but a node from someone else's .blend file look like the bottom one. How do I make mine look like the bottom one? I can resize them horizontally, but not vertically.

I figured it out, click top right icon which looks like material icon. This will collapse render layer preview thumbnail and make node smaller.


Object's attribute that says if object is still or moves? Is it possible to know if an object moves or not with python in Blender? Is there any object's attribute/state/other that gives this information?

EDIT: Here I speak of movement in world space. More precisely, if the world positions of the vertices of an object don't move between two frames, I consider the object doesn't move. If the camera moves but the objects don't, then their world positions shouldn't change and I consider they don't move.

I saw some answer using Blender Game Engine with an active object, but I just use a rigid solids simulation in Cycles.
EDIT bis: My goal is to know when the objects in the simulation are in their final state basically.

Example: a wrecking ball breaks a stack of cubes. Some cubes fall, and after some time they stop sliding on the ground: the object's state should tell me that now they are "inactive". If they get hit by other falling cubes, then their state should change back to "active", until they "stabilize" again.

Thanks !

Here is a simple setup with script that displays the velocity vector of the active object and an indicator of that vector's length: http://www.pasteall.org/blend/31772

If you run the modal operator and start the playback, you'll see how velocity changes, but that it never settles to completely zero. Thus, use some epsilon (tolerance value), such as
min and max out of 30 samples from diff vector lengths < 0.1
(use a collections.deque(maxlen=30) for that, it's a capped array)

At the core of the script, I access Object.matrix_world.translation to get the current location in 3D world. Note that you need to .copy() this vector if you want to store the start vector, otherwise it will be an alias and the difference therefore zero.

It could be made a bit more efficient if one used an app handler (frame_change_post).


How can I create pre-rendered animated sprites with Blender and use them in Godot game engine? How can I generate an animated pre-rendered sprite in Blender like in the 2000s games like Age of Empires, Commandos, StarCraft and then use them in Godot game engine? The animations played must change depending on the key inputs.

Note: for this demonstration I have used the character Akai E Espiritu and the animations Idle (looking left and right) and Standard Run from https://www.mixamo.com/. The animations were exported in FBX at 60 FPS.

Note 2: it is possible to use pre-rendered sprites in a 3D view, it is called an Imposter Card. It is useful on assets like fences and wood planks bridge like in Rayman 2. And also for characters (they can be animated), trees and building far away like we often see in car games. In 3D you won't need to render the lighting information but the color, roughness, metallic and a normal map. More informations: https://youtu.be/YvOhIFnAa8U
You can also use Billboard, it's 2D images always facing the camera,you can use Sprite3D or AnimatedSprite3D for that in Godot.

Download the Godot project and the .blend used to generate the sprites: https://drive.google.com/file/d/1Pqz6iRkdhgR2prsMmH_R-S-cnmXkqxNu/view?usp=sharing

Benefits of using pre-rendered sprites

Those types of games age very well because they use realistic lighting, shadows, material and have smooth interpolated animations. To remaster them the only thing necessary is to increase the screen resolution setting, if the sprites becomes too tiny the sprites just have to be be re-rendered at an higher resolution and the source images overwritten.
You get a good result and can fake a top down 3D game, it is ideal for an RTS, MOBA, adventure game, top down shooter and more.
Very low system resources are required, this allow to display thousand of characters on an old computer and even a mobile device at the same time. A basic AI would take more computing power than the animated sprites.
You save a lot of time, you can create very smooth animations at 60 FPS and get every angles. You have nothing to draw.
You can edit your animations, models, shaders then re-render it to overwrite your image files.
If you are making a plateformer you will only have two directions to render or a single direction if your sprite and animation are symmetrical allowing to quickly implement your sprites and actions.

Games that use(d) this technique

A lot of Real-Time Strategy games (Age of Empires II, StarCraft, Diablo II, Ceasar III, Red Alert, Heroes of Might and Magic..) and Real-Time Tactic games (Commandos, Desperados, Robin Hood) and some adventure games (Heart of Darkness, Toy Story), RPG (Final Fantasy VII), some SNES games (Donkey Kong Country, Killer Instinct, Toy Story) used this technique. This technique was mostly used in early 2000 when the power of computers were limited.

At that time almost all the best looking 2000s isometric games were pre-rendered and today they often look better than most 3D games because they allow to get almost an infinite amount of details as long as the texture resolution allows it: https://www.kotaku.com.au/2013/03/the-best-looking-isometric-games/

They often age very well. When Donkey Kong Country showed the first pictures of the game, the journalists thought this was a sneak peek of the new Nintendo 64 and it looked better than almost all the 32 bits games available at that time.

BLENDER PART

Cycles render will be used to generate the sprites.

Ground with shadow catcher

You need an invisible ground used to catch the shadows projected by the sun. Add a plane, scale it by 10 and center it (Alt + g). To make it invisible but catch the shadow go in the Object tab of the property panel (the icon is a cube) and at the bottom in Cycles Settings check Shadow Catcher.

Asset settings

Your model must be above the ground and all your animations must loop.

It is important that you animate your asset in different actions and not pack all your animations in the same timeline. This will later allow to play all the actions at once to position the camera correctly because once the camera will be positioned it will need to keep the same coordinates for every other sprites of the same asset.

Duplicate your character and set a different action in each layer, this will allow to switch between animations by enabling a layer.
Use the first layer for the ground and sun, this layer will always be enabled to bake your sprites.

Render settings:

Add a sun for his orientation I recommend you to set it completely vertically, it will allow you to make the shadows fit in the sprite more easily to avoid having to unzoom (and make the sprite more pixelated) and to flip it for the movements on the side if the asset and animations are symmetrical. If you want to use an angle for the sun use a small angle, like 35 degrees maximum. I recommend you a strength of 100 for the sun.
Enable the Sky Texture with a strength of 10.
Enable Filmic in the Scene tab of the property panel, Color Management and View.
Enable transparency in the Cycles render settings, Film and check Transparent.
The direct lighting must not bounce, this is to avoid to get a noisy shadow or large shadow area on the ground that could get out of the camera border. In the render settings, in Light Paths use the Direct Light preset.
I do not recommend you to enable denoising because black pixels could appear, instead increase the samples if needed.
Set the render samples to 200 minimum.
In Output set the file format to PNG 8 bits RGBA and set the output path, you can add a prefix like Heroe_ (I explain bellow how to organize your folders).

Camera settings:

Set your camera in orthographic view mode and the render resolution. For a retro game style or a game where the assets are displayed from afar like a strategy game or simply to save space and memory you can use a low resolution. I will use a render setting of 64x64 for my character, do not forget to set the percentage scale to 100%.

On most isometric games the camera angle is like this:

X: 60
Y: 0
Z: 0 or 45

I recommend you to keep the Z axis at 0 degree to render your character with different orientations and 45 for your building.
For your character you can generate a sprite oriented in 4 directions by incrementing the Z rotation of the camera by 90 degrees or in 8 directions by incrementing it by 45 degrees.

To place your camera center it with Alt + g, go in Camera view with the key 0 of the numpad, press G to move it then press your middle mouse button and drag the mouse to the bottom to move it backward. This is just to make your asset visible, to unzoom change the Orthographic Scale in the property panel.

Add an empty at the center of your scene and make it the parent of the camera (select the camera first, then the empty with shift then press Ctrl + p and click on one of the setting).

To know the best position for your camera display all your animations at the same time by pressing Shift on the layers to open them. Set the animation frame when the character does a long movement like for example the leg behind when running. Rotate the empty and check if everything is visible in the camera border, don't forget to check the shadows too by enabling the rendered view.

After that change of key frame and check another action of the character with a big amplitude like an attack with the hands or sword forward. The border of the camera from the previous action must not be changed, you can only unzoom and move the camera slightly.

Folder structure

Create your folder structure directly into your game's folder, for example from the root of your Godot project.

You can put all those folders inside a GFX parent folder:

-> Sprites

--> Characters

---> Heroe

----> Run

-----> Down

-----> Left

-----> Up

-----> Right

If you use 8 directions don't forget to add those folders:

-----> Down Left

-----> Down Right

-----> Up Left

-----> Up Right

Render the sprites

Important: do not render the last frame of your animation so your character can loop correctly.

Enable the first layer which contain the ground and sun only and enable the layer of the character action you want to  render.

Click on your rigging to see the number of frames used and set it at the end frame of your animation.

Click on Animation in the render properties or press Ctrl + F12 to render it.

Each frame will be saved and each time you will switch back to Godot the sprites will be imported or updated.

GODOT PART

Import settings

In Godot select all your sprites with Shift, in the Import tab uncheck Filter or set the preset to 2D Pixel. The filter blurs your image, it behave like an anti-aliasing to avoid flickering but if you have used a low resolution and don't want post-processing for a retro style looking game or simply want to display the source images untouched I suggest to disable it.

You can also get a bit more anti-aliasing by increasing the render samples.

Using the sprites

Add a KinematicBody2D with two children: the AnimatedSprite node and the CollisionShape2D. For the collision use a Circle shape on the feet of your character. Don't move anything excepted for the AnimatedSprite node, this is because your sprite must be  to get his correct Y position in order to fix the visibility of it (in the "Fixing the depth" section).

The sprites with the collision looks like this:

Create different animations, to nae them indicate the action and the direction like this: "runUpLeft". For 8 direction here are all the actions you should get (you can use spaces):

idleDown
idleDownLeft
idleDownRight
idleLeft
idleUp
idleUpLeft
idleUpRight
idleRight
runDown
runDownLeft
runDownRight
runLeft
runUp
runUpLeft
runUpRight
runRight

Do not forget to set the correct frame rate and to check if loop is enabled or not.

The script

In the script create a direction string variable it will allow to keep the same direction for the idle action after running.
Add a speed variable, to adjust his value use the running to the left or right sprite and try to match the legs with the movement speed so the character doesn't slide.
A motion variable is use to move the character, it is a Vector2().
The motion variable is equal to the multiplier time the speed. The multiplier is in each input condition it is used to set the direction and to reduce the speed. In up and down the speed is halfed because in isometric the scale ratio is equal to 2:1. In diagonal we reduce the speed by 1/4, so it is 1*(3/4) = 0.75 for Y and 0.5*(3/4) = 0.375 for X.

Here are the vectors multipliers:

In each key input condition we must indicate that the other keys must not be pressed at the same time or multiple actions will try to be played at the same time.

The script looks like this:

extends KinematicBody2D

var speed = 12500
var direction = "Down"

func _ready():
    Input.set_mouse_mode(2)

func _physics_process(delta):

    var motion = Vector2()

    #Run

    if Input.is_action_pressed("ui_up") and not Input.is_action_pressed("ui_down") and not Input.is_action_pressed("ui_left") and not Input.is_action_pressed("ui_right"):
        direction = "Up"
        $AnimatedSprite.play("run" + direction)
        motion = Vector2(0, -0.5)

    if Input.is_action_pressed("ui_down") and not Input.is_action_pressed("ui_up") and not Input.is_action_pressed("ui_left") and not Input.is_action_pressed("ui_right"):
        direction = "Down"
        $AnimatedSprite.play("run" + direction)
        motion = Vector2(0, 0.5)

    if Input.is_action_pressed("ui_left") and not Input.is_action_pressed("ui_up") and not Input.is_action_pressed("ui_down") and not Input.is_action_pressed("ui_right"):
        direction = "Left"
        $AnimatedSprite.play("run" + direction)
        motion = Vector2(-1, 0)

    if Input.is_action_pressed("ui_right") and not Input.is_action_pressed("ui_up") and not Input.is_action_pressed("ui_down") and not Input.is_action_pressed("ui_left"):
        direction = "Right"
        $AnimatedSprite.play("run" + direction)
        motion = Vector2(1, 0)

    #Run in Diagonal

    if Input.is_action_pressed("ui_up") and Input.is_action_pressed("ui_left") and not Input.is_action_pressed("ui_down") and not Input.is_action_pressed("ui_right"):
        direction = "UpLeft"
        $AnimatedSprite.play("run" + direction)
        motion = Vector2(-0.75, -0.375)

    if Input.is_action_pressed("ui_up") and Input.is_action_pressed("ui_right") and not Input.is_action_pressed("ui_down") and not Input.is_action_pressed("ui_left"):
        direction = "UpRight"
        $AnimatedSprite.play("run" + direction)
        motion = Vector2(0.75, -0.375)

    if Input.is_action_pressed("ui_down") and Input.is_action_pressed("ui_left") and not Input.is_action_pressed("ui_up") and not Input.is_action_pressed("ui_right"):
        direction = "DownLeft"
        $AnimatedSprite.play("run" + direction)
        motion = Vector2(-0.75, 0.375)

    if Input.is_action_pressed("ui_down") and Input.is_action_pressed("ui_right") and not Input.is_action_pressed("ui_up") and not Input.is_action_pressed("ui_left"):
        direction = "DownRight"
        $AnimatedSprite.play("run" + direction)
        motion = Vector2(0.75, 0.375)

    #Idle

    if motion == Vector2():
        $AnimatedSprite.play("idle" + direction)

    #Make the character moves
    move_and_slide(motion * speed * delta)

    #Quit the game with escape

    if Input.is_action_just_pressed("ui_cancel"):
        get_tree().quit()

You can improve the script by creating a string variable called "state", the variable will have the string "walk" by default and the string "sprint" will get assigned while the key Shift will be pressed. You will need to replace the prefix "run" of the script by the variable.

You can also add a timer, when a key is pressed the countdown is reseted. When no key are pressed and the countdown reaches 0 you can add an extra animation, like the character sleeping or dancing (or one of both with a randi() % 1).

The result

Fixing the depth (sprite in front of another)

In a top down 2D game, bellow is closer to the camera so a sprite bellow another must appear in front. By default the sprite visibility priority is set by the Z index then the position in the node hierarchy.
To set the sprite bellow on top of the others you just have to add all your sprites as a child of an YSort node. You can eventually add them as a child of a TileMap node an check Y Sort.

TIPS

Adding contours

You can add contours in the compositor by plugin the Alpha output of your image to a Filter > Dilate/Erode node. Use a negative distance, then multiply it with the original image with a Color > Mix node. You can then render the animation, the contour will be added automatically on every images.

Use 4 directions

Instead of 8 directions use 4 directions only, do not use the diagonal inputs script. This will also divide by two the amount of sprites used in your project.

Low game resolution

To get a retro look you can reduce the resolution of the game and keep this resolution in fullscreen mode. For that go in Project > Project Settings, in Display > Window and divide the 1920x1080 resolution by the same number to keep the same aspect ratio. For example 640x360 by dividing by 3.

Check the fullscreen button. At the bottom at Stretch change the Mode to "2D" and the Aspect to "keep".

You can also use the camera zoom setting but decreasing the game resolution in the Project Settings slightly improves the performances.

Low framerate

To reduce the framerate you will need to reduce the animation scale to delete keyframes and will need to rebake your sprites.
Before starting duplicate your original animation in a backup folder because animation data will be lost.

Select your rigging, in the graph editor go in the first frame, select every frame with the "a" key then press S then the number you want. If your source animation is at 60 FPS and you want to reduce it to 15 FPS you will need to divide the scale by 4, so type 0.25. With a scale of 0.1 the framerate will be reduced from 60 FPS to 6 FPS, ideal for a Game Boy type of game. Again do not render the last frame especially in low framerate or your character will do a long pause between the last and first frame.

Don't forget in Godot to set your animation at the same framerate.

8 to 256 colors

You will need to download a batch processing image to import all your sprites and reduce the indexed colors between 8 to 256 colors. SNES games used 16 colors (15 colors + alpha) and old PC games like Age of Empires II used 256 colors (255 + alpha).

You can use Positioned dithering (because for retro game look because less efficient) or Floyd-Steinberg dithering to improve the color transition.

A software you can use is XnConvert: https://www.xnview.com/en/xnconvert/#downloads

Once you have opened it, do Add folder, you can add the entire Godot game project if you want to change every images.

Go in the Action tab, you will find the Color Depth in Add action > Image > Change color depth. You can also find presets in Add action > Misc > Retro.

Once it's finished click on Convert.