Script to fix texture nodes after importing a file When I import an fbx, it has image textures that should be linked from their Alpha socket to Principled BSDF's Alpha socket, but right now link goes from texture's Color to Principled's Alpha, like this:

I tried to write\find a script that would loop through every material and do this:

Find Image Texture node and get the name of a texture used, since I don't know their names
Replace Color -> Alpha link with Alpha -> Alpha link

Every thread I've found about Image texture nodes creates a new node for this and then adds an image. Tried doing it like this, creates an eternal loop:

import bpy
nodes = bpy.context.active_object.active_material.node_tree.nodes
links = bpy.context.active_object.active_material.node_tree.links
principled = nodes.get('Principled BSDF')

    for obj in bpy.context.scene.objects:
        for s in obj.material_slots:
         if s.material and s.material.use_nodes:
          for n in s.material.node_tree.nodes:
           if n.type == 'TEX_IMAGE':
                image_node = nodes.new('ShaderNodeTexImage')
                tex = bpy.data.images.get(n.image.name)
                image_node.image = tex
                links.new(image_node.outputs[1], principled.inputs[18])

Loop the materials collection

Loop over the material collection. Need only do this once per material, rather than for each object that uses the material.

Search for links from tex node to bsdf and from color to alpha socket, if found unlink old, make a new link, and print the image name.

import bpy

for m in bpy.data.materials:
    if not m.use_nodes:
        continue
    print(material.name)
    node_tree = m.node_tree
    links = node_tree.links
    # list comprehension to find those links
    tex_ps_links = [l for l in links
            if l.from_node.type == 'TEX_IMAGE'
            and l.from_socket.name == "Color"
            and l.to_node.type == 'BSDF_PRINCIPLED'
            and l.to_socket.name == "Alpha"]

    for l in tex_ps_links:
        # print tex node image
        texnode = l.from_node
        if texnode.image:
            print(texnode.image.name)
        else:
            print("No Image")

        from_socket = l.from_node.outputs["Alpha"]
        to_socket = l.to_socket
        # make the new
        links.remove(l)
        links.new(from_socket, to_socket)
        # remove the old

Blender scripting connect nodes

Also note this one, where it maps socket index to name.  When playing around with languages noticed the names can be in a different language, eg Color in Spanish will fail the node.outputs["Color"] name lookup.

https://blender.stackexchange.com/a/160069/15543

eg instead of name test used above, if we know a socket number eg "Sheen Tint" is 11 could look for l.to_socket == l.to_node.inputs[11] instead of l.to_socket.name == "Sheen Tint"


How to render material with alpha channel seen through material with halo I'm using Blender Internal, and I have a scene where an object is placed inside a mesh with halo material to simulate being in a spotlight beam.

(part of) the object looks like this:

And it has a material with alpha channels:

During a quick pre-render with z-transparency enabled, it looks like this:

which is alright, but I would like it to be affected by the halo.

Switching transparency to raytrace makes it looks like this:

which is exactly how I want it to look like, except for the glaring problem - parts of the texture that are supposed to be transparent and, for all intentions and purposes, invisible, are now refracting light which I do not want at all.

Beside enabled alpha, the material in question also has a specular map that controls object's highlights and mirror values, but disabling those doesn't fix the problem.
The halo material also has a texture to it.

My question is - with Blender Internal, is it possible to achieve the look of raytrace transparency with halo affecting opaque areas of the object behind it, but keeping the transparent parts of the texture completely invisible like with z-transparency?

there is very simple answer: Halo can't be cast through alpha. It only works with geometry. So you have 2 options, fist one is to edit the geometry, second one is not to use halo.
I know that this answer isn't what were you hoping for but at least you know that it's not possible using BI.


How can I inprove my render image quality, even used denoiser too I have used denoiser, resoluton 1080x1080 px, render300, but still image looks blury when I zoomed it in.

The resolution and the amount of samples you used are not particularly high. The simple answer is: if you want more quality, you should increase the resolution and samples. If you tried something like 4096x4096 resolution and 2000 samples, the image will become a lot clearer.

You will of course inevitably face exactly the same issue almost every single one of us face pretty much constantly - your render times will increase dramatically. There is a solution to that none of 3d artists like to hear about - just buy better/more hardware, or use render farms. SheepIt is great for example, because it's free in a sense you do not need to pay money, but you still need good hardware to constantly render projects of other people so you collect points and can get yours rendered quickly when you need it.


Rendering file wont appear Im trying to make a cycles rendering test with HDRs but when i render an image it doesn't appear in the specified folder.

Here are some screenshots:

When you render images they don't export themselves to a folder, you have to do that manually. Just use the shortcut Shift + F3 (with the mouse hovering over the render in the UV Image Editor) and navigate to the folder you want the image to export to.


Mesh freaking out when moving bones So, I recently got into Blender and so far I'm having a lot of fun, even though it's really, really complicated. I've stumbled upon a few problems so far but most of them I have been able to solve. Expect for this one.

I'm testing my skills by trying to make a human, and right now I'm learning how to rig. I created the arm bones so far, but theres only one weird problem that I'm having. When I move the lower part of the arm, The whole human freaks out, as seen below:

Now first I though this had to do with the weight map, but after painting the body like this;

I still get a result that looks close to the previous image. As you can also see in the previous image is that it looks like as if the body exists of 2 inside each other (One part of the stomach stays still, the other one moves). However, when I look in edit mode there are no double edges, so im quite confused.

Does anyone know what causes this? Any help is much appreciated!

My .blend file can be found here:

This happens because couple of the vertices has very small weighting to the bones. So avoid this you need to select your mesh, then enter edit mode then select these vertices and set the weighting to 0 for the two bones as shown below:

This will fix the problem as shown below:

Updated .blend file can be found here:


How to tag a redraw in all viewports? I've designed a modal operator that changes the geometry of a mesh when the user clicks and drags the mouse.  I'm able to see the geometry update in the viewport I'm dragging in by tagging a redraw with
    def modal(self, context, event):
        context.area.tag_redraw()

However, this does not affect other viewports so I cannot see the updated geometry in any other viewport until I finish my operator and mouseover the other viewport.  Is there any way to tell Blender to updates those viewports right away?

Figured it out.  This seems to work:
    def modal(self, context, event):

        for area in bpy.context.screen.areas: # iterate through areas in current screen
            if area.type == 'VIEW_3D':
                area.tag_redraw()


Why do I keep getting a 'No faces filled' error when using the Face-fill tool? I'm new to Blender (yes, I'm working on a donut) and I'm trying to get my head around the Face-fill command.

I cleaned up an SVG of a logo and imported it to Blender, then converted it to a mesh. Now I'd like to create faces from the logo so I can extrude it and use Boolean tools to essentially 'cut' the logo into a shape. No problem with the part of the logo which was originally just a vector shape drawn in Illustrator and passed to Inkscape. The part of the logo which started as text is a total nightmare, though. I was trying to do it with the F (create face) command and it was creating faces without leaving holes (as in letters like 'b' and 'a').

Reading around in the Blender 2.82 manual I discovered the Face-fill command. I even created a shape similar to what the manual shows (by adding a single vertex then extruding it numerous times and setting Snap to Vertex, thereby creating the required continuous perimeter). It just gives me the same (sorry, useless) error 'No faces filled'. Does anyone have any idea how to go about filling more complex vector shapes made up of many vertices?

I ran into a similar issue but was mixing up the "Make Edge/Face" (F key) command, and "Fill" (Alt F keys), "Make Edge/Face" was working


How to fix horse spine? sorry I can't think of a better way to phrase this question.

I have been working on a horse walk animation for quite awhile now. I am pretty inexperienced with rigging and animation in general, but I am quite familiar and comfortable with Blender as a whole.

Following various image references & video tutorials I have the horse legs working in the way I want.

Edit: Link to armature & keyframes

Now to make Horse really shine, I want to animate his spine bouncing with him. Following this reference image  I can see the stages where his spine should move to certain places, but my rig doesn't transform the way I need it to.

The biggest issue is when I try to make his butt go down, it makes the whole front half of him shoot straight up into space.

I've tried to re-rig it quite a few times, but I am getting the feeling that I am missing something to make it work the way I need. Is it possible I need to use an IK Constraint from the Back to front? I haven't seen anyone use a method like that, but I am very confused on how to approach this problem.

So, considering how your armature is made, you should parent InverseKack and Spine02 to SpineCTRL. At the end, parent SpineCTRL and all the IK controllers and targets to the root bone. Now when you move up and down SpineCTRL, the whole back of your horse follows, as it is supposed to do.


Python Scripting, add hotkey with map type Mouse? I want to add a hotkey by script. The regular Addon tutorial mentions how to add a normal hotkey. But i need a Map Type Mouse, left mouse button, with holding down a modifier key. And i run into trouble here.

My current code is

kmi = km.keymap_items.new("view3d.paint_select", map_type = 'MOUSE', type = 'LEFTMOUSE', value = 'PRESS', key_modifier = 'I')

And i get this error:

TypeError: KeyMapItems.new(): was called with invalid keyword argument(s) (map_type), expected (idname, type, value, any, shift, ctrl, alt, oskey, key_modifier, head)

map_type is missing in the expected list of keywords. But where else should i put it then? Is map_type not part of KeyMapItem?

Shift+LMB example to toggle Properties > Scene > Simplify:

import bpy

# operator
class ToggleSimplify(bpy.types.Operator):
    bl_idname = "view3d.toggle_simplify"
    bl_label = "Toggle Simplify"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        context.scene.render.use_simplify = not context.scene.render.use_simplify
        return {'FINISHED'}

addon_keymaps = []
# register
def register():
    bpy.utils.register_class(ToggleSimplify)

    # handle the keymap
    wm = bpy.context.window_manager
    kc = wm.keyconfigs.addon
    if kc:
        km = wm.keyconfigs.addon.keymaps.new(name='3D View', space_type='VIEW_3D')
        kmi = km.keymap_items.new(ToggleSimplify.bl_idname, type='LEFTMOUSE', value='PRESS', shift=True)
        addon_keymaps.append((km, kmi))

# unregister
def unregister():

    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

    bpy.utils.unregister_class(ToggleSimplify)

if __name__ == "__main__":
    register()

Also see: https://www.blender.org/api/blender_python_api_current/bpy.types.KeyMapItems.html


If Blender API document doesn't provide enough information of a function or class, what should we do? I ran into a fundamental problem in blender scripting. That is how to use the API document.
When I ran into a function I don't know, basically, I will check the document to understand what that is.
For example, some code employ

layers = tree.nodes.new('CompositorNodeRLayers')

Then what is that layer used for?
Ok, let's check the API doc. However, it only gives what members are in that class but never introduces what this class is used for eventually or give any examples.
https://docs.blender.org/api/blender_python_api_2_78_1/bpy.types.CompositorNodeRLayers.html

After reading this doc, I still have no idea what is that or how to use that.
What is the input of that node and what will be the output?

So in such situation, what should we do? How to learn blender scripting by refering this API document?

Thanks.

The API is for the programmatic options and things.  What is happening in that line of code is a new node is being created of the type 'R_LAYERS' in the Compositor. In short, it just makes a Render Layers node. To know more about the node, you would need to look in the manual, not the API. Render Layers Node


Can I use an image sequence with offset frames as a texture on array items I'm creating an animation of a film bed with a film strip running through it. The film strip is basically just an array object with a curve modifier. What I want to do is use an image sequence for the material that is being tiled along the array object, and offset 1 frame for each duplicated array object. Thus giving the effect of moving images on the actual film strip.
I hope this makes sense, and I'm just assuming that this is a python requirement, as I can't think of anything to do it with in the Blender toolkit.

Instead of using the the Array modifier

Link the material to object.
Create a individual linked duplicates.
Select the duplicates, Object | Make Single User | Materials+Tex (or UT)

You might want to setup a nodegroup first to make future changes to the material easier.

Now increment the texture offset for each material.


Reverse armature deformation on vertex in python I have a mesh with armature modifier (active+posed) and wish to do some modifications with vert coords (after armature deformations) saved in shape key on that mesh. But currently it seems not possible - shape key contain coords before modifiers and armature can change each vertex in unpredictable manner. So to save final coord back into original mesh coord (on each vertex) - i have to revert armature deformations some how… and this seems to be generally impossible //

In other words - for every given vertex coord, after all deformations (armature) and after applying some custom movements i need (i can calculate them only on final mesh) that i need - i need to calculate ORIGINAL coords (that can be saved in shape key) so they will give me my final position after applying armature.

Interestingly enough, Sculpt mode manages to do this somehow - you can sculpt posed mesh with active shapekey and it will put into shapekey proper position related to undeformed mesh. Not the coords that can be seen on screen.

Is it possible to do the same in Python? May be there is a way to do “sculpted translate” for vertex, that will do all the revert magic? any suggestions welcome

Answering own question: Ended up by applying deformations as displacement with custom texture AFTER armature… shapekey is essentially just a displacement for verts, after all, and making this displacement after armature make more sense. and easier to implement (just baking verts shift into packed image)


Is it bad to stretch/rotate your quads? I am currently learning how to model (fresh noobie here). To do this I am undergoing a project that is way over my head: Modelling a female body (I removed all nudity from images in this post).

I making progress; however, I have noticed one major difference between my model and an incomplete model from an cancelled tutorial. (Unfortunately I only learned it was cancelled several hours into it XD).

If we look at the most up to date version of the model from the tutorial, you can a lot of squares that seem to avoid rotating or stretching. They are, for the most part, all in similar size and aligned rather straightly on the various axises. There are exception of course for the more unique areas, like the shoulders.

Now if we look at my model...
I ended using a lot more curving and rotated my quads. I don't really have similar sized quads throughout the entire model and a lot of them rotate a fair ways which dis-aligns them with the various axises. While my model is still incomplete, I felt like that area was pretty close to completion.

I ended doing this because I felt like it followed a better flow with the female body. In the particular area of my screenshot I thought it goes better to define the bones at the top of the waists. See the screenshot at the bottom for a visual reference.

Is there a particular reason why the modeler from the tutorial might want to emphasize on the similar sized quads and not rotating the quads as much? Or is it just an individual modeler's preference?

Is there any "bad practice" views on how I've been making my model?

I am NOT looking for opinion/preference based views. I am looking for answers that are backed up by generally accepted "good practices" and "bad practices".

Faces are generally shaded better if the quads are less distorted. They are also better for subsurf and animation. Best practise would be avoiding distortion (parallelogram shape) but not rotation.

Take a look at "face topology". I find it very helpful to get an idea how to approximate a surface with quads best as possible.


Blender => Unity Export, UV Coloring I have struggles with Importing my Blend to Unity with the Colors i mapped it in Blender.
In Blender the Colors are the way I want them.
I can get the Object in to Unity, as an Object,
in Unity I either  get a Blank Object or complettly misscolored Object.
My Object in Blender

This is the Method I used to color my Objects,
using the UV Editing.

When Imported to unity the UV colors are wrong.

I have Tryd the Folowing things:
Creating a New Simple Cube With same UV Editing method to see if problem persists.
With the ressult being exact the same Problem that was in Unity as with my Modell.
Tryd editing the Material Tilt and Offset in Unity to correct the Colors
wich only changed colors without finding the Color arrangement I was searching for
Importing the .blend File trough Drag and Drop to Unity
Importing the .fbx file and tryng to add the Material after adding the empty Modells
I also tryd messing with diffrent setting whilst exporting
Restarting everything
When I open the exported .fbx file in windows everything is normal as it shoud be.
These are some atempts I tryd, I woud realy Appriciate help,
for I have been tryng to find a sloution over the last 6 Houres,
reading all over the Internet and looking up tutorials for a solution.
Thx in Addvance
-Josh
(Sorry for bad Grammar)

Problem was Solved,
The .fbx file was all fine
In Unity I Created a new Material and Dragged my Texture file,
from the UV Editing onto the Albedo of the Material.
After That the Colors will be wrong, so you need to change some settings of the Texture.
Compression => None,
Filter Mode => Point(No Filter)


Breaking an environment into multiple objects I'm completely new to Blender and wanted to gain some experience with the software. As my first project I decided to recreate an entrance to a underpass that's close to where I live.

The walls from the structure are mostly continuous so I'm not sure on how (or if) should I break them into multiple objects. I tried leaving it as a single giant object but I don't know if it would give problems when adding modifiers (as I'm looking forward to round the wall edges a bit).

I also thought about breaking it down it like so:

But it still feels like the objects are too big, and since everything is a single scenario I don't know if it's really a good idea to break it down to multiple pieces. What should I do, and if there's no concrete answer, what are the pros and cons of each method?

I'm an advocate of breaking meshes up. There are numerous reasons that I feel this way:

Not many objects in real life are solid chunks.  Maybe concrete walls to a certain extent, but even those tend to have seams to allow for movement and expansion so they don't crack.  Seams will add realism.
When your object starts to get large and/or complex, the mesh topology can get weird in places.  For example, I would guess you have a lot of extra edges where the stairs connect with the walls.  Those edges wouldn't be needed if the stairs are separate.
It's way easier to UV/unwrap smaller, simpler objects than it is with large complex objects.  Similarly, it's a lot easier to assign materials to whole meshes rather than selecting individual faces.
Even as separate pieces you can still group the objects together in Blender so you can move them as a unit, so keeping them together doesn't really give you much of an advantage there.

That's mainly what I can think of off the top of my head.  I hope that's helpful!


Remove inner wall on thin shell model with complex geometry Is there an easy way to remove the interior wall on a model with complex geometry? The model was imported from an STL file for a object which is very large, but has very thin walls. One of the walls needs to be selected, then deleted in the edit mode.

Note: Using the mesh selection tools requires a huge number of steps to separate the mesh.

Maybe your inner mesh have different Normals, try selecting one of them and go to Select > Select Similar > Normals

And then see if it selects them all


How to change the appearance of an object? Often in the tutorials I watch, I see that the objects have a dark color as if the scene was slightly underexposed. I like it because you can see the details of the object(s) better. However, when I open Blender the objects are shown with a "bright" color, as if overexposed. The picture below shows what I get:

As you can see the edges of the cuts are barely visible. I've found out that if I select the "cavity" and "shadow" boxes in the Viewport Shading menu, I obtain a better visualization, close to what I often see in tutorials. The picture below shows what I mean:

It's much better and I don't have to strain my eyes.

My questions are:

Is this the right way of doing it, to improve the visualization of an object?

Is there a way to have Blender applying the "cavity" and "shadow" options automatically rather than having to do it manually every time?

Thanks.

Stay safe

Davide

You can turn on Shadows and Cavity Shader from the Shading Popover to the right of the 3D View Header while in Solid viewport shading mode.

You can also simultaneously combine those with different matcaps that give objects different colors, studio lights, or random colors for each object. If those aren't enough you can also base object colo from the assigned materials, or even a specific per-object color.


Help with transfering items to rig This may have been answered in another post, is so simply direct me to that post. (I had a pretty hard time searching for it)

Here's my problem- I've been trying to transfer (or move, not yet any good with terminology) the shoes I've modeled for my character to the rig so that when I move his foot, the shoes will move with it. But every time I do, the shoes become off set from where I modeled them. (pics will be posted for better example) Does anyone know why this is happening?? Its probably a simple issue I'm just missing.

It looks like you did't add the Armature Modifier to the shoes. You need the armature to deform the shoes, using same vertex group names you used for feet.


How to call rigify operators? I'd like to run some rigify operators. As you might know, the operators are "unique" for each armature because of their rig_id. If I have the rig_id = "i8fj1rbnfbd76bf5" then it takes the following syntax to call the operators:
bpy.ops.pose.rigify_limb_ik2fk_i8fj1rbnfbd76bf5(prop_bone='thigh_parent.L',
                                                  pole_prop="pole_vector",
                                                  fk_bones='["thigh_fk.L", "shin_fk.L", "foot_fk.L", "toe.L"]',
                                                  ik_bones='["thigh_ik.L", "MCH-shin_ik.L", "MCH-thigh_ik_target.L"]',
                                                  ctrl_bones='["thigh_ik.L", "foot_ik.L", "thigh_ik_target.L"]',
                                                  extra_ctrls='["foot_heel_ik.L", "foot_spin_ik.L"]')

bpy.ops.pose.rigify_limb_ik2fk_i8fj1rbnfbd76bf5(prop_bone='upper_arm_parent.L',
                                                  pole_prop="pole_vector",
                                                  fk_bones='["upper_arm_fk.L", "forearm_fk.L", "hand_fk.L"]',
                                                  ik_bones='["upper_arm_ik.L", "MCH-forearm_ik.L", "MCH-upper_arm_ik_target.L"]',
                                                  ctrl_bones= '["upper_arm_ik.L", "hand_ik.L", "upper_arm_ik_target.L"]',
                                                  extra_ctrls='[]')

I was thinking of concatenating the id with the rest of the syntax and converting that into an operator call that I can execute. Is that possible or what alternatives do I have?

I think you can use Python's exec() or eval() to do this, if the operator is already registered
import bpy
rig_id = "i8fj1rbnfbd76bf5"
op = eval("bpy.ops.pose.rigify_limb_ik2fk_" + rig_id)
# or with exec
# exec("op = bpy.ops.pose.rigify_limb_ik2fk_" + rig_id)

# now you can call op
op(prop_bone='upper_arm_parent.L') # and rest of arguments


How to emit particles at intersection of faces (Scan animation) I want to make an animation that explains laser scanning. It will consist of two videos.
One of the videos is rotating duck with a laser on it.
You can see the animation here. The animation is by me and the first of the two videos is already done.

https://media.giphy.com/media/iDJOi8TmgXrHKRQuoA/giphy.gif

The other is supposed to be a sort of point cloud that is generated by the scanning laser from the first video. So wherever the laser hits the rotating duck, there should spawn points.

What I have tried so far:
I tried to make the point cloud with a particle system. It worked well except that I could only generate points over the entire duck faces and not only at the "laser line". Ideal would be to have an emitter that is the intersection between the rotating duck and a face.

I hope I stated my question clearly.
Thanks

Material
Dot pattern texture with appearance controled by Radial Blend texture.

Laser line is shrinkwrapped line, just for illustration, you will use your laser :)
Particles
They looks better, since there is not a deformation on surface curvature. I wanted to use the same Radial blend texture as factor for Emission, but I had some dificulties to get it work for particle system. So here is a version with particles emited from Shrinkwrapped line of vertices suggested by Rich Sedman
Works nice like real one in term - light string follows surface and keeps empty places where light cant touch surface (like in tail part).
Issue is distribution. I wasnt able to set even release particles from vertices.


How to handle modal operator events in a single loop? When writing a modal operator, handling each event runs the 'modal()' callback which handles a single event.

While this makes sense, its not always convenient compared to a simple loop that consumes events (local variables need to be stored in the operator and restored every time, and you can't use flow control (break/continue) - for example).

Is there a way to handle events for a modal operator in a Python loop?

psudo-code example:

def modal_loop():
    for event in modal_events():
        # handle event
        if event.type == 'ESC':
            return {'CANCELLED'}

        if other_test:
            break
    return {'FINISHED'}

Note, this question is a little contrived. Since it should be possible using some of Python's coroutines, posting here since its probably a useful reference for others too.

Yes, Python's coroutines can be used make the operators callbacks interact with a generator.

Here's an example of a generic re-usable operator mix-in class, and an example usage.

See modal_iter function for an example of how (invoke, execute, modal, cancel) can be handled from within a single generator.

import bpy
from bpy.types import Operator

# -----------------------------
# Generic Modal Iterator Mix-In

class ModalIterOperator:
    """ Defines Operator callbacks (invoke, execute, modal, cancel).
        Sub-classes only need to define `modal_iter` generator.
    """

    def invoke(self, context, event):
        self._iter = iter(self.modal_iter(context))
        self._iter.send(None)
        result = self._iter.send(event)

        if 'RUNNING_MODAL' in result:
            wm = context.window_manager
            wm.modal_handler_add(self)
        return result

    def execute(self, context):
        return self.invoke(context, None)

    def modal(self, context, event):
        return self._iter.send(event)

    def cancel(self, context):
        self._iter.send(None)

# ----------------------------------
# Example of ModalIterOperator Usage

class MyIterTest(Operator, ModalIterOperator):
    bl_idname = "wm.my_modal_iter_operator"
    bl_label = "My Modal Iter Operator"

    # -------------------------------------------
    # Entire modal operator in a single function!

    def modal_iter(self, context):

        event = yield

        if event is not None:
            # -------------------------------------
            # Section typically handled by invoke()

            print("Operator.invoke(..., event=%r)" % event.type)

            # Check we would typically do inside invoke()
            # to see if we want to exit, or continue and run modal()
            if event.type == 'ESC':
                yield {'CANCELLED'}
                return
        else:
            # --------------------------------------
            # Section typically handled by execute()

            print("Operator.execute()")

            # We may want to cancel the operator here too.
            if 0:
                yield {'CANCELLED'}
                return

        # ------------------------------------
        # Section typically handled by modal()
        event = yield {'RUNNING_MODAL'}

        while event is not None:
            print("Operator.modal(..., event=%r)" % event.type)

            if event.type in {'RIGHTMOUSE', 'ESC'}:
                yield {'CANCELLED'}
                return

            # ------------------------------------
            # Main modal operator logic goes here!
            # ------------------------------------

            event = yield {'RUNNING_MODAL'}

        # cancel may be initiated externally
        if event is None:
            # -------------------------------------
            # Section typically handled by cancel()
            print("Operator.cancel()")
            yield  # --> None, since we're closed externally
            return

        yield {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.wm.my_modal_iter_operator('INVOKE_DEFAULT')

Notes:

None of the return's in modal_iter are needed, since the way the generator is used these points will never be passed anyway. I've added them in so as to be clear whats happening and so any accidental iteration past yield {'CANCELLED'} will raise a StopIteration exception, which intentionally isn't handled.
This code example may seem overly verbose, this is done for completeness.In practice you may not need all of the callbacks (cancel or execute for eg).
This article was used in writing the example above.


Blender 2.8 Command Line: Errors on running script I am looking to run my python scripts using the command line. So far, I have confirmed I can open blender using the command line, and I can open a specific file as well.

The issue comes when I attempt to load a script. I seem to always get the following error:

OSError: Python file "C:\Program Files\Blender Foundation\Blender\genererate_tears.py" could not be opened: No such file or directory

I would imagine I have some missing reference, but I have not been able to find anything where someone else solved this issue.

Here's what my my command line looks like

C:\Program Files\Blender Foundation\Blender>blender -b H:\Blender3d\ScriptingPractice\scriptingpractice.blend -P genererate_tears.py

Essentially:

[Blender.exe] _ [blender file with script] _ [syntax to run python] _ [python script isnide of .blend file]

I have tested the rest of it without the script part, and not running it in the background, so I'm pretty confident it's just the script reference

and according to this post https://developer.blender.org/T60330 it isn't an issue with older versions?

Thankyou @RobertGützkow for your help!

The solution was true that I needed to have a python-specific file (outside of blender) that I could run.

To do this I

1) created a new Text.txt file
2) named it the same name as my script (optional)
3) copied and pasted the code into the text.txt file
4) rename the text.txt --> text.py
5) add the text.py file path to the code.

Here's what mine looked like :
(with the command prompt pointed at blender)

C:\Program Files\Blender Foundation\Blender>

blender H:\Blender3d\ScriptingPractice\scriptingpractice.blend -P H:\Blender3d\ScriptingPractice\genererate_tears.py


How to deactivate the red lines I am following a tutorial to create a 3D model. Then I accidentally pressed a button and the edges turn red. It is hard to see and how can I deactivate it? Thank You.

With default theme, these red lines are seams (cuts for UV unwrapping).

To get rid of it, in edit mode: select all and clear seam.
A
U then "clear seams"


A mishmash of questions about lighting and messing with parallel line textures I'm brand new to Blender (and 3D modeling). I'm attempting to use it to duplicate this graphical style (not my work):

I've created my terrain, and experimented with a variety of node tutorials to produce a series of lines. This is my current node setup and resulting render:

I have four questions:

How do I remove all the shadows from the final render so I only see my white and black lines and nothing else? – I've killed the lamp and set the material to emit (this was the only understandable way I could find to remove shadows), but I still see gray areas in the final image.
How would I get the lines to stay a constant width? – They currently get thicker as they run over terrain sloping perpendicular to them. I'd like to see a version with a constant line width, if that's possible.
Is there any way to introduce an element of randomness into the lines (shake, spacing, or thickness), so they look more hand drawn?
How would I get the render to show perspective? – I want the perspective to be more pronounced so the lines closer to the camera look spaced out more than the lines in the distance. I expect this is a camera setting but I find the camera stuff rather confusing.

Thank you for all and any help you can offer, and sorry if I've posted too many questions in one go.

-- Dunstan

#1 I think you got the general setup right, you use an Emission Shader node down to the Light Path node, but made a mistake in your setup. Down the nodetree you later mix the emission with a diffuse defeating the purpose. Also your node tree seems overly complicated, and unnecessarily convoluted for the setup.

#2 As Jerryno already mentioned, it is not trivial to do with material nodes alone, but see bellow.

#3 Add a Noise node to your texture coordinates, use a Color Mix node to control the amount of noise you add to the coordinates. Some scale change is to be expected, so compensate the size.

#4 Camera settings like Focal Length will dictate the perspective

Alternatively if you want true constant width, and don't mind a geometry based solution, convert your terrain to a mesh, select all the edges in one direction, and erase everything else. Convert it to a curve then use the Bevel Depth property to add constant thickness.


Does changing the fps change the speed of the animation? I had created animation in blender 2.76 with sound effects, at 30 fps, and rendered it at 60 fps. However, when I saw the rendered result, the video was faster than the sound. Does increasing the fps while rendering a video increase its speed? If yes, will simply rendering the animation at 30 fps solve the issue? If no, how should I solve this problem?

Generally, the keyframes (as the name indicates) of blender animations are based on frame numbers instead of absolute time. So if you render an animation that has been created with 30fps in mind at 60 fps, the video will be half the length.
If you really want it to be 60 fps and you do not want to redo the whole animation, you could make use of the "time remapping" parameter (https://docs.blender.org/manual/en/latest/render/output/settings.html), as described here for example: How to render an animation at a higher framerate?


Complete newbie, all vertices moving instead of the 3 I selected, not proportional editing https://youtu.be/tt-Y8rPOPHE?t=70
I'm trying to follow this video having never used Blender to model something before, and at 1:12, he selects 3 vertices and drags them to the upper left. The rest of the object stays the same. When I try to do it, every other vertex moves, to a lesser extent. After some googling, I can tell you it isn't 'proportional editing'. I can find that option and see that it's not on and if I do turn it on, the other vertices move noticeably more. This is what my scene looks like before and after the transformation.

This is a cube with a Subdivision Surface modifier. I have Blender v2.82.7

I hope the info I've given is helpful, please let me know if you want pictures or info from another tab. Be explicit about how to find it, because I don't know what anything is.

The reason you're seeing that effect is that you have the 'On Cage' option selected for your subdivision surface modifier.

What this option effectively does it it allows you to work on the result of the subdivision surface on your mesh in edit mode, as opposed to the mesh before the subdivision surface.

Since the subdivision surface moves vertices based upon the positions of their surrounding vertices, when you move a vertex with 'On Cage' active, you also move surrounding vertices.

Simply toggle off the indicated button, and you should see the wireframe of your cube in Edit mode, and be able to move one vertex at a time again.


How do I Inset a face equally? How can I inset/extrude a face, so that the outer faces have the same width?

Any kind of help is appreciated

Apply Scale to your mesh first in object mode.

Ctrl+A >> Scale.

Now try Inset faces again with I.


smart uv unwrap creates duplicate (not overlapping) uv mesh segments I scan a bust of someone and get an xxx.obj file and a texture file. The mesh is too dense and also needs repair so I make a separate obj file to repair. During the repair it loses the texture.
I bring in the original mesh and the new mesh, align them (ether in meshlab or visually in Blender). I remove duplicates in both meshes. Then I unwrap the new mesh using smart UV unwrap. Then I bake the original texture to the new mesh.

Besides finding overlapping UV meshes (fixable), the issue is that there are more than one UV face for certain areas. I get duplicate individual faces and duplicate multi-face areas in the uv map.
The resulting model has bits of the shirt color in the face and vice-versa.

When I select the troubled faces in the editor view, multiple separate areas in the UV image map light up. When I paint the face, the shirt gets bits of the skin color, etc. I can't seem to delete the bad duplicate faces in the UV mesh.

Is this a problem with Blender 2.72 or am I doing something wrong - and how to I fix this?

Thanks for your help.
B

UPDATE: I've uploaded a blend file at  . I've created  completely black testuv.png file an as soon as you open the blend file, you'll see the mesh and the UV editor panel.
Notice that two faces are selected on the mesh edit panel and on the left two completely separate pairs of UV faces are highlighted.  This occurs many times after doing an unwrap using Smart UV Project..
Notice that I painted the face area red and see how many red triangles there are in other parts of the mesh.
I do see areas of overlapping mesh but I can fix those manually. I can't seem to separate the duplicate UV meshes or delete them.
You can re-do the unwrap and recreate the problem.
Thanks.

These are not not duplicate face they are vertices shared between these faces and are highlighted on both of them and that's because you are using vertex select mode if you switch to face select it will be clear

something to note about UV mapping :

each vertex has a general index obj.data.vertices[index] and loop indecies (one or more ) obj.data.loops[loop_index] which is used in the UV mapping so each vertex can have more than one UV coordinates in the UV map. UV coordinates are obj.data.uv_layers[UVmap_index].data[loop_index]

in a nutshell when UV mapping you are dealing with faces not vertices

UPADATE:
The problem is with UV unwrapping which is producing scattered face from different regions  and the low resolution texture image you are painting on ,after using texture paint on the face only :

you can see that the paint spreads to different regions and that's because of :

UV unwrapping ( small spacing , and scattered faces )
Texture low resolution (compared to the mesh density )

what you can do is :

unwrap again with larger margin
use higher resolution texture

OR:

try another unwrapping method

Note :

you may want get ride of the extra vertices using Remove Doubles ,
you can paint texture directly on the mesh with Texture paint mode


Python: Imported Curve points lose Z coordinate in Edit Mode I'm trying to use bezier curves for editing paths of a custom game file format.

A weird bug (?) when switching to Edit Mode makes the bezier spline points lose their Z coordinate, it being set to 0, and I have no clue why.

Here's the code that simply creates a new bezier curve, adds a spline with enough points and feeds it the coordinates of the control points and handles.

# Create a bezier curve object representing the Path.
cu = bpy.data.curves.new("Path", 'CURVE')
ob = bpy.data.objects.new("Path", cu)
self.context.scene.objects.link(ob)
self.context.scene.objects.active = ob
# Add the points to a new spline.
sp = cu.splines.new('BEZIER')
sp.use_cyclic_u = path["IsClosed"]
points = path["PathPt"]
sp.bezier_points.add(len(points) - 1)  # There is already one point in new curves, so add one less.
for i, point in enumerate(points):
    pt = sp.bezier_points[i]
    pt.co = vector_from_dict(point["Translate"], invert_z=True)
    pt.handle_left = vector_from_dict(point["ControlPoints"][0], invert_z=True)
    pt.handle_right = vector_from_dict(point["ControlPoints"][1], invert_z=True)
# Lock the transform as paths are always in the global coordinate system.
ob.lock_location = [True] * 3
ob.lock_rotation = [True] * 3
ob.lock_scale = [True] * 3
return ob

def vector_from_dict(dictionary, invert_z=False):
    # Game file format is right handed with Y up, convert accordingly.
    if invert_z:
        return dictionary["X"], -dictionary["Z"], dictionary["Y"]
    else:
        return dictionary["X"], dictionary["Z"], dictionary["Y"]

As said, this imports fine and looks well at first. Hence this path of birds flying around the palm trees and above the house ceiling in the front:

But as soon as I enter Edit Mode, the path drops down to the floor, the Z coordinate of all points has become 0 (0 is far below the game model)!

It's indeed just Z losing its value, I imported the path again without editing it this time, making it very clear - the correct one is above, the one with the edit attempt lieing flat below:

Going back to Object Mode keeps these "corrupted" coordinates! What is going wrong here?

The file format itself is stored as binary, but also nothing special, and a Path in it can be represented as dictionaries and arrays like this:

{
    "IsClosed": True,
    "PathPoints":
    [
        {
            "Handles":
            [
                {"X": -2374.132, "Y": 2985.336, "Z": 2211.747},
                {"X": -2318.274, "Y": 2964.664, "Z": 1901.128}
            ],
            # Can't import Rotate since no Blender support for bezier point normals =(
            "Rotate": {"X": -2.684734, "Y": 0.167497, "Z": -3.044649},
            "Translate": {"X": -2346.203, "Y": 2975, "Z": 2056.438}
        },
        {
            "Handles":
            [
                {"X": -2277.908, "Y": 2960.383, "Z": 1596.964},
                {"X": -2294.248, "Y": 2989.617, "Z": 1175.442}
            ],
            "Rotate": {"X": -2.808016, "Y": -0.1063031, "Z": 3.136256},
            "Translate": {"X": -2286.078, "Y": 2975, "Z": 1386.203}
        },
        # ... and so on for each point ...
    ]
}

I'm not much into scripting or coding and now very little about Python myself, so apologies if this doesn't fix your problem, but I believe this is happening because your bezier curve seems to be in 2D mode (in your first screenshot), hence when entering edit mode it will automatically ignore any Z coordinates that it should not have in the first place.

Set your bezier curve to 3D either through the Properties Window > Object Data (Curve) > Shape > 3D or using the Pyhton API through bpy.types.Curve.dimensions setting it to 3D


Moving bones out from a center point I am trying to move these bones out from a center point (the center platform). I'd like to animate them moving out from the center platform (center platform doesn't move. All of the squares are separate objects and the bones are connected to their respective platform. I also parented all of the bones to the center one.
I'm currently stuck trying to figure out how to move all of them out in pose mode. I tried searching and found a couple things to try involving the pivot point, but they don't seem to work. I just end up scaling up the platforms instead of actually moving them away from the center point.
Any help is greatly appreciated! Thanks bros

there are 3 steps to this:

scale with all selected and center one being the active element


Unable to install add-ons to Blender 2.82a and Blender 2.9 on a Mac I am at total loss and YouTube/Google offer nothing to solve this issue.

I downloaded the .zip file for Edge-Flow Master from Github and there is no way to actually install the files.

I've opened up Blender 2.82a and 2.9a) and go through the usual route of opening

Edit>Preferences>Add-ons ensuring Official/Community/Testing are active then click on Install an addon.

I then navigate to the folder in my Downloads but all that is there is; Pyhthon scripts, a doc folder containing jpg and psd files, a License text file and a Readme Text File (neither of the latter will open on my iMac 2011)

I've gone through clicking on each possible python script and clicking install and nothing happens.  So I searched YouTube and there are very few helpful videos or websites going through the process, but I did find one very very annoying video that eventually got to opening Blender in a finder window using Show Package Content then navigating to the addon via Contents>Resources>2.82>Scripts>Addons and then I copied the files to this location rebooted Blender and yet still nothing when I search for the addon proving it's not installed.

So just how am I to install addons to Blender without a .zip file to install from (Apparently it just dumped the files to my download folder I assume it unzipped itself in doing that)?

I don't know enough about addons or python to know how to properly get Blender to recognise these files there's no installer and no .zip file and directly coping the files to the addon folder does nothing.

So I am at a lost.  I've used Blender years ago but I don't remember if I ever came across this issue before, or maybe I did but have forgotten.

I'd like to purchase some modelling addons but I'm not laying down hard cash until I can resolve this addon installation propblem. This isn't the first addon Ive had this problem with I also downlaoded WrappingTools - same issue, no way to install it.

The installation process is detailed under the GitHub page and is the same as most if not all add-ons.

Download the zip file from the releases page. Open Blender, open up Preferences, click on Add-On tab, press Install and select the zip file. You'll then be able to find the add-on listed as Mesh: EdgeFlow. I tested it. It works.


Why Does This Happen? I just want both sides to lift up like the one on the left so that I can make a cool paper airplane folding animation. I tried with a plane and got the same issue. I even tried using two loop cuts in the middle and putting them right next to each other.

Update:
It may be hard to see but the little dots that indicate the middle of a face are in a bunch of weird spots.

You have overlapping faces in your model. You need to delete the ones you don't want.

If you use the dots in face select mode as a guide, it should be hard to find and delete them.

It looks like you may also have duplicated vertices, so I would suggest also using the remove doubles tool on your model to get rid of them.


How do I get my -Project from View- image back in Blender v2.83? We're doing a Motion Tracking project in class and we had to use Project From View for the UV on the building we intend to create the VFX meteor explosion, but when I went back into the Blender v2.83 file to continue my work, the picture is only a pink rectangle? (See below)
Since it's a school project, I can't move into any higher versions of Blender, but need to work within this v2.83 only. Also, we're in Spring Break, so I'm unable to ask my teacher how to fix this, but I need to complete it this week.
If anyone can help, please do, this is really the only part hanging me up as I do understand the rest of the assignment.  Thank you.

That pink color means “missing.” The blend project cannot find the source image. Try using “find missing files“ and going to the new location of the image, or trying to put it back where it was before.
If the image or video clip is small, sometimes I pack it in the blind files so I can move it about without having problems.


Addons failing in 2.79 daily builds, here is the error Some addons like Cubesurfer and Animation Nodes are failing to initialize in latest Daily Builds of 2.79, can someone tell me how to solve this?

Here is the error:

Traceback (most recent call last):
  File "D:\3D\BlenderBB\blender-2.79.0_10_12_2017\2.79\scripts\modules\addon_utils.py", line 331, in enable
    mod = import(module_name)
  File "C:\Users\jgea\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\cubesurfer__init__.py", line 39, in
    from cubesurfer import mciso
ImportError: Module use of python35.dll conflicts with this version of Python.

Cheers

Both Animation Nodes and CubeSurfer are compiled addons and subsequently only work on the operating system and python version they were compiled at.

Prior to blender 2.79.x (nightly builds now), all blender versions used python 3.5, thus almost all Animation Nodes and CubeSurfer builds used python 3.5 to compile. Now that blender uses 3.6, all those builds will fail to work just as you experienced.

Solution

You will have to compile your own builds using python 3.6 or wait for the developers to release new builds.


How to modify width of "wire" material type I'm struggling to model my objects into a 90's retro vector style, with the wireframe and low poly look.

Freestyle won't render in a game mode, and it seems to use a tremendous amount of time just to render simple black outlines around my mesh faces.

It seems if I create two materials, one as "wire" and the other as a surface - it does the trick, however it's only 1 pixel thick, and seems to get lost.  When I pan around different angles, the matte material seems to take over the wireframe material.

Does anyone know how to modify the thickness of that wire attribute in the materials?

I don't want to create a whole different mesh object for the wireframe effect, that the blender previewer seems to handle gracefully by default in preview mode. The render animation seems to do a whole lot of extra work to render frames, and all I want is a retro 90's cartoon, and possibly do something in simulator / game mode.

Apart the Z offset setting shown in another answer, there are at least other 2 ways to render that wireframe: freestyle and wireframe modifier.

The first draws stylized lines over the resulting object after all rendering finish. You can customize the lines styles and where to apply them, like:

The second method can be used with two copies of the object: one gets the usual colored material, the other has the wireframe modifier, and gets another material just for the wire mesh to display, and you have some degree of editing for  the wireframe "style"

here you see how the wireframe is really a separate object, I scaled it up a bit...


Background script only works when BGE player stops I want to run a thread in the background of the BGE, that retrieves accelerometer data from a LoPy, and uses the values to rotate the object.

For now, the code I have can only receive and print the data in the console, however the thread itself only runs when I exit the blender game engine. This is my code:

print("---------------------------------------------")
print("Begin collection")

import serial, threading, keyboard

port = 'COM5'

def acc_data(ser):
    while True:
        if keyboard.is_pressed(' '):
            print('The script was interrupted!')
            break
        raw = ser.readline().decode("utf-8")
        data = raw.split(",")
        try:
            pitch = float(data[0])
            roll = float(data[1])
            print(str(pitch) + " " + str(roll))
        except:
            print("Only one value read")

def acc_thread():
    acc_data(serial.Serial(port, 115200))

try:
    thread = threading.Thread()
    thread.run = acc_thread
    thread.start()
except:
    print("Unable to connect")

print("End collection")

This is the logic editor:

blender console print data

I found out that you can make the script run in a loop by doing this:

Which allowed me to remove the thread and the infinite loop from my code:

print("---------------------------------------------")
print("Begin collection")

import serial

port = 'COM5'

def acc_data(ser):
    raw = ser.readline().decode("utf-8")
    data = raw.split(",")
    try:
        pitch = float(data[0])
        roll = float(data[1])
        print(str(pitch) + " " + str(roll))
    except:
        print("Only one value read")

try:
    acc_data(serial.Serial(port, 115200))
except:
    print("Unable to connect")

print("End collection")

This is what is printed in the console:


How to convert an object's location to another's rotation I'm modelling a belt, where a motor rotates the belt, thus rotating a cylindrical object on the other end.

I did the belt with a simple plane segment with an array and a curve modifier.
this way I could simply imitate the belt rotation by moving the plane's location, like this:

How can I make the cylindrical object rotate with the plane's location change, so that it looks like the belt actually rotates it?

What you need to do is to copy the distance (or absolute position) of the "belt" to the cylinder's rotation, and if necessary, multiply by a factor. To achieve this you can use Animation Drivers.

To do this, select the object you want to rotate, press N and right click over the Z rotation filed and select Add Single Drivers (or if you want to select Add Drivers to add the drivers to the three of them).

Then, go to the Graph Editor (Ctrl + Left Arrow twice, from the default view), change the type to Drivers, like so:

Then select the Driver on the left, press N, scroll down and on the Drivers part, and use this settings:

Where the plane is the "belt"; If you need to, in the Expression field you can change the factor to suit your needs.


Object1 in the local coordinate system of Object2 I am trying to find the coordinates of Object1 in the local coordinates of Object2.  Neither Object1 nor Object2 are the object that the python code is attached to.

I can find the location of the 3D cursor relative to my active object using:
co_find = context_act.matrix_world.inverted() * context.sce.objects['Cube001']

But I do not know how to find the location of Object1 in the local coordinate system of Object2.

Does anyone know how to do this?

To get the matrix of ob1 in the local space of ob2

mwi = ob2.matrix_world.inverted()
m_local2ob2 = mwi * ob1.matrix_world

loc = m_local2ob2.to_translation() # local loc
loc, rot, scale = m_local2ob2.decompose()


How to fix Sprinkles in rendering? Just started out Blender, and as my first project, I made Blender Guru's donuts. The problem is, when I go rendering, there are A MASSIVE amount of sprinkles, quite different from the Viewport. Here are some screenshots:

You can find the file here!
Any help is appreciated!

You have enabled Interpolated children in the particle settings, which means every sprinkle will spawn new sprinkles. If you set children to None and activate Show Emitter to render both sprinkles and the icing it will look just like in the viewport.


How to Make Glow Effect to Fade? I'm trying to make a glow stick. Current result (it's just a stick with emission shader) looks like this:

Problem is that, it looks really boring.
So to make it more interesting and better, I want to make the glowing effect to fade at the end of the stick like in this reference:

How could I make the glow effect to fade at the end of the stick?

Here's one way. This assumes that the long axis of your glow stick is the Z axis.

The Texture Coordinate node will give you a value for each dimension that varies between 0 and 1, in the form of a color map.

The separateXYZ node will give you just the Z value.

The ColorRamp converts that value into a single color.

My color ramp goes from black to white, but you can change the color

Select the color ramp
click in the vicinity of one of the two pointers
click on the color patch just about the Fac input
Select a color from the color picker

There are many ways to adjust the color ramp.  You can move the pointers around.  THe most useful to you might be that moving the right pointer farther left will reduce the area where the fade happens.


Two Particle Systems - Fire +Water, But only one shows - How come? I am working on a project to shoot out fire and want to have it start as liquid then go to flame. I couldn't figure that out so I decided to have two particle systems, one for each material.

I can get the flames to show, but can't see the liquid particles, no matter what I try. I have a dupli object, materials applied etc, but only the fire shows in the view port and render.

How can I get the other material, set to a diffuse black for now bc I was worried that the glass/water effect was hiding it.

Here's the blend file:

Okay, stupid me!

On further exploration and clicking on everything I could find, I opened the object properties tab/Cycles settings.

Ray Visibility for Camera was unchecked for some reason. I don't remember clicking it but obviously I must have.

I found it through @tacofisher answer here: Particles not showing up in cycles render

Check it on and suddenly the particles show up]1


Cell Fracture adding unintentional items to object I'm trying to use the Cell Fracture add-on in Cycles Render to shatter a wine glass. The final product had added "blocks" onto the final object.

Does anyone know what could be causing this and how to fix it??

Original:

Shattered Object:

It's because your "wine glass" has no volume in some parts. The brim of the glass is infinitely thin. How can something like that be fractured?

Try adding some thickness to your model first before doing your spin extrusion (if that's how you made this).


Render object partly hidden I am using a background image (of table), where a would like to render an object partly recessed (partly hidden) i the table. I do not know if this is this possible at all.

CC

Certainly is possible. What you want is the same techniques used in motion capture and compositing.

There are three key elements here:

Matching the perspective of the camera in the photograph.
Reflection of the environment onto the object (most importantly the table).
Shadows of the object onto the environment.

To solve the perspective problem, there is an old addon for Blender called BLAM, it's discontinued but still works for now. They are however recommending that instead of using BLAM you use a new tool called fSpy, I haven't used fSpy personally but it looks very good.

Once you've matched the camera's, try and get an HDRI that matches your environment. If you took the background photo yourself, you could try and capture an HDRI yourself. Alternatively, you could find a different HDRI that resembles the background image. You could probably get away with unwrapping the background image onto a cylinder around the object actually but you will have to experiment to see what looks good.

To cast shadows on (and cut into as requested) the table you will need to use a shadow catcher. Create a plane and scale/position it to match the table. If your object is reflective, I would suggest projecting the table image onto the shadow catcher plane. This will create realistic reflections that match the environment. Place your object as you like on top of (or cutting inside of) the plane. With the plane selected, navigate to the object panel and enable Shadow Catcher.

You can now render this and export it as a PNG, and then put it onto of the background image in Photoshop. Or, if you're familiar with compositing nodes you could do it in blender.

Below is a simple scene. A Suzanne and a plane. Notice how Suzanne is glossy and you can see the reflections of the UV grid.

Shadow catcher enabled on the plane. Notice how you can still see the reflections of the UV grid.

Suzanne cutting into the plane. Still showing the reflections.


Apply different materials to boolean cuts I have this cube which is being affected by another mesh with a boolean and a solidify modifiers, making those inner cuts, is there a way to apply a different material for the inside and not the actual mesh without applying the boolean modifier? I'm trying to animate it and It'll make it a lot easier
Edit: I've added a material to the base mesh and it only applies the material to the outside which is a good thing, how do I go on from here?

Nevermind, I've found a way to do it, you have to add two materials to the base mesh for it to work, once you've added them it's just playing with them to match the mesh with the materials


Cutting an Object with a Plane Using Boolean Modifier I'm a complete novice at Blender 2.8x, and I'm trying to create an object whose surface is defined by a deformed plane. Basically, I'm trying to recreate this effect. When I try to perform the boolean, however, it seems to only sometimes work depending on the position and rotation of the plane. An example of the broken effect, where both sides of the object disappear:

While at a slightly different rotation it works as expected:

I know that the boolean modifier works best with manifold objects, but I've seen several sources online that say you can use the boolean modifier in this way. Is it simply undefined behavior to use it with planes instead of another manifold object?
I also found many posts online whose problems were caused by coincident vertices or messed up normals. But I don't see how this could be the problem since the issue is replicated with a simple default cube and a plane.

Since Blender 2.91, you can boolean with manifold objects like a Plane.
There are two methods now. The Exact method should solve your issue.
old 2.9x Fast (2.8 method)

new 2.9x Exact

It is cut out in inside normal direction (red color when Face Orientation overlay enabled).

If you still need to work in 2.8 you would have to use Solidify modifier or other tech to create non-manifold object as you mentioned.


How to install BoolTool on a Mac? How can I install the BoolTool?

The instructions lead me to this Github site but don't tell me whether to use "BoolTool 0.1.rar - BoolTool 0.2 release" or "BoolTool 0.2 rar - BoolTool 0.2" (and those names are confusing). The instructions are also unclear in other ways. For example, "5. Save in somewhere as "BoolTool.py" if it's not"—does that mean manually change the extension to ".py"?

A step-by-step list with no assumption that I know Github or ".rar" or "Raw" or ".zip" or ".py" would be very helpful. Thanks!

Go to the main repository page, and click download zip.

Then extract it on your computer, and navigate to the folder it creates, and then into the BoolTool folder.

Then extract the .rar file with the largest number (these are version numbers).

Inside Blender, go the users preferences, and then to the Addons tab, and click install from file.

Navigate to the booltool folder, and enter the folder that was created from the .rar. Then click on the .py, and click install.

The BoolTool Addon should now be installed. If you want to save it into your settings, so that it's always enabled, simply click Save User Settings button.

To extract a .rar on a Mac, you can use UnrarX.


Tranparent object is hidden behind tranparent object i have a problem about transparent object.

As the pictures show, the part of the bottle behind glass can not be seen.

I made the models in Blender. It would be used in AFrame.

Maybe someone can tell me, what is the reason and how can I solve that?

Thank you for any help you can provide

Global collapse of hidden faces is enabled. Just disable it and solve the problem.


Whats problem with my mesh to shrinkwrap? Im making eyes of spiderman. I have the mesh of face and the eyes separate with the shrinwrap modifier i want to wrap the eyes on the face. I have tried but look its a sticker im putting on the face. Not look good.

The project option projects along the normals of the object which is projected.

So here, you need to orientate the eye along the face of Spider Man:


How to animate plane to sound falloff in animation nodes 2.1 (Blender 2.8)? For Blender 2.8, i tried to recreate the sound falloff on a plane from the Animation nodes 2.0 Documentation:

So far i came up with this, but it does not work, i can not figure out why:

Can someone give a brief explanation of how to work with the new Sound Spectrum node in the latest animation node version? The Grid mesh node has also changed. Is this causing the error?

Thank you for your help!

Connect "Frame" to Time Info node in Sound Falloff node so that it has frame information


What is matrix_basis? I'm trying to use Blender as my GUI content creator, and I'm writing plugins for it.

I have a brief look on the API document and noticed that Objects have three matrices: world, local and basis. It is pretty easy to understand world and local matrix, and they work as I expected. However, I don't get the concept of basis matrix, and it can be disturbed by Alt-O hotkey.

Although it seems local and world matrix is enough for me, I am still curious about the meaning of the basis matrix. So what does basis matrix stands for?

From the documentation it states:

  Matrix access to location, rotation and scale (including deltas),
  before constraints and parenting are applied

The key is that it is the matrix before constraints are applied, as some constraints can alter the local matrix.

API docs - bpy.types.Object


What does path_from_id actually do? I learned to use

object.path_from_id(property)

to obtain the path for my fcurves. But when I did this:

object.path_from_id('rotation_euler')
output: 'rotation_euler'

I started to wonder

on other properties I tested it behaved exactly the same
so, why should I even bother with this method?

It's useful for more complex situations than this. Let's say you have an object with a subsurf modifier, and you pass a reference to that modifier to some function:

mod = bpy.context.object.modifiers['Subsurf']
somefunc(mod)

That function can now figure out the path of a property of the subdivision surface, like this:

def somefunc(mod):
    print(mod.path_from_id('name')) # this outputs 'modifiers["Subsurf"].name'

Here is another practical example I just encountered. I want to create a driver for a specific property on the active sequencer strip. The driver needs to be defined on the scene itself, and I need to get the path for the property to drive:

se = C.scene.sequence_editor
se.active_strip.transform.path_from_id('offset_x')

This outputs 'sequence_editor.sequences_all["2017-07-06T11-04-11+0200.webcam"].transform.offset_x', which is what is needed for the driver.


Checking if boolean true or false not working I'm trying to make my character jump using python script. And the character jumps but I want to check if the character is already jumping, and if he is, then not be able to jump again. But for some reason this code doesn't work.

# this triggers when I press space.
if isJump.positive:       #<-- this one doesnt work. but it still prints 'jumped'
   if jumping == False
       cont.activate(j)
       jumping = True
       print("Jumped")
       cont.deactivate(j)

# this triggers when I collide with an object with a property 'ground'
if collide.positive: #<-- This whole block works fine
   jumping = False
   num = 0
   print(num)
   cont.deactivate(j)

You store the current state in an intermediate variable. This can't work. You need to store it in a storage that will survive at least till the next call access. I wondered that you did not get any errors.

There are many ways to solve that issue.

FSM (build in state machine)

One way is to use the build-in state machine.

You can define a "jumping" state that, (when current) tells the character is currently jumping. On the other hand, if it is not current the character is not jumping. You do not even need Python to do that.

any state can transit to jumping state:

The jumping state cares the jump e.g. playing animations, detecting collisions and switch to other states

Property

You can create your own state machine. E.g. by using a property of the game object:

jumping = cont.owner.get("jumping")

# this triggers when I press space.
if not jumping and isJump.positive:
       cont.activate(j) # what is a "j"?
       cont.owner["jumping"] = True
       print("Jumped")
       cont.deactivate(j) # this will not take effect

# Better separate start jumping from jumping.
# This code does not need to be executed when there is no jumping, regardless of the collision sensor result.

if jumping and collide.positive: #<-- This whole block works fine
   cont.owner["jumping"] = False
   num = 0
   print(num)
   cont.deactivate(j)

There are much more ways. I hope it helps a bit.


How to render daz character hair in cycles? I am trying to render Daz character hair in cycles but its looks weird and no color,Daz hair textures is different.its not looks my regular hair texture.here is the textures.

I found the answer from a guy name javiermichael here is the nodes setting!


How to fold a plane? I have a plane in Blender, and I'd like to fold it along the edges. My goal is to fold the plane like an iPhone X's case as shown in the image:

How to achieve this?

You may stack 2 solidify modifiers with only rim enabled to get this kind of effect. You may also have to enable Flip normals and change the offset to get the fold in the right direction. Finally add a bevel to get rounded edges.
The modifier stack :

The base plane, and then with each consecutive modifier applied :


Is it possible to animate a single mesh as if it were multiple objects? I am attempting to animate a single mesh which appears as a group of separate objects.
I want to animate three separate boxes which are joined together as a single mesh for ease of use in the dope sheet/action editor. This makes exporting the actions into GLTF easier for action manipulation/programming in three.js.

When I join armature bones to the single box object, I am able to manipulate/pose each object independently. However, when I join the objects together into one mesh, I lose the ability to independently manipulate them, and the bone pose influences all other objects.

Is it possible to join the three boxes together as a single mesh, and independently pose each box within the mesh as if it were its own object? This would make things much easier for exporting to three.js.

I don't think it's possible to add more than one armature to a single object (haven't tested it, though).
What you can do is create all three bones inside a single armature and then parent the mesh to the armature with automatic weights. I think it'll weight properly, but if it doesn't just manually edit the weights so all the vertices in each box are only affected by its respective bone.
I don't know if that helps for your specific needs.


Rendering a colored plane with NO shading creates weird pixels at borders? I turn to you with a question about Blender (2.90) rendering behaviour.
I am rendering a colored plane only (literally, that's it - no shading, plugging the "image texture" node right into the surface node of material output), so quite a simple setup. However, when rendering the plane, Blender creates some weirdly colored pixels at some locations on the plane's borders (see image). Note that these are not visible in the viewport and only show after rendering.
I am rendering with Cycles, transparent RGBA, to 16bit png. I already tried setting Film -> Pixel Filter -> Gaussian to the smallest size possible (0.01px,  I need to render it without Anti-Aliasing), and also set "Alpha Clip" in the material section. I experimented with Eevee and also with different render resolutions (ranging from 250p to 1080p), alas to no avail. I tried setting the backside of the plane to another color, but that didn't help either. I also tried setting the number of samples in both viewport and renderer to 1, which didn't help either.
Full plane:

Artefacts (zoomed):

Does somebody have an idea what is going on here? Any hints appreciated!
 and the texture that is applied to the plane: https://imgur.com/aldZWyX

Because you are using Repeat extrapolation in Image Node.
Those pixels are just texture's pixels from opposite side of texture.
Set Extend instead.


How to synch audio with video when both tracks are from same source? I am using the VSE in Blender 2.80 on Windows 10 to add cards to an existing video in MP4 format that is about 20 minutes long. I placed my cards and have chosen the following settings:

These are the settings of the original video file:

I changed the Blender audio Bitrate first to 130 but noticed it was "off" from the video. The lips of the speaker don't quite match. Then I read that powers of 2 were useful so I changed it to 128. I also tried The MPEG-4 container but after hitting "render animation" nothing would happen. I also tried FFmpeg video codec #1 but my video player (Matroska) was unable to read the sample animation I rendered from it. Changing the quality settings and keyframe intervals alternate between making the file unreadable and not having any noticeable change. Changing "Output Quality" to "Lossless" gives me a file with audio but no video.

What do I need to do in order to have the audio match the video as closely as I can to the original video file?

I you loose sync between video and audio, generally the reasons can be:

1) you didn't match the frame rate (in your case 29,97)

2) you didn't match the audio sample rate (in your case 48 KHz), in the preferences

The others parameters are a matter of quality/file weight, not about Sync.


Set all panels to be closed by default or remember settings by file? I'm currently working on a very small screen, and I'd like to have all the panels closed by default and only open the ones I need manually, or if possible even just remember my last open panels when I save a project. Is it possible?

(open (1) and closed (2) panels in the editor)

I know I can use Ctrl+LMB to open a panel singularly, and that alone is a great help, but this would be even better.

Open blender.

Set the screens the way you want them.

Save your new layout as default by saving the startup file.
In the top menu use File > **Save Startup file.

(For older versions 2.7x) Press Ctrl U to save the current file as the startup file.

From then on, every time you open blender you'll be presented with the layout you've customized.
Setings are always saved so that when you reopen a file it will open with the windows in the same way they where when the file was saved.
If you want to override this behavior unclick the Load UI in when opening a file:

To go reload blender's original settings you can always go to the top menu and use File->Load Factory Settings


Getting Textures To Apply I'm completely new to Blender so I have no idea how to make this work but I almost made it (I think). I'm trying to make a player model for Garry'a Mod using a model and textures from another game. I have the .obj, .mtl and texture pictures in the same folders. I have edited the .obj s and .mtl s to use the correct files (I think I did it right). When I open the .obj files and put it into texture mode, or whatever it is, I can't see textures on any of them, but when I set it to texture paint I can see the textures on the selected piece. I feel like I'm close, but I don't know how to do it myself.

I also went to the little row of editing things near the top right, added a new texture, and selected the picture file before I did the texture paint (If it makes a difference).

Pictures Of Situation

Not sure it is your problem but usually (in my use case) when you can see a texture in Texture paint and not in Object mode, it is caused by the viewport shading settings.


Remove pop-up window when running an operator Is there anyway to remove this pop-up window when running an operator?

In the viewport menu just uncheck the option View → Adjust Last Operation and the popup no longer appears. You still can hit F9 to bring it back and adjust the last operation.


What are subsurface modifiers? Using version 2.78c, hash e92f235283. Following instructions in "Beginning Bender" by Flavell, 2010. I have opened Modifiers, but have not found any modifiers referred to as subsurface modifiers.

From the Blender Docs:
The Subdivision Surface Modifier is used to split the faces of a mesh into smaller faces giving a smooth appearance.....

For more info, visit the documentation:
https://docs.blender.org/manual/en/dev/modeling/modifiers/generate/subsurf.html


Including an animatied plot in animation I made my first animation using blender and now I want to include an animated plot graph in one corner of my initial animation such that a point on the graph moves with time to show the change of temperature. What do you think is the best way to achieve this? I was thinking of making several graphs with a point drawn on them on excel and then making a gif of this and adding it to the corner of the initial animation. Would this work and how? Are there better solutions?

Best wishes,
Nenko

One way to do this is using the Blender video editor.
You create the animation and render it to a sequence of images. Then create you animated graph and save it as a sequence of images.
In the video editor, you add the animation as an image sequence in one channel. Then in the next channel add the graphs as an image sequence. Use the editor settings for the graph to position and scale the graph.
When the video is rendered, the graph will be overlaid on the animation.


DopeSheet/GraphEditor : How to detect/change, with API, displayed frame range Is there a way to detect (and change) displayed frame range in dopesheet and grapheditor using python API ?

I am not talking about frame start/ frame end or restricted frame range, but what is the lowest and highest frame visible on screen (that can be changed with scrolling for example)

I can't find data for now on API documentation.

Thanks !

The frame, value from the region coords can be obtained from view2d.region_to_view

import bpy
from mathutils import Vector
context = bpy.context
c = context.copy()
for i, area in enumerate(context.screen.areas):
    if area.type != 'GRAPH_EDITOR':
        continue
    region = area.regions[-1]
    print("SCREEN:", context.screen.name , "[", i, "]")
    c["space_data"] = area.spaces.active
    c["area"] = area
    c["region"] = region

    # region size
    h = region.height # screen
    w = region.width  #
    bl = region.view2d.region_to_view(0, 0)
    tr = region.view2d.region_to_view(w, h)
    print("region bottom left (frame, value)", bl)
    print("region top right (frame, value)", tr)

    range = Vector(tr) - Vector(bl)

Note from Getting area (region.view2d) pixel coordinates of 2D views (VSE, NLA) how to get the scrollbar width.

As for setting the region to a desired frame value range, I have found using bpy.ops.view2d.anything an absolute nightmare, of finding rhyme or reason, and instead have used the methods outlined here Focusing the graph editor area to a custom [frame, keyframe_value] range using bpy.ops.graph.view* operators in the graph editor, and I expect would work similarly in dope sheet for bpy.ops.action.view*.


Cycles noise no matter what I do, and the denoiser makes it look cloudy I realise so many people have asked this question so many times, but I just can't see what I'm doing wrong here.
I'm on Blender 2.83.2.  I have a simple scene with a room and some objects, some with glossy shaders.  There are 3 point lights on the ceiling providing plenty of direct and indirect light, so shadows are soft and mostly diffused, and in most cases there are very few shadows due to the generous slather of light being dumped into the shot from 6 point lights on the ceiling.
This is a portion of the shot rendered in Cycles without denoising for reference:

And this is the full frame with denoising creating what you expect... a shot that looks like someone smeared my camera lens with a potato.

These are my cycles settings, which are set to default except for indirect clamp being set to 10 as part of my own troubleshooting.  I've tried samples up to 512, and there was virtually no difference from the results I got with 256 samples.  So I suspect I'm doing something else to create this noise beyond just being stingy with compute power:

I used to think Cycles only struggled when lighting was low, so I was surprised when I first switched from Eevee to see how it would look.
Any help is greatly appreciated.  Thanks.

Denoising works well only at high resolutions, in my experience from 4k. Try putting more samples, or increasing the resolution and using denoising. I rendered a scene with different light sources on 512 samples.
In addition, you can see examples of different samples and noise effect here Will increasing samples reduce fireflies?

1000:1000px; 128 samples and denoising.

1500:1500px; 256 samples and desoising on compositing tab.
As far as I know, sometimes denoising in the compositing tab, for some reason, works differently than in setting the view layers :)


How to use an animation for one object on another object? I've animated the location of a text object, and now I want to use that same animation on many other text objects at arbitrary times. How can I do this?

When you keyframed the locations on an object, an action has already been created

Select the object which should be animated
Switch to the Dopesheet and change to the Action Editor
Assign the action to your object. (default name here is Textaction)

Note that the keyframes have absolute coordinates, I you're looking for relative changes you would need to offset them in the NLA-Editor (or alternatively change the origin of the individual text objects).

When you want start animations at different time offsets you would need to place them as Action-Strips in the NLA-Editor there you can move the strips to the time offset they should start (and even scale the duration).


Advantages and disadvantages of using key shapes to correct pose of a scene I have seen the use of a key shape for a special pose of a scene in This Video.

It looks like a very cool way.

However, this method requires that I bring the character's mesh into editable state for each scene, so it seems impossible to organize your entire work with the Linking Library.

For that reason, it seems difficult to respond to a character's design being modified while working on a shot in a production environment with tight schedule.

In other words, I thought that using a special key shape for each scene would improve the quality of the character animation, but it would be dangerous to apply it to a rapidly changing production situation.

Did I correctly understand the Advantages and disadvantages?

A shape key is a difference effect on a mesh.
So for better controlling faces, or elbows  or shoulders etc.
You can add shape keys, their effect is visible based upon their weight setting. So setting their weight value back to zero will return your original mesh again.

If you worked with linked blend files, sure then you would need to reload(update) if you do this a lot in post production. However one can also create several situations first (angry face/happy etc).
Alternatively if its only a few characters you dont link it, but import it.

BTW its an interesting video that you found!


Missing Open Shading Language in Cycle Renderer Check Box Was reading up some interesting answers on animating noise. Until, I found out that blender 2.75 doesn't have the same interface as shown on the image below.

Does anyone know how to turn on Open Shading Language in the cycle renderer? Following the post here How to animate noise texture "seed"? I was not able to see the noise on screen at all. It outputs the noise as plain white.

OSL isn't available on GPU. If you are already set to CPU, it's possible your version of blender was compiled without it. Are you using an official build from blender.org? (btw, any particular reason for using 2.75? The latest version is currently 2.76) – gandalf3


How to model a ribbon I've got to model a minnie-like ribbon to put it on a character, but I can't find any tutorials on the web.
Have you got some tips on how to do it?

Start with a bezier circle.  In edit mode, scale along Y-axis so that it is squashed.  Add an extrude factor to form the main part of the bow.  Add another circle for the centre part of the bow and a bezier curve for the bottom strands.

Convert all three objects to a mesh with ALT+C.  In Edit mode, add some loops lengthwise to all three objects to support the deformations.

For the main bow, add a simple deform set to Twist to give it a more realistic look.  Create a new Lattice at the origin and add a lattice modifier to the bow.  Modify the lattice in edit mode to create the distinctive bow shape.

Add a subdivision surface, solidify and bevel modifier to the object to give it some thickness.

Repeat the process for the other parts of the bow.  You may need to tweak the modifiers to avoid any intersecting faces.


Remove Doubles < Merge by distance? Remove Doubles was removed and replaced with Merge by Distance? If, you set the value small enough it works the same and gives versatility.

Blender 2.8 Beta Version 5/13/19

It's the same, only thing is that they changed the name.


Create paint pour with fluids, needs to fill with a round mesh Hello I need the create an effect with fluids where the fluid fills with a perfect circular form. Viscosity must be like paint, see picture below.

I have tried tweaking the fluids, but I cannot get it to "stick together" as a round form as it fills. All I can get is results as below:

I have tried to change the resolution, but it only makes the liquid break apart more...

Can anyone point me i the right direction? Thank you in advance

Set the viscosity high (either set the Base and Exponent manually in Fluid World properties or by using the Fluid World 'Viscosity Preset' for Honey (which should be somewhere close to paint)) and then use a Fluid Control object to keep the pool of liquid in the desired shape.

See How to melt an object then reverse the melt into another object for an example of using Control objects to direct the fluid into a specific shape, using a thin cylinder to shape the pool.


How do I work with grayscale? I would like to work with greyscale like this photo.

I have a landscape and models. What should I do first?

The most elegant solution is using color management and a custom matrix to convert the image's color information to a grayscale.

You can easily and non-destructively represent your scene in grayscale without the need of changing materials or affecting the overall quality of the render.

User @troy_s has created a LUT pack and OpenColorIO (OCIO) config that greatly enhances blender's display transform.

Included in the pack there are a couple of matrices that can be used to set grayscale looks.

  Greyscale on Desaturation This is a greyscale preview of the desaturated look helpful for evaluating contrast and other details in some contexts.
  Greyscale This is a greyscale preview without the desaturation look applied.

LUTs and OCIO configuration can be downloaded at this Github link along with the instructions on how to install and use.

For other related topics read this link


shadows on faces with no source I'm getting some weird shadows on my mesh that I can't figure out how to remove. It appears they don't have any natural reason for being there as they are along straight edges and on  faces.

I've checked normals and they are all pointing the right way. I've removed double/unnecessary vertices. The mesh has 1x mirror and 1x EdgeSplit modifiers on, but applying these doesn't fix the problem. Iv'e tried change clipping without any luck.

The edges have been marked sharp, but removing this doesn't change the shadows. (The red dots are holes I made in the mesh with Boolean modifiers (that have been applied) and the back of the mesh showing through) The shadow problem was there prior to the boolean operation.

If I extend out a face the shadows are visible along the side/connecting face as well.

Hopefully someone can help me with this as it it driving me a bit mad at the moment.
Thanks.

Possible solution: It might have something to do with UV unwrap. Working to confirm if this is the case or not.

Blender 2.82a (Mac Catalina OS) Cycles render engine.

Figured out the problem (in this case) occurred due to UV unwrapping and an image texture that wasn't single colour. The UV unwrap crossed over parts of the image that was empty and created the black lines in seemingly random places. New UV unwrap and new image texture solved the problem.


Multiple smoke flows in one domain, with different colors So I want to mix smoke with different colors in one domain object, I've found tutorials about that topic with Blender render engine, but not how to do that effect in cycles. I can define the smoke color in the node setup of the domain, but how can i seperate between my different flow objects?

You can use an Attribute node with color as a keyword to read color information from smoke (use colored flow objects).
Available keywords are:

color
density
flame
heat *
velocity *

They are now all defined in /addons/cycles/kernel/kernel_types.h though dunno if the last 2 are yet usable (maybe in some test builds) - edit - these attributes are usable from version 2.78 up - from left to right: smoke render, heat map, velocity vectors:

Smoke sim from benu:


Mantaflow smoke looks a bit weird I tried following this tutorial (https://www.youtube.com/watch?v=YCdQgREfVq8&t=362s) Im at 6:15 And my smoke ball looks nothing like his. Mine looks like this
Ive followed every step and thats where im stuck.
Any ideas?

Did you read the comments? Often people write problmes + solutions in the comments.
So next questions:
Did you use Cycles?
Did you bake?
Did you see that comment here:
NOTE TO NOOBS LIKE ME AND ANYBODY ATTEMPTING THE TUTORIAL - when Olav says the word "flame" is important, he actually is referring to how it's typed, not just what is typed.
DONT USE CAPS! Took me forever to realize it's like an input term, not a name, and effects the results it must be written as "flame" or it won't be recognized as the intended value. I had F capitalized.  The attribute flame won't work right if typed in any other way.

...and...what i made wrong often: every little step in the tutorial, do it exactly how the teacher does it, else everything can happen. I often did thing slightly different which looked the same in that moment, but weren't the same. E.g. if you move your cube in object mode with G, it is something totally different to move your cube in edit mode!!! Because the origin point changes! Took me quite a while to understand this "little" differeence...


How to rename selected objects using python? I want to rename a large number of items. Doing so manually could take quite some time. I want to use python to rename the object. To find out the python command for renaming I renamed an object manually and looked in the console for the echoed command. The command was:

bpy.ops.object.select_all(action='TOGGLE')

This command does not seem to be the correct command for renaming. It does not even contain the new name in the command. I also tried to look up the python command reference for the name, but the link was a dead end.

How can I rename an object using python?

You can access them by iterating and assign the name property:

import bpy

for obj in bpy.context.selected_objects:
    obj.name = "newName"

Blender automatically add .001, .002 and so on to newName if another datablock of same type and name already exists. You may need to check a name pattern within the for-loop.

Another example - rename all Mesh objects in current scene that start with C (e.g. Cube, case insensitive):

for obj in bpy.context.scene.objects:
    if obj.type == 'MESH' and obj.name.lower().startswith("c")
        obj.name = "newName"


Multiple GPUs in AWS G2-8X LARGE I can only use 1 out of 4 GPUs Using cycles on AWS G2-8X large which has 4 GPUs however cannot get blender to use more than 1 GPU at a time even though I can get it to switch between GPUs any suggestions? I have the latest drivers and versions

I know this question is pretty old but posting this in case anyone is having similar issues.

The question is a bit vague. I'm assuming you're using python script to call and render something in blender. I'm also assuming that you're using the following lines in the python script for setting GPU as the render device:

bpy.context.scene.cycles.device = 'GPU'
bpy.context.user_preferences.system.compute_device_type = 'CUDA'
bpy.context.user_preferences.system.compute_device = 'CUDA_0'

where the CUDA_0 means to use the first graphics card, CUDA_1 for second graphics card and so on. To make use of all the graphics cards, all you have to do is to modify the third line to:

bpy.context.user_preferences.system.compute_device = 'CUDA_MULTI_0'

Unrelated: If you want to see what all options are available for this setting in your current system, use the following in the python script:

print (bpy.context.user_preferences.system.bl_rna.properties['compute_device'].enum_items.keys())

Please note that if you give only this line in the script, it will show only 'CPU'. Make sure you set the render device to GPU using the code sample I've shared, and then use this line.


Create a volumetric cone shape in eevee? Anyone know how to create a volumetric cone in EEVEE? I know that volume scatter is able to follow a shape in CYCLE but not in EEVEE... I found how to create a sphere thanks to the nodes, but unable to make a cone.
Thanks for your feedback
Sorry... My English is so bad

Thanks to  Inigo Quilez, here's a signed-distance function from the surface of a cone of a given pitch angle.

float sdCone( vec3 p, vec2 c )
{
  // c is the sin/cos of the angle
  float q = length(p.xy);
  return dot(c,vec2(q,p.z));
}

I would have done it another way, but this is much simpler... it boils down to the distance from a point to a line.(The vector projection proof)

Here, the cone is in the space of an Empty, so you can move it around. You set the angle at the 'Angle' input in radians, and can adjust the scale of the cone with the 'Threshold' setting, and the density inside it by multiplying the result.

I tested it on a stack of planes.. it is filling the volume, with the 'Less Than' (the threshold).. if you use a 'Compare' instead, you can capture just a shell.


Moving vertex moves only the vertex, not the edges it is connected to I select one vertex on a 2D plane extrusions from another 2D plane and transform it along the X axis, but only the vertex moves and not the edges it is connected to. There is an Orange line connecting where the dot of the vertex is to its original spot.

I want to be able to move the vertex and the vertex stays connected to the edges (so it slightly deforms the edges).

I have Proportional editing off.
For reference, I am trying to follow these steps : https://www.youtube.com/watch?v=xQ8fOYTdqow

Looks like I was not pressing G AFTER selecting the vertex I wanted to move.
I was just selecting the vertex and moving it.
Pressing G then the vertex I want to move made it work as intended.