How can I add custom icon for my operators in a specific addon? According to this question and this example I am trying to add some custom icons to my addon's operators. But I have an "issue".
In both examples, functions draw, register and unregister are in the same file. In my case, register and unregister functions located into my __init__.py file and looks totally different and the draw function located into an other file I have create by the name fu3dm_main.py. Can anyone help me on how I'll apply this example in my case?
Here is how my __init__.py file looks:
bl_info = {
    "name" : "Blah blah blah",
    "author" : "Simonetos The Greek <simonetos.the.greek@gmail.com>",
    "description" : "Blah blah blah",
    "blender" : (2, 90, 1),
    "version" : (1, 0, 0),
    "location" : "View3D",
    "warning" : "",
    "category" : "Generic"
}

import bpy
from . fu3dm      import *
from . fu3dm_main import *

ops = fu3dm.ops

classes = (
    fu3dm.ops.view.front,
    fu3dm.ops.view.back,
    fu3dm.ops.view.right,
    fu3dm.ops.view.left,
    fu3dm.ops.view.top,
    fu3dm.ops.view.bottom,
    fu3dm.ops.preferences.model,
    fu3dm_main.panel
)

register, unregister = bpy.utils.register_classes_factory(classes)

And here is how my fu3dm_main.py file looks:
import bpy
from . fu3dm import *

class fu3dm_main():
    """Main class"""

    class panel(bpy.types.Panel):
        """Main panel class"""

        bl_idname = "fu3dm.main_PT_Panel"
        bl_label = "Blah blah blah"
        bl_space_type = "VIEW_3D"
        bl_region_type = "UI"
        bl_category = "FU3DM"

        @classmethod
        def poll(cls, context):
            return bpy.data.collections.get("FU3DM v20.0")

        def draw(self, context):
                layout = self.layout
            #   ┌────────┐
            #   │ Box #1 │
            #   └┬───────┘
                box1 = layout.box()
                box1_col1 = box1.column()

                box1_row1 = box1_col1.split()
                box1_row1.label(text="Preferences:")
                box1_row1.operator("fu3dm.model_prefs")
            #   ┌┴────┐
            #   │ End │
            #   └─────┘

Well I found the solution from this attached file here, and here is a code example...
import os

import bpy
import bpy.utils.previews
from bpy.types import Panel

preview_collections = {}
# If you work with a simple script.
dir = os.path.dirname(bpy.data.filepath)
# If you work with an addon.
# dir = os.path.join(os.path.dirname(__file__), "icons")

pcoll = bpy.utils.previews.new()

for entry in os.scandir(dir):
    if entry.name.endswith(".png"):
        name = os.path.splitext(entry.name)[0]
        pcoll.load(name.upper(), entry.path, "IMAGE")

class VIEW3D_PT_test(Panel):
    bl_label = "TEST"
    bl_category = "TEST"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

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

        layout.prop(scene, "use_gravity", text="Enable Layout")

        col = layout.column()
        col.enabled = scene.use_gravity
        col.operator("object.duplicate_move", text="Custom Icon", icon_value=pcoll["ICON"].icon_id)
        col.operator("object.duplicate_move", text="Built-in Icon", icon="OUTPUT")

bpy.utils.register_class(VIEW3D_PT_test)

Just note, that If you work on an addon, the dir should be like this dir = os.path.join(os.path.dirname(__file__), "icons") and icons should be saved in .png format into folder icons into the same place where your .py file is.
And if you work on a simple script, dir should be like this dir = os.path.dirname(bpy.data.filepath) and icons should be into the same place where your .py and .blend file is.


How to rename different UV maps in blender 2.74 In every tutorial i've seen, there is a Name field under the "UV Maps" section of the Data for an object.  The latest tutorial i've seen said simply it was version 2.7.  I am using Cycles renderer.

However I have no Name field, nothing in right click, and nothing I could see in the UVs menu seems to have anything to do with naming it.

How can I rename my multiple UV maps?

Edit:  I didn't think to ask about renaming vertex groups because it wasn't obvious to me that they would have anything in common.

You can now Double-Click (or Ctrl+Left-Click) on the name of items in 'UI Lists' and they will change into an editable text field. Press Enter to confirm the new name once typed.


Getting noise texture to flow continuously across multiple objects I have 3 separate planes that are contiguous and have a common material.  I have applied a noise texture which I later want to use for displacement.  However, the noise texture shows up on the seams, it has clearly been stamped on each of the objects from the same origin point, as can be seen in the first image.

Is it possible to make this seamless?  For example, if I do the same thing with the wave texture, it goes across the objects seamlessly, as below.

Thanks

One way of doing it is to add an empty to the scene and using it as a texture coordinates provider in the material. My guess is that you have something like this for now:

So after adding an empty to the scene and using it in the texture coordinates node, you'll get this:

Hope this helps!


Render with alpha channel for transparency for After Effects? I'm using Blender 2.8 to render a simple text animation with no background (I want to render a transparent bg).

I'm rendering with the Eevee engine, following this tutorial:

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

The file format for output I'm using is: FFmpeg video and the container Quicktime. Video codec: QT rle / QT Animation.

In render film I'm using "Alpha: Transparent".

When I press F12 or Ctrl + F12 the render is actually transparent as desired, I can open the video in Quicktime but not in After Effects. Why?

Blender file:

https://www.dropbox.com/s/dsd52fnlunwr968/text_animantion.blend?dl=0

AE Error when importing file:

  Basically it says: Origin compression method is unkown.

  Installed Quicktime to see if this solves the error. This is a
  brandnew Windows 10 PC, so I havent install any particular codec.

Never render to video, always render to image sequence (PNG or EXR) and enable alpha output.

Rendering to video will mean you'll lose your entire render should your system crash or you have a power outage.

Sequences allow you to carry on rendering from where you were when the power went out or your system crashed.

Sequences in PNG allow for greater compatibility between programs, but the alpha channel will be unassociated alpha, so you won't be able to create objects that are luminous and transparent. EXR can do associated alpha correctly and you can keep your data linear. The EXR multilayer format will allow for the inclusion of compositing layers information, light, depth channels, diffuse, specular, transmission, etc.


Array / fit curve modifier doesn't produce a long enough array to fit entire curve I've had loads of issues around getting objects to fit and follow the multiple curves in my project. I've searched and overcame every obstacle but one, that I'm aware of lol. I continue to have an issue with the array modifier, using fit curve, not fitting the entire length of certain curves. I have had this modifier work the first time on multiple occasions on brand new curves. However, the curves I'm specifically having this issue with were originally edges of a mesh selected with vertices, duplicated, separated, and converted to curves. Some of these problem curves were joined together as they visually create a continuous line.
As far as I can tell all scale values are 1 and apply scale has been used multiple times between all my problem curves and hasn't resolved the issue.
When using the fixed count fit type, I can push the array past this stopping point, but the array fails to follow the curve past that point. Specifically, the arrayed object just continues straight in one direction.
I literally opened Blender for the first time 5 days ago so this issue has to be a user error. I just haven't nailed down what I'm messing up and the old google machine hasn't produced a working solution. Happy to post my file, I just can figure out how...

If you make a default cube, and a default circle, the default cube is 2 units wide and the default circle has a circumference of 2pi (2 * radius * pi).  How do you evenly array something 2 units wide into something 6.28... units longs?  You can't.  2 doesn't go into 2pi evenly.  So Blender makes 4 of the cubes.  (Differences in yours may be due to unapplied scale, but it doesn't matter; you're not going to get any array to fit any curve exactly.)
As for things failing to follow the curve after its end-- there is no curve after the end.  If you want it to continue to curve, create more curve.  Which you can do by entering edit on your curve, selecting a control, and 'e' to extrude it.
Now, you might find it useful to enable "stretch" and "bounds clamp" on your curves, in properties/object data/shape.  If you do this, any curve modifiers you use will stretch the modified mesh to fit the curve-- so those 4 cubes, 8 units long, 2 units each, will turn into 4 cubes, 6.28... units long, pi/2 units long each.


Do something when check/uncheck checkbox Python I have a checkbox in my addon and I wonder how I can I execute or run some code when checking and unchecking it. I found this link but I tried following the given answer there (as shown below) but it is not working, nothing happens when I check/uncheck the checkbox.

This is my script:

bl_info = {
    "name": "tester",
    "description": "",
}

import bpy
import os
from bpy.props import (StringProperty,
                       BoolProperty,
                       IntProperty,
                       FloatProperty,
                       FloatVectorProperty,
                       EnumProperty,
                       PointerProperty,
                       )
from bpy.types import (Panel,
                       Operator,
                       AddonPreferences,
                       PropertyGroup,
                       )

class MySettings(PropertyGroup):

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

class UV_OT_my_panel(Panel):
    bl_idname = "UV_OT_my_panel"
    bl_label = "My Tool"
    bl_space_type = "VIEW_3D"
    bl_region_type = "TOOLS"
    bl_category = "Tools"

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

        # display the properties
        layout.prop(mytool, "my_bool", text="Bool Property")
        layout.prop(mytool, "my_int", text="Integer Property")
        layout.prop(mytool, "my_float", text="Float Property")

        # check if bool property is enabled
        if (mytool.my_bool == True):
            print ("Property Enabled")
#           bpy.data.objects['Cube'].hide = True

        else:
            print ("Property Disabled")
#           bpy.data.objects['Cube'].hide = False

def register():
    bpy.utils.register_module(__name__)
    bpy.types.Scene.my_tool = PointerProperty(type=MySettings)

def unregister():
    bpy.utils.unregister_module(__name__)
    del bpy.types.Scene.my_tool

if __name__ == "__main__":
    register()
os.system('cls')
def my_prop_callback(self, context):
    if context.scene.my_prop:
        #pass # do something here if user checks checkbox (but not uncheck, just as an example)
        print('Enteredddddddddddddddddddddddddd')
        if context.scene.mytool.my_bool == True:
            bpy.data.objects['Cube'].hide = True
        else:
            bpy.data.objects['Cube'].hide = False

bpy.types.Scene.my_prop = bpy.props.BoolProperty(update=my_prop_callback)

actually your code is running... but you must open your blender with the cmd (console)

after that you can see the prints in the cmd

/**** update

you should check enter link description here

I clean the code....

bl_info = {
    "name": "tester",
    "description": "",
}

import bpy

from bpy.props import (StringProperty,
                       BoolProperty,
                       IntProperty,
                       FloatProperty,
                       FloatVectorProperty,
                       EnumProperty,
                       PointerProperty,
                       )
from bpy.types import (Panel,
                       Operator,
                       AddonPreferences,
                       PropertyGroup,
                       )

# ------------------------------------------------------------------------
#    store properties in the active scene
# ------------------------------------------------------------------------
def update_func(self, context):
    for obj in bpy.data.objects:
        if (self.my_bool == True):
            #print ("Property Enabled")
            obj.hide = True
        else:
            #print ("Property Disabled")
            a = obj.hide=False
            print(a)
def update_func_1(self, context):
    for obj in bpy.data.objects:
        if (self.my_bool1 == True and obj.name=="Cube"):
            print ("Property Enabled")
            obj.hide = True
        else:
            print ("Property Disabled")
            obj.hide = False

class MySettings(PropertyGroup):

    my_bool = BoolProperty(
        name="Enable or Disable",
        description="A bool property",
        default = False,
        update = update_func
        )
    my_bool1 = BoolProperty(
        name="Enable or Disable",
        description="A bool property",
        default = False,
        update = update_func_1
        )
    my_int = IntProperty(
        name = "Set a value",
        description="A integer property",
        default = 23,
        min = 10,
        max = 100
        )

    my_float = FloatProperty(
        name = "Set a value",
        description = "A float property",
        default = 23.7,
        min = 0.01,
        max = 30.0
        )

# ------------------------------------------------------------------------
#    myTool in the image editor
# ------------------------------------------------------------------------

class UV_OT_my_panel(Panel):
    bl_idname = "UV_OT_my_panel"
    bl_label = "My Tool_modify"
    bl_space_type = "VIEW_3D"
    bl_region_type = "TOOLS"
    bl_category = "Tools"

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

        # display the properties
        layout.prop(mytool, "my_bool", text="hide everything")
        layout.prop(mytool, "my_bool1", text="only hide cube")
        layout.prop(mytool, "my_int", text="Integer Property")
        layout.prop(mytool, "my_float", text="Float Property")

# ------------------------------------------------------------------------
# register and unregister functions
# ------------------------------------------------------------------------

def register():
    bpy.utils.register_module(__name__)
    bpy.types.Scene.my_tool = PointerProperty(type=MySettings)

def unregister():
    bpy.utils.unregister_module(__name__)
    del bpy.types.Scene.my_tool

if __name__ == "__main__":
    register()


Convert extrude plane to solid I have one problem, I would like to know how I can convert an extruded plane into a solid.

You may have already solved this, but do this :

1/ Select plane and go into edit mode (tab)

2/ Select All (a)

3/ Activate Extrude mode (e)

4/ Depending on the orientation of your plane, limit extrusion to the X, Y or Z axis by selecting "X", "Y" or "Z".

You plane should now be a solid. Just note that you need to be aware of the normals for your faces you have created with this method. Normals explained here


Color grading/matching strips in the VSE Imagine you have a number of strips in the VSE and you want the white balance, the exposure, or the color balance to match between each strip. Would there be a setup that would enable you to display for example strip 1 (with strip modifiers if any)  in a window and strip 2 in another window? If such setup was possible, one would them add strip modifiers to strip 2 to match strip 1 (eyeballing).

Thanks

There are 2 ways to do this:

You could stack the strips above each other and make a new preview window for each strip. At the bottom of the preview window is a channel number, simply set this for the strip you want to see.

Or you can make 2 preview windows and turn on the Ghost offset function in the preview window. Simply turn on the ghost button and enter the frame offset so the black line lands on the shot you want to compare. Then toggle down the Overlay menu next to the offset and select "reference". The other preview window should show "Current", this will display whatever the green play indicator is stopped on.


Where do I find the metaball panel? In the manual it says press F9 but I have tried that, and it doesn't work. I am trying to find this for the negative feature that meta-balls have.

When in edit mode open Metaball panel and scroll down to Active Element section.


Is it possible to get the length of a ray inside an object with nodes? Is it possible to get the distance a ray travels inside an object with cycles material nodes?

Then map it to a 0-1 range to create a map:

E.g. to adjust the color of a Glass node to make it more transparent where there is less volume between the camera and light:

How can I do this?

The example images above were rendered with the Layer weight node. This only works on spheres.

It is always the way you ask. Ray length is the distance from previous bounce or refraction.

What might be a bit confusing - you have to apply toning to the inner side (backfacing) of your object, because outside rays return distance from other objects - as ray begins from camera, not from light source.

As far as mapping goes - approaches are different - for instance: http://lesterbanks.com/2012/10/using-blenders-raylength-node-to-create-a-re-usable-custom-absorption-shader/


Which bpy.data.objects option controls the color of the object's texture? I have 784 cubes in my scene right now, and I can loop through all 784 of them by using

for i in range(784):
    bpy.data.objects[i]

Each cube represents a pixel which is in grayscale color, a value between 0.0 to 1.0. I already have my colors extracted from a 2D grayscale image and now I just want to transfer the corresponding brightness value to the cubes. Basically, do:

bpy.data.objects[i].find_its_color_options.change_brightness_to(0.873)

and repeat for all 784 cubes. I am currently using blender 2.8 but I don't think this is going to be much different than 2.79.

Any help is appreciated!

If you use in bpy.data.objects.active_material.material.diffuse_color you can set the diffuse color, and there are some other properties that may be useful here and here

In my experience, materials are tricky with scripts. You need to remember that materials are separate from the objects, so if the same material is assigned to every cube, changing it for one material will change it for all of them.


Hair particle system rotation is not working I seem to have encountered an issue where the rotation function for hair particle systems doesn't change the rotation of the hairs at all.
I am using Blender 2.91 (recently updated from 2.82a, as I thought updating to the stable branch might solve the issue) and Eevee, and I'm trying to get a setup where hundreds of objects are sitting on the surface of a larger object. However, when I instantiate a new hair particle system, the direction of the hair particles seem to be completely randomized and absolutely nothing I do will change them. In the below screenshots you can see that I have advanced turned on, rotation control turned on, and the orientation axis set to tangent. However, the hair is very clearly not pointing in the direction of the face tangent. What's more, no setting will change the orientation of the hair in any way that I can tell.
This is the state after creating a new particle system, setting number of particles to 100, switching to hair, turning advanced on, turning rotation on, and then setting orientation axis to normal. No other changes to the particle system have been made.
If anyone could, please tell me if there's something I'm forgetting, misunderstanding, or if this is a glitch. Work-arounds or other possible routes of action would also be appreciated.
Here is a blend file that should demonstrate the issue
To Summarize

What I want is for all hair particles to align with the normal vector of the vertex or face it is emitting from.
The current hair particles are all offset from the normal vectors by a seemingly random amount in a seemingly random direction, so just adjusting the rotation of an object that is being used as the hair model will not help.
The general methods of adjusting the alignment of the hair particles through use of the rotation option are not having any effect.

I have come across a work-around for this issue. When experimenting, I placed hairs particles on other objects in the scene and notice that they lacked this issue (their orientation axis could be fully manipulated and were properly aligned to begin with), so I concluded that the issue was in the object itself. Thus, my solution was to replace the object.

I separated the "vines" from the "log" by selecting everything in edit mode with A and then using P followed by selecting loose parts.
Then I created two large half-pipe cylinders around the log object (one above and one below) and used the shrinkwrap modifier with the target being the log. I had to select the project option because any other option resulted in issues stemming from the (presumably corrupted) normal data. This is also the reason for making them be half-pipes instead of full cylinders, as I could not get a full cylinder to work correctly with the project option.
After applying the shrinkwrap modifier, I had a replacement object with proper behavior, and was able to produce the images below.

Note that if you find this question because you have a similar issue, this might not work for complex models. I am lucky because my object was essentially just a deformed cylinder.


Faces black/flickering How do I make the two strange faces normal? I have tried several things with the normals, as shown in the gif, but nothing helps.

Those aren't Normals, those are Doubles
Just select "Remove Doubles" in mesh options (W)


selection history from "shortest path"? is it possible to retrieve the selection history(the specific sequence) of vertices selected using "shortest path"?

Using bmesh, I can get the selection history by doing:

vertlist = [elem.index for elem in bm.select_history if isinstance(elem, bmesh.types.BMVert)]

But this unfortunately only works for verts, that have been manually selected(by hand and via "next active").

If anybody has any insight into this, I'd appreciate it.

this script will help you

import bpy, bmesh

print("*"*50)
oa = bpy.context.active_object
obj = bpy.context.object

bpy.ops.mesh.shortest_path_select() #add for request

me = obj.data
bm = bmesh.from_edit_mesh(me)

v1,v2 = [elem for elem in bm.select_history if isinstance(elem, bmesh.types.BMVert)]

list = [v1]
verts = len([v.index for v in bm.verts if v.select])

cont=0

while cont< verts:
    v=list[cont]
    edges = v.link_edges

    for e in edges:
        if e.select:
            vn = e.other_vert(v)
            if vn not in list:
                list.append(vn)

    cont+=1

print(list)

for v in list:
    print(v.index)
bmesh.update_edit_mesh(me, True)


Where shading "smooth" and "flat" are located inside Blender 2.80? I would like to know where the realtime rendering options for faces "smooth" and "Flat" are located inside Blender 2.80.

In the 3D Viewport, while in Object Mode, under the header's "Object" menu

To use it in Edit mode for some selected faces, look again in the Viewport's header, but this time under Mesh > Shading > Smooth/Flat Faces


How do I smooth a low-poly mesh without shrinking its volume? I am trying to turn a low-poly character mesh into a smooth high-poly for better sculpting, is there a good way to do that? Subsurf modifier makes the character skinnier.

example left cylinder to right:

There is actually no need to subdivide mesh before you sculpt.  If you go into sculpt mode with your character selected, you can then select Dyntopo > Enable Dyntopo on the toolbar.

This will automatically subdivide you mesh as needed while you are sculpting.  You can change the Detail Size to a lower number for more detail.

Here is what Dyntopo with a detail size of 3px does to a cube that only had six faces before I started sculpting:

As you can see, with dyntopo enabled, Blender only subdivides the area that is being sculpted, instead of subdividing the whole mesh.


Animate mesh size change I have this cylinder which I want to get longer (z size) over a certain 50 frames. However, when its size is say 20 at frame 1, then I create a keyframe at frame 50 and change its size to 20, then its size at frame 1 changes to 50 to. How can I get it to animate going from frame 1 to 50, getting longer? Thanks in advance.

I can't upload pictures, so here's a drawing of what I want:

frame 1:

|
|
|

frame 25

|
|
|
|
|

frame 50

|||||||

You have to create a size keyframe on Frame 1 at size 20. Then when you move to Frame 50, scale it up and add a new keyframe, you'll get the scaling animation working correctly.

In addition, if you want the scaling effect to be more even you can also switch into the Graph Editor and change the keyframe interpolation from Bezier to Linear.


Interrupted loop-cut alternative Unfortunately I have deleted some face. Now my loop cut stop at the deleted face.
I am trying to model my lock, but without a loop cut I am currently lost.

Can anybody tell me how to model my lock? Do I have to rebuild the deleted faces to make perfect loop cuts again, or can / should I do it differently?

Thanks.

The first thing i tend to teach people in 3d modeling is that loop cuts are good and that their geometries should be quad based.

Having told them that I immediately tell them that loop cuts arent ALWAYS a good thing and that not having them is sometimes preferential before they start to spam loops everywhere generating unnecessary geometry.

Its much more important that you have clean and simple topology than it is to work with loop cuts (unless you have a very good reason)

In your case I would finish the door and then model the lock as a separate object, keeping the geometry as simple as possible. If you parent the lock to the door (ctrl+p) it will stay with the door at all times when you move it.

Don't be afraid of non-manifold objects/meshes.
Unless you work in 3D printing, then be very afraid.


Rendering - Save Intermediate When I render an image that could take hours to finish is there a way that I can save the render  at every hour, so that if my computer crashes I do not loose everything?

In the performance panel (for either BI or Cycles), there's a Save Buffers option which will save the render to a layered EXR file in your temp directory quite often. I could be mistaken, but I think it's each time it starts a new tile.

On windows, this temp directory is located at C:\Users\[name]\AppData\Local\Temp\ by default, but will use the path specified in User Preferences > File > Temp if set.


Blender hair particles shape. Change to ribbon Using blender 2.79. In earlier versions of blender in particles settings i'm using ribbon particles shape, but in 2.79 i'm unable change hair particles shape to flat ribbon. Why this option removed?

One way to do this is create flat ribbon object and using it to render object? Right?

Maybe there is some other way?

Old blender dialog

New blender dialog

Found this!

This setting is now in render tab - geometry section.


How to Blur a Video Background in blender? I want to make those Shallow Depth of Field type videos but don't have any expensive cameras. So can I make a video with my regular camera and just the blur the background in blender? Maybe with masking or something you know I don't want any chroma or something like that. What I want is to blur the already existing background in my video like a park, a room, a wall or anything.

Yes, you can do it. There are two methods I can think of right off the bat:

Use a Difference Key! This will NOT work if your camera is moving, but can give you decent results that don't require masking by hand. If your footage is from a stationary camera that was mounted to a stable tripod, you could take the difference of the background with no actors, and then the background with actors. Just take the time to shoot the background alone, and then bring your actors in for another shot without moving the camera at all (you might want to just let the camera record continually for both shots so you don't have to touch it).

A word of warning though: if your actors appear in color that is
    similar to the background footage, the mask will have lots of nasty
    holes in it. So don't wear blue shirts if your background is blue,
    etc.

Also, the backgrounds in both shots have to stay EXACTLY the same; I would avoid anything that moves like trees in the wind etc because they will ruin the Difference Key. Cheap cameras also tend to auto adjust exposure / brightness, and this will also ruin your Difference Key if this happens. A good rule is to shoot in a bright area and do not get too close to the camera or block the light from entering it in any way. Also, watch out for shadows because they WILL show up with your actors, and cannot easily be separated (unless you mask them out by hand or try some layer filter curves to block darker color values).

Using a Difference Key on the two pieces of footage, you can apply a blur effect to your background while preserving the focus of your actors. In the image below, I have simulated a background shot, and a background shot with an actor, and used the Compositor to achieve fake DOF. You can use the same node set up for your video footage! You could further tweak the layers in Compositor to get more specific results, but I wanted to keep the example as simple as possible so you can build on it however you like. Notice on the "Difference Key" node I turned "Tolerance" to "0.009". You will need to play with "Tolerance" and "Falloff" to see how it affects your video footage for best results!

Use Tracking and Masking, and patience. If your footage has spots that work well for tracking (high contrast areas that are stable) you could use masks in Blender like the guy in this Youtube tutorial explains, showing how he did it on a still photo, but this same technique can be used with video, even video from a moving camera if you can track and animate the mask for the subject. The difficulty level to get good results varies a lot depending on what you want to do, and how complex your subject / scene is. Tracking and masking is awesomely powerful, and the scope of it is beyond what I can answer right now. I will say though, you will have to plan your shots well if you want the best tracking results, even placing markers or using props to make things easier when working with the footage in Blender. For Masking, it helps if you know how to use the Pen Tool / Bezier curve handles. Knowing those tools is essential for making good masks. Best wishes!


Apply collision event only on a specific mesh I've been using Blender Cycle render for over an year and never done any game engine... This morning I looked a tutorial how to make an object move and after that I wanted to experiment a bit.

I did a simple project where I just move a ball in a box. The box is make of 2 meshes, a plain for the ground and a 4 sided cylinder(I don't know why I did't use a cube...) I setted those 2 meshes on static and the ball on dynamic.

But there is the problem. I put a collision sensor to make the ball bounce back with the proper rotation, but this event trigger even if the ball does not it the front wall. I understand that the ball is always colliding with the floor, but i would like to trigger this event only when hitting the wall when the up arrow is pressed.

Is there a way to trigger a collision event on the wall only?

Here

I found out by enabling the 'Invert' button, it's working like a key release event.

So I createdstrong text
another sensor keyboard event on up key
while Invert enabled linked to my 'Stop' logic block

and it works fine.


Is there a shortcut to change snapping type? I really like the "Pie-menus" addon, it allows me to change my editing setting really quickly. It's awesome.
I also love snapping, it's so snappy and fun, but I need a better way to change the snapping type (i.e. vertex, increment, or face) than this:

I think a hotkey for toggling snapping type and pie menus would work great together, in fact, it's probably already a thing. So what is the key shortcut?

There is. Ctrl + Shift + Tab. In addition, you can also toggle snapping altogether from there.

You could literally have hovered over it :P


2.82a - Can't import multiple videos to sequence editor maybe a dumb question, but has anyone else had issues importing multiple video clips to the sequence editor in 2.8? With the older versions, you could select all clips in a directory using the A-key and they would import all clips in series. Beginning with 2.8, I get an error when using this same process. It seems like Blender is trying to load the directory instead of all the files in it maybe?

Any thoughts? Maybe with the implementation of the new file browser, there's a setting i'm missing?
Thanks everyone!

This has been fixed in 2.83 beta. Grab it here: https://builder.blender.org/download/


Ruler doesn't start from mouse & scale on object & pose mode is different The ruler's start point appears at certain distance from the mouse

As for the issue on scale, I've set my scene to metric. I'm using armature to drive keyshapes so on object mode the armature's location is 1cm = 1cm while I was in pose mode, moving the bones, 1cm = 10cm.

Anyone knows what's wrong? This is the 3rd time I'm using this method and it worked fine in other previous projects

I've tried resetting the user preference but it didn't work.

Let me know if there's anything else I need to show or clarify.

Using Ruler /Protractor

Ctrl+Left Mouse Button (will snap the start point) and Hold ctrl and drag

It snap to the edges


How can I get particles to collide with objects? I want my particles to form a pyramid on the ground; how can I do that?
- It seems not possible, how can i make them settle in a cup or somethign like that; i mean the settings to put for cup's plane or any tip.
Thanks

If you would like to form a pyramid from particles I recommend that you use keyed physics.

Here are my particle settings

Pyramid's particle settings called Initial

Cube's particle settings called Main

Start frame: 1, end frame:100, lifetime: 250


How to Decompose and Compose the local transform matrix The Setup:
I have a simple setup with two cube objects with a parent child relationship like so:

The Red cube is a child object of the green cube.
The Red cube has the following transforms:

The green cube has the following transforms:

The Problem
The thing I am confused about is, when I try to decompose the local_matrix of the red cube and compose it back to its original transform matrix. I get different results. Below is a script I used to decompose and  compose the local matrix. Any clues why they are different? And what is the correct way to re-compose the local matrix given the translation, rotation and scale matrices.
Script and Result
import bpy
import mathutils
import math

myObject = bpy.data.objects['Cube.002']

print("\n location mat")
loc = myObject.matrix_local.to_translation()
print(loc)
mat_loc = mathutils.Matrix.Translation(loc)
print(mat_loc)

print("\n rotation mat")
rot = myObject.matrix_local.to_quaternion()
print(rot)
mat_rot = rot.to_matrix().to_4x4()
print(mat_rot)

print("\n scale mat")
scl = myObject.matrix_local.to_scale()
print(scl)
mat_scl = mathutils.Matrix.Identity(4)
mat_scl_x = mathutils.Matrix.Scale(scl.x, 4, (1,0,0))
mat_scl_y = mathutils.Matrix.Scale(scl.y, 4, (0,1,0))
mat_scl_z = mathutils.Matrix.Scale(scl.z, 4, (0,0,1))
mat_scl = mat_scl_x @ mat_scl_y @ mat_scl_z
print(mat_scl)

print("\n myLocalMat mat")
myLocalMat =  mat_loc @ mat_rot @ mat_scl
print(myLocalMat)

print("\n local mat")
print(myObject.matrix_local)

 location mat
<Vector (0.0000, 0.0000, 3.0000)>
<Matrix 4x4 (1.0000, 0.0000, 0.0000, 0.0000)
            (0.0000, 1.0000, 0.0000, 0.0000)
            (0.0000, 0.0000, 1.0000, 3.0000)
            (0.0000, 0.0000, 0.0000, 1.0000)>

 rotation mat
<Quaternion (w=0.9280, x=0.0000, y=0.0000, z=0.3726)>
<Matrix 4x4 (0.7224, -0.6915, 0.0000, 0.0000)
            (0.6915,  0.7224, 0.0000, 0.0000)
            (0.0000,  0.0000, 1.0000, 0.0000)
            (0.0000,  0.0000, 0.0000, 1.0000)>

 scale mat
<Vector (1.5811, 1.5811, 1.0000)>
<Matrix 4x4 (1.5811, 0.0000, 0.0000, 0.0000)
            (0.0000, 1.5811, 0.0000, 0.0000)
            (0.0000, 0.0000, 1.0000, 0.0000)
            (0.0000, 0.0000, 0.0000, 1.0000)>

 myLocalMat mat
<Matrix 4x4 (1.1422, -1.0934, 0.0000, 0.0000)
            (1.0934,  1.1422, 0.0000, 0.0000)
            (0.0000,  0.0000, 1.0000, 3.0000)
            (0.0000,  0.0000, 0.0000, 1.0000)>

 local mat
<Matrix 4x4 (1.4142, -1.4142, 0.0000, 0.0000)
            (0.7071,  0.7071, 0.0000, 0.0000)
            (0.0000,  0.0000, 1.0000, 3.0000)
            (0.0000,  0.0000, 0.0000, 1.0000)>

Best Regards.
QC

Using the 3x3 matrix rotation part.
Does a child object inherit the matrix from the parent?
Can decompose a matrix via Matrix.decompose()
loc, rot, scale = M.decompose()

the rotation is given as a quaternion.  There is no guarantee that that the same rotation matrix will be returned when converting that quaternion back to a matrix.  https://en.wikipedia.org/wiki/Rotation_formalisms_in_three_dimensions#Rotation_matrix_%E2%86%94_quaternion
Test script, with both "standard" quaternion decompose and using the 3x3 rotation matrix part.
import bpy
from mathutils import Matrix

ob = bpy.context.object
# basis (or local) matrix
Mb = ob.matrix_local

print("Input")
print(Mb)

t, q, s = Mb.decompose()

T = Matrix.Translation(t)

R = q.to_matrix().to_4x4()

S = Matrix.Diagonal(s.to_4d())

M = T @ R @ S
print("Quaternion decompose")
print(M)

print((M.to_3x3() - Mb.to_3x3()).determinant())

R = Mb.to_3x3().normalized().to_4x4()

T = Matrix.Translation(
        Mb.to_translation()
        )

S = Matrix.Diagonal(
        Mb.to_scale().to_4d()
        )

M = T @ R @ S

print("3 x 3 decompose")
print(M)

print((M.to_3x3() - Mb.to_3x3()).determinant())

Sample output.
Input
<Matrix 4x4 (1.8334, -0.5595,  0.0113, 0.6324)
            (0.5749,  0.1069, -0.9128, 2.6868)
            (6.2012,  1.4492,  0.3085, 0.8749)
            (0.0000,  0.0000,  0.0000, 1.0000)>
Quaternion decompose
<Matrix 4x4 ( 4.5809, -1.0592, -0.1913, 0.6324)
            (-1.7931, -0.0093, -0.9261, 2.6868)
            ( 4.2364,  1.1414, -0.1851, 0.8749)
            ( 0.0000,  0.0000,  0.0000, 1.0000)>
0.6159369945526123
3 x 3 decompose
<Matrix 4x4 (1.8334, -0.5595,  0.0113, 0.6324)
            (0.5749,  0.1069, -0.9128, 2.6868)
            (6.2012,  1.4492,  0.3085, 0.8749)
            (0.0000,  0.0000,  0.0000, 1.0000)>
0.0


Shadow Sun Object data Propertie doesn't have softness setting I am missing some of the settings and can't find them.
First one is mine.
Second is from the tutorial made in August 2019.
Did they move it somewhere else and how can I get to that?

I believe this setting has been changed to a global setting recently. You can find it in the render Settings, then the Shadows Subpanel, and the "Soft Shadows" checkbutton.


Where do I have to put the Bump on my nodes? I made a material, added a bump before but it didn't worked at all.
where do I need to put the 'Bump' option on my nodes? Which is the correct place? I'm pretty new about using this.

Please help me!

Add > Vector > Bump. Connect like this:

You can also feed the texture directly into the displacement input of Material Output node and use Multiply Math node to adjust the strength.


how do I stop blender from randomly creating multiple (often disconnected) vertexs in the same place? ver 2.82a While trying to create a low poly standing model I keep finding (while loop subdividing or while grabbing individual vertexes) a face has been lifted off with two (often) disconnected vertexes overlapping the same spot. The model seems to keep doing this in spots I'm not working on even.

I'm not sure, is this a bug?

Go to mesh > clean up > merge by distance... figured it out but any idea why it happens?


How to map a procedural brick texture to a sphere? Is there a way to map a procedural brick texture to a sphere ? I tried with Textures Coordinates and Mapping nodes, but it's still not good.

Enter Edit Mode on the Sphere Object, press U and unwrap using "Sphere Project".
In the Node Editor, press shift+A>>Texture>>Texture Coordinate and connect the "UV" Output with the "Vector" Input in the Brick Texture node. Finished!

I hope this helps you ;)


Weird bug with Alembic & Blender 2.8 + Eevee I am working on my second project with Blender and I have a very weird bug.

I import Alembic files created with Quill and I time correct it with expressions to reproduce the stopmotion look (6fps or 12fps, converted to 25 fps).

It works well in the viewport and I already rendered my previous project with success in Cycles. Unfortunately, when I try to render my full scene with Eevee, my loops seems broken, and the animation becomes weirdly jerky and random.

On this short gif, you can see that the character animation is not smooth (sorry for the bad quality of the gif, it is limited by this website) :

When I try to unactiv some objects from rendering, it can randomly works again, but there isn't a specific object responsible of the bug.

It looks like that Eevee is randomly bugging with Expressions (or Alembic) when I have too many layers. I tried with differents Blender releases, it is still the same.

Is it a known problem ? Do you have suggestions to bypass this problem and finish rendering?

Thanks !

Here is the expression I use to loop and keep the stop motion effect :

(round(25*round(frame*wantedfps/globalframerate)/wantedfps) - 1) % animationlenght+ 1

It works in the viewport, or with Cycles and lightweight scenes in Eevee. But it doesn't work with my scene with Eevee until I unactiv some objects.


Animate an object along the z-axis in a sin wave So I wanted to make an animation of an object where it bobs up and down along the z-axis, like a sin wave on a graph.

I understand one way of doing this with drivers, by which I add a driver to the z-axis of the object I want to move and then assign a scale, location or rotation to the empty driving the movement of the object (that was a bit convoluted I know, but it'll be better illustrated by the gif below).

Is there a different method that I can use to achieve the same animation, but not require the use of a driver (something that I have to move or scale)? I want to be able to control the intensity of the waves through the use of some simple maths. For example: Sin(x) (the red line) and sin(5x) (the blue line) have a different frequency in waves.

I want to be able to control the animation through using similar principles in Blender.

You can use the Graph Editor for this by adding Modifiers.

Simply add a single keyframe to your object's Z-Coordinate (right-click the property in the Property panel (N) and select 'Insert Single Keyframe') and then swap to the Graph Editor.

In the Modifiers properties panel add a Built-in Function, select 'Sine', and adjust the properties (Amplitude, Phase Multiplier, etc.).


Face Expressions from one mesh to another I have 2 human faces in a scene, one of them imported with a heap of keyshape facial expressions,
and another mesh which only has one keyshape. open mouth.

I would like to know if there is any way to use mesh deformers or other modifiers to somehow copy the general changes of a different mesh to mimic it.

Maybe there is an advanced way with bones / drivers or something else.??

some of the facial expressions are really cool, at the worst case I would copy the ones I like one at a time manually editing mesh for keyshapes, but if there is another way I'd like to learn.

The following 3 images show the Face on the left has some expressions I would like the face on the right to copy..

If the meshes are different regarding their vertice (count and inter-vertice-connection - the "edges") there is no native way to do this - at least not with native blender tools. I don't know of any addon, which does this - I often need to have such a tool and didn't find any.

The reason is, that the shape keys are recordings of vertex displacements.
Think of a sphere with shape keys and try to transfer them to a cube....
(ok...that example is extreme...;) )


How do I delete/remove/replace an image using a script? I have a script that inserts three images (Image1, Image2, Image3) into a blend and then renders the video. It works great. The images show up exactly when and where they are supposed to.

The problem is that I want to be able to run the script as loop, picking up a different set of images each time through the loop. I have that part working just fine except...

The new images (Image1.001 - Image1.00n, Image2.001 - Image2.00n, Image3.001 - Image3.00n) simply overlay each other. Since I am using .png images with transparencies, this is a real problem. To be clear, these are foreground images, not a texture or anything similar.

I have tried everything I can find to delete, remove or replace the original images with the new ones via my script. Nothing I have found and tried has worked. I have to believe there is a way to do this.

Help??? Please.

Here is the relevant part of the code:

import bpy
import csv
import sys

csv_path = sys.argv[5]
file = open(csv_path, 'rU')
reader = csv.reader(file)

fnt = bpy.data.fonts.load('../fonts/Helvetica-Bold.ttf')

s = bpy.context.scene
sed = s.sequence_editor
sequences = sed.sequences

header = next(reader) # 1st line is header`

data = [ ]
for row in reader:
    name0 = row[0]
    pic2 = 'gfx/'+ row[2] # car(s)
    pathout = 'renders/proj003/' + row[4] + '.m4v'
    f = s.objects['Text']
    f.data.body = name0

    frame_start2 = 202
    frame_end2 = 266
    image_strip2 = sequences.new_image("Image2", pic2, 5, frame_start2)
    image_strip2.frame_final_end = frame_end2
    image_strip2.blend_type = 'ALPHA_OVER'

    bpy.context.scene.render.filepath = pathout
    bpy.ops.render.render(animation=True)

bpy.ops.wm.quit_blender()

Image1
Image1.001
Image1.002

Note that 'Text' is replaced properly.

Some options

Result  with image strips are overlapping would indicate you are  setting start and end frames incorrectly in loop. If the idea is to make an animation of all the added strips,  not sure then why the render operator is inside the loop.

If that is how you want it, will need to  remove the image strip, replace the image strip, change the image strip data,  or batch render one make at a time

Remove the image sequence  Not sure if this will work, could be dodgy removing parts of a scene before it is fully rendered. Add code after render op.

 sequences.remove(image_strip2)

Secondly create the strip once, and change image settings, rather than creating new strip each time. This is equivalent of how you are resetting font body. (py console example) added strip with some dummy image, changed directory and element (image) name to a real one.

>>> im = sequences.new_image("Dummy", filepath="/tmp/xxx.png", channel=2, frame_start=3)
>>> im.directory
'/tmp/'

>>> im.directory = '/home/batfinger/Desktop/'
>>> len(im.elements)
1

>>> im.elements[0].filename
'xxx.png'

>>> im.elements[0].filename = "images.jpeg"
>>> im.update() # required???

Thirdly, rather than loop the csv inside the script, could set up a blend file to render a single car make, pass the make string and images to it and run from some shell script.

How to pass command line arguments to a Blender Python script?

For batch scripts there is no need to call the exit operator, as this is default behaviour.


What are the units for camera shift? I'm having trouble making sense of the units of a camera lens shift.  It ranges from -2,2, defaulting to 0, but it doesn't seem to be in scene units, nor does it seem to be in radians.

Anyone have an idea what the values represent?

It seems to be in percentage or fraction of the render size (in pixels).

That means that a lens shift of 1 shifts the camera exactly one frame unit in a certain direction, making it frame exactly outside the previous default framed area.

This is measured however in relation to the largest dimension of the rendered frame size. So lets say you are rendering in Full HD, that is 1920 x 1080 pixel image; a frame shift if 1 unit will shift exactly 1920 pixels in any direction, that is up/down/left/right.

This may seem obvious while shifting sideways towards the X axis, but might seem random while shifting in the Y axis.


Trapezopid shaped face to square UV coordinates has unfavourable skewing When I map a trapezoid shaped face to square shaped uv coordinates it doesnt skew how I would expect it to. I want it to go to from fat to slim pixels. Instead it seems to skew based on triangles maybe?

(object scale is applied btw)

If you have a seam down one side and around the circumferences top and bottom, then you can:

Align the approximately cylindrical region in an orthographic view (minus the caps)
U unwrap the tube with 'Cylinder Projection'


Adding multiple colors to an object without assigning them I want my object to be able to have multiple color choices to choose from, but I don't want to make it multicolored by assigning the colors to different faces. Like, say I made a ring, and I wanted people to be able to choose what color they want it to be. How do I do that?

You can add as many material as you want and change the active material whenever you choose.

You click the + button next to the material name to create a new material.

You will want to make sure you click the F so that is highlighted, this creates a fake user that ensures the material is saved with the file. Normally unused materials will not get saved.


Looking for a correct formula I have set up a scene in the bge where I need to animate the mist. I have an object that loops between 0 and 4999 and I assigned its action current frame number to a property called 'axisT'
Now I want to be able to modulate the result so that at frame zero mist color = [1, 1, 1] and at frame 1250 mist color = [1.0, 0.9, 0.8] and so on at each step until my loop starts back.
What is the correct way to do this ?

Sorry to answer my own question but here is how I got through it.

import bge
import math

scene = bge.logic.getCurrentScene()
A = scene.objects['Axis']['time']
mist = scene.world
F = math.sin(math.pi*A/2500)

if (A) < (1250):
    mist.mistColor = [1.0, 1.0-F*0.1, 1.0-F*0.2]
elif ((A) >= (1250)) and ((A) < (2500)):
    mist.mistColor = [F*0.8+0.2, F*0.7+0.2, F*0.6+0.2]
elif ((A) > (2500)) and ((A) < (3750)):
    mist.mistColor = [0.2-F*0.6, 0.2-F*0.6, 0.2-F*0.3]
elif (A) >= (3750):
    mist.mistColor = [1.0 + F*0.2, 1.0+F*0.2, 1+F*0.5]


How can i copy NLA Tracks from one armature to another? I want to copy the NLA action strips from one armature to another armature. The simple approach does not work of course because the nla_tracks is read only :

tgt.animation_data.nla_tracks = src.animation_data.nla_tracks

So how would i do this?

sidenote: both armatures can use the same actions, so i expect that the NLA strips shoul dalso work on both armatures

Here is Python for deep copy. Just replace the names of the source and target armatures. Hope it helps - Sri

import bpy

sourceObj = bpy.data.objects['SOURCE_ARMATURE']
targetObj = bpy.data.objects['TARGET_ARMATURE']

if targetObj.animation_data is not None:
    targetObj.animation_data_clear()

targetObj.animation_data_create()

source_animation_data = sourceObj.animation_data
target_animation_data = targetObj.animation_data

if source_animation_data:
    for source_nla_track in source_animation_data.nla_tracks:
        target_nla_track = target_animation_data.nla_tracks.new()
        target_nla_track.name = source_nla_track.name
        for source_action_strip in source_nla_track.strips:
            target_nla_track.strips.new(source_action_strip.action.name, source_action_strip.frame_start, source_action_strip.action)


How to read all ‘recent reports’ from info window I think I know how to make a report that contains information from the info window.
I think the report is saved in a textblock called ‘recent reports’.

My question. How do I read the textblock, or how do I ‘print’ the textblock, or how do I save a file of ‘recent reports’?

I have read:
How do I get the Info window's log text with Python?

How to use the textblock operator in Python

https://blenderartists.org/t/copy-from-info-panel/700032/2

Recent Reports

Modifying code from https://blender.stackexchange.com/a/62620/15543

The code in answer prints the textblock.

This one removes all other recent reports from blend file, creates a new one via operator,  and writes it to filepath

import bpy

#remove other Recent Reports
reports = [bpy.data.texts.remove(t, do_unlink=True)
           for t in bpy.data.texts
           if t.name.startswith("Recent Reports")]
# make a report
bpy.ops.ui.reports_to_textblock()
# save the report to file

filepath = "recent_reports.txt"
with open(filepath, "a") as f:
    f.write(bpy.data.texts["Recent Reports"].as_string())

Alternatively, if you don't want to clean up others, the new text added by operator can be found using sets.

import bpy

texts = set(bpy.data.texts)
bpy.ops.ui.reports_to_textblock()
new_text = (set(bpy.data.texts) - texts).pop()
filepath = "recent_reports.txt"
with open(filepath, "a") as f:
    f.write(new_text.as_string())

both write to a file "recent_reports.txt" in the same folder blender was opened


VSE how to transition from one video strip to another with effect like turning (flipping) page? I would like to setup a video transition that looks like if you were turning a book page (with the current strip image) so that the new video strip appears after page is turned.

Is there a way to do this transition in BLENDER VSE?

In VSE I don't know how. However you can model a book, and on the pages you can build a double sided material: you need a geometry node with "backfacing" connected to the fac of a mix shader node. Connected to the mix shader's shader slots, will be the 2 movies/image sequences you want for the transition. Next, you just need to rotate the page as you want/need. There are tutorials on model a book or animate the pages, like this one: https://vimeo.com/11232299 node setup would be something like this https://blenderartists.org/forum/attachment.php?attachmentid=154566&d=1316065621&thumb=1
I talked to a friend and he recommended a external free software called VSDC video editor, as it is easier to acomplish this (http://www.videosoftdev.com/free-video-editor/download)


How can I stop specs of light coming through my object? I am currently creating a pumpkin to sing (don't ask) I have got it singing but I have realized that I have specs of lighting coming on the outside of my pumpkin. I really need to get rid of all these light specs on the outsides as it is not very good. I have tried moving the light around etc. but have not solving the issue.

Turn of caustics in the render settings.

here is a superb video that tells how to fix all types of problems like that.
http://www.youtube.com/watch?v=vbj4d5XL0NA

watch min. 32 for your specific problem.


Best output file format for 3D model to Unreal engine 4 I am creating models in Blender for a game in Unreal Engine 4.  What output file format is the best and I can use for this for commercial purposes?

I use Unity, another game engine. It does accept normal .Blend files. However, I'm not sure about Unreal engine. I would recommend .fbx as this is a sort of global file type for models like these.


Pie Menu simple script condition I've been using Pie Menu Editor and I'd like to create one that activates only in object mode when nothing is selected. I did a lot of research but since I have no background in coding it makes it very hard for me.

The idea is to have one pie menu to create meshes when nothing is selected and another one with the same shortcut to merge two meshes together for instance.

It seems like it has to do with poll options. An example they give for instance if you want to create a pie menu that activates only while in edge mode you have to write :
return C.scene.tool_settings.mesh_select_mode[1]

Thank you for your help :)

I found a way !!!

return len(bpy.context.selected_objects) == 0

This works just fine :)


Reading boolean values from file always return "True" from bge import logic
path = logic.expandPath("//")

def save():
    cont = logic.getCurrentController()
    own = cont.owner
    # 'info' is what will be saved to the file.
    # Example:
    # info = str(*What you want to save*)

    info = str(own['pink'])+","+str(own['red'])

    file = open(path+str(own)+".txt", 'w')
    file.write(str(info))

def load():
    cont = logic.getCurrentController()
    own = cont.owner

    file = open(path+str(own)+'.txt','r')
    line = file.readline().replace('\n','').split(',')
    own['pink'] = bool(line[0])
    own['red'] = bool(line[1])

instead of casting to a boolean you can use them in an expression:

file = open(path+str(own)+'.txt','r')
line = file.readline().split(',')
own['pink'] = line[0] == "True"
own['red']  = line[1] == "True"


How to import .dmx files (SFM sessions) into Blender I downloaded a model for SFM but the model is in .dmx format instead of .mdl format. Is there any way I can get the model from the .dmx file?

I am a complete noob when it comes to this, but I have found a bunch of videos and written a short list on how to get models from steam source filmmaker to blender with textures. This may or may not be helpful to you. The Youtube video I linked does not explain everything, but he gets you set up with most of the programs. I was able to get Lifeline from Apex Legends character model imported with bones, but I had to retexture myself. These are the personal notes I made.

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

Moving Character Models from Steam to Blender
Programs Needed - Blender, VTFEdit, Crowbar, Steam - Join Source Filmmaker

Go to source Filmmaker on Steam browser
Don't open it. Type in search bar for model
Open crowbar and click download tab
Copy link on steam and paste in Item ID or link bar
Change output to folder name
Click download
Click on Decompile tab
Browse for MDL file in the created folder from step 5
Choose an output to folder
Click decompile
Once in blender, click import smd
Use VTFEdit for textures
Click on tools
Convert folder button in order to convert vmt files to png files
Use blender shader editor to apply textures

Image Texture => Color Ramp and Principled Shader
Color Ramp => Bump
Bump => Displacement on Material Output Node
Principled Shader => Surface on Material Output Node


UV Map/Atlasing Texture Scaling Issue I'm not really sure how to phrase this, and I'm a bit of a novice still, but basically I'm trying to atlas an object that uses multiple materials/textures, and I'm running into issues that degrade the quality. This is an example of just one of the materials, it is meant to be mapped to a 512x512 image.

https://i.imgur.com/1tWTzIC.png

That works fine of course, and the quality of the image is as it should be. The problem is I've created a 4096x2048 image that contains all of the objects textures and plan to map each material to the corresponding texture. The problem is when I import the image the materials want to scale themselves to that image in the uv editor like this.

https://i.imgur.com/XNiyR9q.png

I've scaled the material down on the uv editor to fit its texture, but the issue I've run into is that the quality has then gone down significantly.

What I want is to import that image, and have the material stay the same size as it was for the 512x512 image so that I can retain the quality and properly create the mapping.

UV mapping is used to position a vertex on an image. The U and V values for a vertex are between 0.0 and 1.0, a value of 0.0 means it is on the left or top edge of the image, while 1.0 means it is on the right or bottom.

Whether you use a 512x512 image or a 4096x4096 image, a value of 0.5 will always be in the middle of the image. Where a face uses vertices that are 0.25 apart, the face will use one quarter of the image, a larger image means more detail on the given face.

In your example, you layout the UVs on a 512x512 image and then use a 4096x2048 image. As the new image is twice as wide as it is high the texture gets stretched in the one direction, which depends on the face orientation on the image.

If you want to increase the texture detail, you want to increase the image resolution the same amount in both directions.

It is possible to bake multiple textures onto one, which sounds like what you want to look into. To get the result, you want to make a new UVLayout that positions the multiple materials onto different parts of the image and then you bake the old materials onto the new image. This method allows you to convert between a square and rectangular image texture.


Transforming armature bone by matrix of another bone in pose mode I am attempting to move an armature bone in edit mode by the inverted matrix of another bone in pose mode. My reasoning for doing this is because I have joined two armatures and have lined the bones of the second armature up with the first armature while the first armature was in pose mode (made it much easier). So what I'm attempting to do is keep the same location/rotation offsets between the two, but transform the second armature's bones to be relative to the default position of the first armature. I hope that makes sense. I believe this is possible, but I'm not sure exactly which matrices I need to be applying to get the desired effect as my below script does not provide desired result. I feel like I'm missing some vital key element...might anyone know what that is?
import bpy
from mathutils import Vector, Matrix
import numpy as np

matFilePath = 'Z:\\models\\myfps\\weapons\\pretty\\arms\\script\\mat.txt'

def convert_matrix_to_string(some_matrix):
    # omitted for brevity

def convert_file_to_matrix(some_path):
    # omitted for brevity

# select the bone in pose mode and run this to save to matFilePath
#for b in bpy.context.selected_pose_bones:
#    f = open(matFilePath, "w")
#    f.write(convert_matrix_to_string(b.matrix))
#    f.close()

# load in the matrix from file
hand_pose_mat = convert_file_to_matrix(matFilePath)

# apply inversion of matrix to bone
for b in bpy.context.selected_bones:
    b.transform(hand_pose_mat.inverted())

The below images should assist in explaining what I am attempting to accomplish:

The solution to this was to transform bone2 by the inverse of bone1's pose mode matrix, then transform bone2 again by bone1's matrix in edit mode:
for b in bpy.context.selected_bones:
    b.transform(hand_pose_mat.inverted())
    b.transform(hand_edit_mat)


Is there a way to register a python script at other moments than loading? I know that you can register a python script to be exectued when a blend file is opened (if Autorun is checked in the Preferences). It works very well.

I would like to know if I can register a script to be run at other moments than loading. For instance:

run a script periodically
run a script before/after saving

You can use an 'Application Handler' to register code to run after certain events in blender, like rendering, saving, loading files and several other situations.

For example, in the code below, appending the function to the save_pre handler would print out "Saving File" just before the file is saved:

import bpy

def my_handler(scene):
    print("Saving File")

bpy.app.handlers.save_pre.append(my_handler)

If you wanted code to execute after the file is saved then you would append to save_post.

I am not too sure how you would execute code periodically, though there is a scene_update_pre and scene_update_post which runs whenever the scene needs to be updated that you could look into.


Modeling curved table legs can someone tell what would be the easiest way to model the curve on this table leg. I dont know how to get the corner as round as it is in the reference without mage the edge of the leg round too.
Probably its easy but i dont have that much experience.
Thank you!

I tried it with the spin tool. The edge looks ok now but I dont know how to get the vertices back to the table leg in a proper way. Is this the right way?

You could build the outline, and then create the topology inside.

Start with straight edges, and then bevel the corner vertices
Add a slight inset (to keep space for beveling later)
Build the inner topo-flow so it doesn't get in the way of other corners


where is transparent view in luxrender I use the transparent view in blender with Cycles a lot and I just started using LUXrender and I need to enable transparent view in the viewport except, I can't find it. Is this an option in Luxrender?

Select the camera, open the camera properties, and scroll down to the "Image Pipeline" panel.
In there, you can enable the "Transparent Film" option.


How to get "Correct uv" to work on popup menu I want to have the "correct uv" command on a popup menu, but according to the programmer i am using at the time the the "Correct uv" can't be overided. I want to be able to check that box so that the next time when i slide a vert the function is activated. Is this possible to do?

Haven't had time to test this, the code comes from another answer.  Adds a menu label for each operator in the window_manager list of reg'd operators used.  The settings used for the Edge Slide operator are expanded. Added the correct_uv for you to test if changing the prop from the menu results in the behaviour you require.

import bpy
from bpy.props import BoolProperty

class SimpleCustomMenu(bpy.types.Menu):
    bl_label = "Recently Run Operators"
    bl_idname = "OBJECT_MT_simple_custom_menu"

    def draw(self, context):
        layout = self.layout
        wm = context.window_manager
        op = wm.last_edge_slide
        if op:
            row = layout.row()
            row.prop(wm, "set_correct_uv")
            row.prop(op, "correct_uv")
            layout.separator()
        # reverse order
        ops = [o for o in wm.operators]
        ops.reverse()
        for o in ops:
            row = layout.row()
            row.label(text=o.name)
            if o.name == 'Edge Slide':
                layout.separator()
                row = layout.row()
                row.label(text="bpy.ops.transform.edge_slide(%s)" % ", "
                         .join(["%s=%s" % (k, str(v))
                                for k, v in o.properties.items()]))
                for k, v in o.properties.items():
                    row = layout.row()
                    row.label(text="%s = %s" % (k, str(v)))
                # draw the prop
                row = layout.row()
                row.prop(o, "correct_uv")
                layout.separator()

def get_correct_uv(self):
    op = self.last_edge_slide
    if op:
        return op.correct_uv
    return False

def set_correct_uv(self, value):
    op = self.last_edge_slide
    if op:
        op.correct_uv = value
    return None

def get_last_edgeslide(self):
    ops = [o for o in self.operators if o.name.startswith("Edge Slide")]
    if len(ops):
        op = ops[-1]
        return op
    return None

def register():
    bpy.types.WindowManager.last_edge_slide = property(get_last_edgeslide)

    bpy.types.WindowManager.set_correct_uv = BoolProperty(get=get_correct_uv,
                                                             set=set_correct_uv,
                                                             name="Set Correct UV")

    bpy.utils.register_class(SimpleCustomMenu)

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

if __name__ == "__main__":
    register()

    # The menu can also be called from scripts
    bpy.ops.wm.call_menu(name=SimpleCustomMenu.bl_idname)

Narrow down the operator list above to the last occurrence of the Edge Slide operator, can also look at context.active_operator

Added a property on the window_manager with a getter and setter to emulate the operator property, and a last_edge_slide property on the window manager to return the last used edge slide op, or None.


How to insert a reference picture in 2d animation I am trying to insert reference image to use in the 2D animation part of Blender. How can I get an image inserted?

You need to switch form Draw Mode to Object Mode

Then select the camera in the outliner.

In the properties window's settings for the camera you can add a "Camera Background Image".

Once the image is loaded you can use it as reference in the background.

(or you can also choose to add an Image Reference object or an Image Background object in the 3d Viewport, but those images will not be tied to the camera.)

To go back to Draw mode, select the Stroke object in the Outliner and go back to Draw mode in the 3D Viewport.

Keep in mind that Camera Background and reference images will not be rendered.


Scripting metaballs with negative influence I'm generating metaballs with a python script, and I need to be able to toggle the negative option for some of the metaballs. (Edit: negative changes the object's "influence" to subtract from the other metaballs, instead of adding like normal metaballs; the negative checkbox can be found in a metaball object's Object Data section while in Edit Mode.)

def metbaseobj(N=3,scale=1.0):
    '''adds N metaball objects to provide the base shape'''
    shapes = ['CAPSULE','ELLIPSOID','BALL','CUBE']
    metbaseinfo = []

    for each in range(N):
        shape = shapes[random.randint(0,1)]
        loc=(scale*random.random(),scale*random.random(),scale*random.random())
        rot=(random.random(),random.random(),random.random())
        bpy.ops.object.metaball_add(type=shape,location=loc,rotation=rot)
        #[toggle metaball influence to be negative here]
        metbaseinfo.append((shape,loc,rot))

    return(metbaseinfo)

I found a documentation page that makes me think use_negative=True is what I need, I just can't figure out how to use it exactly. Thanks for any help, I'll keep looking in the meantime.

It seems you already found the wiki docs on metaballs, lots of juicy content there indeed, perhaps after reading/running this script that documentation will make more sense.

You seem to be adding multiple separate metaball objects, instead add one metaball object, and internally to that object create metaball elements, then set their interaction type, something like this.

import bpy

scene = bpy.context.scene

# add metaball object
mball = bpy.data.metaballs.new("MyBall")
obj = bpy.data.objects.new("MyBallObject", mball)
scene.objects.link(obj)

# test with different values, for viewport do you need ultra high res?
mball.resolution = 0.16  # View resolution
# mball.render_resolution = you decide

# first metaball element doesn't exist yet - create it.
ele = mball.elements.new()
ele.co = (0.0, 0.0, 0.0)
ele.use_negative = False
ele.radius = 2.0

# adding extra metaball elements to the object
ele = mball.elements.new()
ele.co = (-0.726, 1.006, 0.559)
ele.use_negative = True
ele.radius = 0.82279

And that's it.


My mesh is partly hidden in the viewport I was working on my mesh when all of a sudden, I realised it was partly hidden when I go to the Solid or Wireframe mode.
I probably toggle something that only allows to show what's inside that dark grey area but I can't find what it is.
Does any of you have an answer to that problem ?
Cheers,

You've accidentally pressed AltB, press again to cancel. AltB (Cliping Border) allows you to see only a part of your 3D view.


get rid of stretched faces on models? Here is the scenario, for a project i'm working on i need to stretch a uv sphere into a long spike and then apply a displacement on it (let's for convenience sake say i'm using the procedural voronoi displacement found in blender), the problem is when i stretch it the faces get all stretched out and the displacement just looks like streaks, is there any way i could stretch out a uv sphere into a long spike, and then change the faces back into a similar arrangement as the non stretched out uv sphere? i have tried the remesh option but the displacement still just looks like streaks. i am using the latest release of blender.

You don't say enough about your final purpose, for example is it supposed to be animated, is the texture supposed to be exactly the same or about the same, etc?

If you're animating it with shape keys you could use the Texture Coordinate's Object output socket. The texture won't deform:


Piping Mesh Data back into original Just wondering about Blender AN workflow. Normally I have original mesh and do something and output as NEW mesh.

Wondering, if I actually plugging in whatever process back to original mesh, is this actually possible?

Say, perhaps I am pushing the vector of Suzanne head... the output currently is the NEW Target object.

Is there a correct way to do this?

The correct way to do this is to use a source and a target mesh object. Unfortunately it is not possible (well it is, but not useful in most cases) to use the source object as target.

The reason is that the original mesh data is lost when you overwrite the source. There is no way to get it back.


Curved lines in between vertices here´s the thing: I´m trying to give a more round like look to my model by modifying the lines in between the vertices, but I don´t know how. Below there´s a picture of what I want (took a snapshot of a video on youtube) I asked the artist how he does that but he doesn´t answer. I tried applying a curve modifier but it gives me a message of error that says "modifier disabled skipping apply". Is that how it´s done? by using the curve modifier? and if it is...how do I enable it?
Thanks in advance, I´d be really grateful for any help you might provide :)

Add a Subdivision Surface modifier

Make sure the edit cage is turned on

For more info on the subsurf modifier, here is a link: http://wiki.blender.org/index.php/Doc:2.4/Manual/Modifiers/Generate/Subsurf


OpenGL [realtime] 360 camera possible? Is it possible to render a 360 equirectangular OpenGL view from camera? I already know to set it up on Cycles and BI, but I would like to know if it is possible to set this kind of camera to make a realtime render of the OpenGL view for speed render purposes.

You can take 6 rectangle cameras with 90° FOV, which head to East, West, North, South, Up, Down. Then you get faces of a cubebox.
You can map the cubebox into equirectangular in a simple fragment shader or use it directly.


Hair Particle grows different on curved mesh I have a mesh, a plane, and it is supposed to be a landscape with grass. It has some ups and downs not a flat plane. When adding the hair(grass). I did some weight paint to tell where the grass should grow. It seems to be more grass on lower parts of the mesh for some reason. The strange thing is that it looks fine in the viewport but not after rendering in Eevee. I have played around with the settings but can't find any solution. Would appreciate any help here.

This was caused by another plane that forgot to disable in render, as well as in the viewport.


Problem mixing a scene with video clips in the VSE I am using Blender 2.79 on a fully updated iMac.

I want to create a 2-D animation and have 2 video clips before this animation.

The issue is that even if the clips are above the scene strip, or even as in the screen-shot, the scene starts after the videos, the videos do not render.

Strangely, they are show in the preview, but not in the rendered video or even image (F12), as you can see in the screen shot.

Am I doing something wrong, or is it simply not possible in the Blender VSE to mix video clips with the scene?

I could render the scene and then import the video into another blender file, but then I would have to render the movie twice and rendering time in Blender is already quite long.

Thanks for your kind feedback.

The main output of Blender is the 3D window, after that you must activate the Compositor to apply effects (like color grade or blur) by checking the Compositor box in the Scene Properties panel. Then you can bring that compositor output (or the 3D scene) into the VSE for editing with other footage (as you have done). But for this render engine to work you must check the Sequencer (as in Video Sequence Editor) box.

Note that you can check either or both the Compositor or the Sequencer box, depending on what functions you want.

If you only want to edit video clips or pre-rendered animations, then you MUST check the Sequencer box, otherwise the VSE output will not be rendered. In fact all you will see is what is present in the 3D view.


Creating Bullet Trail in Cycles Hey People how do they create this Trail Behind the Bullet in particular games where a slow motion effect is shown.

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

Its created by vector-displacing pixels in post-production. The game engine does this with pixel shaders in post-production too.
Check this its related: How to make a heat distortion effect?
You just don't need a particle simulation for the trail but a single texture behind the bullet will do.
This will create a spherical ball-like distorsion:

Smear it and adjust it in your favourite 2D application to create some water-like wave effect.

Red channel affects the X position
Green channel affects the Y position
Pixel value of 0.5 is no change, brighter is positive direction, darker is negative
Leave blue channel black

You can also sculpt the effect on a plane and bake it into a normal map. Then erase the blue channel from that map.


Blender GLTF : which rotation values are really exported? I am using https://github.com/KhronosGroup/glTF-Blender-Exporter in a script and trying to compare the exported rotation values. But none of them seem to match. Ie. for exported values in the gltf file such as :

"rotation": [0.7071068286895752, 0.0, 0.0, 0.7071067094802856]

the exported object in blender has the following values:

---> OBJECT ROTATION QUATERNION: <Quaternion (w=0.3715, x=0.6323, y=0.4318, z=-0.5251)>
---> OBJECT MATRIX LOCAL: <Quaternion (w=0.3715, x=0.6323, y=0.4318, z=-0.5251)>
---> OBJECT MATRIX WORLD: <Quaternion (w=0.3715, x=0.6323, y=0.4318, z=-0.5251)>

while exporting, the settings are set to export_yup=False so I guess no other transformation should be involved?

I'm not seeing exactly the same issue.  If I take the default Blender cube and rotate it, and look at the quaternion on the UI, this is what I see:

In glTF, the order of the quaternion's components is different.  Blender is showing [W, X, Y, Z], but in glTF they are expressed as [X, Y, Z, W].

Thus, my exported cube (with export_yup turned off) looks like this:

These are the same numbers, it's just that W has moved from the front to the back of the array.

Your example shows completely different numbers.  There can be various reasons for this, including parent hierarchy and "parent inverse" transforms.  But there's another potential explanation, too:  The node orientation is being handled as matrices, not TRS (Translation, Rotation, Scale), in the exporter, and each matrix is being decomposed into TRS during the export process (source code).  If the node's matrix happens to have more than one way to decompose into TRS, it's possible the decompose function will pick some other quaternion from the one you were expecting.  But the end result should still work the same.


How to set Dimensions Unit and Metric unit on the same ratio? How you can see, on the Dimensions (metric) it says my cube is 2x2x2 but on the Scale tab it is 1x1x1. How can I set it so, that the metrics are same as dimensions?

Scale is a ratio, so it don't have units. You can think of it like the "1/24" (or whatever scale) of a scale model. There is nothing wrong to have a Scale that is different of the Dimensions.
However, if you absolutely want the Dimensions to fit the Scale, you can go in Edit mode and reduce the whole cube by a factor of 2 (S / 0.5). That's pretty much useless, because if you extrude some faces, or move them, the Dimensions won't fit the Scale anymore.


Particle system puts everything on a circle around object ? Tried with Geometry nodes too, the same New to blender I try modeling a tick .. I'm about to put hait on the body but it doesn't work.. when I add a partcile system (or geometry nodes) everything is added on a circle around the object.. here's the link to the file.. : https://pasteall.org/media/f/8/f855c53839b7736296afd8b4775acd7b.blend
Any ideas ?

Your hair object is far from its origin on the X axis, that will shift the hair away from the emitting faces on their Y axis (I still don't know why hair's X axis becomes Y on the emitter though). If you move the hair object in Edit mode towards its origin it will shift back:


How can I use local rotation on objects created with geometry nodes? I have geometry nodes to spawn in objects all over my mesh. Currently they rotate with the mesh, so on a sphere they all point outwards, which I want. But I now want them to be rotated around their 7 axis, so they aren't all lined up. If I use an Attribute Randomize node set to rotation then it resets all their rotations, and they are all pointing directly upwards.
How can I make them rotate on their local axis?

Use Point Rotate node with setting Point, Z rotation is what you need:

If you want to rotate in a random angle use Attribute Randomize in vector mode, but keep X and Y equals 0:


Hiding and unhiding a Collection in the Viewport This may have been asked before, but I cannot make sense of it. I need a script which simply toggles the eye of my collection named "Animation".
I have enabled my viewport by using bpy.data.collections["Animation"].hide_viewport = False
The eye however is closed and I need to open it with a script. Any help is appreciated.

Have you tried accessing collection from view layer?

bpy.context.view_layer.layer_collection.children["Collection Name"].hide_viewport = False


Offset on driver via scripted expression I am trying to rotate a set of limbs on a centipede all slightly offset from each other in a 360 degree cycle. Each one will have a driver with an offset, thus the centipede would walk as seen here https://www.youtube.com/watch?v=ivWcwgfWR7Y

The turning of a main control wheel offsets the y-height of the target bone by x amount.

The driver so far is this

sin(abs(v*.25))*.9

where v (var) is the z rotation of main wheel, and drives the y height of bone. How can I offset the expression so that, say, plus %10 of rotation causes the next limb to lag or lead height by 10 percent?

Note that the wheel is located toward center/root of centipede.

Use self and a custom property

Offsets L to R, -pi / 2, -pi / 4, 0, pi / 4, pi / 2

Using a simple example with 5 cubes as feet and another as the wheel.

Add a custom property to foot, if you are driving a pose bone add a custom property to the bone.

Helper script to add a custom property named "offset" (edit to suit) to all selected pose bones.

import bpy
from bpy import context

propname = "offset"

for pb in context.selected_pose_bones:
    pb[propname] = 0.0 # set a float proprty

Drivers have a use self option. When on self in an expression refers to the object being driven.  The custom property on the object can be added to an expression as self["prop"] Pick a better name than prop.

'rot' is a variable set up as usual getting the local rotation of the spinning cube.  We offset that rotation by adding the value of the property to it.

abs(sin(rot + self["prop"]))


Wrong / Undesired Bone Rotation problem with IK rigging Anyone know how to fix it?
I was rigging the legs of a robot. When I setup the IK, and move the control bone to test the result, I found that the leg on left hand side cannot show proper as the right hand side does. I was using the same setting by symmetrize function of the bone.
Here is the blender file. I hope someone can help. Thanks.
https://drive.google.com/file/d/1epvhikoV1_exKOxB_Y1INY6L6JZJzmyr/view?usp=sharing

Re-symmetrize the left bones, roll 180° the top 2 right bones (CtrlR). You sometimes need to correct the bones orientation once symmetrized:


Baking a particle system in Blender to use in Unity I am using Blender(2.77a) and Cycles render.

I have a particle system set up in Blender which emits 3D Blood cells. Now, Unity's inbuilt particle system is different from Blender's. So exporting a particle system made in blender to unity is not possible.

But I'm in very much need for this to work. I browsed the web and came across a tutorial for baking 3DsMax particles to Unity and hoped it would work with Blender as well.

But no luck there as well. These are the steps I follow,

Set up the particle system
Save the blend file and enable Disk Cache
Click on "Bake all Dynamics"
Export as fbx and import in unity.

Where am I going wrong? Is there any other way to achieve this?

This is not possible. Particle System simulations are not supported at all due to the fact that Unity has a completely different solution.

Unity currently imports (from blender)
all nodes with position, rotation and scale. Pivot points and Names are also imported.
Meshes with vertices, polygons, triangles, UVs, and normals.
Bones,
Skinned Meshes, and
Animations


Menu for bevel edges Is there any way to show a menu of the tools in the middle of the screen, like its done in 3ds max. I mean, for example, when you choose the tool Bevel Edges It show the menu in the bottom of the screen. But i want this menu will appear in the middle of the screen where i can to select specific parameters by clicking the mouse button instead of clicking keyboard buttons.
Thanks in advance.

I don't think it's possible at the moment: if you start bevelling using Ctrl+B you are forced to use the keyboard-based workflow.

However, you can use the bevel tool (green icon in the left-side toolbar) instead of the bevel operation, which gives you access to some more options (not all the shortcuts though).

In combination with the "tool settings" header, it allows you to change the options right before starting your bevel operation:

Actions performed in the above gif:

Edit mode, select your edge
Select the Bevel tool
If it's not active already, activate the "Tool Settings" header by right-clicking on the 3D Viewport header
Adjust the setting
Hold down the mouse button and drag

Alternatively to the "Tool settings" toolbar, you can display a "Tool properties" panel in the Properties area.


small white tracking box i cant get rid of new to blender and accidentally clicked SOMETHING, now i have this annoying box that's "tracking" and i cant get rid of it. ive searched through youtube and other sources for about an hour but since i dont know what feature it is i can find no useful info.  (also, may be unrelated but now grease pencil stopped working as well)

This is a tracking point used for motion tracking.

It is creating by pressing Ctrl + the opposite for your select button.
To get rid of it, simply select it and press X, delete.


how to make lines of mask/image thicker using material nodes in blender I got an image from google images, and i am using that image in a material, but i want the lines in the image thicker So I was thinking, is there a way to make the line thicker, since making similar pattern procedurally or using photoshop maight take some time. Thank you

Here's a quick and dirty way to do it, that I think you can get away with based on the fact your image is black and white, and is relatively simple. The graph looks like this:

The idea is simple - make 5 separate "instances" of your image, offset 4 of them slightly (one in each direction), and add (or multiply in this case) them together. For the sample image that I chose, I offset by both .002 and -.002 for each of the X and Y axes, and multiplied them together (to copy the darks) with the original image. As you can see from the image below (which represents the original image), that the lines are much thinner.

As a side note, the "clamp" checkboxes are optional - I just often use them as a matter of habit to keep things in range and so I know there's no wacky HDR stuff going on behind the scenes.


How to control specular/glossyness of glass shader in cycles I am trying to control the amount glossyness/specular (not roughness) of glass but not able to find any option in cycles. I have tried both the traditional glass shader and the new Principled BSDF shader - none of these seems to let you control the amount of reflection on glass.

I understand that it might not be physically accurate but is there a way to do it?

Here is the blender scene in case anyone wants to examine the setup. http://pasteall.org/blend/index.php?id=47771

If I understand you correctly, you can simply mix a Glass Shader with a Refraction Shader.  The factor will determine how reflective the glass material is:


adding detail (extruding a grill type part at top) to a box mesh without affecting lower part of mesh Hello all I'm still learning Blender and I am stuck understanding the best way of adding some extruded parts to the top of my mesh. Im modelling a Glock 17, its fairly blocky so thought it might be an ok mid-project (i've made stuff such as Bottles, cups, tables etc and even made a pretty decent car which took me forever and probably had lots of 'errors' in the mesh.)

Anyway as you will see in the picture, I want to add a bunch of splits in the top rear part of the gun barrel. I could do this by adding some loop-cuts running vertically where i want the slices to appear. But this will run lots of unnecessary loop cuts into the lower barrel and handle of the gun.

What would be the best way to avoid these loop cuts?

Pics:

It is not ideal to do what you are asking because you will most likely have to triangulate your mesh.

I recommend going with the loop cut, finishing your model, triangulating it (control-t), then decimating it down without losing quality (Note: Decimate is a modifier :D ).

But if you insist on doing it now:

Make the loop cut and select the vertices you don't want.

Double press G to slide along the edge and move it on top of the next edge.

Press W and select remove doubles.

If you have done it properly, there should be a single triangle in the middle of your mesh.

:D

Good luck with your project and I hope I helped,

BFB


Seemingly random decoding errors I'm working on an import export addon, and while importing a skeleton I'm running into a wide variety of errors when importing the .skl skeleton file. They all point to the same place in my script though.

class sklHeader():
    """SKL header format:
    fileType       char[8]    8    version string
    numObjects     int        4    number of objects (skeletons)
    skeltonHash    int        4    unique id numbers
    numElements    int        4    number of bones

    total size                20 bytes
    """

    def __init__(self):
        self.__format__ = '<8s3i'
        self.__size__ = struct.calsize(self.__format__)
        self.fileType = None
        self.numObjects = None
        self.skeltonHash = None
        self.numElements = None

    def fromFile(self, sklFile):
        """Reads the skl header object from the raw binary file"""
        sklFile.seek(0)
        fields = struct.unpack(self.__format__, sklFile.read(self.__size__))
        (fileType, self.numObjects, self.skeletonHash, self.numElements) = fields
        self.fileType = bytes.decode(fileType)
        #self.fileType = fileType

    def toFile(self, sklFile):
        """"Writes the header object to a raw binary file"""
        data = struct.pack(self.__format__, self.fileType, self.numObjects, self.skeletonHash, self.numElements)
        sklFile.write(data)

specifically all the errors are pointing to the same line

self.fileType = bytes.decode(fileType)

but I am getting a wide variety of errors most of them are invalid continuation bytes or invalid start bytes.

UnicodeDecodeError: utf-8 codec can't decode byte 0xc3 in position 4
UnicodeDecodeError: utf-8 codec can't decode byte 0xd5 in position 2

UnicodeDecodeError: utf-8 codec can't decode byte 0x98 in position 0
UnicodeDecodeError: utf-8 codec can't decode byte 0xc8 in position 0
UnicodeDecodeError: utf-8 codec can't decode byte 0xb8 in position 0
UnicodeDecodeError: utf-8 codec can't decode byte 0xa4 in position 0
UnicodeDecodeError: utf-8 codec can't decode byte 0xa8 in position 0

All the ones in position 0 are invalid start bytes
the others are invalid continuation bytes.

Sometimes it works fine, other times I get errors such as these.

Any ideas?

  The .py file this is in, is what actually opens the .skl file its another 200+ lines defining how to use the raw data

  Skl files have to be unicode or it wouldn't sometimes work correctly.

Skl files have to be unicode or it wouldn't sometimes work correctly.

That's a really vague statement. I'm pretty convinced they are binary files, which may or may not contain some unicode-encoded strings. But you definitely need to open them as binary files:

file = open(filepath, "rb")

You may then decode binary strings:

binary_object.decode("utf-8")

Reading the file in binary mode will prevent decoding errors caused by non-strings (which can be a simple '\x89' of a binary integer.


How can I fade out a strip that requires an Alpha Under effect? I have two strip with images and one effect strip.

Strip 0 has a standard JPG image that I set for the full length of the render.
Strip 1 is a PNG with alpha layer that contains text.
Strip 2 is an Alpha Under that is required so I can see Strip 0 and Strip 1 in the final render to video allowing the text to be rendered on top of the bottom strip.

My problem is I want to fade out Strip 1 so the text fades away and does not effect Strip 0, unfortunately nothing I have tried works.

I tried:

Keyframing opacity on Strip 1: The opacity is changing but there
is no effect on Strip 1. It does not fade away.
Keyframing opacity on Strip 2: This fades out all Strips
I tried making a Meta layer with all three strips and keyframing an opacity change. This would work if I added another strip of the same images as Strip 0 but there is a darkening in the final render. This also required another Alpha Under strip. The end result is not clean.

How can I fade out a strip that requires an Alpha Under effect?

All you need to do is:

Remove Alpha under effect strip
Set Image with text and alpha channel above jpg.
In N-menu set Blend type to Alpha Over.
Animate Opacity of text layer to create fade out effect


What to choose GPU or CPU , and should I use opencl, Linux (openSUSE)? AMD ryzen 5 2600 6 cores
RX570 vid card.
16 gig ram.
I have done allot of research, but can't find what ideally would be the best setting for my system.
At the moment Blender says my vid card does not support opencl, but I know why thanks to help on the openSUSE forums, and how to fix it.
( for others on Linux you need the proprietary amd drivers or at least the opencl part of it, not mesa opencl, that won't work with Blender. RX570 and RX580 do support opencl on Linux )
Now my questions, will opencl reduce the render times, and should I use the cpu or gpu setting in preferences? Or both if I understand the opencl part right ?
I am totally lost on if I want opencl at all and what setting to use.
The one thing I do know, Blender works fine without it.
For a vid I want to make I probably want to use eevee rendering.

Long story short. Until Vulkan is implemented in Blender (which is going to be soon from what I hear) you can use OpenCL

Yes using OpenCL will reduce your render times significantly compared to when you have set it to 'None'.

But since 570x is not that fast compared to 2600X CPU, it comes down to very specific situations where you will have advantage in using GPU over CPU (while in other cases it would be opposite). It won't be as vast as in my case, as I have a pretty old CPU.

Using a rough estimate, you would get better results using CPU in cycles (an additional setting, not present in eevee), but make sure to set the tile size accordingly in Performance Submenu In Render Settings (right side on blender, not in preferences menu). A tile size of 128 or 256 or 512 is ideal for GPU (render something on each setting to test), and 16 or 32 is ideal for CPU.

Somethings only use CPU, like the cloth simulations.

Also Blender allows you to use CPU & GPU together where possible. Just click the box in front of both CPU and GPU, like in my following screenshot.

Also, most of the blender devs use Linux, various flavors, so Linux is strongly supported. You can even get bleeding edge Alphas from builder.blender.org

Note that Blender would not raise or cause any errors based on what you are using CPU or GPU. You have to test it by doing different renders or better yet running the benchmark (BMW scene only .. or the comprehensive 5-7 scenes)

In my experience, for a beginner, you are better off just using the settings I showed below, and use eevee without worries.

Having installed ROCM recently myself on a seperate system (Ubuntu used for some unrelated testing).. I don't think you need AMD ROCM.But rather the drivers downloaded from AMD website (they released Linux drivers, that include OpenCL support), or alternatively try installing the xf86-video-amdgpu if you are using XORG


a problem with applying automatic weights i have been following a rigging tutorial on you tube and then i encountered a problem with parenting the armature to my character
i right clicked the character mesh then the armature and i pressed ctrl+p and then chose the automatic weights option
the error was : bone heat weighting failed to find a solution for on for two bones
i have read several answers on the forums and here is what i have tried
1.removing doubles
2.selecting all the bones without .l and .r extensions and then s->x->0

and here is the .blend file https://github.com/phantomcoder1996/blendermodels/blob/master/man.blend

Just add a subsurf modifier to the mesh as shown below:

Then parent the mesh with the armature again and it will work as shown below:

Updated .blend file can be found here: