Changing the name/icon/function of menu/pie menu/panel with a condition? for example in this pie menu below

import bpy
from bpy.types import Menu

class Pie_menu(Menu):
    bl_label = "Some Pie Menu"
    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()
        pie.operator("wm.call_menu_pie", text = "Some Other Pie", icon = "RIGHTARROW_THIN").name="Pie_menu"
        pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
        pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
        pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
        pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
        pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
        pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
        pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
        pie.separator()
        pie.separator()
        other = pie.column()
        gap = other.column()
        gap.separator()
        gap.scale_y = 7
        other_menu = other.box().column()
        other_menu.scale_y=1.3

        if len(bpy.context.selected_objects) == 0:
            option = "option if nothing is selected"
        else:
            option="defaultoption"

        other_menu.operator("mesh.primitive_cube_add", text = option ,icon = "BLENDER")

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

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

#if __name__ == "__main__":
    #register()

    #bpy.ops.wm.call_menu_pie(name="Pie_menu")

there is a button with different functionalities, name, icon, (here its just the name) depending on a condition.

it work fine if i register this addon from the script, by removing the three # at the end and Running the script, but as soon as i register this as an addon, its not working anymore. Why ?

also in this same idea, how can i put a vaiable like that not in a form of a button but a simple text ?

So i cannot write a condition directly on the pie menu
BUT i can reffer the name,function and icon to an actual name inside of blender.

so i could create a custom properties just for the occasion

for example i can first add two custom properties with thoses codes:

bpy.context.scene["Name of my menu"]="Adaptive Name"
bpy.context.scene["Icon of my menu"]="BLENDER"

the only problem is that it need to be done BEFORE opening this pie menu.
and you can do this with the followed technique:

class BackMeUpPie_OT_Operator(bpy.types.Operator):
    bl_idname = "view3d.pie"
    bl_label = "Back Me Up Pie Menu"
    bl_description = " OPERATOR DESCRIPTION HEYYYY"
    def execute(self, context):
        try:
            bpy.context.window_manager["Auto-Copy Icon?"]+=1 #if i can do this its not the first time i launche the pie
        except:
            bpy.context.window_manager["Auto-Copy Icon?"] =1 #if i can't it is, so the timer cannot be
            bpy.context.scene["Auto-Copy"] = "OFF"
            bpy.context.scene["Auto-Copy Ic"] = "FAKE_USER_OFF"

        bpy.ops.wm.call_menu_pie(name="view3d.pie_backmeup")
        return {'FINISHED'}

creating an operator, that determine the icon, name..Ect.. of your cutom assets with the condition of your choice, like in this exemple above, and then just after opening your pie/menu


Rigging an umbrella-like object I'm trying to figure out the best way to rig this setup. I have several pipes arranged vertically, right next to each other. I want a rig where I can use a single controller to have them spread out at the base, similar to opening an umbrella.

Here's an example object showing how it should look when opened:

I want the rig to work by scaling a controller at the base of the pipes (like the circle in the image.) I also want to be able to translate the controller, and have the individual pipes stay locked to it, but not have their lengths change.

I know I can do the rotation by putting a bone down every pipe, then using constraints to have them rotate on their local axis based on the scale of the controller. But this doesn't handle the translation. I could also do it by IKing each one to a point on the circle, but then it starts getting very complicated and can have Roll problems.

The actual object I'm trying to rig will have a lot more pieces than this example, so I'm trying to find a way to NOT need to make and position a ton of bones or constraints.

Is there any simpler way to solve this problem?

Not sure if this helps or not but here is what I could come up with using only constraints  to simulate an umbrella like opening mechanism.

If you actually need an armature (for exporting purposes, linking, or otherwise) you could probably construct a similar setup with bone constraints on an armature object.

Make a three rod system with a $Post$ (blue), the $Arm$ (white) and the "muscle" or $Piston$ (red) object.

After that add two empties, one at the base will be the $Master$ controlling object, and should lie somewhere along the blue post, the other $Pivot$ will act as a hinge point and should lie somewhere along the arm length.

Then it is all based on a system of parents and constraints.
The red piston should be parented to the $Master$ controller empty, and constrained with a Track To to the Pivot empty along the $Arm$.

The white $Arm$ should have a Track To constraint to the $Pivot$ empty;

And lastly the $Pivot$ empty should have a Limit Distance constraint set to the $Master$.

The distance value should exactly match the total length of the "Piston" object (red). You can optionally constrain angles and movements of different parts, like say, constrain the master to move only in $Z$ axis no more than the height of the blue $Post$ rod.

Lastly duplicate the whole system around, making sure you leave the $Post$ and $Master$ out of selection so they remain as single objects

You can then probably use drivers to link the positioning of the $Master$ control object to the scale of any other object, thus achieving what you need.


Advice on how to remove these weird black shadow things? I am not sure what to do with these vertices to fix this weird pinch I have. It creates weird shadows and looks bad. Here are some images.

I could probably just delete a big chunk and try again but maybe this will be a good learning experience for the future to learn other ways to fix this. Thanks a lot for the advice!

It looks like there is a Face/Polygon inside the handle, deleting that face will fix the shading problem.


Need help figuring out how to fix this non-manifold 3d print I am making a checker board type piece as pictured. I used the loop cut and slide to break up the rectangle into smaller rectangles and then extruded them upwards. It is now showing as a non-manifold problem and I can't figure out how to fix it. Thanks

The Face on the side of your mesh shows a N-Gon (Face with more than 4 Vertices). You should make sure that you only use quads (and tris if necessary) to get a good edgeflow to work with.

See if you can fix that by Hand (K is shortcut for knifetool, so you can insert edges manually) and when you're done you can also use Blenders Cleanup Function. Go to Edit mode, select all faces and go to Mesh (in the 3D viewport header) -> Cleanup. There you'll find a few options to cleanup other nonmanifold geometry like lose edges or double faces. It has Tooltips if you hover your mouse over it.

Hope this helps you, Happy Modeling :)


Cannot set "is_overridable_library" option via python ["_RNA_UI"] I'd like to control these bools there via Python but I can't quite figure out how.

If I try something like this code, "min", "max", "soft_min" and "soft_max" work fine and update their values but "is_overridable_library" and "use_soft_limits" do not.

import bpy
obj = bpy.context.object
obj["_RNA_UI"] = {"prop":{"min":0,"max":1,"soft_min":0,"soft_max":1,"is_overridable_library":1,"use_soft_limits":1}}

Thank you very much!

The value behind is_overridable_library can be set through the method property_overridable_library_set() of an object. The following example demonstrates how to set a custom property named "prop" to be overridable.

import bpy

obj = bpy.context.object
obj.property_overridable_library_set('["prop"]', True)

The use_soft_limits is dynamically evaluated and it's not necessary to set it when using the Python API. If the soft_max or soft_min are different than the max or min, it will automatically show as enabled.

Calling bpy.ops.wm.properties_edit() results in an error message, because it expects that self._last_prop is set. This only happens in the invoke() function, not when calling execute() directly. Therefore the execution context has to be set by passing INVOKE_DEFAULT.

bpy.ops.wm.properties_edit("INVOKE_DEFAULT", data_path="object", property="prop", value="1.0", default="1.0", min=0, max=1, use_soft_limits=False, is_overridable_library=True, soft_min=0, soft_max=1, description="", subtype="NONE")

The downside of this is that the UI popup appears and has to be confirmed. Therefore the operator cannot be used without user interaction.


How do I pass an argument to an operator that is called inside a panel? I would like to be able to pass aarguments to operators that I am calling from panels/buttons but I do not know how to do that. At the moment I use "global" variables but they tend to make the code a bit like a puzzle since I need to constantly update them.

See the code below, in that example I would like to pass an argument (like ARG) to "object.simple_operator" when the button is clicked.

import bpy

def DO_SOMETHING(arg):

    print(arg)

return

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        DO_SOMETHING(ARG)
        return {'FINISHED'}

class MyPanel(bpy.types.Panel):

    bl_label = "mypanel"
    bl_idname = "OBJECT_PT_MyPanel"

    def draw(self, context):

        layout = self.layout

        wm = context.window_manager

        obj = context.object

        row = layout.row()
        row.operator('object.simple_operator')

General example based on your starting point including a property group setup.

import bpy
from bpy.types import PropertyGroup

class MyToolPropertyGroup(PropertyGroup):
    testint = bpy.props.IntProperty(  # bl 2.80 use testint: bpy.props
        name="testint",
        description="",
        default=1,
        min=1,
        )

def DO_SOMETHING(arg1, arg2):
    print("%i * %f = %f" % (arg1, arg2, (arg1*arg2)))

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        props = context.scene.MyPropertyGroup
        my_val = 2
        DO_SOMETHING(props.testint, my_val)
        return {'FINISHED'}

class MyPanel(bpy.types.Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
#    bl_category = "Tab Name"  # not used in blender 2.80
    bl_context = "objectmode"
    bl_label = "mypanel"
    bl_idname = "OBJECT_PT_MyPanel"

    def draw(self, context):
        layout = self.layout
        obj = context.object
        props = context.scene.MyPropertyGroup
        row = layout.row()
        row.prop(props, "testint")
        row = layout.row()
        row.operator('object.simple_operator')

classes = [SimpleOperator, MyPanel, MyToolPropertyGroup, ]

def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.Scene.MyPropertyGroup = bpy.props.PointerProperty(
            type=MyToolPropertyGroup)

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)
    del bpy.types.Scene.MyPropertyGroup

if __name__ == "__main__":
    register()


Why is only one side of the object affected by subdivision surface? Why is only one side of the object affected by subdivision surface?

I think the subdivision has applied equally to the whole surface (check the wireframe).. but maybe some of it is flat-shaded, and some of it is not.


array and curve modifiers (bezier) - distorted texture I have created a simple road using bezier curve, array and curve modifiers. As you can see on the picture some faces looks weird - a texutre is distorted. Why ? Did I do something wrong ? How to  fix that ?

So I hope my answer is accurate enough.

Your faces are projected as squares on the image in the UV Editor. But your faces are actually not squares, they are twisted quads. Also, in any 3D software a face is made of 2 triangles. So when Blender will map this face the UV map it will simply map 2 triangles, and it will give the following result.

If you subdivide your face a bit with some Ctrl R, the same thing will happen, but as your faces are much smaller the effect will be much less visible.


How to bake using Principled + cycles under reasonable time? GPU + CPU = Instant crash Here is the deal, I'm using principled shader to bake a simple object, it works is great but I've waited 36 Hours and it was at 70%.

The object is a car with only 13K polys and I've separated the materials for each object that uses it, and I try to bake a single object/material per time.

I have a Ryzen 1600 and a RX 580 with 8GB, I have tiles at center and at 512px,

Light Patch at 6 bounces (max) and render samples at 256. Caustics Disabled.

Not sure why it is taking ages to render on 2.79B and why it crashes intantly when trying to use hybrid CPU+GPU OpenCL render on newer 2.79 and 2.8.

I have also tried with only roughness and diffuse and nothing changed.

OK, looks like todays (07/07/2018) Blender 2.79 is baking using GPU + CPU without crashing. Plus I've unchecked the square samples and now it baked the same file with same node setup in 40min instead of 44 hours.

very nice!


Falling bricks building the walls of a house I want to build a house animation from ground up to the roof.
Is there a way to automate falling bricks that are building the walls of a house? I thought about the buildup-modifier, but the modifier only builds up polygon per polygon.
Im using Blender 2.8.

Any help would be highly appreciated!

I would try using making a rigid body simulation, upside down so that the bricks are animated to fall down from your model. Then, once the animation is baked, flip it 180d so that it is oriented correctly. Finally, play the animation backwards. If you want it to be layer-by-layer, you would have to find a way to bake each layer individually (If your bricks are individual objects, just select each layer to animate and play them in the right order).


Hydraulic Cylinder with Damped Track Constraint not aligning (2.8) trying to make a cylinder..watched several tutorials and did the following..

Center the axis for Rod and Cylinder at the pivot points
Add an empty plain axis for the rod and the cylinder
Parent Rod to its Empty Axis and Cylinder to its Empty Axis
Add a damped track constraint from cylinder to rods empty axis
Add a damped track constraint from rod to cylinders empty axis
tried to adjust on the settings but cannot get the two components to align....

Appreciate any help

Here is the Blend file (added after FFela answered as it still does not work unfortunately).

Here are 2 pistons one with with 2 and one with 3 sections

I got the solution from Here after using the track to constraint instead of the damped track which I mistakenly took for a look at constraint from 3ds max.

The Track to constraint has all sorts of issues like spinning mesh the Damped track doesn't seem to.

I realize after 7 months you probably have solved this issue, but someone else might find my research helpful.


Is there a way I can make a hollow object solid? Yesterday i managed to create this shape that is similar to a teardrop.

Front view:

Side view:

I then mirrored it on the Z axis using the mirror modifier like this:

But the shape is hollow from the inside and that creates a problem when I render it as glass, because instead of passing through a solid object, the light simply passes through 2 glass planes.

Is there a way to create a solid object from a hollow one ? I haven't been able to find a sort of "Fill" function that does that.

You can just use the soldify modifier. This lets you change the thickness and tweak it later on.


Change camera from rectangle to square by center Is there a way to change axis of scaling camera?
I have a rectangular render, but need to get identical square render. I simply need to cut off the left and right side of the camera view, but after changing camera settings, i get extra view space above and below my desired picture.
I am not interested in zoom-related solutions, since it and Focal Lengh would definitely differ from the original rectangular render.

Thank you in advance for your time!

The camera property Sensor Size is a measurement in the largest camera dimension. Therefore, to keep the same scaling, if you change the largest dimension (in this case, reducing from 1920 to 1080 leads to a reduction to 56.25%) to match the smaller dimension (eg, 1080) you simply need to adjust the Sensor Size to match te reduction in the maximum dimension.

Therefore, for default render dimensions of 1920x1080 changed to square 1080x1080, the largest dimension is reduced to 56.25% of its original size (1080/1920 = 0.5625) - so to keep the same scaling the Sensor Size of 32 should be similarly reduced as 0.5625 x 32 = 18.


Change all linked objects? I have tried to understand linking objects (or is it meshes?), but am apparently failing. I want to create a 2nd and 3rd copy of a collection such that if I change any of the objects, they all are changed. It's fine if one has to be a master copy that has to be the one changed. I have tried various approaches including selecting the objects in the collection then use Duplicate Linked, and it always makes copies that are not updated when one is changed. I have been using links to copy modifiers to other objects, but again it copies the modifiers but doesn't link them together in any way I can see. I have only been working with simple cubes.
Can someone recommend a better source for how to do this than I've found so far (or point out what I am misunderstanding)?

Duplicate linked (alt d, or "duplicate objects" operation with "linked" enabled in operator panel)  should work.  I can't say why it's not working for you, not without a file and procedures to follow that don't do what you expect.
However, there is something else that you can do, which is to simply change the geometry that an object refers to.  If you select an object and look at properties/object data, the very first thing on the tab is a drop-down that specifies which geometry is used for the object.  You can assign any (mesh) object any geometry datablock that exists in your scene.  At that point, the geometry is linked:

There's no master object for linked meshes; editing any of them should edit all of them.  Note that some things, like shapekey values, are still per-object, so you can edit a shapekey for the linked mesh data and then choose to use it or not on a per-object basis-- perhaps this is what was giving you trouble?  Editing a shapekey?
Linking modifiers isn't the same thing as linking mesh data.  It's basically a "copy modifiers" operation, and future changes made to one won't affect the others.


How can I enable in 2.8 an overlay of an object's local coordinate system? I would like the local coordinate system of an object to be drawn on the object, just like with empties. Is there a way to enable this?

How about adding an Empty that shows the arrows that you want, set its parent to the object, and then disable selectability (in the Outliner)?


Basic Cell Fracture not appearing to work I'm new to Blender, and am using Blender 2.78b, and I thought I would try cell fracturing a cube. I turned on the Cell Fracture add-on in User Preferences and subdivided the cube a  couple of times. I tried to use the Cell Fracture add-on, and it seemed to be working like it did in the tutorial I was watching, but when it was done the cube returned to its original state. Does anyone know how I can fix this?

I am noticing on 2.77 that Cell Fracture will add the fracture cells to the outline, but they are not visible.  If I save the blend, restart Blender and load the blend, then the cells will show up.  I don't know why this behaves this way and would love to know if there is a fix.


Difference between Ctrl P > Follow Path and Add Object Constraint I am trying to let my camera move along a path. The method to first select the camera, then the path and then use Ctrl P > Follow Path works fine.

However, if I select the object, go to Object Constraints and add a Follow Path constraint, the behavior is not the same.

Mainly, in the second procedure my object jumps to a different position once I added the constraint. Why is that and what is the difference between both methods?

CtrlP > Follow Path parents the selected objects to the active object (=curve), enables Path Animation in the curve's Object data tab in the Properties Editor and adds an F-Curve for the Evaluation Time property. An F-Curve Modifier is added to that F-Curve of type Generator (first order expanded polynomial).

Adding a Follow Path constraint to an object and target it at a curve only relocates the object (apparently to one of the end points of the curve), you need to click Animate Path to add an F-Curve with modifier (1st order exp. polynomial generator again) to the curve object in order to let the object move along the curve.

If you don't want that offset when using a Follow Path constraint, select your object and a curve,
CtrlP > Path Constraint. It adds a Follow Path constraint, creates the F-Curve with modifier for the the curve and does not translate your object.


Combining Translucent and Volume Shaders I would just like to know why when using both a translucent shader and a volume absorption shader the volume absorption shader will darken and color the look of the translucent shader. I understand it has something to do with the way the translucent shader works, but I would really like to understand exactly why this happens.

Translucent shader gets power (brightness) from the light rays that enter the surface scatter inside and come through the material.

When the rays coming through the volume are absorbed by volume absorption, the translucent shader gets less energy and is darker.

The scattering is also an approximation and you will get much more accurate results with volume scatter or subsurface scattering shaders.


Fluid Simulation Real Ocean waves I am trying to create real ocean waves that break on a shore in Blender. The three ways I know I could achieve this is the wave modifier, the ocean modifier or the fluid simulation. Don't know so much about Force Fields and thus can't say if that would help. I would like to create the ocean with the ocean modifier (to get the realistic rough ocean look) and then use this ocean in a fluid simulation as the fluid (or anything else that I can achieve my goal).

I have used obstacles to create the wave, but that never looked good/behaved like a real wave. The inflow/Outflow was similar. I would like the plane (modified with the ocean modifier) to behave like a real ocean and if I set obstacle (=shore) that this plane interacts with that shore. What is the best way to achieve something like this and are there any addons that do exactly this. Ocean Wave addon. I have baked a lot of fluid simulations and it never looked remotely realistic. Thank you very much !

You can generate a wave on a shore using a combination of a Blender fluid physics simulation and moving geometry. The moving geometry will displace water like in a wave pool. An inclined shore will cause the waves to rise and crest. The fluid particle system will simulate a foam on the surface.

Step by step instructions (Blender 2.76):

Add a cube and size it. This will be the domain for the fluid simulation. In the physics tab, set this up as a fluid domain. To get the floating foam on the water, in the particles panel, select 5000 particles and set generate to 1. Specify the location for the fluid domain cache. This location is needed later in step 4, remember it.

Add a cylinder, scale it, rotate it, and move the origin away from the center. This cylinder will be animated to rotate and cause the water displacement. In the physics tab, set this up as a fluid obstacle.

Add a object which will be used to visualize the foam. A cube does this job nicely. Name this object 'fluid-particle-for-rendering'. Scale this object to the size desired for the foam particles. In general this will be very small. In this example a value of 0.01
Add a small cube to hold the physics for foam particle. Put this object off screen. In the physics tab, set this object as a fluid particle. Select floating. In the particles tab, select the 'FluidParticles'. Set the path for the cache to the same path used for the fluid domain in step 1. In the rendering panel, set the rendering to object and select 'fluid-particle-for-rendering' as the object.

Add a cube a scale to become a plane for the beach. Rotate the beach to have an incline like a shoreline. In the physics tab, select Fluid an in the Fluid panel, set the Type to Obstacle.

Add an object to the scene to initialize the water. This can be done by adding a large cube, then using Boolean operations to define a volume inside the fluid domain. In the phyics tab, select Fluid and set the Type to Fluid. Then select Volume for 'Volume Initialization'.

Select the cylinder and make sure the timeline is at 0. Set an animation keyframe. At a later time, use 100 frames for this demo, change the rotation  about the cylinder's axis to a new value like 360 degrees. Set an animation keyframe. Open the graph editor, and set the extrapolation type to linear (use the menu at the bottom of the panel: Channel -> Extrapolation Mode -> Linear Extrapolation). This will keep the cylinder rotating forever.

The fluid simulation requires baking to generate the meshes. Select the object used for the fluid domain. Hit 'Bake'. This may take several minutes to several hours depending on the Resolution of the fluid domain and the number of trace particles.

Now the mesh is ready, and renderings or animations can be generated. The animation may require some tweaking to get the desired effect. The fluid domain panel has several settings which can be experimented with. Also, the waves may take a few rotations of the cylinder to behave consistently.

Download the demo blend here:


Cycles - Material Grey In Render and in Materials tab? i'm new to blender I've only used in for around a month and I've got myself into this problem that i'm completely baffled by.

The material in the view port is clearly applied to the plane but in rendered view and and in the materials tab in is white. I know this is probably a silly mistake I've made but if anyone can help me here it will be greatly appreciated. I thank you in advance

Blend:
https://drive.google.com/file/d/13sRTpW3X-FzWXR5ACi0WQUXmy551LB0O/view?usp=sharing

It's a very simple mistake to make. What you need to do is have your image textures hooked up to the color input of a shader, not directly into the mix shader. While it can sometimes work (as you saw in your preview and render modes), it doesn't always do as you expect (as evidenced by the final version). Simply putting diffuse nodes there should fix your problem.


Character motion jump So I'm not good at blender and you can see that. My problem is that I added a control like jump and whenever I press spacebar the character does not go back to the floor. If this is related to physics I tried some but I can't seem to find the right one and for a character where should I put the physics armature or the main character?

And also when I use some physics it makes my character fly or go up nonstop

From what I've seen online the method usually followed by the character is the following:

Add a small cube. Fix its size to be almost from the feet to the knees of the character.Then make the lowest part of the cube to be in the same height with your character's feet.
Add every motion SCAs to that cube. Only add animations to your character. So the cube will decide where you go and the character when to play the walking/jumping animations.
Set the cube's physics to "character" or "dynamic" or what suits you. Gravity will automatically affect it then.
Last don't forget to parent everything to your cube.

Tip: In order to remember which to select first for parenting think this. When a ship goes down, you pick the children first and then the parents. So the last thing you select is a parent. Read that somewhere.

Edit: Forgot about the bones's physics. Set that to no collision if you don't want it to interact with stuff. Also I think that the parent's physics would overwrite the childrens's. So even if bones was dynamic nothing would make them move differently.


blender 2.8 refresh the graph editor after removing a modifier? I wrote the code below, in Blender 2.8, to remove fcurve modifiers from fcurves.

def main_step():
        obs = bpy.context.selected_objects
        for ob in obs:
            fc = ob.animation_data.action.fcurves
            for i in fc:
                for j in i.modifiers:
                    i.modifiers.remove(j)

It works, but the actual animation will not update. Only after I touch some animation curve points with the mouse the animation will update.

Is there a way to 'refresh' or update the graph editor?

Ok, damn, figured it out. I added one line of code that fixed it.

i.modifiers.update()

So now the function looks like this, and it works:

def main_step():
    obs = bpy.context.selected_objects
    for ob in obs:
        fc = ob.animation_data.action.fcurves
        for i in fc:
            for j in i.modifiers:
                i.modifiers.remove(j)
            i.modifiers.update()


Shiny black leather in cycles I'm trying to  make black, shiny leather straps with blender cycles as seen in this picture (for example):

But I have a couple problems.

First of all, the straps are supposed to be completely black, but shiny, and I'm not sure how to do this in cycles, if I make a glossy pure black material, it's not shiny at all, and if it's a little bit gray, it doesn't look totally black at all (anyone can easily test this), so I'm wondering if there's a way to keep the completely black, slick look but still make it receptive to light (a.k.a., shiny).

How can you tell if something is shiny?

Because there is something reflected on it...

When you deal with reflective objects don't expect reflections to come out of nowhere. Put something in there to be reflected on the surface of your object.

Here's a black glossy belt with no environment and only one top light.

If you add a few white elements to be reflected you will have the black golssy qualities of your material. It will be bright in the areas where something bright is reflected and dark in the areas where there is nothing to reflect...

For a longer explanation read: Why does an object with a glossy shader render in black?

As for the texture of the leather, just add some texture and use it as a bump map.


Blender 2.8 - Field property declaration and dynamic class creation Now that we need to use field for property declarations in Blender 2.8. I was wondering how this can be done when creating class dynamically using type() like so:

type('TestPropGrp', (bpy.types.PropertyGroup,), {‘MyProp’:StringProperty(default=‘MyStr’)})

=> this would work in Blender 2.8 but will throw a 'make field' warning.

Any idea how to declare field when using type() ?

Thank you !

edit (this is actually wrong - see answer): Of course one way to do it is to write this in 2 lines:

clss = type('TestPropGrp', (bpy.types.PropertyGroup,), {})

clss.myProp : StringProperty(default=‘MyStr’)

but I was wondering if there could be a more compact solution ?

The annotations for an object (which can be a class or a function as well) are stored in its __annotations__ property, as defined by PEP 526 and introduced in Python 3.6. This gives rise to the following solution:

The following approach works as I suspect you're looking for:

>>> clss = type('TestPropGrp2', (bpy.types.PropertyGroup,), {
...     '__annotations__': {'myProp': (StringProperty, {'default': 'MyStr'})}
... })
>>> print(clss.__annotations__)
{'myProp': (<built-in function StringProperty>, {'default': 'MyStr'})}

This also allows you to see that your proposed "one way to do it" approach doesn't actually work as intended:

>>> clss = type('TestPropGrp', (bpy.types.PropertyGroup,), {})
>>> clss.myProp : StringProperty(default='MyStr')
>>> print(clss.__annotations__)
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
AttributeError: type object 'TestPropGrp' has no attribute '__annotations__'


What does 'Distortion' in the 'Mesh Analysis' panel do? I have a few questions in regards to some of the options in the Mesh Analysis panel in the Properties panel in the 3D View. I pretty much understand all the different categories except for "Distortion". Can someone explain in detail the reason behind distortion and the varying "degrees" you can set the two options to right above "Samples (sample per face)? What do 'Minimum angle to display' and 'Maximum angle to display' do?

From Blender's Manual:
Distortion

  Distorted geometry can cause problems since the triangulation of a
  distorted n-gon is undefined.

  Distortion is measured by faces which are not flat, with parts of the
  face pointing in different directions.

Let's examine simple four sided n-gon

Before 3d printing each n-gon is being converted to triangles. Our four sided n-gon can be triangulated in two ways marked with yellow and purple line:

On a complex model leaving non-planar (not flat) polygons can lead to triangulation in a way that is not desirable for the final product. 'Distortion' option can detect all n-gons which vertices don't lie on a plane (flat surface)

The color of those n-gons is defined by the minimum and maximum angle that the resulting triangles may form - blue for minimum angle and red for maximum angle with color transition in between.

If the polygon is flat the color will remain gray.

Here is an example of the same n-gon but with one vertex rotated at 5 degrees (minimum angle for detection) around polygons center:

Here the vertex is rotated at 30 degrees:

Here the vertex is rotated at 45 degrees (maximum angle for detection):

Any angle above maximum will color the n-gon red.

Now by looking at Monkey mesh, can you tell which polygons are not planar and which are most distorted?


Imported a 3ds w vertex groups(?) How do I rig it properly in blender? I imported a robotic arm 3ds model to play with and it came in with these little nodes. I think they are vertex groups but I don't know how to play with these because I dont know what to call them to search in google for a tutorial.

I tried to delete the nodes so that I could attempt to build an armature system. But, when I did, it deleted parts of the mesh.

Rotating or moving the nodes cause parts of the mesh to move, but not in the way they should. For example, clicking on the node that is associated with the top arm and rotating does not cause the arm to rotate as if it was attached to the lower arm. It just moves independently.

Since they look like origin points, I tried to set the origin to mesh. But the node didn't move.

There are no dope sheets or curves associated with the model.

How can I set this up so that it works properly?

How do I delete these nodes without deleting the mesh, if I wanted to start over? Or how can I convert these to bones?

Where should I start to look? (I have watched tutor4's animation tutuorial at https://www.youtube.com/watch?v=xy8yFclpC9E but all it did was make me want to make my own bones for the model.)

Short Answer: You will probably have to manually fix and rig your object by hand

Long Answer

3DS File format is a very basic and old interface file format, with antiquated features and limited capabilities.

It does not support many organization structures, nor does it doesn't support animation, rigging, armatures or vertex groups. I am not even sure if it supports any type or hierarchy at all like parenting; and it certainly doesn't support Blender specific features like vertex groups.

Bottom line is if you only imported your model directly from a 3Ds file those can't possibly bones nor any type of control for your objects.

The objects you show selected in your screenshot are of Mesh type, you can tell from the Properties Window active Object Data icon.

My blind guess is, from the look of your model is that it was somehow modeled in some sort of CAD-like software with iether NURBS or ACIS Solid based geometries, which often don't support Blender-like traditional rigging systems either.

Those types of software also often don't have a concept of "object centers* or explicit "origin points" nor "local coordinate systems", which often results in objects not having a specific, or expected origin or pivot of transformation when imported into mesh based modelling applications like Blender.

So even if those centers were successfully imported there is no guarantee they would get where you need them to be by default.

Those may be stubs or remains of any CAD specific structures that were left over while exporting the model, as much as they can be representative of some sort or "object origin" from the origin application.

Bottom line is, if you want to animate this you will probably have to manually assign correct origins to all your objects one by one, parent them properly, and create your own skeleton or constraints based rig.


How to add image into compositor? I recently rendered a scene in blender after following a BlenderGuru tutorial and made sure to save the image. After closing Blender and going back in, I am able to open the image up in the UV Image Editor (below)

However, after selecting "compositing" and going into the node editor, I can't seem to view the image with the "viewer" node. The only option I seem to have is to re-render the whole scene again in order to see this in the node editor?

Use an add Input>Image node.

If the image is already loaded in the UV/Image editor all you have to do is select it. If not you have to import it.


Point clouds in blender Hi all i work with point clouds in blender, I was wondering if anybody has developed a tool that can mask/clip or hide parts of the point cloud from view, so i am able to work on small sections of point cloud without the need to cut areas out to model?

I don't think you need an add-on for what you want to do, there are a lot of tools for viewing efficiency.

Hide the selection, H key, undo Alt+H
View only the selected objects, / key, undo / (toggle)
Crop the view to a border, Alt+B and define a border left click + drag, undo Alt+B

Perhaps the third is what is suitable in your case.


Is it possible to set names of objects based on their texture name? I'm trying to import texture wrapped models into Unity 3D.

Unity needs to have the object name the same as the texture name for it to automatically assign the textures.

this is for texture name assuming the texture is on the first material :

import bpy

C = bpy.context
D = bpy.data

objects = [obj for obj in D.objects if obj.type == 'MESH']

for obj in objects :
   nodes = obj.material_slots[0].material.node_tree.nodes
   tex_node = next((node for node in nodes if node.type == 'TEX_IMAGE'), None)
   if tex_node :
       img_name = tex_node.image.name
       img_name = img_name.replace('.jpg','')
       obj.name = img_name.replace('.png','')

incase its the material name :

import bpy

C = bpy.context
D = bpy.data

objects = [obj for obj in D.objects if obj.type == 'MESH']

for obj in objects :
   obj.name = obj.material_slots[0].material.name
   #obj.material_slots[0].material.name = obj.name   #if it's the other way


How do you use constraints with Armatures? I was wondering how to use constraints with an armature, i.e. have an object copy the rotation/location of a bone, or a bone copy the rotation/location of an object. How exactly would I do this?

You can use armature in Constraint parentings very easily, select the object you wan the bone to influence, add the desired constraint, and then select the proper armature.

You can also select the individual bone within an Armature object within the Constraint settings.

Not only that, you can also influence a bone's rotation via constraints:


How do I make a flattened sphere shape? I'm trying to make sort of a flat spherical shape. It is the shape of an M&M. I have looked all over the internet but have not found anything.

Use a sphere and scale it on the Z axis.

SZ

Else you can use the scale manipulator and scale on a single axis:


Seperate objects by loose parts automatically in python A have some objects that undergo several boolean. This leaves parts as unconnected. I know that I can:

Enter edit mode
Enter face select
Select a face
"Ctrl+L" for select linked all (done in picture below)
"p" separate by loose parts

I can see the corresponding python command and could just write it in a script. EXCEPT step 3) above. I can select a face, sure, but do I then have to loop over all faces and try to select linked? I suppose that I could count the number of selected faces and check it is equal to all faces, hence no unconnected part. But this seems very clumcy.
It there an elegant way to separate unconnected part into individual objects??

Ok. I've search quite a while now. But just after posting this I stumpled on the answer sigh. If any one else is interested:

Enter edit mode
press "a" to select all vertices
press "p" to separate by loose parts


Why is a vertex from another island is moving if I move an UV island? Why is it that if I move an island from my UV a vertex from another island is moving?

Two possible settings:

As @moonboots has suggested, you may have 'Keep UV And Edit Mode Mesh Selection In Sync' checked, in which case the whole UV is made available in the UV window, and you're selecting mesh vertices, so all UV face-corners associated with the vertices are selected:

Or you may not have Sync Selection checked, in which case you are selecting UV face-corners directly, but you have the option via the 'Sticky Selection Mode'  to select them separately, or together if they share a UV location, or together if they share a vertex in the mesh:


Image texture intensity on deformed mesh I'm rendering image textures on deformed meshes like in this question:

The parts of the rectangular image that are compressed into the small faces look the same as the do in the flat image, except they're simply smaller now. Conversely, the large faces look the same as before, except now they're simply larger.

One might say that the mean colour intensities over the face have been preserved. Is it possible to preserve the sum instead of the mean over each face? With this method of deformation, compressed areas would get brighter, and stretched areas would get dimmer.

An analogy would be stretching out a balloon, where its colour fades as the stretch gets more extreme.

EDIT: Here is an example .blend file and image

You'll have to change the path to the image in the texture menu (I couldn't figure out out to suck the image into the .blend file, or specify a relative path).

It is possible to create an Image Texture from the Vertex Color layer. The process is a little convoluted (for the time being)
Method 1

Establish the vertex color map
Make a material from the vertex colors
Bake Mode: Texture
Make a material node tree to brighten the original texture with the baked one

Method 2  (cycles specific.. but can be done in BI too)

Establish the Vertex color map

Add Node Material to rgb Mix this:

Texture node
Attribute node referencing 'Col'

Establish the vertex color map. Here i'm remapping from average distance to the median of each polygon, I suspect you can modify it to behave the way you want. For this to work you need to be in vertex paint mode
import bpy
from mathutils import Vector

obj = bpy.data.objects["Plane.001"]
mesh = obj.data

mesh.vertex_colors.new()
color_layer = mesh.vertex_colors.active
verts = mesh.vertices
polys = []

# first scan through to figure out min and max stretch
for poly in mesh.polygons:

    face_median = Vector()
    for idx in poly.vertices:
        face_median += verts[idx].co
    face_median /= poly.loop_total

    qdist = lambda idx: (verts[idx].co - face_median).length
    stretch = sum([qdist(idx) for idx in poly.vertices])
    polys.append( stretch / poly.loop_total )

# now colour them as a function of their relative stretch
min_val = min(polys)
max_dif = max(polys) - min(polys)
i = 0
for g, poly in enumerate(mesh.polygons):
    c = (polys[g] - min_val) / max_dif
    for idx in poly.loop_indices:
        color_layer.data[i].color = (c,c,c)
        i += 1

## set to vertex paint mode to see the result
bpy.ops.object.mode_set(mode='VERTEX_PAINT')

1 - c would give the inverse

Node Tree
The two methods differ mostly in how the Node Tree is constructed:

mix(baked, original texture)
mix(vertex_color_layer, original_texture).

It may end up something like this, the setup is pretty similar for Cycles and Blender Internal

But really there are many ways to set up this node tree, probably deserving their own Question/Answer.


How can I add a vertex in empty space? https://www.youtube.com/watch?v=8tZ4nSTm7Tc
At 0:24 the youtuber said "then create a single vertex..." but I can't find such a command like 'add a vertex' in edit mode.
How can I create a single vertex in empty space?

in Preferences, check "add mesh: extra objects"

then you can tap shift-a in 3d view and choose add single vert


Render fails after a few frames For some reason, the render of my current projects fails after rendering 5-10 frames. I am using cycles, have tried experimental and supported. I have tried many variations of sample size at 256x256 tiles and cannot find anything specific in my scene that would be causing this issue...
I have rendered on Optix with an rtx2070.
I have also tried CUDA with 2070 and 1060 checked.
I am attaching the .blend file below if anyone can please help.
https://drive.google.com/file/d/1cg6OjQ5zyL_Ox7_6my0Z0iRgTUfqJqkb/view?usp=sharing

First, some statistics:
Your file is 255MB big, the scene has ~780k vertices, the shaders take several minutes to compile, and it used 2GB memory.
In the first step, I would reduce the number of vertices. You have a car driving on a long road and the camera is chasing it, looking at the tires... a great animation. So the car and tires are in the focus. But you don't need tires that have a total of 500k(!) vertices. Remove the Subdivision Surface modifiers. The wheels are spinning when the car drives and you can't see the tire tread at speed anyway.
The same applies to the interior of the car. The car has black opaque windows. You can't see the interior. Why is there a Subdivision Surface modifier with 2 levels?
The car can have a level 1 Subdivision Surface and you won't see a difference.
If you do this the scene has only ~240k vertices. Half of it has the car, the other half is used for the environment.
(Side note: The car looks a bit too small or the house too big)


applying mirror then resetting loc and rot does not set mirror properly modleing a head. steps taken: get circle 8 sides. set aline to view, shape circle to eye, add mirror. reset location to 0, reset rotation to 0. this is what I end up with. the eyes are too close together. how do I get the mirrored eye to actaully be where it is suppose to be in the referecnce photo? I even reset the reference photo to center in the 3d viwer and it still does not set the mirrored eye in center of eye.

file and photo inclused in this post. sized down so I can uploaded it

First apply rotation and scale (scale is not need here but it is better for the future) :

Ctrl+A then choose 'rotation & scale'

Now set the 3D cursor at the center of the 3D space (as the picture is centered also) : Shift+S, then cursor to center
Then place the object to the center : Shift+S, then selection to cursor
Go to edit mode and replace the eye

The left part (her right) is a bit offset... but no human face is totally symetrical...


Mesh Repair, "Torn" Mesh with Holes, Shrinkwrap Modifier? I am currently working on a project that requires me to convert multiple 3D meshes into voxelized models. Clean voxelization requires clean original meshes. However, the meshes I am working with are very... "corrupted." My pictures show this clearly, the meshes are composed of multiple disconnected faces and vertices, and the entire mesh has a "torn" look to it. However, the overall shape of the mesh remains.

I'd like to somehow approximate the general shape of the entire mesh, including bends/holes/etc. Basically, imagine automatically stitching together all the broken faces to create a single manifold mesh.

For one of my simpler models, I actually manually repaired the mesh through hours of selecting vertices, making faces, and moving stuff around: (Before and after)

However, this technique is very slow and tedious. I came across other solutions such as the Shrinkwrap modifier, however it doesn't work well around sharp angles/doesn't preserve the original shape well. Converting to a Convex Hull also loses all detail. I found the Point Cloud Skinner add-on, however all the random chaotic vertices in my model produce very bad skinning results.

For example, here's a mesh I want to repair, in a similar fashion to the first example.
Any tips/advice on what tools/methods to use to repair a mesh like this? Also, since my voxelization has pretty low resolution, I don't need great detail in the repair, just a clean, general shape.

Thanks!

How about trying to retopo it? I see that mostly it is composed from easy shapes like circles, boxes and ovals, that you can easily create manually and everything else you can retopologise turning on and off snap to the surface when needed.


Rendering my animation is black, but there is a light? I'm normally a programmer in unity so i know very little about modeling and all that stuff so sorry if this is a stupid question :) What i'm trying to do is make a background video for the main menu.

When i'm in the normal 3d viewport with rendered materials turned on in the bottom and look through the camera everything is fine such as seen here.

However when i go to "Render Animation" in the render tab to make it into a video the view comes back as black even though there is a light as seen here.

Never check the V.S.E. (the black screen you're seeing) for your rendered animation.

To see the outputed footage go to your file explorer and type in C:\tmp at the top (if you are on Windows). There you should see a string of image files for your movie. You can change the output file format and where it outputs to before rendering it. To see the rendered animation from within Blender, hit CTRL+F11.


Eevee & particles: hide mesh emitter at render It was simple to hide the object that emits particles in Cycles by unchecking
emitter in PropertiesEditor-->Particles-->Render.

But there is no such option with Eevee.
How could I do ?

Depending on your needs, deselect "Display duplicator" and/or "Render duplicator" in the Object properties panel.

This works in Blender 2.8 regardless of the rendering engine (it works with Cycles too). It applies to every situation in which an object is used to create instances of other objects.

Note that unchecking "Display Duplicator" will prevent you from selecting the object with right-click in the Viewport: you'll still be able to select it from the Outliner.

(As of today, the viewport doesn't update correctly once you uncheck the boxes, but if you advance one frame in the timeline it should refresh)


How can I create a toggle 'view to selected' hotkey? I've changed my 'view to selected' hotkey and would like to make it a toggle shortcut that allows me either to focus on the selected object or toggle back to the whole scene. Can anyone help me with that?

Use the "forward slash (/)"  in the number pad on your keyboard to toggle 'View Selected'

View to Selected

Goto>Tool Shelf
Look for "Display Tab" at the corners where there are other Tabs. You will see "View to Selected" in the display tab options.!

Click here to view image illustration


How to 'Select All' using the keyboard? Is there a way - using key commands - to select all?

I have a sphere that has some vertices deep inside that only appear when I move the ball, and they are not selected no mater if I use the C or the B select keys.

If I could "select all" the program should be able to get these little rouge vertices that I can not seem to collect when I try either C or B.

Thank you

Yes, you can select all with A.

If there is anything selected then A will deselect everything, if nothing is selected A will select everything.  You can change this behavior immediately after pressing A at the bottom of the T toolbar, or with the F6 menu.


Fluid simulation leaking through obstacle In this project, water is leaking from the walls of the waterwheel and it doesn't look realistic at all.  I tried so many possibilities but nothing worked. please help me to make the water looks realistic. I'm really grateful for anyone who could help me with this
Herewith I've shared a link for a blender google (google drive) -

https://drive.google.com/file/d/1pmJ7dQF6zz4SSzpXclHlWIR4nWDZ8R3A/view?usp=sharing
-Thanks-

I had a quick look at your scene. So here are a few hints, maybe this won't fix your issue but this will surely enhance your life working with this scene. (But the points 2. and 3. are part of the issues anyway, so they might solve it.)

450 as render resolution and 40 for the viewport is really low.

Those two aren't enough. 40 is way too low to show you something even close to what you're going to, crank it up, start from 128 and see from there. 450 is also a low value, but you'll see what you need.

Your domain's scales are insanely wrong and inverted.

Your fluid simulation (including resolution) are directly linked to the scales. You have to apply them with CtrlA menu in object mode (and as they are inverted, you will also need to invert the normals via CtrlN in edit mode)
While you're at it, also check any other object's scale the same way. Always avoid inversed scale or uneven scales, unless you really need them and know how to work with them. If you're in doubt, select everything and apply scale on everything.

Your watermill has no thickness on its sides.
The big circle shapes are made of a flat surface without any thickness. This cannot work properly as a physic simulation's obstacle. Add some thickness via extruding those circles.


Can you recreate this Subsurface Scattering effect in Cycles? I have applied a simple Subsurface Scattering and adjusted the Transmission value in the Principled BDSF. In Eevee this really pops. In Cycles it's quite dull. How can I recreate this effect in Cycles?

I have tried a handful of different node setups (Transparency, Transmission, Mixed etc.) and I can't quite get it. Any ideas how to achieve a similarly bright luminosity in Cycles.

Both renders are using the proprietary HDRI (forest.exr) that is used in the Material Preview window.

Thank you if you've got an idea how to approach this.

1)Top Image is in Eevee; there's a lot more luminosity in the Subsurface Scattering.

2) 2nd Image is in Cycles, comparatively quite dull, no Bright Pink coming through.

3) Bottom Image is the Principled Shader setting (Note: Transmission as well as the SSS). Both images use these same settings, just with different render engines.

In the interest of completion I'll answer with the result I arrived at for rendering these leaves. I didn't arrive at precisely the same result but something quite close.

I have attached an image with the various tests and shader settings. I included the Displacement Texture Nodes I used for surface texture because it does have an effect on the final look.

The biggest changes were affected by altering the Transmission and Transmission Roughness values. And by using Random Walk instead of Christensen-Burley as the SSS Method.

This is what the Blender manual says about these SSS Methods:

  Subsurface Method Rendering method to simulate subsurface scattering.

  Christensen-Burley Is an approximation to physically-based volume
  scattering. Gives less blurry results than Cubic and Gaussian
  functions.

  Random Walk Provides the most accurate results for thin and curved
  objects. This comes at the cost of increased render time or noise for
  more dense media like skin, but also better geometry detail
  preservation. Random Walk uses true volumetric scattering inside the
  mesh, which means that it works best for closed meshes. Overlapping
  faces and holes in the mesh can cause problems.

One commentor suggested using Alpha for Transparency, but to me this appears to affect a different kind of near total transparency that doesn't seem to have any relation to the physical nature of the simulated material but something more like an overall opacity of the object. It is my understanding that Alpha is primarily used to modify another node which plugs into it. (But I stand to be corrected here).

In this particular case, adding Sheen also had an influence that came closer to approximating the look of realtime Eevee rendering in Material Preview mode.

Something I have not been able to imitate, is the way that realtime rendering in Eevee seems to pick out some edges with a highlight. Even after rendering an output image in Eevee this effect was not reproduced. Perhaps this is a feature of blender to allow for objects to be more quickly visually isolated while editing them, rather than physical accuracy for a final render. Just a guess.

This technique of picking out edges with a highlight is an effect used by old painters, you can see if you look at dark old oil paintings.

You might be able achieve a similar highlight with carefully placed back light, but for the purposes of this experiment I was more interested in trying to pin down some of the specific aesthetic effects of each render engine, albeit on this one very particular example, so I stuck with same default HDRI for the render.

I hope someone may find this useful sometime.


How to "unravel" a model? Imagine the following model was actually a rubber shell in real life. Like the shape of a rubber mask but for the whole body. What I would want to do to this real life model is cut with a scissor all the way down the spine and the inside of the thighs all the way down with a scissor, so that for example someone could put it on like a costume.

Rough demo of what I'm imagining. As you can see here the problem is that I can't get blender to peel back the back layers of the model elastically like it would in real life.

Any ideas of how to do this? Relatively new to 3d modeling.

Thanks!

First I would start by making the initial cuts. This is called "ripping" a mesh - press V in Edit Mode while the edges you want to cut/rip are selected. Then Press Esc to snap them back to their original location (they're still ripped).

From Object Mode, in the Mesh Context add two Shape Keys, the Basis and one more. After selecting the second Shape Key, Tab back into Edit Mode.

You can then enable Proportional Editing AltO and with the ripped vertices selected pull them to the peeled back position. Sharp Falloff may be the best falloff curve to use when doing this.

Tab back to Object Mode and move the Shape Key slider to see the peel-back effect animated.

You can then add a Solidify Modifier to generate the thickness of the suit automatically.

This is just a basic answer to get you started, as your question is really pretty large in scope (it's a project of its own). You may need to use cloth simulation. You may need to use a Shrinkwrap Modifier to get the suit to fit precisely onto a body. You may need to even rig parts of the rubber suit. There isn't really one quick method for doing this that I know of, but a combination of the techniques I mentioned above can probably be used to achieve a satisfactory result. Good luck!


Transforming a paper-like model into a 3d model I recently started using Blender this morning and I got up all the way to this point:

But I didn't realize that it was flat (almost like a paper as shown in the image), I first concluded that I could probably change it's thickness later on in the making.

I tried using Solidify but it distorted the model, a lot.

Is there anyway I can make the model thicker without having to redo it from the start?

Try to get front, back, top, bottom, left, and right reference images of things and making them background images with N panel N > Background Images. Make a 2D mesh for each reference and then try to combine them together to make a 3D mesh. I cannot tell you how exactly because it will vary with each model, but I can tell you that you can do CTRLJ to join the meshes and try to combine the appropriate vertices, and then fill in the faces.

I did this for a hawk's beak recently. What I did was that I made the side reference mesh, duplicated and made them 45 degrees apart (the front reference showed this), joined and connected them and made faces, applied a subsurf modifier, and it looked like an actual beak. So that tells you that this technique works. There are other methods, though!


I want to make the year '2020' out of coronavirus cells... how can I do it? I've already made the coronavirus cell.

There is no way that I am going to tediously move every single cell to create the shape of the numbers that'll take forever! Is there some way I could make the year '2020' 3D, turn the numbers into invisible containers and then 'pour' the cells into them? Or could I make the 3D numbers invisible and somehow make all the coronavirus cells stick to them as if they are magnets?
Ideally, I would like the coronavirus cells to look as though they have gathered together, like a swarm of bees, to create the shapes of the numbers in the year 2020. Is this doable?
It's not for an animation, it's for a still image.

You can do this with Text and a Particle System.
Start by adding text, and converting it to a mesh:

Extrude the mesh a bit in edit mode, then go back to Object Mode and add a Particle System Modifier.

In the particle settings, choose "Hair", and down under render, choose "object" and select your "cell" from where it says "instanced object" (I used an ico-sphere to represent your "cell").

You can change the scale/rotation/etc.. in the particle settings panel. You can also choose to show the "emitter text" or not (note that there are 2 different "show emitter" boxes - one for the viewport and one for the render).
This last step is optional - you can see that the mesh made by the conversion from text contains some ugly topology. You can "clean it up" rather easily by using a Decimate Modifier set to "planar".


My material nodes aren't applying to the whole object I can't seem to figure out why the sides of my object aren't being wrapped by my material. Here's a photo of my node setup, and the finished result. Does anyone have any ideas? Thanks.

Some things in your Node setup don't appear to be doing much (eg the bottom half Voronoi looks like it's cancelled out by the white ColorRamp and then just adds white to the top part?). But - never mind that, the problem is that you're using Generated Coordinates. As a result, the Mapping nodes are probably not doing what you expect.

Generated Coordinates treat one corner of the object's bounding box as (0,0,0) and the diagonally opposite corner as (1,1,1). You can see the effect of this if you momentarily set the Mapping Node to 'Normal' - you should see the Voronoi spanning out from one corner in a radial burst pattern.

To fix it how you want, you just need to UV unwrap the object, and use UV coordinates for the shader input instead. There are other fancier methods, such as blended box mapping, but the quickest/easiest way to get to the result you want is to go into edit mode on your object, select all faces, then hit U > Smart UV Project.

This should do a decent job keeping all faces scaled and aligned properly.
After doing this, change that Texture Coordinate node to feed 'UV' output into the Mapping node instead.

This will mess up the scaling values you have already set, but setting those back to 1,1,1 should give you a correct baseline from which to set proper texture stretching and expand the Y direction as desired.

If the Smart Project doesn't perfectly fix all the mapping areas, you may need to do some further reading on UV mapping/editing and fix some areas manually.


Ambient occlusion bake crashes blender (cycles) I can't get an ambient occlusion bake to work with my file; every time I try to bake, Blender crashes. I'm using cycles render, and my object is pretty low-poly. There might be some weird geometry in it, but the UV unwrap worked alright.

I'm using Blender 2.78 on a MacBook.

I've tried having the image texture node selected, both edit mode and object mode, checking and unchecking "clear", and creating a blank texture image to put the UV onto.

I'm absolutely new to Blender, so please let me know what other info is necessary! Here's the .blend:

The main reason for the crash is dupliframes (not really expected behaviour though).

The object has Frames enabled in the Properties editor > Object tab > Duplication rollout. It duplicates the object as many times as there are frames set (from 1 to 100), resulting in ~44 000 faces. It isn't visible as object is static.

Also with this the object won't be renderable. Set the option to None and the bake will work.

There are some minor problems though in mesh geometry (non-manifold geometry) which are better to fix. Although they won't crash the bake:

Remove doubles (W > Remove Doubles) and recalculate normals (Ctrl+N) first, this will remove some of the non-manifold geometry.
Edges overlayed on top of the faces (moved with Grab tool below for visualization purposes):

To avoid UV map corruption delete one edge, then select vertices from the sides  and use Connect Vertex Path tool with J to split the face as it kind of was. Repeat for the other edges shown in the screenshot above.

Above selected edge was already made as mentioned.
Internal vertex inside of the mesh.

Above faces of the body are hidden to allow seeing through the mesh. Remove that vertex.


Bezier curve-based mesh's front surface is not appearing I made a bouquet by blender 2.70 for The Sims 4, but the front surface is not appearing (even in the Blender). I made it with a Bezier Curve.

How can I make it show the front surface? I'm trying to make it again, but is there any way I can fix it?

In this version it could be one side surface only. In 2.81 go CURVE => 2D => FILL MODE: BOTH. If you don't won't to update the software convert it to mesh and create mirror etc.


Can I control depth of focus (v depth deph of field) I'm creating some studio-shot style images of products. I'm trying to get the foreground elements in focus while having the background blur slightly.

I've done a lot of real world studio photography and I know that depth of focus and depth of field are two different parameters (though frequently confused). Put simply, depth of field references the precise centre of the plane of focus as parallel to the image plane, while depth of focus reference the sum of the distance on either side of this plane that remains in focus.

But 2.6x only seems to offer control of the depth of field, so that only that exact plane is in focus, and everything either side gradually defocusses. Or am I missing something?

The point is, I want to know if there is a way to control the z-depth of the area in focus, not just it's distance from the camera.

You can find it under the camera property.
Select the camera and go to the camera tab.
There is a panel named "Depth Of Field". Either select an object to be your focal point or set the distance.
Set Focal length and radius (f/stops) to adjust the depth.
Here with Radius 0.06

...and here with radius 0.3

From one photographer to another, as you know the Focal length and f/stop produce the DOF effect. Same in Blender where F/stop is better expressed in radius.
You can of course use F/stop instead of radius but don't forget to change the focal length, otherwise you will have to use ridiculously small F/stops. :D


Is there a way to save a baked cloth simulation (in .blend file or to disc)? Is there a way to save a baked cloth simulation (in .blend file or to disc)? seams odd if you have to bake each time the blend file is reopened?

Save the file first, cache your simulation with AltA. then use Current Cache to Bake. Then use the Disk Cache option on Cloth Cache and save again:

Next time you open the file the cloth simulation will be there.

On the folder where the file is saved you'll see a new folder called blendcache_filename. If you move the blend file to a new location make sure yo move the blendcache folder to the same location.


How to animate the visibility of a constraint? How to animate the "Copy location" constraint visibility?

Place the cursor over the 'visibility property'
Press I to insert a keyframe
Go to the next frame, disable the visibility and press I again
Go to the next frame, enable the visibility and insert a keyframe


Arrays along two paths -- possible? I am trying to figure out how to create something like a bracelet where an object is arrayed around two different curves.

Example: Imagine a small gem that I want to be duplicated on the surface of a torus. I can create a gem, a small circle curve (the minor radius), and a larger circle (the major radius). I can create a curve modifier for the small circle and then an array modifier to get the gems to form a ring. But is there a way to array this assembly around a larger, perpendicular circle?

I can apply the first array and curve constraints before adding more curve and array modifiers, but this is destructive -- I want to still be able to edit the gem, etc.

Thanks!

You can redo the array and curves modifier combos: Here is a blend file with the setup (you just need to change one monkey, everything will change automatically since its non-destructive):


My UV map isn't wiring Properly with my normal direction I'm a bit of an amateur in Blender, but I'm making a mockup LEGO box for a school project, and I can't seem to figure out why my image texture is showing up on the inside panels on my box. Only two panels seem to be at fault. The box has a solidify modifier, but doesn't have any real depth, which is why I set it up this way.

My normals are all facing outwards, and my UV map seems to be set up correctly.

Here is a link to some screens from within blender.

http://imgur.com/a/LGiwW

This may not be the correct method of doing this, if that is the case I'll figure out a different method.

You need to add a "UV Map Node" and connect it to the "Vector" of your image texture. While in the "Node Editor" Press "Shift + A" and find the "UV Map Node" under the "Input category.

Also, make sure that you have selected your image in the UV Editor.

Try this simple node set up.


how do u add colour / texture hi I'm kinda new to blender and I've managed to create a object buy sculpting it ( a face ) but no matter which youtube videos I watch or web pages I read I just can't add colour / texture. Manny sites are saying about a dot next to my colour option but there is no dot next to it! and when I click anywhere on it I am just taken to a simple colour wheel (which even if that's what I wanted it don't change the colour of the object) .
I've also seen things to do with the uv panel and tried that ( it didn't work) and also I've tried downloading a JPG image but still nothing happened. I hope one of u can help Xo

let's say this cube is the face you made

(step 3 is very important)

1

2

3

4


How I can change the object properties after I add it in the scene and move it? Suppose I add torus in my scene, and I change in the Minor segments from 16 to 3. In addition, I made many actions such as scaling, rotating and moving the object. How I can return to the Minor segments to 16 after all these actions? I do not add any actions in the edit mode.

Short answer:

You can't.

Long answer:

Blender doesn't create parametric objects out of the box. Once a mesh has been modified after initial creation (including translate, rotate, or scale) you cannot modify it further with the original tool creation parameters. Blender no longer considers the object a "torus", but it becomes a bunch of vertices, edges and faces instead, like any other mesh.

In the case of a torus you could use a curve to describe the basic profile and then use that as a bevel object on a circle curve.

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

There is an addon to create parametric objects https://www.blendernation.com/2019/12/04/blender-2-8x-add-on-review-parametric-objects-wmesh-free/ you might want to try it.


character splits in half when moving leg I'm new to Blender and playing around a little bit, trying to make a decent enough character that can walk and what not. My problem is, so far all of my rigs seem to split in half when I move the leg. The lower torso moves with the leg and the belly pretty much gets cut open up to the belly button.

When I modeled the character I applied a mirror modifier. Could that be the reason? If so, what did I do wrong?

Is there any way to fix this without having to start over?

Thanks!

To avoid this problem you should had the "clipping" option checked in the mirror modifier. Now simply go to rest pose (select all bones, then press Ctrl+G, Ctrl+R, Ctrl+S), then in edit mode select all and remove doubles, or manually join (Alt+M) the unconnected vertices, which probably are one on top of the other.


Hide vertices in a mesh Blender 2.9
I'm working on a big mesh and I would like to hide the "big black dots" (vertices) of the mesh.
For the Edge for example I can do it in the viewport overlays

But for the vertices I didn't find an option to do somethig similar...
Visualy, what I would like to have is something like this (capture from another forum, another program):

in the selected region, the vertices are not marked as dots. That's what I would like to get.
Edit: I do not need to hide the vertices in an specific region. The image is only to show the diference between vertices as "big dots" VS vertices only "as interception of edges", which is what I want. Just hide them or make them really really small...
I hope this is posible to do.
Thanks for any help!

Do you still need to manipulate vertices? If not you could just use edge/face mode, keys 2 and 3?
Seems too simple to be the answer!


What does it mean that part of my mesh is darker grey in edit mode? Boolean Problems I have been editing a mesh I created after importing an svg and using it as a boolean to cut into a plane. The plane needed lots of work to get rid of extra verts.

As I was deleting and dissolving, I noticed that parts of the plane were darker grey. When I got rid of a few extraneous verts, it turned lighter grey, which I took to be a sign that I was doing good.

But, I have parts that I can't get to turn lighter grey. If I knew what I was changing or what Blender was warning about, it would help me to formulate a better plan for decimating this mesh cleanly.

I have checked the normals and recalculated, flipped and set from faces etc, but I don't know what is going on.

Thanks]1

@Dimali was correct, there appears to be two faces on top of each other that share MOST of the same edges, but not these two.

I discovered this after trying to select the edge loop and those two would not be included.

Deleting those two turns the mesh a uniform grey.

Now, the edgeloops go all the way around and I can start making quads by grabbing two vertices and using J

there is probably a simpler way to "quadify" this but I haven't figured it out yet.


What are wire edges? In the select > select all by trait > non manifold menu there is the option "Wire". What are these wire edges?

Wires are edges that do not belong to any face.

From the manual


How to change the resolution on a X or Y axis witouth having a scaling issue? How to change the resolution on a X or Y axis witouth having this weird scaling issue ?

for example, when searching a good ratio for a shot, you want to play and start changing the ratio of the rectangle of the shot as you wish , but blender after a certain point, (after hitting a 1:1 ratio ?), completely change the XY relations, i really dont understadn why, he start cropping the image on the other axis for some reasons... is this a bug ? i find this really annoying ... if anyone know a way to stop this behavior, either by tweaking a setting that i dont know (i tried tweaking aspect XY but same problem)with a add on, or a custom script somewhere ? please tell me

in this gif i only tweak the x resolution but somehow, blender re-crop on the Y axis

thanks

The apparent inconsistency is due to the camera Sensor Size being set to 'Auto'.

When set as 'Auto', Blender will use the specified sensor Size as the size of the longest edge of the sensor - and in your example this will correspond to the largest of the X and Y resolution. This means that whichever dimension is the largest will dictate the effective size of the sensor and this (in conjunction with the Focal Length) determines the view from the camera - hence the change in behaviour when the X dimension crosses the threshold of the Y dimension in your example.

The solution is to change the Sensor settings to Horizontal or Vertical. This locks the 'Size' to correspond to that specific axis.


How to change what an object is pointing at I'm creating an animation of an airplane and was wondering whether there is a simpler solution to make it pointing at where it is going instead of manually animating it. I found this question: How to make an object point in the direction that it's going?

The answer suggest using paths, however it is very old and I can neither find the follow path constraint in blender 2.8 nor access the information in the blender wiki link as the page cannot be found. So I chose to ask a new question.

So here's my idea: We have already animated the path. So would it be possible to copy the object's motion to a point object (or any other object that won't be visible in the final render) and off-set it by one frame or so. Then the point will be one frame "in the future". This should work, however I cannot figure out how to change where the airplane is pointing at. Is there such a function in blender and how can it be accessed?

If you just need to point an object to another (for example to an empty) you can use an "object constraint" and targeting to the empty.

check this video:


How to run this operator? I've found a script that I want to test and use from a thread around, which was marked as "SOLVED" with this script. However, I can't get how this script is used:

import bpy
import bmesh

class SimpleOperator(bpy.types.Operator):
     """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

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

    def invoke(self, context, event):
        me = context.object.data
        bm = bmesh.from_edit_mesh(me)
        verts_sel = [v.select for v in bm.verts]
        edges_sel = [e.select for e in bm.edges]
        faces_sel = [f.select for f in bm.faces]

        loc = event.mouse_region_x, event.mouse_region_y
        try:
            geom = bm.select_history[-1]
        except IndexError:
            geom = None

        ret = bpy.ops.view3d.select(extend=True, location=loc)
        if ret == {'PASS_THROUGH'}:
            self.report({'INFO'}, "no close-by geom")
            return {'CANCELLED'}

        try:
            geom2 = bm.select_history[-1]
            print("geom2 sel 1st", geom2.select)
        except IndexError:
            geom2 = None

        if geom is None:
            geom = geom2

        if isinstance(geom, bmesh.types.BMVert):
            geom_sel = verts_sel
            bm_geom = bm.verts
        elif isinstance(geom, bmesh.types.BMEdge):
            geom_sel = edges_sel
            bm_geom = bm.edges
        elif isinstance(geom, bmesh.types.BMFace):
            geom_sel = faces_sel
            bm_geom = bm.faces

        for sel, g in zip(geom_sel, bm_geom):
            if sel != g.select:
                g.select_set(True)
                bm.select_history.remove(g)
                bm.select_flush_mode()
                break

        self.report({'INFO'}, repr(geom))
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

The thread I am mention is here: Get Edge / Vertex / Face from mouse position
Please, if you can explain what I have to do with this code.

Regards.

Well, basically if you don't define an interface for your operator, you can run your code and then press the Spacebar and search it with the name of "simple object operator" in the box that appears. When you find it, simply click it and it will run.


Making the buttonpress F6 into a scripted button In bpy how would I make a button of the F6 operation? That way I can have a button to call a panel. I would just add it to the top of my panel.

If you mean the "redo last" operation, which I believe is the default key binding for this function, then you can use this: (note that    you'll have to include bl_info and register and unregister functions    as in the code snippet below )

import bpy

class redo_last_operator(bpy.types.Operator):
    bl_idname = "screen.redo_last_operator"
    bl_label = "redo last"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self,context):
        bpy.ops.screen.redo_last()
        return {'FINISHED'}

Please note that importing this as an add-on will only add the operator to Blender, not add a Button to any panel. You can do that yourself, however, by creating a panel for it or adding it to a Panel yourself. The following code will create a panel as well:

import bpy

bl_info = {
    "version": (1, 0),
    "blender": (2, 75, 0),
    "name": "Redo Last Operator",
    "description": """Creates an operator for the redo last menu""" ,
    "category": "File",
    "location": """""",
}

class redo_last_operator(bpy.types.Operator):
    # this class is meant only for destroying data blocks of a certain type, very powerful but very dangerous
    bl_idname = "screen.redo_last_operator"
    bl_label = "redo last"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self,context):
        bpy.ops.screen.redo_last()
        return {'FINISHED'}

class redo_last_operator_panel(bpy.types.Panel):
    bl_label="redo last"
    bl_idname="redo_last_operator"
    bl_space_type = "VIEW_3D"
    bl_region_type = "TOOLS"
    bl_category='Addons'

    def draw(self,context):
        self.layout.operator(redo_last_operator.bl_idname)

def register():
    bpy.utils.register_class(redo_last_operator)
    bpy.utils.register_class(redo_last_operator_panel)

def unregister():
    bpy.utils.unregister_class(redo_last_operator)
    bpy.utils.unregister_class(redo_last_operator_panel)

if __name__ == "__main__":
    register()

If, on the other hand, you meant another operation, you can use the same code and still bind it to the button by replacing the code under execute().


Why are this seams there? I have been modeling and then I've noticed that I had a strange seam going at a certain part of my mesh, quite weird, can't figure out what is causing this to happend.

Extend those vertical edge-loops all the way through those three bottom horizontally-aligned faces (the top of those three clearly being an n-gon, not sure of the two below it). This should go a long way toward fixing your problem.


Access "self" in add-on from separate module file My .py file got big enough that it was time to split it into multiple files. Originally, it would have some bpy.props, then later functions could access that with

    lanes = bpy.props.IntProperty(
    name = "Lanes",
    default = 2,
    description = "Number of lanes"
    )

def execute (self, context):
    def someFunction():
        print(self.lanes)

someFunction is now so big enough I split it into a separate file, imported with importlib.reload. init.py runs and can import that function and run it, but messes up when trying to refer to self again:

curveSetup() missing 1 required positional argument: 'self'

The script previously found self because it was one giant file. how do I access self again now they're in different files?

A buddy helped out with this. In the secondary file, I added an optional argument def someFunction(lanes) and use print(lanes) instead of print(self.lanes). Then in init.py, when I call the function I use someFunction(self.lanes)


Possible to activate different object shape keys at same time? Regarding .vrm --> .fbx model for vrchat & vtuber programs I'm pretty new to Blender. I know how to do a lot of things in theory, but am unable to apply them. I'm not sure if it's my insufficient knowledge or Blender's deficiencies.
For starters, I'm using a .VRM model I exported from vroid studio to be used for vtuber type stuff, so I can't just go in and animate things separately or anything, as I need to export it to an .FBX file, and have them usable for facial expressions in programs such as VRchat, luppet, etc.
I changed the shape of the teeth on the model, and the only way to do that properly without it taking me literal hours to select each and every single vertex with tons of difficulty since the mesh/object is only split into three parts [face/head, body, and hair] I separated the teeth from the original mesh and altered them for each shape key to match the facial expression shape keys. I thought I'd be able to just re-merge the objects, but it seems you can't do that with anything that has shapekeys.. so that route is out the window.
So my second thought was to "connect" shape keys so that they objects activate a shape key with the same name at the same time, so when I export my model the facial expressions register as one single "animation"/expression opposed to separate ones for the teeth and face, but have been unable to figure out a way to implement this
Is it possible to have two completely unrelated/different shaped objects activate shape keys at the same time that will continue over when exported? OR a way for me to be able to somehow re-merge my objects without losing all the editing I did to the shape keys and teeth mesh?

Things I have tried in place of what I want to do.. but with failed results.
-- Separating the mesh but keeping it the same object, and altering it while separated and then moving it back.. Remerging the mesh ruins the shape of teeth & face and the basis shapekey does not affect other shape keys when I used this method.
-- Duplicating the mesh as new mesh/duplicating and separating as a linked object. All of my attempts do not alter the original mesh of the teeth when I alter the secondary teeth mesh.
-- Editing the teeth while still connected and inside the mouth. This is extremely tedious, and for some reason no matter how many times I tried, the edits to the base shape key would not transfer to any other keys unless I separated the teeth mesh from the head/face mesh.

Odd workaround fix was found after a lot of trial and error. I'm hoping there is a better way to do it, but for now I'm at least able to get done what I want to. I answered this myself in case anyone else has any issues regarding exporting shape keys and such.

Not quite the answer I was looking for, but I've figured out a way to get things to work once exported.
You do not need to be able to activate them at the same time within blender, you just need to make sure that all of them are named the same thing, and that you can re-export your .FBX file to a .VRM file once imported to unity. This seems to be the only way to get your shapes/expressions to work properly if they are not all within one object.
Things needed:

CATS extension for blender https://github.com/GiveMeAllYourCats/cats-blender-plugin
Unity VRM export/importer [Apologies I forgot where I got this from so will update with link later]

First things first, This works better if your objects are linked and you've assigned parent and child bones. [How to parent/child bones: https://docs.blender.org/manual/en/2.79/editors/3dview/object/properties/relations/parents.html ]
You want to make sure that all of your shape keys that "connect" and you want to go together are named the same thing and line up properly. Both for ease of access and to make sure things export/import correctly for blendshapes in unity. Then you want to "Fix" your model with the CATS extension, under the "Model" category. All default settings should be fine except for the "Join Meshes" option. Because my mesh and objects are separated with their own keyshapes, joining the meshes here will get rid of or ruin the shapes.

Once your model is fixed, check your shape keys to see if any of them got altered. At this point you are free to go through and delete any shape keys that were transferred over when you separated your mesh/objects with your original vroid model, that are unneeded or do not affect your object. If everything is fine and once you've removed or added any extra shapes you need, then you want to export your model to a .fbx file. Make sure to select the embed textures option under settings in the CATS menu.
I'm going to skip over a bit of this final process as it's regarding unity entirely at this point, but essentially you want to import your .fbx model, make sure all the textures and materials are correct, and then you want to export your model to a .vrm model within unity.
From there you should be able to find a folder titled blendshapes and be able to alter the animations inside with sliders to create a "full" facial expression, pose, etc, as long as you exported and fixed everything correctly within blender.


When I parent my head armature to my body armature it moves I want to parent my hat armature to one of the bones in the neck, but when I do it messes up the location. The armature has no previous parent like most articles seem to suggest, and the rotation, location, and scale are all applied.

Nevermind I found it, you have to select keep transform


selecting multiple items in the outliner My question sounds really stupid but I really cant figure how to use multiple selection by dragging mouse cursor instead of clicking one item by another till I select zillion of objects that I need...any tip how to do it quickly?

Thx
Libor

What you can do is using the border select with 'b', then if you want to select objects in the scene you can do right click /select


Baking displacement map with Cycles Experimental I want to bake some displacement maps for Unity Engine. I want to use Cycles renderer. I have read that it's only available in Experimental version of Cycles, but when I changed Cycles to Experimental version there isn't baking type for Displacement map, there are UV, Normals, Shadows etc. but there isn't any Displacement/Depth map choice. I have Blender 2.78a (2016-10-24) downloaded yesterday. Where can I find this option or how can I enable it?

Baking Displacement maps is very easy in Blender Internal. Switch to it.Then unwrap low poly object. Switch baking pass to Displacement, set appropriate distance.Enable Selected to Active. Select low poly object, switch to Edit mode.In UV/Image editor create new image (switch 32bit float on when generating), make sure, that UV map of the object is displayed on this new image.Tab out of edit mode, select first high poly object, then low poly object and hit Bake. Like this:


Height map tiling: what is it due to? I'm creating a script that produces height map from a mesh.

Testing it, I remarked strange rounded tiling... so I thought it was a bug in my code (again...), but comparing the result with another map taken from the web, it is similar:

my texture on the left, the web texture on the right:

And the corresponding images:

Mine:

From the web:

These tiles appear only at a given subdivision of the grids and above, not if too low.

What is it due to?

Not sure what is really the underlying cause, but I figured out how to reduce the artifacts.

It seems to be related to the image filtering interpolation method.
Turning on Interpolation and increasing the Filter Size property seems to reduce the effect noticeably.


How can I bake vertex animation into keyframes, but make sure that there aren't any duplicate keyframes I've seen a sweet technique for baking vertex animation to keyframes by means of creating a shape key for every frame and keying the shape key to come on at the right time. An awesome user on this site (shoutout to Jerryno) wrote a script to take care of this process in one shot. I'm going to go ahead and include that script in my question in case that link ever dies; here it is:

import bpy

obj = bpy.context.active_object
start = bpy.context.scene.frame_start
end = bpy.context.scene.frame_end

def insert_keyframe(sk, f):
    sk.keyframe_insert("value", frame=f-1)
    sk.keyframe_insert("value", frame=f+1)
    sk.value = 1.0
    sk.keyframe_insert("value", frame=f)

meshes = []
for f in range(start, end+1):
    bpy.context.scene.frame_set(f)
    meshes.append(obj.to_mesh(scene=bpy.context.scene, apply_modifiers=True, settings='PREVIEW'))

obj.shape_key_add(name="Basis", from_mix=False)
for i in range(0, end-start+1):
    key = obj.shape_key_add(name=str(i+start), from_mix=False)
    insert_keyframe(key, i+start)
    for vert_id in range(len(obj.data.vertices)):
        key.data[vert_id].co = meshes[i].vertices[vert_id].co

for mesh in meshes:
    bpy.data.meshes.remove(mesh)

I've run in to some cases, however, where my vertex animation periodically pauses for a bunch of frames, then resumes, then pauses for a bunch of frames, resumes, etc. It seems needless to have all of those duplicate keyframes/shapes during the time when my animation is paused--and since performance is alright not the best on meshes with tons of shape keys I'd love to optimize the script so that it only creates a shape key/keyframe if the vertex data has changed from the previous frame.

I understand that in the code I'd need to do some kind of comparison between the vertices in each frame, but I don't even begin to have an idea how that would be done. Could someone point me in the right direction?

Here is the improved script without duplicate shapekeys:

import bpy
import sys

def update_progress(job_title, progress):
    block = int(round(20*progress))
    msg = "\r{0}: [{1}] {2}%".format(job_title,
                                     "#"*block + "-"*(20-block),
                                     round(progress*100, 2))
    if progress >= 1: msg += " DONE\r\n"
    sys.stdout.write(msg)
    sys.stdout.flush()

obj = bpy.context.active_object
start = bpy.context.scene.frame_start
end = bpy.context.scene.frame_end

# generate unique meshes from animation
meshes_at_frames = []
for f in range(start, end+1):
    update_progress("Generating unique meshes from animation", (f-start)/(end-start+1))
    bpy.context.scene.frame_set(f)
    curr_mesh = obj.to_mesh(scene=bpy.context.scene,
                            apply_modifiers=True,
                            settings='PREVIEW')
    if meshes_at_frames:
        prev_mesh = meshes_at_frames[-1][0]
        new_mesh = False
        for curr_vert, prev_vert in zip(curr_mesh.vertices, prev_mesh.vertices):
            if curr_vert.co != prev_vert.co:
                meshes_at_frames.append((curr_mesh,f))
                new_mesh = True
                break
        # cleanup
        if not new_mesh:
            bpy.data.meshes.remove(curr_mesh)
    else:
        meshes_at_frames.append((curr_mesh,f))
update_progress("Generating unique meshes from animation", 1)

# add unique keyframed shape keys to reconstruct animation
obj.shape_key_add(name="Basis", from_mix=False)
prev_skey = None
for mesh, f in meshes_at_frames:
    update_progress("Adding shapekeys", f/(end+1))
    curr_skey = obj.shape_key_add(name=str(f), from_mix=False)
    for vert_id in range(len(obj.data.vertices)):
        curr_skey.data[vert_id].co = mesh.vertices[vert_id].co

    # cleanup
    bpy.data.meshes.remove(mesh)

    # keyframe start of current
    curr_skey.keyframe_insert("value", frame=f-1)
    curr_skey.value = 1.0
    curr_skey.keyframe_insert("value", frame=f)

    # keyframe end of previous
    if prev_skey:
        prev_skey.keyframe_insert("value", frame=f-1)
        prev_skey.value = 0.0
        prev_skey.keyframe_insert("value", frame=f)
    prev_skey = curr_skey
update_progress("Adding shapekeys", 1)

Same as with previous version: deform modifiers after running script need to be turned off or deleted.

It performs slower than previous one due to comparing mesh vertices if they differ. Worst case is when the mesh is the same across many frames, best case is when mesh changes every frame on first vertex (or every vertex).

For 1M poly meshes and hundreds of frames this comparing can take couple of minutes, so I also added a progress reporting to the system console.