Pass dir.path to a diferent script I'm building an addon which is a collection of scripts, and I have my UI coded as one of this scripts. On of my tools (script) requires a user input, in this case a folder path, but I don`t know how to pass it onto my export tool so it knows where to export the selected objects. Here is how it is written in my UI script, I just copied it:

# root for export
    scn = context.scene
    col = layout.column(align=True)
    col.prop(scn.my_tool, "path", text="")

It shows great in my Panel but I'm not sure how use the string it gives in another script.

Thanks

EDIT

Following @WhataMesh pointed out here is what I did. In my UI script I added a class with a string property and changed the layout to fit, also had to register and unregister the new class and the property.

class MySettings(PropertyGroup):

path = StringProperty(
    name="path",
    description="Path to Directory",
    default="",
    maxlen=1024,
    subtype='DIR_PATH'

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

# root for export
    scn = context.scene
    mytool = scn.my_tool
    col = layout.column(align=True)
    col.prop(mytool, "path", text="")

def register():
    bpy.utils.register_class(UI)
    bpy.utils.register_class(MySettings)
    bpy.types.Scene.my_tool = PointerProperty(type=MySettings)

def unregister():
    bpy.utils.unregister_class(UI)
    bpy.utils.unregister_class(MySettings)
    del bpy.types.Scene.my_tool

You can add properties to the scene that can be retrieved by all scripts. In the code you can find different 'variabletypes' (I think you can also make custom properties/variables yourself). To actually retrieve the value you will have to write bpy.data.scenes['Scene'].Annotation.my_bool

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

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

    my_int = IntProperty(
        name="Int Value",
        description="A integer property",
        default=23,
        min=10,
        max=100
    )

    my_float = FloatProperty(
        name="Float Value",
        description="A float property",
        default=23.7,
        min=0.01,
        max=30.0
    )

    my_string = StringProperty(
        name="User Input",
        description=":",
        default="",
        maxlen=1024,
    )

    my_enum = EnumProperty(
        name="Dropdown:",
        description="Apply Data to attribute.",
        items=[('OP1', "Option 1", ""),
               ('OP2', "Option 2", ""),
               ('OP3', "Option 3", ""),
               ]
    )

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

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


Mirror Modifier mirrors object incorrectly I have encountered a problem. When I add the mirror modifier to my object, it does not mirror correctly as the mirror object is distorted (the sleeves of the shirt have been swapped) and therefore it does not fit correctly.

You can see the mirror object on the right has randomly swap the sleeves of the shirt, and so when putting them back together, it just gonna look wrong. Is there any way to solve this problem??

I'm super new to Blender so it may just be a dumb question. Thank you guys in advance!

I am not entirely sure why you would use a Mirror modifier there. The mesh is not mirrored so you can't "put them back together". When working with a Mirror modifier you only create one half of the shirt and use the Mirror modifier then to generate the other half. You created a whole t-shirt and mirrored it. Why would you even want to apply the Mirror modifier now?

If you want to get a perfectly symmetrical shirt you have to do that from the beginning by creating only a half of it.

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

I hope I could help.


Why does my cycles-rendered heightmap have wrong values? I've been trying to render a heightmap using cycles.

To that effect, i've set up:

1) A sculpted plane squeezed between -0.25 and 1.0 altitude (z-axis) in Blender.

2) An orthographic camera scaled to perfectly match the plane.

3) A cycles emission material set up in such a way that its final emission value is geometry.blue (z-axis position) -> math.add 0.25 -> math.multiply 0.8.

I render this to a 16-bit grayscale png image.

The issue is: The resulting heightmap's pixel values are slightly (or not so slightly) wrong - i.e, different from what the math should say.

For example, while math says that vertices at position ~0 in Blender should produce heightmap values around (0.0+0.25)*0.8 = 0.2 , in the resulting image, those areas are ~0.5; while math says that 0.94 should translate to 0.95, in Gimp when sampling those pixels i see their HSV Value as 0.89.

Upon some asking around in #blender, i've eliminated the following possible sources of trouble:

World (and its material)
Sky pass in render layers
Material color is set to 1,1,1
I've eliminated sections of the plane that violated the bottom boundary.

None of these fixed the problem.

If anyone feels like poking around instead of guessing around, i've also put the blend file to here.

This is probably due to blenders color management. You're expecting a linear relationship between the height of that part of the object and the colour of the pixel. However whilst the luminosity/emission strength of that pixel should be correct, when you render your image these values will be converted to an sRGB color space, and the values will not be correct.

What you need to do is set your display device to "None" in your colour management settings. This will leave your rendered values as Linear Values and not convert them to sRGB.


Vertex Normals different from loop normals I'm writing a model exporter in Blender 2.77 and except from triangles and vertex positions, I also want their normals and tangents.

As an example, I'm using a simple cube centered at the Origin (0,0,0).

I found out that Blender can calculate normals and tangents using the following commands:

data=C.object.data
data.calc_normals();
data.calc_tangents("UVMap");

So after that for testing purposes I'm executing the following code

data.calc_tessface();
for f in data.tessfaces:  # indices
    polygon = data.polygons[f.index] #Load Polygon

    for vert in range(len(f.vertices)):
        norm = data.vertices[f.vertices[vert]].normal
        norm1 = data.loops[polygon.vertices[vert]].normal
        print(norm, norm1)

I know that the order of the output vertices won't be correct when iterating in the  tessfaces and the polygon structs. My problem is that the output looks like this:

<Vector (-0.5773, 0.5773, -0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (-0.5773, -0.5773, -0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (-0.5773, -0.5773, 0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (-0.5773, 0.5773, 0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (-0.5773, 0.5773, 0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (0.5773, 0.5773, 0.5773)> <Vector (0.0000, 1.0000, 0.0000)>
<Vector (0.5773, 0.5773, -0.5773)> <Vector (0.0000, 1.0000, 0.0000)>
<Vector (-0.5773, 0.5773, -0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (0.5773, 0.5773, 0.5773)> <Vector (0.0000, 1.0000, 0.0000)>
<Vector (0.5773, -0.5773, 0.5773)> <Vector (0.0000, 1.0000, 0.0000)>
<Vector (0.5773, -0.5773, -0.5773)> <Vector (0.0000, 1.0000, 0.0000)>
<Vector (0.5773, 0.5773, -0.5773)> <Vector (0.0000, 1.0000, 0.0000)>
<Vector (-0.5773, -0.5773, -0.5773)> <Vector (0.0000, 1.0000, 0.0000)>
<Vector (0.5773, -0.5773, -0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (0.5773, -0.5773, 0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (-0.5773, -0.5773, 0.5773)> <Vector (0.0000, 1.0000, 0.0000)>
<Vector (-0.5773, -0.5773, -0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (-0.5773, 0.5773, -0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (0.5773, 0.5773, -0.5773)> <Vector (0.0000, 1.0000, 0.0000)>
<Vector (0.5773, -0.5773, -0.5773)> <Vector (0.0000, 1.0000, 0.0000)>
<Vector (0.5773, -0.5773, 0.5773)> <Vector (0.0000, 1.0000, 0.0000)>
<Vector (0.5773, 0.5773, 0.5773)> <Vector (0.0000, 1.0000, 0.0000)>
<Vector (-0.5773, 0.5773, 0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (-0.5773, -0.5773, 0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>

Am I missing some other data operator that will update the normals? Why are the loop normals not equal to the vertices normals?

I never used tessface logic, but I can tell that you are using the wrong index in data.loops[] : each polygon has a loop_begin and a loop_end variable, and each loop with index in [loop_begin; loop_end[ belongs to that face, and is associated with a vertex, which have loop.vertex_index as index.
that means that there are WAY more loops than vertices.

also, it seems that you are using flat shading. in that case, loop normals  are the same that their faces' normals, and (I am not sure about that last bit) vertex normals are interpolated between face normals, and will be used for smooth shading


How to hide Empty in perspective view Blender 2.8? In 2.79 with background images, it was easy to only allow them to be shown in ortho view, but in 2.8 I'm using empties as reference images, and I can't find how to hide them in perspective view and only show in ortho, like the old version.  Where can I find that option, assuming it exists?

First press the related number on the numpad to select the view of your preference, then import the ImageReference Empty.
Then on its image properties deselect (uncheck) the "Display Perspective"


How to interactively add vertices based on custom input fields? I want to make UI with input fields and a button which add verts with coords based on values in this fields.
I kinda almost understand what I need to do but it slips away because I am not a programmer. Looks like I need a class which creates a point when executed, UI part and reg ofc. Like this:
class addPoint (bpy.types.Operator):
    bl_idname = 'something.point'
    bl_label = 'Point'

    def execute (self, context):
        bpy.ops.mesh.primitive_vert_add()

class Panel (bpy.types.Panel):
    bl_idname = 'panel'
    bl_label = 'Panel'
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = 'Panel'

    def draw (self, context):
        layout = self.layout
        row = layout.row()
        row.label(text = 'Add point')

def register():
    bpy.utils.register_class(addPoint)
    bpy.utils.register_class(Panel)
def unregister():
    bpy.utils.unregister_class(addPoint)
    bpy.utils.unregister_class(Panel)

if __name__ == '__main__':
    register()

As far as I know there is no built in way to setup creation coords? I feel like I can add bpy.ops.transform.translate to execute part but how to show inputs for it in UI?
Anyway I guess it will not work because those fields only active if the object is already selected, and it can't be selected before it's created. So I feel like I need to add properties to addPoint class(?), show them in UI, then input data there and use this data for translation. But how to write all this and connect all together?
Or maybe I am totally wrong?

Have a look into the Operator Mesh Add template that comes with Blender.

First of all, you would have to figure out how to create a mesh which is nicely explained in create mesh then add vertices to it in python, then declare an Operator ideally along with a FloatVectorProperty for the actual location and add that code from before to its execute method.
The following code is based on Operator Mesh Add template, adds a menu entry to the Mesh menu (ShiftA) as this is the prefered way of adding a new object to the scene. If bl_options are set to 'UNDO' the properties of the operator will be displayed in the bottom left of the 3d Viewport (location in this case) which allows the user to set the parameter interactively while adding the vertex:

import bpy
import bmesh

class MESH_OT_addVertex(bpy.types.Operator):
    """Add a simple vertex object"""
    bl_idname = "mesh.primitive_vertex_add"
    bl_label = "Add Vertex"
    bl_options = {'REGISTER', 'UNDO'}

    location: bpy.props.FloatVectorProperty(
        name="Location",
        default = (0,0,1))

    def execute(self, context):

        # Create a new mesh based on the given location
        # https://blender.stackexchange.com/a/61893/
        # https://blender.stackexchange.com/a/23088/
        mesh = bpy.data.meshes.new("Vertex")
        bm = bmesh.new()
        bm.verts.new(self.location)
        bm.to_mesh(mesh)
        mesh.update()

        # Create new object and link object to the active collection
        # https://blender.stackexchange.com/a/145715/
        obj = bpy.data.objects.new("MyVetexObject", mesh)
        context.collection.objects.link(obj)

        # Make the object the active one and select it
        # https://blender.stackexchange.com/a/126581/
        context.view_layer.objects.active = obj
        obj.select_set(True)

        return {'FINISHED'}

def menu_func(self, context):
    self.layout.separator()
    self.layout.operator(MESH_OT_addVertex.bl_idname, icon='DOT')

def register():
    bpy.utils.register_class(MESH_OT_addVertex)
    bpy.types.VIEW3D_MT_mesh_add.append(menu_func)

def unregister():
    bpy.utils.unregister_class(MESH_OT_addVertex)
    bpy.types.VIEW3D_MT_mesh_add.remove(menu_func)

if __name__ == "__main__":
    register()

    # test call
    #bpy.ops.mesh.primitive_vertex_add()

If you would like to place the operator onto a panel, register your panel, add the Layout.operator() call to the draw() method of the panel class and pass its bl_idname:

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

    row = layout.row()
    row.operator(MESH_OT_addVertex.bl_idname)
    ...

In case there is a serious reason to display the coords on your panel as well, I'd suggest register a new FloatVectorProperty property per scene (bpy.types.Scene) and pass the values to the Operator within the draw method of the panel class:
def register():
    bpy.utils.register_class(MESH_OT_addVertex)
    ...

    bpy.types.Scene.mytool_location = bpy.props.FloatVectorProperty(
        name="Location",
        default = (0,0,0)
        )

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

    del bpy.types.Scene.mytool_location

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

    layout.prop(scene, "mytool_location")
    op = layout.operator(MESH_OT_addVertex.bl_idname)
    op.location = scene.mytool_location
    ...

Further reading

How to create a custom UI?
How to pass multiple operator properties via UI layout?


Centralizing properties updates in one function? Is there any way have some more information of the prop from it's update function?
In the example below, unfortunately, self will point out to bpy.types.Scene, instead of the prop itself.
so it seem at first glance that we cannot have any information of the props from the update function, and we are forced to have one update function per prop, instead of a single centralized update function that could work with every one the prop
(Note that We can have more information from set, but of course, it will create feedback loops if we change the prop value.. )
please prove me wrong
def update(self,context):
    print("what is this prop value?")
    print("what is this prop api?")
    print("what is this prop name?")
    return None

bpy.types.Scene._prop          : bpy.props.FloatProperty(default=1.0 , name="Prop", update=update)
bpy.types.Scene._prop_this     : bpy.props.FloatProperty(default=1.1 , name="Prop This", update=update)
bpy.types.Scene._prop_that     : bpy.props.FloatProperty(default=1.2 , name="Prop That", update=update)
bpy.types.Scene._prop_another  : bpy.props.FloatProperty(default=1.3 , name="Prop Another", update=update)

Make a generic function to create your update method.
There is another answer very similar to this by @pinkvertex could not find it.
Instead using one function as the update method, create a method factory to pass properties to.
Example code, and example run (pretty self-explanatory),
import bpy
from bpy.props import FloatProperty
from bpy.types import Scene

def update(prop):
    def update(self, context):
        print(f"Update {prop} of {self}")
        return None
    return update

for prop in ("prop_this", "prop_that", "prop_another"):
    setattr(
        Scene,
        prop,
        FloatProperty(
            default=1.0,
            name="Prop",
            update=update(prop)
            )
        )

Sample run.
>>> C.scene.prop_this
1.0

>>> C.scene.prop_this = 4
Update prop_this of <bpy_struct, Scene("Scene") at 0x7fc97bff8008>

>>>

Two things re question code,

The properties are assigned to the type, not as an annotation. Use
annotations in a class definition.
Cannot create a private variable prefixed with underscore.
 >>> bpy.types.Scene._prop = bpy.props.FloatProperty()
 Traceback (most recent call last):
 File "<blender_console>", line 1, in <module>
 ValueError: bpy_struct "Scene" registration error: _prop could not register because the property starts with an '_'


How to pass a property from popup to execute I'm writing a Curve Outline Addon which works quite nice as a script, but I'm getting confused with the UI integration: I would like a simple popup asking for the Outline amount which interactively shows on my Curve. Instead I have a popup which forwards my property to the execute and then applies to my Curve.

Somewhere I didn't completely grasp the concept of modal/pass_through and invoke/execute...

class CurveOutline(bpy.types.Operator):
    """Curve Outliner"""
    bl_idname = "object._curve_outline"
    bl_label = "Create Outline"
    bl_options = {'REGISTER', 'UNDO'}

    outline = bpy.props.FloatProperty(name="Outline", default=0.1, min=-10, max=10)

    @classmethod
    def poll(cls, context):
        return context.object.type == 'CURVE'

    def execute(self, context):
        createOutline(context.selected_objects[0], self.outline)
        return {'FINISHED'}

    def invoke(self, context, event):
        return context.window_manager.invoke_props_dialog(self)

invoke_props_dialog() opens a "blocking" popup, it won't call execute() with the updated values until user confirm with OK button.

Use invoke_props_popup() instead, if you want to immediately re-run the operation:

import bpy

class CurveOutline(bpy.types.Operator):
    """Curve Outliner"""
    bl_idname = "object._curve_outline"
    bl_label = "Create Outline"
    bl_options = {'REGISTER', 'UNDO'}

    outline = bpy.props.FloatProperty(name="Outline", default=0.1, min=-10, max=10)

    @classmethod
    def poll(cls, context):
        return (context.object is not None and
                context.object.type == 'CURVE')

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

    def invoke(self, context, event):
        return context.window_manager.invoke_props_popup(self, event)

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

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

if __name__ == "__main__":
    register()

Added a check for context.object is not None to ensure the operator isn't run with no active object and replace selected_objects[0] by object, as it's not the same. If you intended to work on multiple selected objects, get all selected objects and remove the active one from list to separate them.


Solidify modifier creates edges with a different thicknesses I create a car model. I wanna make a rooftop of this car for first and I use Solidify modifier for this. After I used this modifier I got edges with different thicknesses. Here is what I mean:
One edge has the thickness 0.023 another - 0.0231. Is there a way to fix this or I don't understand something. Help me, please.

Here is an example:

The figure on the top here has "even thickness" unchecked.

That means the modifier makes so all segments length are the same. But as you can see the flat parts are uneven because the corner has the same length as the extremities.

The figure on the bottom has "even thickness" checked.

Here the flat parts are regular. But the segment at the corner does not have the same size compared to the extremities.

Now look at this figure:

When "even thickness" is checked, Blender calculates the intersection of 2 flat parts. Like intersecting 2 rectangles. That means (as shown with the green segment here above) that the length at the corner must be larger than the others.


This Light effect not showing in Render but shows up in View-port rendering. Affecting both EEVEE and Cycles When render in view-port,

The lights creates this effect on the fuselage(notice the part before wings.). But when I render it out that does not shows up. This is true for both EEVEE and Cycles.

Am I doing something wrong?

The final result is hard to see because there is no texture in the shared file and all is pink.
Though, it seems some of the lamps are not activated for rendering.

To see this icon, use the filter button:

There is 3 levels of visibility:

The eye icon that corresponds to H and AltH

Enable/disable in viewports, the monitor icon

Enable/disable in renders, the camera icon

These last two also correspond to the object properties here:


How do I create vertices that form square faces on a rectangle? I need to do this so I can build terrain properly.

This is what I am trying to get square faces on:

I tried deleting everything but the corners and this happens:

And this is what I want, square faces:

I'm curious about how come you have to start from this topology?

In this particular case though, you could:

Select a vertical edge, and ShiftG > Select Similar > Direction
CtrlI (Select Inverse)
X > Limited Dissolve the now selected edges


How to add edge loop parallel to an axis rather than relative to mesh How can I add edge loop parallel to x axis rather than relative to mesh, I want to add edge loop so that it is similar to the grill in the reference image beside it, But when I try to do that blender adds edge loop relative to mesh which is slanted. How can I achieve that?

I don't know if I get it correctly.
Would the "edge loop", being parallel to X on the slanted part, not cut through the part? Basically you want a grid going perfectly vertical/horizontal to fill the inner part?
Maybe "knife" tool or model frame and add the grid as a second mesh part?


Will EEVEE eliminate the need for cycles and rendering? So I have been seeing a lot lately about EEVEE, and even though it is in early development it still seems really powerful. What I'm interested in is will it just eliminate the need for having cycles and rendering your scene?

Given the fact that everything is rendered in real time I see cycles and waiting for things to render becoming obsolete.

No. EEVEE will not replace cycles.

If you want accurate renders, cycles will still be your renderer. Cycles is a ray tracer, so it simulates individual rays of light your scene.

EEVEE uses approximations on the behavior of light and will not be as accurate, however is much faster.

For some projects (such as low-poly renders or stylized works), EEVEE could replace cycles, but when it comes to photorealism, cycles will still be the champion.


UE4 tools (add on) for exporting fbx is not working for me I don't know what to do, I followed exactly what Jayanaman did on his video about fbx exporting but I get an error.

According the error "Tangent space can only be computed for tris/quads, aborting":

You might have a mesh containing a face with more then 4 vertices (BMesh). You can make sure to triangulate your mesh or fix your mesh manually. And try again.


Can Rigid body follow a path I want to make an asteroid falling on earth.... something like that so I want to know how this is possible, because rigid body falls straight to earth, and asteroid falls diagonally.

Initial velocity
An object's location and rotation can either be animated by hand or by rigid body simulation. Both things are not possible at the same time for logical reasons. Rigid bodies have the Animated option to switch which animation mechanism is used at any point in the timeline. We can use this to control the initial velocity.

Rigid Body Settings
Set the planet to passive type, the asteroid to active and give it an initial velocity using keyframes and the Animated option, as explained in the link.

Gravity
Depending on how big your scene is compared to the planet, the direction and strength of the gravity force can be regarded constant or not. If the asteroid is only seen from the ground's perspective, it is usually sufficient to use a constant field.

Constant field
Using the default settings for gravity in Scene panel is sufficient for this approach.

Variable field
Deactivate the gravity in Scene panel and add a force field of Point shape on the planet, or in a seperate force field object. Check the Gravitation setting for more realistic force magnitudes.


Why are my textures blurry? This is an image of a 50 samples render of my scene. I know, low samples but no matter what samples I render it at the textures are always blurred.

This is my camera options.

And this is my render options. How do I un-blur these textures?

That looks like Minecraft, in which case the textures are intentionally low resolution. You're looking at interpolation, which is normally good, but not for this. To turn it off, go to your image texture node and change Linear (the texture interpolation) to Closest.


Working with isometric refrence images How does one set up the camera for working with isometric reference images? I have tried addons like BLAM and others, but those require either vanishing points, or non-parallel lines. An example image for what I want to use is attached. Thanks in advance.

Under the assumption of right angles somewhere in the structure you can rotate a cube to match the angles on the picture and work from there. You should make yourself familiar with the "local" axis of an object.


Fur not moving with rigged main mesh So i created this bear model with fur and rigged it but when i pose it only the bear´s base mesh moves and not the fur. i can´t find what to do anywhere. Need help please!

This is what it looks like:

You have to move the particles modifier to the bottom of the modifiers stack, this way the particle system will use the modified mesh from the previous modifiers:

Note:
also there is an option on the particle system tab to use the modifiers stack ( but I don't think it does anything ? )


Sverchok: Parametric Brick Wall I was trying to reproduce this grasshopper tutorial on creating a parametric brick wall and I was able to reproduce almost everything, except the bricks rotation along the surface.

In the left side is the expected result, in the right side is what I got
I tried using the "duplicate bojects along an edge" node, but it seems that is doesn't work with multiple items in a list (it creates only the first one).
Any ideia how I could approach this?
Here is my node setup:

Thanks!
[EDIT]
Here my final setup after @nikitron answer:

Try this tree instead. and developt it
https://gist.github.com/4d0867def4fb5a12f7ce5485970302fe


Boolean with bevel bezier curve I have loaded an stl file and want to do some boolean stuff on it using python API (see code below). First I create the bevel spline and move the end points where I want them. Then I create a boolean modifier and try to union with the bevel-curve. After that want to subtract the union from a cube to make a hole.
But the curve can't be assigned as the object of the union; not even manually and I don't even get an error. Nothing happens. I can set the surrounding cube as the object and that works fine.
So is there something wrong with using bezier curves in boolean modifiers or am I doing something else wrong.

# ------- Model stuff -------

#bpy.ops.import_mesh.stl(filepath="K:/PQJ/Mold Generator/Blender test/Sphere_Full_40.stl", filter_glob="*.stl", files=[{"name":"Sphere_Full_40.stl", "name":"Sphere_Full_40.stl"}], directory="K:/PQJ/Mold Generator/Blender test")
bpy.ops.import_mesh.stl(filepath="K:/PQJ/Mold Generator/Blender test/898L-OutputModel-SLA[]_09.stl", filter_glob="*.stl", files=[{"name":"898L-OutputModel-SLA[]_09.stl", "name":"898L-OutputModel-SLA[]_09.stl"}], directory="K:/PQJ/Mold Generator/Blender test")
model = bpy.context.active_object

# ------- Mold stuff -------

mold_size = (20,30,30)
mold_displace = (mold_size[0]/2.0,mold_size[1]/2.0,mold_size[2]/2.0)
#mold_displace = (10,10,15)
bpy.ops.mesh.primitive_cube_add(enter_editmode=False, align='WORLD', location=mold_displace, scale=mold_size)
mold = bpy.context.active_object # New objects are selected by default

# ------- In- and outflow stuff -------

bpy.ops.curve.primitive_bezier_curve_add(radius=10, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
curve = bpy.context.active_object
bpy.ops.curve.primitive_bezier_circle_add(radius=0.5, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
profile = bpy.context.active_object

curve.data.bevel_object = bpy.data.objects["BezierCircle"]

curve.data.splines[0].bezier_points[0].co = (-0.01, mold_size[1]/2, mold_size[2]/2)
curve.data.splines[0].bezier_points[0].handle_left  = (-1, curve.data.splines[0].bezier_points[0].co[1], curve.data.splines[0].bezier_points[0].co[2])
curve.data.splines[0].bezier_points[0].handle_right = ( 1, curve.data.splines[0].bezier_points[0].co[1], curve.data.splines[0].bezier_points[0].co[2])

curve.data.splines[0].bezier_points[1].co = (5,13,10)
curve.data.splines[0].bezier_points[1].handle_left  = ( 1, curve.data.splines[0].bezier_points[1].co[1], curve.data.splines[0].bezier_points[1].co[2])
curve.data.splines[0].bezier_points[1].handle_right = (-1, curve.data.splines[0].bezier_points[1].co[1], curve.data.splines[0].bezier_points[1].co[2])

# ------- Boolean -------

bool_model = model.modifiers.new(type="BOOLEAN", name="bool mold") # create and store a modifier
bool_model.object = curve
bool_model.operation = 'UNION'
#model.hide_viewport = True

#bool_mold = mold.modifiers.new(type="BOOLEAN", name="bool mold") # create and store a modifier
#bool_mold.object = model
#bool_mold.operation = 'DIFFERENCE'
#model.hide_viewport = True

!!! EDIT: I see the same when I try manually. I find this totally bizarre. I have subtracted large objects from stl with 50000 faces each. So why can't I use bool on a simple bend cylinder? It is even meshed! I just happen to know even more about it than just the mesh. So just forget that it's a curved bevel and just use the mesh.

So why can't I use bool on a simple bend cylinder? It is even meshed!

In your screenshot it's not a mesh. You can't use the boolean modifier with a curve object, even if it's beveled. You have to first convert it to a mesh.

I am not a Python developer, so I don't know how to perform that step in code, but that is likely what your problem is.
Edit: Here is another question that has a Python implementation.


Can't solve my camera I was tryng to track my scene. I made and image sequence then exported all the jpg pictures. To get tracing points I used the "Detect Features" option to create keyframes. When I was ready I pushed the button "Solve Camera Motion" And it displayed that:
Atleast 8 trackers...

Can someone help me find out why it says that and could help me fix it?
Video: https://youtu.be/xEaocgkWAVM

You won't be able to solve a shot like that with the default solver. The camera is stationary and is rotating only, in those cases you need to solve as tripod. Be aware that this will only reconstruct the rotation of the camera, but will not yield any 3D information.
Read: How can I get better results when doing camera motion tracking?


How do you merge two faces that are connected by two differently sized edges? I am trying to merge/dissolve these two faces, but so far any option just removes the central vertex and dissolves it into an "average" face. How do I just merge them as if I removed the intersecting edge only?
Reference:

Edit mode> Face selection>  RMB + SHIFT  the desired faces>  F

Rough end result:

If the underlying structure is more complex than your orthographic view suggests, adding an inconspicuous loopcut or two may simplify things (so long as it won't be affected by doing so).

Hopefully this is what you were looking for.


Missing "encoding" panel/tab I have recently installed the latest stable version of blender (2.75a) and used
the video editor to join audio with a video. The problem is, when I click Anim to render the video, it generates a video file but with no audio at all. As I have seen in many tutorials, all I need to do is to set the renderer's audio settings properly in scene's "encoding" tab... it should be found under the "output" tab, but it just does not exist! What I see is exactly this:
OpenSUSE - Blender cannot encode or export video
I have searched in many sites over the web and tried many "possible" solutions with no luck at all. I have checked the FPS settings, reinstalled and even installed previous versions of blender (2.6) and still nothing.
I just want to get what I have made in my blender's project written in a video file, just that...
Thank you for your help

I don't think that AVI Raw has encoding options.

As it's an uncompressed format you'll not have much setting to work with, they are just plain frames.

The purpose of this format is to provide an input video that will be mixed and encoded with sync audio in a second phase, after for example some compositing, or color correction. It's the RAW data, it is expected to be used as a "base", not to be the final result.

You can Mixdown to extract audio from your file and than mix them with video in Blender or an external application.

Note: I wasn't able to find out any evidence of the fact that Blender AVI Raw format, despite its name, is not able to contain audio (and I'm not even sure), so consider this as a personal opinion.

You should use another output format.


How can I make my particles emit from the emitter object moving by key animation, instead of the emitter's default position? I'm on Blender 2.8, and am trying to make an animation of a ghost knight, with flames flowing from behind the visor and under the mail hem. To make it look nice, I used particles to animate the visor and hem flames, and using the flame physics kit for the arms wreathed in flame. Problem is, now that I've got the model animated, I noticed that the particles' emission spot doesn't move from the emitter's default location, even if the emitter itself does.
I know this question has been asked before, but of the two I found on the site, one had an answer which doesn't work in my instance, and the other wasn't answered. And before you ask, using hair particles isn't an option to my knowledge, as I can't animate that in a satisfactory manner.

Here's the character in it's default position, with emitters highlighted.

And here's the same character, with emitters still highlighted, mid animation. Note how the particle stream remains in the default position despite the emitters moving with the character's animation.

I've tried baking and re-baking the particles, to no avail.

Particle System has a bake option you wil see in the Panel.  You will probably need it.

If you have a previous bake.  Delete the bake.  Then bake again.

If you never baked.  Try baking for the first time.

Remember to bake after every significant change.  The particle system will not let you change parameters when a bake is active.  Yet you can change other objects such as physics obstacles. I have not checked every version of Blender 2.8X yet at one point there were obvious defects in the Particle System.


Quaternion problems, Rotation in direction of transit Quaternion problems
Hi Guys and Gals. I've been trying to code my way out of a problem. Essentially, I've been trying to get an object to roll in whatever direction its travelling, so if moved on the x axis it'll roll on the Y, and so on.
So here's the code I'm trying to use. and below that is a dropbox link to the blend. As you can see i'm close. But the rotations all wrong. It looks like the quaternions misinterpreting things, and my brains to frazzled to unravel the issue. I would really appreciate it if some one could tell me where its all going wrong.

import bpy
from mathutils import Vector
from mathutils import Quaternion
from math import pi
# create variables
target = bpy.context.scene.objects['CTRLEmpty']
empty = bpy.context.scene.objects['offsetEmpty']
rotator = bpy.context.scene.objects['RotatorEmpty']
obj = bpy.data.objects['Sphere.001']
# create a custom function called delay on the empty
target['delay'] = 2
# create a custom function called delay on the empty
target['radius'] = 2

# create empty list
prev_locations = []

# define the function
def roller_function(scene):
    # add the location of the Target (variable) to the prev_locations list
    prev_locations.append( Vector(target.location) )
    rot = Quaternion((0,0,0,0))
    # create variable called loc_count that is equal to the amount of entries in prev_locations list.
    loc_count = len(prev_locations)
    # cull list to 10 items
    # whenever loc count is larger than the delay variable...
    while loc_count > target['delay']:
        # "pop" or remove the entrie at index position 0 (i.e.  the first entry)
        prev_locations.pop(0)
        # then subtract one from location count
        loc_count -= 1

    # create an average location vector and position vectors P0 is for previos frame position (or current frame of delayEmpty P1 is for current position
    loc_average = Vector()
    P0 = Vector()
    P1 = Vector()
    for loc in prev_locations:
        #  add together location average and loc
        loc_average += loc
    # divide loc_avrage by loc count to get the actual average location
    loc_average /= loc_count
    # place delayEmpty in the priorframe location
    empty.location = prev_locations[0]

    #the clever bit
    #create previous frame Position variable
    P0 = loc_average
    #create current frame Position  variable
    P1 = target.location
    #if no distance travelled rotation is the same as prior frame
    if(P0!=P1) :
        #find the difference in location between this frame and last
        dif = P1-P0
        #get the distance travelled
        dist = dif.length
        #set the radius from average dimension
        r0 = (obj.dimensions[0] + obj.dimensions[1] + obj.dimensions[2])/3

        vec = dif/-dist
        zUp = Vector((0, 0, 1))
        rotAxis = vec.cross(zUp)
        angle = 360*dist/((r0)*(2*pi))
        rotDif = Quaternion(rotAxis,angle)
        rot += rotDif
        # print feedback in console
        print("locational difference is")
        print(dif)
        print("distance travelled is")
        print(dist)
        print("vec is")
        print(vec)
        print("angle is")
        print(angle)
        print("rotation is")
        print(rot)
        print(loc_count)
        rotator.rotation_quaternion = rot
        obj.rotation_quaternion = rot

# clear then add a function
bpy.app.handlers.frame_change_pre.clear()
bpy.app.handlers.frame_change_pre.append(roller_function)

https://dl.dropboxusercontent.com/u/35247393/troubleshooter.blend

So thanks to TheBusyTypist I was able to fix my code to work...

import bpy
from mathutils import Vector
from mathutils import Quaternion
from math import pi
# create variables
target = bpy.context.scene.objects['CTRLEmpty']
empty = bpy.context.scene.objects['offsetEmpty']
rotator = bpy.context.scene.objects['RotatorEmpty']
obj = bpy.data.objects['Sphere.001']
rot = Quaternion((1,0,0,0))
# create a custom function called delay on the empty
target['delay'] = 2
# create a custom function called delay on the empty
target['radius'] = 2

# create empty list
prev_locations = []

# define the function
def roller_function(scene):
    # add the location of the Target (variable) to the prev_locations list
    prev_locations.append( Vector(target.location) )

    # create variable called loc_count that is equal to the amount of entries in prev_locations list.
    loc_count = len(prev_locations)
    # cull list to 10 items
    # whenever loc count is larger than the delay variable...
    while loc_count > target['delay']:
        # "pop" or remove the entrie at index position 0 (i.e.  the first entry)
        prev_locations.pop(0)
        # then subtract one from location count
        loc_count -= 1

    # create an average location vector and position vectors P0 is for previos frame position (or current frame of delayEmpty P1 is for current position
    loc_average = Vector()
    P0 = Vector()
    P1 = Vector()
    for loc in prev_locations:
        #  add together location average and loc
        loc_average += loc
    # divide loc_avrage by loc count to get the actual average location
    loc_average /= loc_count
    # place delayEmpty in the priorframe location
    empty.location = prev_locations[0]

    #the clever bit
    #create previous frame Position variable
    P0 = loc_average
    #create current frame Position  variable
    P1 = target.location
    #if no distance travelled rotation is the same as prior frame
    if(P0!=P1) :
        #find the difference in location between this frame and last
        dif = P1-P0
        #get the distance travelled
        dist = dif.length
        #set the radius from average dimension
        r0 = (obj.dimensions[0] + obj.dimensions[1] + obj.dimensions[2])/3
        angle=dist/r0*2
        vec = dif/-dist
        zUp = Vector((0, 0, 1))
        rotAxis = vec.cross(zUp)
        rotDif = Quaternion(rotAxis,angle)
        rot.rotate(rotDif)
        # print feedback in console
        print("locational difference is")
        print(dif)
        print("distance travelled is")
        print(dist)
        print("vec is")
        print(vec)
        print("angle is")
        print(angle)
        print("rotation is")
        print(rot)
        print(loc_count)
        rotator.rotation_quaternion = rot
        obj.rotation_quaternion = rot

# clear then add a function
bpy.app.handlers.scene_update_pre.clear()
bpy.app.handlers.scene_update_pre.append(roller_function)
#bpy.app.handlers.frame_change_pre.clear()
#bpy.app.handlers.frame_change_pre.append(roller_function)

The last 4 lines are interchangeable, the frame change set is more stable the scene_update allows you to see changes as you drag.


When Animating the Eye with the "Track To" Constraint, the location of the mesh changes. How do I fix this? I am new to the community and have hesitated before asking, but I really think that I cannot find an answer online.

I am currently working on my first project and have a 3D Mesh of a female character with separate eyeballs. I have parented these to the head bone and have tried recently to make them follow a controller bone using the "Track to" Contraint. The Problem is, when I apply this constraint, the Eye teleports outside of the body. With the Z axis set as "Up", the location of the eye changes according to wich axis I pick as target, except when I check Z or -Z, it returns to normal... but it has no point anymore as the constraint is no longer active.

Here is my mesh how it is supposed to be with the eye mesh and the controller in place:

Here is the mesh when I add the Constraint to the Eye, you can see where it ends up:

Actually the "teleportation" starts even before I specify the Bone I want to Track. As soon as the constraint follows the armature, it teleports:

If you have any ideas on how to fix the issue, or what could be causing it, please let me know.
Thank you.

It is hard to see the "how to" in the context you describe, but here is an approach for rigging the eyes.

Create an armature
Add bones for the eyes to this armature (keep a main bone, extrude and set it as not connected bone)
Place these bones to the center of the eyeball (place the 3D cursor in the center and place the bone at the 3D cursor, use Shift + S)
In object mode, select the eyes, then the armature and Ctrl + P and "with automatic weights"

At this step we may have something like this :

Create 3 empties (bottom of the image below)

2 empties for the eyes, with a little convergence. 1 empty to drive the 2 previous. Parent the two first with the last empty.

Back to the eyes armature

Go to pose mode (for a direct answer, this point 'pose mode' is probably the problem in your question).
Select the left bone and add a "track to" constraint. Set the corresponding left empty as target.
Then do the same for the right eye.

It is done :

Eventually, you can parent this armature to your current armature, but I think this is better to incorporate all in your armature.


Is it possible to use cloth sewing springs to make pants? I saw a few tutorials on YouTube utilizing the cloth sewing spring method and I'm trying do such a thing with pants.

 All of the examples that I saw, have a piece of cloth going over the character's shoulder.

 Pants however don't  do so unless if they're overalls. I want to know does this method work only if a mesh is over an area of the character?

Of course it's possible to create pants using sewing springs. You can either turn off gravity, or pin the top of the pants to the avatar to prevent it from falling.


Overriding Context for bpy.ops.transform.shrink_fatten I can't seem to get sufficient context for calling bpy.ops.transform.shrink_flatten() without this error:

RuntimeError: Operator bpy.ops.transform.shrink_fatten.poll() failed, context is incorrect

I've attempted to specify the active object and some area parameters (via this answer),

# attempt to set obj-to-be-resized as active obj
bpy.context.scene.objects.active = obj_to_resize

context = bpy.context
override = context.copy()

for area in context.screen.areas:
    if area.type == 'VIEW_3D':
        override["area"] = area
        override["space_data"] = area.spaces.active
        override["region"] = area.regions[-1] # rule of thumb r.type == 'WINDOW'
        break

bpy.ops.transform.shrink_fatten(override, value=0.02)

but this isn't enough to avoid the error. I'm not sure which context parameters I'm still missing. Inspecting the source (line 947) gave me its polling function (line 373), ED_operator_editmesh, which checks the edit_object.

However, attempting to override this parameter by supplying override["edit_object"] = obj_to_resize produces a seg fault:

# backtrace
blender(BLI_system_backtrace+0x34) [0x561503952f54]
blender(+0xb7b882) [0x561502ede882]
/usr/lib/libc.so.6(+0x37e00) [0x7f060029ce00]
blender(BLI_addtail+0xc) [0x56150391cfac]
blender(ED_region_draw_cb_activate+0x39) [0x561502f04739]
blender(initTransform+0x8d3) [0x561503040e73]
blender(+0xcfd54c) [0x56150306054c]
blender(+0xcfd5ff) [0x5615030605ff]
blender(+0xb836ba) [0x561502ee66ba]
blender(WM_operator_call_py+0x6d) [0x561502ee6fed]
blender(+0xfab340) [0x56150330e340]
/usr/lib/libpython3.7m.so.1.0(_PyMethodDef_RawFastCallKeywords+0x148) [0x7f0605df31c8]
/usr/lib/libpython3.7m.so.1.0(_PyCFunction_FastCallKeywords+0x21) [0x7f0605df3461]
/usr/lib/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0x4a75) [0x7f0605e62a75]
/usr/lib/libpython3.7m.so.1.0(_PyEval_EvalCodeWithName+0x2e9) [0x7f0605dac879]
/usr/lib/libpython3.7m.so.1.0(_PyFunction_FastCallDict+0x2fc) [0x7f0605dadadc]
/usr/lib/libpython3.7m.so.1.0(_PyObject_Call_Prepend+0x68) [0x7f0605dbd028]
/usr/lib/libpython3.7m.so.1.0(+0x16d3ef) [0x7f0605e0b3ef]
/usr/lib/libpython3.7m.so.1.0(_PyObject_FastCallKeywords+0x3ac) [0x7f0605e1f2fc]
/usr/lib/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0x5d35) [0x7f0605e63d35]
/usr/lib/libpython3.7m.so.1.0(_PyFunction_FastCallKeywords+0x10b) [0x7f0605df2a3b]
/usr/lib/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0x76d) [0x7f0605e5e76d]
/usr/lib/libpython3.7m.so.1.0(_PyEval_EvalCodeWithName+0x2e9) [0x7f0605dac879]
/usr/lib/libpython3.7m.so.1.0(PyEval_EvalCodeEx+0x44) [0x7f0605dad7a4]
/usr/lib/libpython3.7m.so.1.0(PyEval_EvalCode+0x1c) [0x7f0605dad7cc]
/usr/lib/libpython3.7m.so.1.0(+0x2381e4) [0x7f0605ed61e4]
/usr/lib/libpython3.7m.so.1.0(PyRun_FileExFlags+0x9e) [0x7f0605ed76ee]
blender(+0xf95b38) [0x5615032f8b38]
blender(+0xb79be5) [0x561502edcbe5]
blender(BLI_argsParse+0xd7) [0x561503908347]
blender(main+0x2e9) [0x561502ec5a39]
/usr/lib/libc.so.6(__libc_start_main+0xf3) [0x7f0600289223]
blender(_start+0x2e) [0x561502edb33e]

What context am I missing? And why does attempting to override edit_object cause a seg fault?

@batFINGER's comment is helpful: you (probably) can't override context for edit mode. I ended up just replacing the shrink_fatten operator with the equivalent function, per this:

def execute(self, context):

    ob = bpy.context.object
    me = ob.data
    bm = bmesh.from_edit_mesh(me)

    for v in bm.verts:
        if v.select:
            v.co += v.normal * self.factor

    bmesh.update_edit_mesh(me, True, False)
    return {'FINISHED'}

which was an order of magnitude easier and could be, in general, potentially the best way to replace relatively simple edit operations instead of overriding their context.


Active image of UV/Image Editor After creating an image using:

bpy.data.images.new(name="NewImage2", width=512, height=512)

How would I set that image to the active image within the UV/Image Editor in Python?

You loop through area till you find the UV/Image editor and set the active image to you image

for area in bpy.context.screen.areas :
    if area.type == 'IMAGE_EDITOR' :
            area.spaces.active.image = my_img


bl_context multiple areas Is it possible to make a panel in multiple areas at once?
Below I make a button, I want it not only on the materials tab, but also on modifiers and other tabs (all in properties).

bl_context = "material, modifiers, ..."

Example code:

class myPanel(bpy.types.Panel):
        bl_label = "My Multi-Panel"
        bl_idname = "scene.multi_panel"
        bl_space_type = 'PROPERTIES'
        bl_region_type = 'WINDOW'
        bl_context = "material"

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

        scene = context.scene

        row = layout.row()

        row = layout.row(align=True)
        row.operator(myClass.bl_idname, text="Button")

AFAIK not directly.  Often use type(...) to register multiple classes. Code below will register a panel with "material", "object" and "data" bl_context, based on your myPanel class definition.

import bpy
from bpy.utils import register_class

class myPanel(bpy.types.Panel):
    bl_label = "My Multi-Panel"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'

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

        scene = context.scene

        row = layout.row()

        row = layout.row(align=True)
        row.operator("wm.splash", text="Button")

contexts = ["material", "object", "data"]

for c in contexts:
    propdic = {"bl_idname": "mypanel.%s" % c,
               "bl_context": c,
               }
    MyPanel = type("My%sPanel" % c, (myPanel,), propdic)
    register_class(MyPanel)

Another method would be to make a list of the panels you want to append / prepend the button to.

import bpy

panels = ["SCENE_PT_scene",
          "OBJECT_PT_context_object",
          "DATA_PT_context_mesh",
          "MATERIAL_PT_context_material",
          "TEXTURE_PT_context_texture",
          "OBJECT_PT_constraints",
          "DATA_PT_modifiers",
          "DATA_PT_context_metaball",
          "WORLD_PT_context_world",
          "DATA_PT_context_lattice",
          "DATA_PT_context_lamp",
          "NODE_PT_active_node_generic",
          "Cycles_PT_context_material"]

def draw_func(self, context):
    layout = self.layout
    layout.operator("object.select_random", text="BUTTON")

for p in panels:
    panel = getattr(bpy.types, p)
    if panel is None:
        continue
    panel.append(draw_func)


How to Change the Origin when moving a Collection Instance I have created an Collection Instance, when I try to move it, the origin(to snap at vertices or edges) is far away from the object, I want to set it.

In the image, the Collection Instance is selected, the cross is far away from the object and I can´t set it using "Set Origin to 3D Cursor"

What Am I missing?

First Method : Set the origin in the base collection

To change the origin of a collection instance, you have to go to the object information panel, then the collections foldout and choose "set offset from cursor" with the drop-down popup on the right of the collection name.

Second Method : Set the origin in the collection instance

There is another way to do it as pointed out in the comments. Select the collection instance and type F3 to search for "Set Origin" and choose accordingly to your case. Alternatively go to Object>Set Origin.

Note that this will be a bit more work if your object's origin is not in the center of its geometry. You can still manually place your cursor and choose "Set Origin" "From Cursor".


Duo-tone Effect in Blender's Compositor How can I make a duo-tone effect shown on this picture?

You really only need to use a color ramp node, but I have added some math nodes to control the contrast. Instead of these you could use a Color Curve node.


Render Regions renders part of region only I rendered an image using the Render Regions add-on, and it turned out like this:

Here are my render settings:

Here are my Camera settings:

The first image was rendered using the Render Regions addon, with one row and column.

With Render Regions set to four rows, here is what the top fourth of the image looks like when rendered at %100:

Here's what it looks like when rendered at 60 something percent:

As you can see in the picture below, the region margin is as wide as the whole render dimension. Only the top region is selected. I used the Render Regions add-on to render four fourths of the image and the top fourth was rendered last. That picture is there to show you that Render Regions was rendering images as wide as the width of the render dimension.

Because there is a background image being used as the sky, Alpha, under Shading needs to be set to Transparent. I'm using Blender Internal Render.

A little bit of computer info: 128 MB graphics, 3.00 GB RAM; 1 Intel Core 2 Duo processor T2500 2.5 GHz (processor is just a lucky guess).

Link to .blend file

Rendering a region will always have the margins added to it when completed. The purpose of this tool is to make it so you do not have to render an  entire image when you are test rendering, so the margins give you an idea of what part of the scene it is in.

If you really need to use this method for a final render (NOT recommended, move your camera!) then you can use any image manipulation software to get the margins trimmed off.

If you want to render different sections because of huge render times for the entire image, and then add them together in post-pro, that works well, too.

HINT: Check transparent background settings, it will make your work a whole lot easier!

If this does not answer your question, please leave a comment, I'll try to get back to you.


Proper intersection modeling How to properly model such triangular intersection?

What I did is just slapped another rectangle on top of it and beveled it?
But I guess that is not a good practice?

Add a Cube
Extrude its two opposite vertical side
Merge the new upper verts to the originals to create a frustum
Extrude the frustum's upper side
Select all the non horizontal edges and choose Edge>>Subdivide
Select the new edgeloop around the frustum and move it to the right position by double hit "G" and move the mouse vertically.
Extrude the appropriate faces.


Dynamic Paint Brush not working on canvas I'm trying to get the Dynamic Paint Brush on my model to touch the Dynamic Paint Canvas and I've done this before but it's not working this time and I'm not sure why.

Here is a screenshot of the overall problem and here are screenshots of my settings.

If there is further information needed, let me know and I will provide it

I needed to add a subsurface modifier with at least 5 divisions to get my desired result

There was only 1 face, so the brush was working but I was unable to see it due to the size being so small at .01 on one face without the subsurface modifer


A tube of light in a volume shader As I had much fun with this (thx Chebhou) but gaussian functions are a bit too complex for me, i want my volume scatter cylinder to have simply a smaller cylinder emitting light inside it, from the same object/material. The same size all along, or why not being able to control the fading at one or both sides (why not asking :) )

It has to be done with math nodes, vectors and things like that (what I want to learn)

Something like this but in a single object

looks like a light saber :)

use this circle equation and chose a radius "max R = 0.5" :

Coordinates node group :

and for fading on the sides i used a sin function :

render :


Making a reflection on a glossy object based on each frame of the video I made some attempts in doing it but all of them didn't look to well and they didn't change with the video.

I managed to achieve this. Perhaps someone with more experience could give me some tips on making the effect more realistic?
Another question: how can I add a noise to my render so it looks more grainy in a way bad video does?

If I understand correctly, you want to create a glossy object and have it reflect an environment comprised of moving images from a video...

You don't have to map the reflections into the object, just give it a glossy shader and let it reflect the environment.

It's on the World that you need to map your video image and let it reflect on the ring:


Is there a more accurate way of knowing which vertice are affected by proportional editing? The proportional editing tool use a white circle as an indicator to which vertice are affected but that works in 2D world well and not 3D.(for example if you design a flat paper page in blender and view it from top it works 100% accurately)

As you see in the image above some vertice are within the circle but they aren't affected.Is there a more accurate way to know which are affected?

This script / addon may help. It simply selects the vertices impacted by the proportional editing, starting from the current selection.

Once visualized, you can Ctrl+Z to come back to your current selection.

bl_info = {
    "name": "Select proportional editing impact",
    "author": "lemon acidjuice",
    "version": (1, 0),
    "blender": (2, 77, 1),
    "location": "View3D > Select > Edit mesh > Select proportional editing",
    "description": "Selects vertices influenced by proportional editing",
    "warning": "",
    "wiki_url": "",
    "category": "3D View",
    }

import bpy
from bpy.types import Operator

def Influenced( u, selected, size2 ):
    for s in selected:
        if (s.co - u.co).length_squared <= size2:
            return True
    return False

class EDIT_MESH_select_proportional(Operator):
    """Select proportional editing impact"""
    bl_idname = "editmesh.select_proportional"
    bl_label = "Select vertices influenced by proportional editing"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        scene = context.scene
        obj = context.active_object

        size = scene.tool_settings.proportional_size
        size2 = size * size

        mode = bpy.context.active_object.mode
        bpy.ops.object.mode_set(mode='OBJECT')

        selected = [v for v in obj.data.vertices if v.select]
        unselected = [v for v in obj.data.vertices if not v.select]

        for u in unselected:
            u.select = Influenced( u, selected, size2 )

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

        bpy.context.scene.update()

        return {'FINISHED'}

# Registration

def add_select_menu(self, context):
    return self.layout.operator( EDIT_MESH_select_proportional.bl_idname )

def register():
    bpy.types.VIEW3D_MT_select_edit_mesh.prepend(add_select_menu)
    bpy.utils.register_class(EDIT_MESH_select_proportional)

def unregister():
    bpy.types.VIEW3D_MT_select_edit_mesh.remove(add_select_menu)
    bpy.utils.unregister_class(EDIT_MESH_select_proportional)

if __name__ == "__main__":
    register()


mtl file after exporting comes without texture map (map_kd ...) I am quite new to blender. I have retopologized a high poly model with texture and then bake the texture  (all in cycles) to the new model in blender. When I export the obj file the mtl file comes without the map_kd texture reference.
I exported with the following settings: Selection only, appply modifiers, Include edges, Write normals, Include UVs, Write materials and Objects as OBJ Objects (aso tried with "Material groups").

The texture is applyed with the following nodes: Image Texture - Diffusse BSDF - Material Output.

Any tip about what am I doing wrong?

Thanks!

The problem is that the .obj exporter requires a material setup using the Principled Shader in order to write an .mtl with the map_Kd attribute. Unfortunately the documentation is still work in progress for Blender 2.8, that's why this wasn't previously documented.

The fix for your problem is to replace the Diffuse BSDF nodes with the Principled BSDF. Then you can simply plug your texture into the base color socket of the Principled BSDF, set Specular to zero and it should export as expected.


Is it ever ok to use bpy.context instead of operator context? I wouldn't say I'm a new developer but certainly still amateurish in the Blender API ways. Basically, I'm kinda tired of passing context to every single class and function XD
Examples:

Can I use bpy.context.scene anywhere without issues?
Will bpy.context.selected_objects always return the selected objs in the 3DView regardless of where the operator was run?

Is it ever ok to use bpy.context instead of operator context?
I'm guessing there are situations where you get lucky and the two just happen to align, but I assume it's bad practice to rely on that.
...should I just get used to passing the operator's context everywhere because its safer?

Can I use bpy.context.scene anywhere without issues?

Yes, you can always use it, as the blender scenes are practically never lower than 1. So bpy.context.scene, will always refer to the current scene
But be careful, if for example you do something like assigning this to a variable scene = bpy.context.scene, the scene may at some point, no longer exist, as the user could create new ones, and delete that scene from the bpy.data.scenes

Will bpy.context.selected_objects always return the selected objs in
the 3DView regardless of where the operator was run?

Yes, this always returns the selected objects in a list, so to check for yourself, you can run bpy.context.selected_objects in the Blender console, closing any window with the 3D view, you will notice that it will always refer to the current scene, and consequently to selected objects in the scene.
In addition, by returning a list of objects, you can check if the list contains any objects with if bpy.context.selected_objects
The operator in general already contains the context, in principle if known, within an operator, for example in the function execute(self, context), the context is already present together with self (self is itself, i.e. the operator class).
The context can also be assigned at the beginning of a script, as happens in the Blender console:
C = bpy.context as is also the case with D = bpy.data


Create and add net to helmet I'm currently modeling a ww2 helmet:

I finished the helmet and now want to add a net like in this picture:

I tried to create a plane with modifier wireframe and then add cloth physics to the plane. The problem is that when the plane falls down on the helmet it creates a lot of wrinkles. I don't have a lot experience with blender physics yet...
Is there a better way? I want the net to be a seperate object. The net can be very simple but it should have the same form as the helmet.
Thanks in advance!

Try it with the Tissue addon:

Enable the addon. Create a lowpoly version of your helmet (the size of the pattern will depend on the size of your faces) and create the hexagonal pattern:

In Object mode, select the pattern, then the helmet, and in the N panel > Edit > Tissue Tools > Press Tesselate:

It has created this net, it has some flaws that you can correct. Keep your helmet where it is (or bring the highpoly), make it invisible, select the net, give it a Shrinkwrap modifier with the helmet as Target:

Go in Edit mode and bring some correction to the topology so that you only keep hexagons or kind of, the Shrinkwrap will help to keep the vertices on the surface of the helmet:


Vertex normal issue after separating and re-merging Hey fellow Blenderers,

I created an asteroid mesh, bisect cut it 3 times (for each axis) to get 8 parts out of it. I need these parts later for animation purposes. After cutting and separating these parts into individual meshes I remerged them, because I only need the parts separated from each other (no connecting faces).
The issue I discover now is a different normal on the vertices at the cutting edges as you can see on the image. I think it's normal behavior?  Idk.
So my question is either "how can I fix the normals to appear the same" or "how can I cut the mesh in parts without influencing the normals"?

Thanks so far

First off:
Yes this is normal behaviour.

When you split a parts off of a mesh, then you get more vertices. Those new vertices have their own normals and the normals of the old vertices change a little.

Why? Because vertex normals are calculated by averaging the normal for all adjacent faces of a vertex.

You can see the change of the vertex normals in this image:

You use tangent space normal maps so you'll have a problem in your game engine, because tangent space normal maps change the normals of your mesh based on the existing normals. Maybe it still looks ok in your engine, the difference of the normals is not that big, then just leave it as it is.

If it doesn't look ok and you can see a sharp edge, then you have these options (that I know of):

Rebake the normal map to the new split mesh (that's probably going to be complicated because projections are also based on mesh normals ...)
Use the Normal Edit Modifier and create a vertex group and an object to point the normals to for every single vertex you need to adjust (hopefully your exporter accepts the info correctly, because applying the modifier doesn't work and you will not see any changes on the normals in edit mode)
Use the Data Transfer Modifier to transfer the normals from your old, unsplit mesh to your new split mesh (check "Face Corner Data" and "Custom Normals" and hope that your exporter accepts the info correctly, because applying the modifier doesn't work and you will not see any changes on the normals in edit mode)

I know that Maya allows manual editing of individual vertex normals and 3ds max has smoothing groups which is a weird way to almost set vertex normals manually, but not quite (and it wouldn't work in your case).

Sorry to leave you with bad news. Good luck!


How to make an object transparent to the freestyle pass? In Blender 2.75a, I'm making a render using Cycles and the Freestyle pass. My scene contains a mesh with a smoke modifier that I'm rendering through a volumetric shader.

The boundaries of this mesh (the box, in the example below) are meaningless to the extents of the render, therefore the mesh should neither have its edges drawn by freestyle nor cover the lines of the things behind or inside it.

I don't know if it's possible to tell freestyle to completely ignore the mesh, and how to do it.

This is what happens if I render a sample scene with cycles+freestyle+volumetric rendering and without further options (left) and with the box assigned to an excluded object group (right)

Neither of them is the expected result: I'd like to have the freestyle lines on the sphere but not on the box. Is it possible?

Add after TLousky answer

As you can see, even if I choose to render freestyle all the objects except the box using an "Inclusive" group, the "phantom" of the box still covers the edges of the sphere and partially of the cone and torus (exactly as in the example above where I used an Exclusive group containing only the cube instead)

The source of the problem is that Freestyle view map has (can see) the smoke domain geometry. This is a typical problem. Transparent mesh like glasses can be solved with the same method.

Put torus, cone and sphere on a new render layer (mesh on layer 1). This render layer will be rendered with freestyle.
Isolate the smoke domain cube to another render layer (ie: mesh on layer 2). Turn off freestyle on this render layer or don't render this layer at all.

That should solve the smoke domain cube from being rendered.


How can toolbar transparency be modified? Transparent toolbar functionality was released in 2.66, how do I enable transparent toolbars and how can I modify how transparent they are?

Seen here:
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability

I would like mine to resemble the toolbars shown in the screenshot, very low opacity.

Enable Region Overlap in CtrlAltU→ User Preferences → System:

To modify the transparency of the sidebars, change the Alpha value of User Preferences → Themes → 3D view → Region background:


Alt+M to merge vertices is not working anymore I'm trying to merge vertices using the Alt+M keyboard shortcut, but instead I get an option to split. I never saw this menu before
Please help.

The new shortcut to merge is M.
No Alt is needed no more.
You can use the right mouse button to bring up the Context Menu, and the shortcuts should be visible there.


Normal Map image being used for texturing Here's a link to my files and texture images

For some reason certain parts of my mesh are using their normal maps for texturing/color instead of the texture images I have selected for color with their respective blender materials. The result is shown below:

You can see that the hair and fins on the arm are affected. Their colors should be closer to this:

Than multitexture setting enabled, faces displays last assigned texture in UV-image editor.

Switch to GLSL mode, in this mode faces tries to display close to material settings:

  However, when it is set to "solid" I still see the normal map as
  opposed to the proper texture.

If you have textures in solid mode, uncheck textures solid:


Is it bad practice to use overlapping meshes/objects? I noticed that in a lot of videos people will make objects that have two or more overlapped meshes, such as a gun made of a barrel, magazine, etc. and they look fine, but I would assume this would cause issues for rigging, animating, and even reduce performance in a game engine due to the internal geometry and separate objects, wouldn't it? (not talking about z-fighting)

Is there any problem with making an object by just overlapping two different ones, with no geometry connections?

For example, if I was to create a windmill that I wanted to easily rig and animate and export to a game engine, should I create the windmill's sails from the geometry of the windmill and keep it as a single object, or should I create a new object and make the sail then Boolean it so it's 1 object, or instead just leave them overlapping?

I think that « 1 or 2 objects » and « meshes overlapping » are two different topics, and what you decide really depends on your needs. Anyway:

Don't overlap the meshes of your object if you want to 3D print.
In the case of a gun with a barrel, if you don’t need to animate the barrel you can keep one unique object. No matter if some meshes overlap, but you could consider deleting some vertices if they are invisible, i.e. useless. If for a reason or another you want to keep 2 separate objects (for example you want to keep a modifier only on a part of the whole object), you can decide to parent the barrel to the gun, or parent the 2 objects to an empty, it will make the manipulations easier.
If you need to animate the barrel (or the sails of a windmill) you'd better make 2 separate objects, it will allow you to parent the barrel to an empty and make a 360° rotation. If you keep the whole gun one object you'd have to use bones and anyway I don't think you can make a bone rotate more than 180° (?).


Blender 2.80, Face area info In blender 2.79 there was option of showing face area in properties menu, but in blender 2.8 I can't find it. Is there a way to show it in 2.8 version?

Face area is an overlay.
In the 3D view header, while a mesh is in Edit Mode, open the overlays popover and tick Face Area towards the bottom.


How can I generate camera shake? I would like to generate camera shake in either a render or in BGE.  How can I accomplish this?

You could insert a single keyframe for the location on the camera (if you dont have any movement) and then, in the the graph editor, add a noise modifier to the curves in the properties panel (N key). Adjust the values of the modifier so you can get the intensity and movement that you like.


I cant quite get cloth sawing down on my character I am trying to add some clothes on my character.
I saw two main ways of doing this. First by selecting vertices and duplicating them and scaling them up. I tried it, but it didnt work quite well because my vertices look like this.

Also ignore the arms, I moved them 1 unit away so they don't affect the clothing wrapping up the body. I should have sculpted it in a T pose but I didn't know how to pose it after without messing up the vertices. I think there was something related to weight paint but i just want to 3d print this, so the ability to animate it doesen't matter to me.
Second way i tried, was by sawing.
It went ..
I am going to let this explain everything..]

I need help.
Thank you for reading and thanks in advance if you try to help me.
This is the blend file if you need it.

The simulation looks good, it just needs a few tweaks.

Fix the arms first ;-) The sleeves can collide and get messed up there. Either rotate them in Edit mode or use the Pose Brush in Sculpt mode (increase the brush size)
In Object mode apply the scale to the shirt (Ctrl+A)
In Edit mode, select the whole mesh the shirt (A), then flip normals (Alt+N) because your shirt is turned inside out
In Edit mode, scale the shirt a bit up (~20%) because you need more fabric to wrap around the body
Move the shirt closer to the body by scaling it down along the X-axis (S, then X). Make sure the threads to not intersect with the body.
In the Cloth settings, reduce the distance for Object Collision and in Self Collision to 0.005 m. If Self Collision is too low the mesh can 'explode', if Object Collision it's too high the fabric starts to 'crawl' and flips over the head.
Start the simulation. It should look good after 15-20 frames. If not, cancel it, and tweak the settings or try another start position for the shirt.
The seams might have some gaps. I could not find out why this is so. And there can be rough wrinkles. But you can fix this after you applied the cloth modifier.
If you're happy with the result duplicate the shirt (D) in Object mode to create a backup object.
Apply the Cloth modifier in the drop-down menu on the Modifier panel.
To remove the gaps switch to Edit mode, select everything, and do a Merge By Distance (M, 0.017 m). You can adjust the distance in the dialog that appears (F9 brings it back if you missed it). Have a look under the arms if they are all gone.
To smooth the rough wrinkles on the shoulder switch to Sculpt mode, use the Smooth brush with a strength of 0.2 and smooth it. The Inflate brush can be used to bring the volume back if you have smoothed too much. (The Cloth brush can be used to add more wrinkles. Use a Subdivision modifier is needed.)
Congratulations! You have made it! The simulation is a bit choppy. Small changes in the values can have big effects and it usually takes several attempts to get a good result.

Back view:


Can 3 objects be replaced by 1 object, or joined by their location? (BGE) I have a crane loading three 40' long pipes onto rollers to be welded, end-to-end to make a 120' long pipe. (The pics are not to scale, just a mock-up):

3-40'Pipes on Rollers, Pipeyard to the left

On keypress "W" the rollers turn once with robotic welders joining the 3-40' pipes. I used the actuator EditObject/EndObject to remove the 3-40' pipes and an EditObject/AddObject to replace them with one 120' pipe on the rollers so it can be lifted from the rollers onto a truck.

1-120' Pipe replaces 3-40' pipes on keypress "W"

Problem with that is the pipes in the pipeyard also disappear. So, my question is...can the 3-40' pipes on the rollers be JOINED, or replaced, by their LOCATION on the rollers rather than by assigning EditObject to each pipe? Animation won't work because I need to move the finished pipe to the truck with the crane.

Any ideas would be appreciated!

The BGE does not support mesh manipulation that way. You can scale the objects (forming a longer Pipe) but you can't merge meshes.

When you let all objects listen to the same even (w) with the exact same behavior, they will behave exact the same way by ending themselves at the same time. This is what you told them to do.

What you wanted to do is to end the objects on the rollers. So you need to discriminate between objects on the rollers and objects that are not on the rollers. To be more specific you need to identify the three small pipes that can form the big pipe.

You could

check what pipes are on the rollers. This excludes all other pipes.
check what orientation they have. This excludes misaligned pipes.
check the location. This excludes pipes too far away.

How to do?

You could assume that any pipe on a specific roller is already placed and aligned correctly
Check all three rollers to have a pipe on top of itself
or let the pipes check themselves if they are above a roller

Checking options:

ray sensor (upward or downward)
collision sensor
radar sensor
near sensor
check via python


Textures Not Showing in Viewport (Blender 2.8) I'm working in the new 2.8 with someone else's file (made in a previous version of Blender), and I can't get the textures showing in the viewport. I've relinked all of them to the correct location on my computer and Blender can seem to find them, but just won't display them in the viewport. I've made sure I'm in LookDev mode, and also added a lamp, but still nothing.
In 2.79, it was always just a matter of finding missing files and that's it...
Can anyone see what I'm doing wrong here?

Thanks!

Blender 2.8 uses an entirely different materials system from previous versions. As a consequence of this (and perhaps also as a result of some missing backwards compatibility features in Blender 2.8), image-based materials created in older versions of blender get replaced with plain, solid-color materials with no textures when opened in Blender 2.8.

To fix this, you will need to manually re-assign textures to their appropriate materials in the project. Select the model you want to fix, then in the properties editor go to the materials tab, select a material to fix, and click "Use Nodes". Next, click the small button to the right of the "Base Color", and click "Image Texture". Finally, click the image dropdown below the base color, and select the correct texture for the material you have selected. Depending on how well named the materials and textures are, you may have to use a bit of trial and error to figure out which texture goes where. Now repeat this process for every material in the project.

Yes, this could be extremely tedious depending on the size of your project, but until Blender introduces a built-in way to convert old models to the new materials system this is what we're stuck with, apparently.

For more information on this issue, see Opening old .blend files (missing images) on KatsBits.


How to apply a specific modifier on selected objects? I'm trying to achieve this:

I select all objects with the same type of modifier (Armature) and want to "click" Apply on all of them. I searched different scripts on here and badly put together this one:

import bpy
sel = bpy.context.selected_objects

for ob in sel:
    for i, mod in enumerate(ob.modifiers):
        if mod.type == 'ARMATURE':
            bpy.context.scene.objects.active = ob
                for x in range(0, i):
                    bpy.ops.object.modifier_apply(modifier=mod.name)

It will work for some of the selected objects then Blender will say "Python Script fail". It's obvious I don't know what I'm doing, but why is it failing after working at first? Thanks

EDIT:
I found something that does exactly what I was trying to do. A user from Blender Artists named VincentG created an addon called "Massive Editor" from here. I selected all objects, typed Armature in the custom field and all objects that had that specific modifier applied. The script may be old, but it worked great. Thanks Vincent!

For the sake of learning though, I'd still want to know what went wrong...

UPDATE:
While searching around I found this answer here and tried it out to see if it would work for me:

import bpy

sel = bpy.context.selected_objects
act = bpy.context.active_object

for obj in sel:
    if obj != act:
        bpy.context.scene.objects.active = obj #sets the obj accessible to bpy.ops
        bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Mirror")

bpy.context.scene.objects.active = act

It almost does what I would like but every time it would only apply to all selected objects except the active one.

Blender 2.79

This should work:

import bpy

for ob in bpy.context.selected_objects:
    bpy.context.scene.objects.active = ob
    for mod in [m for m in ob.modifiers if m.type == 'ARMATURE']:
        bpy.ops.object.modifier_apply( modifier = mod.name )

You may have some warnings though (like via the UI).

Blender 2.8

Use view_layer instead of scene:

import bpy

for ob in bpy.context.selected_objects:
    bpy.context.view_layer.objects.active = ob
    for mod in [m for m in ob.modifiers if m.type == 'ARMATURE']:
        bpy.ops.object.modifier_apply( modifier = mod.name )


Third Person: Rotate camera around player I am trying to make a 3rd person game in the blender game engine but I do not know how to make a third person camera. So what I want is: Make the camera follow the player (cube) and rotate the camera around the player (cube) just like other 3rd person games like Uncharted and Grand Theft Auto.

Is something like this doable with Logic bricks? (if not then python code would be alright)

I am also quite new to the blender game engine, so please try to explain it as good as possible.

Blender Version: 2.76

It is the same principle as with first person view:

parent the camera to the character you want to follow
use the mouse actuator (or any other method) to turn the camera according to you needs

The difference is:

you do not place the camera around the (virtual) eyes - but somewhere behind the character.


Copy, paste and moving Suppose that I have 2 identical objects created by copy and paste. How do I move one and left the other
stay at its position ? What are the hot-keys for this and clicking options in the Blender's workspace ?

In order to move an object with a key shortcut, press G to move the selected object(s).  If you choose to cancel movement before you hit enter or click LMB, you can click RMB to cancel the movement.  You can choose to move it just by moving the mouse, but you can also choose an axis by pressing x, y, or z after pressing "g".
If you want it to not move on a specific axis, then press Shift-(axis).  For instance, if you don't want it to move up or down, press Shift-Z.
After pressing G, you can just move it a certain distance with your mouse.  However, if you want to move it an exact distance, you can type in an amount after pressing G.  You can also backspace, so you don't have to try al over again.  Also, you press the - symbol to change the value you typed to a negative amount so it will travel backwards along the axis.  The negative symbol switches the current amount's symbol, so if you hit - when the amount is set to a negative amount, it will change to a positive amount.  Try this out to fully understand.
One more thing: It doesn't matter if you specify distance before choosing the axis you are moving on.  You can even change amounts and change axis in-between each other, if that makes sense.  The only important thing is that you press G before choosing distance or axis.
Please ask if any of this doesn't make sense.


Joined objects won't move with rig I've made multiple individual objects and joined them when I try to rotate a bone the joined objects don't move.

You've probably parented the mesh to the skeleton before joining additional parts to it. Thus vertices of the new parts don't belong to any vertices groups, created by "Parent with automatic weights" operation. If it's only about the helmet, the easiest way to fix that would be to separate it again from the body mesh and parent it to the head bone. If you're planning to add some equipment also to the chest, usually the way to go about it would be to keep that separate and use Mesh Deform modifier to control the character, cause it's usually hard to get perfect weights on fragments that are not physically connected (not just joined, but with common edges) with the main mesh.


When I join objects they are getting all same material as target object When I join objects they are getting all same material as the target object. That's why I don't like. I need them to have different materials. How do I prevent this ?

Nothing simpler. If you want to insert several materials in the same composition, just select the entire object and switch to edit mode. Once this is done you just have to select the interested parts and in the material editor assign a certain material to the selection, same thing with the rest of the object, the selection again, create a new material and assign it to the selection.
In the screenshot (1) I posted you can see how the parallelepiped is actually formed by two joined cubes, and in the material editor you can see the presence of two materials associated with different meshes of the same object.
1.

Bonus tip:There are actually other ways, [see Gif. (2) ] if you don't want to merge the object and leave the meshes separate you can link the two objects. in the sense that although the meshes are separate, the interactions of one of the two objects will affect the corresponding linked. Which will represent the aspect of parents-children, where the influential object is the parent and it will be he who commands the movements etc. This will allow you in your example to move the base of the donut and with it the icing and the sugars that will follow the movements of the donut, being able to apply different textures and materials.

To make the parent link, use the shortcut CTRL + P and click on Object or with Keep Transform which allows you to maintain the original positions, bearing in mind that the parent will be applied to the object with the light yellow selection and not to the orange one.
I hope I was helpful.
2.


Rendering shiny steel on a white background? Even though there are several other questions with answers in this blog, I found the answers to my following question very useful.
I want to render animations of a shiny type of steel, for example, the goal is having a rendering like this, but with a white background!

It seems the lighting, environment and HDRI are important, but I could not make it work!
The result of my rendering is this picture:

Can you please have a look at this file and give any hints about any changes that I should do?

Thanks,
Kind regards

There are just three things you need to get such result:

A studio lighting HDRI (like this one shipped with Blender)
Shiny metallic material (Metalness=1, Roughness=0.2)
Transparent background (RenderTab > Film > Transparent)

Rotate the HDRI to your needs, and add white background through compositor :).


How to append parent object from an external file including all the children? I would like to append a very complicated hierarchy tree from another file. The file has multi-level parent-children relations and I'd like to append the whole structure just by appending it's main parent object. The hierarchy should be maintained after appending.

I don't want to manually select among the hundreds of objects those belonging to the hierarchy tree and I don't want to use Groups. Is there a way to do it?

I asked around and a user JA12 on #blender irc channel suggested me the following:

Open up the source scene, select the parent object in the Outliner with Ctrl+Left Click, that will select all levels of children as well
Use Ctrl+C (Copy) while those objects are selected, that will copy the selection to the buffer
Close the source scene and open up the destination scene
Press Ctrl+V (Paste)

Note: Copy Attributes Add-on prevents default copy action.


Excluding part of the mesh from mirror modifier I'm modeling a car (Napier Railton) which body is not perfectly symmetric I can add a mirror modifier and apply it then add the non symmetric meshes but I don't want to lose the ability to modify the symmetric parts of the mesh latter.

I thought that I can divide my object into two vertex groups:

body.L (the part of the mesh that I want it to be mirrored)
non_symmetric (where I don't the mirror modifier to be applied)

but it didn't work, I'm not sure how the vertex G option works in mirror modifier (actually I'm not sure it's there to do that job)

is there a better way to add non symmetric meshes while having the advantage of keeping the symmetric meshes ready to modify later?

ok, I found a good workflow to do it, I applied the mirror modifier then I activate/deactivate the X Mirror checkbox in the mesh options tab whenever I want to work on the symmetric/non symmetric vertices respectively.

note: this only works for the meshes symmetric along x axis (but still useful :))


Color not coming through glass? I'm trying to do this tutorial to make the cup as shown in the video but I'm having problems with the glass and the color coming through it.

the glass has light coming through it (Or it might be just reflective) but the color of the coffee isn't coming through the glass and into the camera for some reason.

The nodes for the glass

Because I was having the exact same problem, and I mean exact same, I tried lowering my specularity to just .3 and here's the result. While the liquid looks amazing and I think the cup looks ok (too thin now, I'll have to scale the liquid down) there's a large reflection of the plate from the other side. How can I prevent the light reflecting off the plate from also going through the liquid? I would like for light to be diffused inside of the liquid.

I changed the lighting angle and it helped, haha. But there's still an odd reflection.


Select Multiple Key Frames in Timeline Editor How I can select multiple key frames in the timeline editor so that I can delete them all at once .

The timeline isn't actually an editor. It's simply a viewing port for all the keyframes in your animation. What you can do is:

Go to the Graph editor and select the objects that are keyframed
Move the playhead in the timeline to the keyframe you wish to delete
Hover your cursor over the graph editor and press Ctrl-K
Go to the next keyframe and repeat steps 2-3
Press X to delete the selected keyframes

PLEASE NOTE This process works if you want to delete all keyframed information about the selected objects. If, say, you just want to delete X-Location info but not Y-Location info, you have to manually select each keyframe in the Graph Editor.

Hope this helps!


How to use text or curves as metaballs? I need to do something like this:

My first approach was to use metaballs, but I need to know if it's possible to model something like this with metaballs and bezier curves.

If you want to do this effect with metaballs, then the accepted answer to this question shows how you can have a lot of metaballs in a certain shape: Why is there no option to convert a mesh to metaball object?

However, I wouldn't do it with metaballs. It shouldn't be too difficult to set up a shapekeys-based animation on a mesh object, with full control over the details.

HISTORY I gave the following answer when the question was formulated "Is it possible to use metaballs for something more interesting than just a ball?" It received two upvotes, so it seems that it was useful to some people.

The metaballs are not just balls, they are balls that melt into each other when they are close enough.

They can be used to simulate rain droplets on a window, and similar things, but in general they are not very useful. Just like NURBS surfaces, they are outdated technology, and are not used much these days.


Python Script: Run two different commands that depend on 3D View update I'm developing an addon that need to capture the position of the same object in one and other frame. Actually I had to create four buttons for it, one to put on start frame, other to end frame, other to capture start frame positions and other to capture end frame positions. I tryied to do it in one command:

import bpy

frame1 = bpy.data.scenes["Scene"].frame_start
bpy.context.scene.frame_current = frame1

bpy.ops.object.capture_object_start_position()

frame2 = bpy.data.scenes["Scene"].frame_end
bpy.context.scene.frame_current = frame2

bpy.ops.object.capture_object_end_position()

I tryied to put the commands update() and redraw() but it doesnt works, I read in some places that the problem is in the way of Blender works with the bpy.ops.* commands.

Thanks for the attention.

You should be using frame_set

import bpy

def obj_pos(obj, frame):
    bpy.context.scene.frame_set(frame)
    print("frame:", frame)
    print("object location:", obj.location)

me = bpy.context.active_object
frame1 = bpy.data.scenes["Scene"].frame_start

obj_pos(me, frame1)

frame2 = bpy.data.scenes["Scene"].frame_end

obj_pos(me, frame2)


Extrude by unit amount, not percentage I've got a simple square plane (Blender 2.83) that is 66 x 66 meters and that I created by first adding a plane, then setting its X and Y dimensions in the n menu ("Item" tab in Object Mode) and pressing Ctrl+s in the end to "(Apply) Scale", so it afterwards also displays the right "edge length" in Edit Mode.
Now I want to extrude the corners to add a small border and make the plane 70 x 70 meters.
If I press e+s+2, the plane grows to twice its original size. To grow it to roughly 70m, I have to calculate the percentage (70 / (66/100) = about 106), then extrude with e+s+1.06, which is of course still a tiny bit off.
How do I extrude with the actual measurement I want to add, instead of the percentage, e.g.: make e+s+2 add a small border to turn a 10x10 plane into a 14x14 plane (hence, add 2 units on each side)? Is there another way to do this without using extrusion, while still easily and quickly creating new vertices on the outside?
Edit: You can find a screenshot what I want to do (but with units, not percentages) here. Please don't mind the glitchy look, I didn't clean up the double faces.

You can use inset for this.
Start with the outer dimensions of your plane.
Mine is 7 x 7

Press i and type in the offset you need (in my case its 1 unit, so I end up with a inner square of 6x6 units.

Make sure Offset Even is checked in the bottom left corner.


How do you select the pivot of the edit camera? All I find when i try to search this question is how to move the rendering camera, not the editor.

Blender's editor camera focuses on the center, I need to change that to focus on a vertex, how can I achieve that?

The 'viewport' pivot point can be positioned easily be simply hitting . on the numberic keypad. To set the pivot to the vertex of a mesh simply enter Edit mode (Tab), select the vertex (right-click it) and hit . on the numeric keypad.

Another useful shortcut is Alt+Home to set the view pivot point to the current location of the 3D Cursor.


Shrink Wrap Modifier and Distortion I have created two cables that wrap around each other.

I want to apply a foil shield, so I created a cylinder, deleted the top and bottom faces then applied a shrink wrap modifier.

It worked, however, the top and bottom of the wrapped cylinder (marked in red) is distorted instead of a nice straight top and bottom edge, I really wanted a straight line. Please see the reference images.

[

I went through the options, with the same successs :( so ... what about Booleans?

to help a bit topology, use Simple Deform Modifier > Twist
ShrinkWrap >
Smooth Modifier > Repeat 5
add a Cube and for Cylinder add Boolean Modifier > Intersect

(if you plan to move Cylinder, would be better to parent (Ctrl+P) Cube to Cylinder)

to smooth surface - search for Smooth Shading
fix for edges shading - go to Properties Editor > Object Data > Normals > Auto Smooth

(like that Subsurface Modifier probably is not needed in this case)


How to fix rotational constraint 'jumping' in rotation problem I am rigging a set of gears (a car - wheels driving through a differential), and am taking the input as the wheel rotation. I've used parenting and constraints to link the gears. All goes well until I reach the point where I need to have the next gears rotation at 1/3 of the previous gear. Each method I have tried (transformation constraint, rotation constraint, and others, drivers, etc) all result in the correct rotation for only 120 (or 1/3 of a full rotation) before it flips on it's local axis and starts again. This is true for other fractions of the original rotation also. On a rotationally symmetrical gear this may not be a problem, or even visible, but my gear is not. It can easily be seen by selecting the target gear and turning on the local axis view.
Does anyone now of a solution to this, to achieve a fluid, full, scaled rotation?

To get an object rotating at a constant rate you need to set two keyframes to define the speed of rotation then set the keyframe interpolation type to linear and the channels extrapolation mode to linear. This gives a constant rotation without speed variation.

To get another gear rotating in time with the main gear it is easy to setup a Transformation constraint. This constraint allows you to copy a rotation proportionally.

Here I have the source rotating -120 and the destination rotating 360. The key to having it rotate continuously is to tick the extrapolate check box.