How to add PNG image as texture with transparency on a plane and export as obj? I have tried https://www.youtube.com/watch?v=AdrFMEgNgF4 which uses cycles method. But I haven't found any way to export with materials.

I followed this https://www.youtube.com/watch?v=Gi3oFolsPI0 which uses blender render but the exported obj file is not visible in threejs and https://3dviewer.net/.

Blender file
using Blender render method https://drive.google.com/file/d/1nfRLu_BzHYvycXZG5Jqjymj5eV6tYvxP/view?usp=sharing

Using cycles method
https://drive.google.com/file/d/1X48y4D4ImEe03_oxQ-OWszjAuDPnZNQV/view?usp=sharing

Obj file https://drive.google.com/file/d/1gbxpyjpQCz-CG4I91S6XhsmRWyAR_HK_/view?usp=sharing

Mtl file https://drive.google.com/file/d/1lSrtM6Fxgsfrp_zUX_R3Fg_MzrIRCxpB/view?usp=sharing

PNG https://drive.google.com/file/d/1KBGWwm-iikbz14bfR9w0_iUb5N6Km_RP/view?usp=sharing

OBJ files do not store textures, hardly anything does - you have to export OBJ, import it to whatever you need it in. Then you need to import textures, create material/shader using the texture and apply it on the OBJ.

Clarifying with some more details:

Applying texture inside blender will only stay in blender. OBJ only has geometry information, mtl has some material data, but no texture information of any sort.
What you usually do is:

Make object with UV maps,
Make material,
Export Object,
Bake materials into textures,
Export baked textures.

Then you import it in target environment, be it other 3d software, 3d engine, or anything, and there you re-create material using baked textures and tools available in the environment. Then you apply it onto imported obj.


blender python remove button in UI How can I add a remove button similar to the Parent property in Object?

Actually, I need to create something exactly similar to the Parent property where I can optionally select an object from objects according to a criteria.

My problem is how to make it optional or how to add a remove button. Unlike an EnumProperty.

One way is via a UILayout.prop_search

In example below the string property scene.target_object is set to the name of one of the objects in the scene.  Also note the "X" remove button once set.

import bpy
from bpy.props import StringProperty

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

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

        scene = context.scene

        row = layout.row()
        row.prop_search(scene, "target_object", scene, "objects")
        print(scene.target_object)

def register():
    bpy.types.Scene.target_object = StringProperty()
    bpy.utils.register_class(HelloWorldPanel)

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

if __name__ == "__main__":
    register()

On the selecting objects by a criteria, you can also use a user defined collection property as the search data.  For instance in my sound_drivers addon scene.driver_objects is defined as a PointerProperty, scene.driver_objects.armatures is a CollectionProperty.  The collection is populated by all the armatures (by name) with drivers in the scene.

    row.prop_search(scene, "target_object",
                    scene.driver_objects, "armatures")


Match mesh on top of another I am making a costume for a character. I have the costume ready, but parts of the modelling mesh keeps on slipping through it. How do I make the costume completely cover the model mesh? This is my exact problem:

My suggestion is to use the Shrinkwrap modifier. Just add it to the costume object and set the model mesh as the target object. Enable Keep Above Surface and adjust the offset value, so your costume mesh will stay above the model mesh.

With the Shrinkwrap modifier your costume mesh will follow the exact shape of the target mesh, so the mesh will be modified. But if you just want to completely cover the model without changing the costume mesh, use the Displace modifier - tweak the Strength value.


Can't zoom after pressing Numpad (.) on object - Blender 2.8 I have had this problem previously and have spent hours on google trying to figure it out. Unfortunately most problems don't seem to match mine exactly.

So I'm doing a udemy course and the instructor tells us to center our view to the big toe of the model by pressing Numpad (.)(/Del). I understand this concept to mean that the viewport uses whatever you selected as a pivot point. Unfortunately the instructor fails to mention how to escape this mode, instead moving into the next video having done it himself but not explaining to the students. I am pissed to say the least

So I tried pressing Numpad (.) on the whole object, in object mode. This helped a little, but I still can't zoom into the feet properly. Before doing all of this, I could zoom into any part of the model just fine. I get that I could change the origin of the model and it would help, but I find it ridiculous that blender wouldn't be able to zoom the length of a human model - I hope that isn't the case and I'm just missing something.

Another article online mentioned that Numpad (/) fixes the issue, it does give the illusion of it being fixed but also hides all of the other objects

Shift (C) is another suggested solution, nope.

Orthographic view seems to help, but I can't use it for many of my projects as I can't see things properly.

https://youtu.be/FxFmeW6HjBo

This link is to a video example of my issue. When the camera slows, I am still rolling the mousewheel as fast as I can. I also try zooming back out, but am just as stuck.

In 2.8+ the simplest fix is to go into Edit -> Preferences -> Navigation and enable "Auto Depth"

This will fix the zoom slow down issue, but does change it so your cursor placement affects the navigation.

Since 2.8, some of the better responses have changed to this previously asked question and no longer work, or work differently.


Reflection of a light object in Cycles i'm trying to recreate the same lightning condition from that shot (see screenshot), but i'm having troubles to give a little reflection to the light object (ceiling).

Any tips on how to achieve this result?

Thank you!

You can create reflective materials by lowering the Roughness and increasing the Metallic properties.


"Make Cyclic F Modifier" is making my animation cycle go out of sync I'm trying to make an infinite cycle of a swimming cycle but and am using an f curves cyclic modifier to make the cycle. The cycle works for the first few minutes but then slowly falls out of sync. How can I fix this?
I'm also working with a lot of bones. Is there a way to just select all of the bone layers in the f curve window and change the cycles modifier settings instead of going layer by layer...

I figured it out! Turns out not all of my bone's last keyframes were actually at the last keyframe. For example, my right foot ik's last keyframe was at 125 when it should've been at 130.


Reduce/Remove Sub-edges in Skin Modifier When using Skin Modifier it will create sub-edges/intermediate edges (Marked Green on the picture) between two control vertices (Red dots on the picture).
 As far as the shape of the object goes, it is only the Edges produced by control points (Red) I'm interested in, so I have to delete all the unwanted (Green) sub-edges after applying the modifier. Which is fine if the model is simple enough (Just select main edges, invert selection and delete the rest), but with a complex one it gets really time-consuming and at times confusing very fast.
 Is there a way to make Skin Modifier go without creating those sub-edges at all somehow?

You can add a Decimate modifier below the Skin modifier, to reduce the number of faces created by the Skin modifier.


Mirrored object doesn't match it perfectly? Well I retopologized the object and now I am having trouble with the mirror of it. It keeps mirroring int he wrong area and is not matching up equally. Also my verticies at the end of my mesh that would connect the mirror are not alligned properly. Can someonehelp. I have pictures below.

It looks like the origin of the mesh is not quite in the correct place.

Select the vertices that you wish to be the centre of your mirror (the vertical line of vertices which run from the nose all the way
back around the head and back up to the nose)
Press Shift+S and choose Cursor to Selected.
Go into object mode and choose Origin> Origin to 3D cursor from the Toolshelf (press T to show the toolshelf).

The mirror modifier should then be moved to be above the subsurf modifier to avoid having a visible seam.

Update: To make the centre line of vertices completely straight, select the centre loop and press S , Y then 0.


Is it possible to make edge loops on a flat surface with a modifier? Like, you can make edge loops on 3D objects with a bevel modifier with 2 segments and a 1.00 profile. Is there a way to also do this on the edge of a plane?

Mirror along X and Y + Bisect. Add a bevel modifier.


Lagging audio playback in the VSE? I'm editing some videos in the VSE with blender 2.7 and am experiencing pauses and lagging in audio, when I (AltA), which is driving me MAD!

I've  "proxy/Timecode" all video strips to 50% with build quality to 50% too (which was tedious for lots of clips) and strip, rebuilt proxy and strip timecode indices.
I've set the Memory cash limit to 2048, in the user preferences

But still have Audio playback problems.
I have included a blender file so you can see my settings. I have 6GB of Ram and a I5 processor.

Has my computer run out of computing power?
 Have I not optimized a setting correctly?
Or have I loaded too many clips into blender?

blender file

Try using the VSE proxy function, Blender will render lower resolution media for all strips that have proxy turned on correctly. You also have to convert all the strips as Blender can't play mixed proxy/not proxy media.

To do this, in the timeline of the sequence editor press N. Scroll down a bit and tick the box labelled Proxy/Timecode. Change the options to suit your needs.

Then, click on Strip > Rebuild Proxy and Timecode indicies.

Finally, to have playback use these proxies, in the playback window press N, and then change the Proxy render size to make the size of your proxies.


See render progress in VSE I have several scenes in strips in the VSE. When I use the VSE to render I get the results I want but I cannot see the frames as they are rendering the same way I do when I render directly from the scenes themselves (not the VSE scene where all the clips are brought together). They only appear after the frame is completely rendered.

Is there any way to render everything from the VSE and see the progress as it renders in the Image Viewer like you do in a single scene?

Hope this makes sense - thanks!

That just depends on what you set your Display to in your Render Properties:

Set it to Image Editor, Full Screen or New Window to see the result as it's being rendered.

Though you have to keep in mind that Frames that originate from a Movie Clip, Video Strip or Image Strip won't be rendered partially but as a whole image anyways. So you will only see real rendered images that originate from a 3D scene.


Lattice deformation shrinks geometry My mesh shrink if the lattice is transformed, even if all lattice points are only rotated and maintain their relative distances.

Is there any way to enhance the lattice performance?

Adding more subdivisions in X and Y resolves the issue.

It doesn't matter if the Outside property is checked or not.


How to clip a material and give the illusion that it is 'solid' or 'filled' with Cycles? I am using a combination of Cycles material shaders to perform a "clipping" view for a geologic cross-section. The answers to the following question  explain very well how to achieve the cut-away view.

How can I easily animate cutaway views on multiple objects?

The difference between these answers and what I am looking for is that with these you can look inside the mesh. I would like to give the illusion of a solid or filled mesh. Even if it appears to be filled with something like colored smoke.

I'm trying to cut hundreds of objects, and cut multiple X-sections (e.g. clip the Y-axis from 90-110, and 190-210, 290-310, etc).

This is an example of an original mesh that I would like to clip:

This is what I would like to accomplish. I did this using boolean modifiers. The problem with this method is it does not scale well to many objects, nor is it simple to make multiple X-sections.

This is where I currently am using Cycles nodes.

This is the node tree with two groups:

I believe that a volume or emission node may be able to provide this effect. I have tried adding it in a variety of places.

Placing the volume absorption node right before the material output:

Placing the volume absorption node between the diffuse node the first location group results in this:

Is it possible to have this geographically clipped material appear to be solid or filled with smoke?

One option is to do it manually.

1) Press TAB to go into edit mode.

2) Select all the vertices bordering the hole.

3) Press 'F' to fill the selected area.

I hope this helps! -Galaxy


face vertices causing weird indention in model I'm a newbie when it comes to blender so I started making my first model, when I render it smooth a weird indention forms near the bottom where a face intersects, how do I get rid of this?

Link to the blend file:

If we take a look at the inner topology, here is what we can see (below). You have inner faces, i.e. edges that are common to more than 2 faces, it is not good because when you'll try to smooth it, it will tend to create artifacts as it will try to smooth with all these inner faces as well, so select all these faces and delete.:


Animation Nodes - instance objects over time I am trying to create an animation where torus's emanate from a centre at regular intervals (like the RKO Pictures radio wave animation).
This means creating new instances over time.
I have managed to create expanding instances of a bezier curve, which is sort of the effect, but not really.

What I am looking to do is loop the expansion of a master circle over time.
Any ideas would be very helpful.

The wave/scale effect is controlled by the scale of an empty (simply animate it the way you want).

The node setting is in two parts:

Main part:

Get empty scale and generate a set of scales from it.
Duplicates the model (a curve).
Put the result in the resulting curve.

The scale is limited between 1 and 5 in this setup but you can change it as you want.

The next nodes are making an array of scale.
Say current scale is 3.19, we want the array to be [1.19, 2.19, 3.19].
This is done using the float range node.

Sub loop:

The loop is done over the precalculated scales (above).
For each scale duplicates the input vertices and scale them.
The result is merged (reassign to the output).

The result is cumulated in a "reassign" node which is also set as output.
The model input is set as copy as we want a new circle at each iteration.


How to create toggle button use python in blender I want to make a toggle button for my custom operator. It works similar to checkbox: once the button is clicked, the operator keeps running until the button gets another click, so will the button itself greyed out. I tried to achieve the grey-out effect by implementing poll() function like this:

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

Every time the button is clicked I want the toggle state to change, so in the operator's init(), I write:

def __init__(self):
    plane_toggle_flag=not plane_toggle_flag

However, it seems as long as poll() returns false, the init() function never get the chance to be called. Any idea how to solve this? Thank you in advance.

Create a bool property for Window Manager (it can be for anything, but WM will store our modal operator handler so why not put this in the same place):

bpy.types.WindowManager.my_operator_toggle = bpy.props.BoolProperty()

Display it somewhere in the UI with the toggle tag on:

layout = self.layout
wm = context.window_manager
label = "Operator ON" if wm.my_operator_toggle else "Operator OFF"
layout.prop(wm, 'my_operator_toggle', text=label, toggle=True)

It looks like this:

Create your modal operator (example of basic timer):

class SomeModalOperator(bpy.types.Operator):
    bl_idname = "my.operator"
    bl_label = "My Operator"

    def modal(self, context, event):
        print("running")
        if not context.window_manager.my_operator_toggle:
            context.window_manager.event_timer_remove(self._timer)
            return {'FINISHED'}
        return {'PASS_THROUGH'}

    def invoke(self, context, event):
        self._timer = context.window_manager.event_timer_add(0.01, context.window)
        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

The operator ends itself when the bool property is False.
Add update function to the bool property that will run the operator:

def update_function(self, context):
    if self.my_operator_toggle:
        bpy.ops.my.operator('INVOKE_DEFAULT')
    return

bpy.types.WindowManager.my_operator_toggle = bpy.props.BoolProperty(
                                                 default = False,
                                                 update = update_function)

The modal operator is useful when you need to handle user input. For anything else it is better to use app.handlers, you can toggle them through bool property in similar fashion.


How to make a cast iron shader that has scrapes? Attached is an image of my project so far. How could I make this have a scratched texture across the hull and up structure to make it realistic.

The easiest way to do it is to use the Box option of the Image Texture node:

Find a scratch texture image:

Create this node chain: Texture Coordinate > Mapping > Image Texture > ColorRamp > plugged into the Roughness socket of the Principled BSDF. In the Image Texture, switch from Flat to Box so that the image is projected on all the axis. If needed, increase the Blend so that no seam is visible. Play with the ColorRamp to increase or decrease the Roughness. Choose the Principled Base Color:

Here is the kind of effect you can get:


Convert a circular tube into an oval tube Like all newbies I'm probably asking something that has already been answered but here goes.
I've succeeded in building a circular tube 325 mm high and 214 mm external diameter with wall thickness of 4 mm.
I now need to make this tube oval but not a real oval more like a running track with half circles at each end and in my case with straight sides of 50 mm joining the two halves of the circle
Thanks in advance
Keith

Since I don't really know your topology, I better start from scratch. If I interpret your question right, here's how I would approach it:

I assume a Blender unit to be 1 meter. I don't use metrics, so you might have to adapt your values.

Create a cirle. In the redo panel to the left, enter the desired resolution (I chose 64) and as radius, enter .214/2

Go into Edit Mode with TAB, hit A to clear the selection and use B to select half of it (you could do a negative border select with MMBand spare the A).

Then press Y.

It's called split and will duplicate the verts at the border of your selection. In this case it means you now have two half circles. One is selected, one isn't.

With the right half still selected, move the right circle to the right with GX .05 RETURN, right?

Select all with AA and fill it with F

Inset the face with I .004 RETURN

Delete the inner face using X, "Only Faces"

Go into front view, select all and extrude up with E .325 RETURN

The finished tube with, I hope, the right dimensions.


Linked scenes with different materials in blender 2.82++ I need to have two scenes exactly the same. The only difference will be the material of each object. It is important to have all the elements between scenes linked so any change in one scene is also applied in the other. This is in order to have an automatic script to generate the instance segmentation image of the scene.

I could copy the scene when rendering, change the materials and remove the scene and repeat every time the user renders, but having a linked scene is much cleaner. I have followed several similar questions which suggest to link the material to the object and not the data. This looks like not working maybe because it works different in linked copies of a scene or maybe because it is blender 2.82.

Any idea how to achieve this? Thanks everyone

One way would be to create a duplicate of any new object and link it with the 2nd scene and also link the object data of the original and duplicate.

Then you can just link the materials to object instead of data.


How can I get straight lines on a UV map? How can I set straight several edges in one action?

My current workflow is to select each edge, Shift+X+0, but I'm sure there is a more efficient way to do it, as with the Loop Tools -> Relax button.

I know the UV squares has the feature to grid by shape, but what I need is to get several edges on the same axis straight without affect the angle of the edges on the other axis.

Is that possible?
Can you help?

Aside from perhaps some add-on, I'm not sure of a way to do what you want in one action. If you are open to another solution, perhaps consider the align auto function in the UV specials menu. It does basically the same thing as scaling to 0 on X or Y, but can save time as you can just use Shift+R to repeat the operator after using it.

Just Altselect your edge, and then use W>A(Align Auto) to activate the operator, followed by Shift+R after each selection to repeat the function.


Use top-left corner as origin in Blender's camera I'm trying to convert calibration matrix to Blender's camera as the reference document in here: http://ksimek.github.io/2012/08/14/decompose/

It looks Blender camera uses bot-left corner as origin in image space.

Is there a good way to convert this?

Here is my solution.

CAMERA K

    scene = bpy.context.scene
render = bpy.context.scene.render

#-----------------------------------------------
# view port

render.engine = 'CYCLES'
render.filepath = '//'
render.resolution_x = imgWidth
render.resolution_y = imgHeight
render.resolution_percentage = 100

scene.cycles.device = 'GPU'

#-----------------------------------------------
# K
camdata = bpy.data.cameras.new('cameraData')
camdata.lens_unit = 'FOV'

f = float(K[0,0])
fx = float(K[0,0])
fy = float(K[1,1])
ppx = float(K[0,2])
ppy = float(K[1,2])

maxdim = max(render.resolution_x,render.resolution_y)

#camdata.angle = 2*math.atan(0.5*maxdim/f)
camdata.angle_x=2*math.atan(0.5*render.resolution_x/fx);
camdata.angle_y=2*math.atan(0.5*render.resolution_y/fy);

# the unit of shiftXY is FOV unit (Lens Shift)
camdata.shift_x = (ppx - render.resolution_x/2.0)/maxdim
camdata.shift_y = (ppy- render.resolution_y/2.0)/maxdim

camdata.dof_distance = 0.0
camdata.clip_end = 1000.0

#-----------------------------------------
# OBJECT TYPE
cam = bpy.data.objects.new('camera', camdata)
#
# flip axis to top-left
cam.scale=(1,-1,-1);

Extrinsic R|t

Assume all your frame shares using same camera and I add object axis to handle camera rotation. It seems difficult to directly insert R|t matrix into camera object.
Also, please note that the initial order of the rotation and location parameter does matter.

    # extrinsic matrix
    all_wrtx,all_fid = top.loadALLWxyzRt(camDIR);

S=bpy.data.scenes['Scene'];
S.frame_start=1;
S.frame_end=len(all_fid);

D = bpy.data

for o in D.objects:
    o.select=False;

D.objects['objRoot'].select=True

for i in range(0,len(all_fid)):

    fid = all_fid[i];

    wxyz=all_wrtx[i][0];
    rt=all_wrtx[i][1];

    S.frame_current=fid;

    # set R
    root.rotation_mode='AXIS_ANGLE';
    root.rotation_axis_angle=(wxyz[0],wxyz[1],wxyz[2],wxyz[3]);

    # set Rt
    root.location=(rt[0],rt[1],rt[2]);

    bpy.ops.anim.keyframe_insert_menu(type='LocRotScale');

I've only one time used singular value decomposition with OpenCV

As I understand your question manipulating x0, y0 of the camera's intrinsic parameters (as interactivly possible in the 2nd page of your link) is similar to

import bpy

cam = bpy.data.cameras['Camera']
cam.shift_x += .5
cam.shift_y += .5

If this doesn't help you could try to offset the cameras position:

cam = bpy.data.objects['Camera']
cam.location.x = 0.0
cam.location.y = ...
cam.location.z = ...


Can I define a coordinate system based on a mesh, as generated coordinates are based on a bounding box? I am making a procedural cloud based on CGMatter's which takes the shape of the mesh assigned the cloud material, with the added ability to 'shrink' the initial (pre-distortion) volume box so the cloud does not have hard edges where the mesh stops. My problem is that since I am using generated volume coordinates, the shrunk volume takes the shape of a smaller version of the cloud meshes bounding box, instead of the mesh. I want to define a coordinate system that is 1 or -1 at the edges of the mesh, or a similarly effective approach.
Here is a pic of the cloud and mesh in ortho view:

I think you might be wanting this setup, where we use Vector Math nodes to convert Generated Coordinates to something equal or almost equal to Object Space.
It's commonly used with Vector Displacement, because Generated space performs some very specific transformations better than Object.


Physics: Rigidbodies sticking together and softbodies not retaining shape I am trying to simulate a car crash in Blender 2.8, but during the simulation, several errors occur. The meshes seem to stick to each other, most likely the rigid bodies, and they will continue to follow each other for the remainder of the animation. The cars then phase into the ground after collision, jittering the entire time.
There are also issue with the softbodies, that is that they will not retain their initial "crunched" shape upon collision despite having a high plastic setting (100). I have tried to solve this issue by keying the stiffness to the moment before impact, but for some reason the softbodies still collapse before they even hit.
I have set up the simulation using the following method:

I have a deformed body which has no dynamics of any kind, which is broken up into pieces like the windshield and tires.
I then put that deformed mesh under a rigid body which is used to collide with the floor and the other car.
I then parent a soft body under the rigid body and use that and a mesh deformer to alter the deformed base, and I apply colliders to both cars and the floor.
I then toggle the "animated" function of the rigid bodies to switch from a keyed movement to pure dynamics.

An alternative to this current method would be using shape keys and sculpting the damage of the collision, which would remove the need for softbodies, but I want this simulation to be almost entirely driven by dynamics so that I can use it with any vehicle.
Attached in this link is the Blender file:
https://www.dropbox.com/s/dyl0tvlgpmzuzyk/CrashTest4.blend?dl=0

So, I found a solution to the rigidbodies falling through the floor, though they still stick to each other (collision margins set to .1).
I made a new rigidbody with a much simpler cube with a few extra edge loops and increased the mass to 50, and the new simulation does not break into the environment. I am however still having issues with softbodies and the cars still return to base shape after impact.
Here is the link to the updated file
https://www.dropbox.com/s/qnsqfjojrw2star/CrashTest4.blend?dl=0


How can I convert a file with the command line? I want to convert a file from VRML to FBX without rendering the model using blender. Is this possible via command line?

edit:
I'm working on windows and tried the following:
I added the blender directory to my path environment variable. After that I wrote a .bat script with the following content:

start "" blender test.vrml --background --C:\Program Files\Blender Foundation\Blender\2.76\scripts\addons\io_scene_x3d\import_x3d.py -- foobar.blend
start "" blender foobar.blend --background --C:\Program Files\Blender Foundation\Blender\2.76\scripts\addons\io_scene_fbx\export_fbx.py test.fbx

Unfortunately this opens a lot of windows until my windows crashes. I think the error is my lack of knowledge about .bat scripts :-(.

According to the wiki, it is possible to convert (link is just an example, not specific to the formats you mentioned) via the command line. However, I'm not so certain (seeing as I haven't tested this) if you can convert between non-native formats.

I believe you would need to use the script to import VRML, then subsequently the script to export FBX.

If you are looking to automate the process, you could write a script that runs these commands sequentially:

#!/bin/sh
exec blender foobar.vrml --background --python name_of_import_plugin.py -- foobar.blend
exec blender foobar.blend --background --python name_of_fbx_export_plugin.py foobar.fbx

Please note you'd need to edit the above code, and I have not tested this, but in theory it should work.


How can I loop a 2D grease pencil animation within a longer animation? My goal is to create an animation of a boids particle system. Each boid should be an instance of a 2d grease pencil animation. The problem is that the grease pencil animation stops before the boid animation is done. For regular animations, I know it is possible to make them loop within a longer animation by applying a cycles modifier in the graph editor, but I can't get my grease pencil animation to show up there.
blend file

I figured it out thanks to wilks' comment above.
It can be done by adding a time offset modifier to the grease pencil object,
enabling custom range and setting end frame to the length of the grease pencil animation.

Only problem now is that all the boids loop in unnatural unison, but I guess I'll open another question for that.


Cube with rigid body does not fall I downloaded the compound collision change example from blender demo files and just added a cube with a rigid body in there.
It does not fall at all.
I tried to delete bake and baked again -> same result
What am I missing here?
Blend file:

result of moonboots answer:

here my new blend file with moonboots proposed changes:

You need to do 3 things:

Delete the bake:

Apply the scale of the small cube:

Choose Shape > Mesh instead of Convex Hull for your big triple cube object, otherwise it will act like a big box and it will kick out the other objects:


How to do multiple plane tracks from one video I haven't done any plane tracking before, but I'm thinking of making a video where I have a bunch of picture frames and I replace their images with a bunch of my blender work.  What is the process of doing more than one plane track in a video?  Are there plane track datablocks? (Again, I haven't really looked into this.)  Also, what is the best way to put them all together in the compositor?  Thanks!

To create a plane track you select a minimum of four tracking points and then click Create Plane Track, which is available in the solve tab of the tools sidebar T in the Clip Editor.

I don't know if there are any limits, blender just lets you create as many plane tracks as you want for the current movie, I just created 40 as a test.

There is a plane track deform node that you can use in the compositor that will distort an image to match the plane track you choose.


Paper shredding effect I am trying to create a scene where a paper gets shredded up when it hits the bottom of an escalator. Still at the 'learning Blender' phase where I have to use tutorials for almost everything, and I'm having trouble finding a good solution to this type of chaotic paper shredding. Especially since when you search, you mostly get real blenders shredding, if you know what I mean. I've looked into the fracture modifier but it seems to create particles rather than confetti-like slivers. Do I need to manually create the shreds? Or does anyone have a good method for paper shredding? Thank you!

The passport is made from a dissected cube with one half hinged up a little from the fully opened flat state.
The paper is from duplicating the two upper faces of the green cover and separating those with 'P'
(in Edit mode) so paper and cover become two individual objects.  The paper is raised a little so it's a whisker above the cover, then parented (CTL-P) to the cover to form the complete passport.  (child=paper)
The paper is given it's own material slot and coloured white.
The complete model is animated face up to slide down the 'escalator' and into it's workings at the bottom.  The descent keyframes are set to 'linear' and that changes to a much lower speed when it's being drawn into the mechanism.  It's also rotated a little as it's being drawn in.
Two (invisible) emitters are placed at the bottom. One to eject shredded paper, the other to eject torn pieces of (fabric) cover.  Both use identically shaped 'particle objects' (debris) which are held in Layer 2. Layer 2 is not rendered out.

Each debris object uses the same material slot as it's non-shredded kin and the cover debris is scaled up in it's emitter to be much larger than the shredded paper.  It's also ejected a little further than the paper.
The passport begins to enter the base cube at frame 73 and particles start ejecting a frame later.
The number of particles for each has to make the ejection dense enough and with enough particle velocity to appear like the machine is shredding with enthusiasm until a few frames after the passport disappears.
The Paper's emitter has 800 particles in all, the Cover's, just 200.
The base cube and floor are set as 'collision' objects so particles can't can't penetrate and fall through.
Both the floor and base are set to 'kill particles' on contact.
-==============-
The details for Newbies -  The Paper shredding...
The emitters are merely subdivided planes and have different settings so they eject cloth and paper a little differently.  They are placed a fraction above the base cube. i.e. OUTSIDE the cube, not in it.
(They'll be invisible)
You can experiment with the emitter sliders & buttons but keep a reference copy of the Blend file intact.
Set the velocity etc to have them ejected as far, as high, and in the direction desired.  That's all taken care of in the particle's 'velocity' and 'rotation' panels.
Make a particle object that will become the shape of the paper debris'.  Store that in a spare layer or collection.  Don't allow Blender to render that object.  It's there as a reference object only.
The debris object itself is an ordinary plane (or any other object) that's deformed manually and coloured white.  Give it a name.
Open the Particle's "Render" panel and tick "Emitter" & "Died" boxes only.
Click the "Object" button.  That directs Blender to use an object for the particles.
Enter the name of the paper debris object you created in the other layer/collection.
Tick the "Scale" & "Rotation" boxes, set the "Size" value as required.
In the Particle's "Display" panel, click on the 'Rendered' button.   (that's usually the default anyway)
The physics shouldn't need anything changed from the default "Newtonian".
Once it's working right, give the emitter a Material slot and set it to fully transparent and without Specular so it won't be ghosted.
-================-
The Cover Shredding -
Duplicate the paper's emitter and in the Particle settings, click the minus button where you see it's name at the top.  If you don't, you'll be adjusting the paper emitter instead.
Click on the plus button to produce a separate one. Name it  'Cover'.
Raise it a fraction so it's off the other.
This emitter behavior needs to be a little different from the first.  You an see it's settings in the Blend file.


Physics simulation stops at frame 250 I am working on a gravity simulation in Blender of objects falling to the ground. The frame period starts from 1 to 250, and I started the gravity simulation by clicking "play". I somehow changed the end frame period to 300, and the gravity simulation that I did earlier just ended at 250, and I wanted it to continue to 300.

Look at the bottom of the sequence of the interface. You could see that orange line in that sequence area where the simulation took place. Once it goes over the orange line at the end, the simulation stops and it continues on to the end of the frame sequence.

Does anybody know how I can continue the simulation through the rest of the sequence?

By default simulations cache only form frame 1 to 250, you can change that in the scene >Rigid Body World > Cache


Procedurally bend curve from root I am trying to apply a softbody to a curve. Is it possible to not affect the 'root' origin?

I want the top of the curve to hang. As seen in the image, the left one is what I want the soft body to do. In this case I just used proportional editing, but I am searching for a procedural method to produce great variety while still being able to control and adjust it.

you can edit in properties(in edit mode)
weight 1 (stay) 0.01 (move)
strength(goal) set to 1


Mantaflow not baking particles I'm new to Blender, and I'm trying to do the simplest fluid simulation possible in 2.82 using Mantaflow. I can't tell if I'm experiencing a bug, or not following the correct guidelines.

I'm using factory settings, everything is untouched except two meshes, a large domain cube (fluid physics->type: Domain [Domain Type: Liquid] & liquid option is checked) and a smaller fluid cube inside (fluid physics-> Flow Type: Liquid).

After baking, no particles are displayed throughout the timeline. The cache shows that it's certainly saved something, though.

I saw this video a while ago that provides some fixes: https://www.youtube.com/watch?v=2O0QcLpAxV4&t=545s

Basically:

If you have a planar object, like a plane, it is bugged. In the flow object panel you have to increase the surface thickness from 0.5-1.
Make sure both object fluid modifiers, the domain one and the flow one, aren't hidden in the viewport or on the render when you bake fluid.
Make the Flow object bigger, but not bigger than the domain object and the flow object must be inside the domain object.

Those are some common problems, but without the file, I can't check what's wrong. Hope my answer helps, though!


Object selection box with eyedropper How to add an eyedropper functionality to prop_search in my addon?

col.prop_search(scene, "string_property", context.scene, "objects")

This code will create prop_search just like on the animation below, but without an eyedropper.

I spoke to Campbell Barton (the developer who got eyedropper functionality implemented) about this, he said that this kind of functionality is not available in Python API at the moment.

UPDATE:

Blender 2.79 now allows to create add-on properties which reference datablocks.

custom_property = PointerProperty(type=bpy.types.Object)

Using this property with a prop_search() we'll get search box with an eyedropper.

UPDATE 2:

Usage of prop_search() is not necessary, in this case prop() will do just fine.
Noted by J. Bakker.


Error ImportError: No module named 'bpy' I am getting error:

  ImportError: No module named 'bpy' in Blender console.

I am importing bpy module inside Blender console but still getting the error. After long googling I found that no one is getting the same error inside Blender.

Using Blender 2.7 and python 3.4.

My code:

import sys
import bpy
sys.path.append("C:\Python34\Lib\site-packages")
import serial
import GameLogic
contr = GameLogic.getCurrentController()
own = contr.owner
dane=open('dane.txt', 'rb')
x=dane.read()
dane.close()
y = int(x)
print ("y=", y)

bpy.ops.transform.rotate(value=(y), axis=(0.0, 0.0, 0.0), constraint_axis=(False, False, False), constraint_orientation='', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1.0, snap=False, snap_target='CLOSEST', snap_point=(0.0, 0.0, 0.0), snap_align=False, snap_normal=(0.0, 0.0, 0.0), release_confirm=False)

Output at Blender console:

ImportError: No module named 'bpy'
Python script error - object 'Cube', controller 'Python':
Traceback (most recent call last):
File "qqq.py", line 2, in <module>
ImportError: No module named 'bpy'


Detect a Blender Keyboard Shortcut How would I detect a Blender keyboard shortcut in edit mode? I'm trying to detect the merge operation (Alt+M), but I don't want to change the shortcut of anything, just execute a function at the same time that the operation is called by the key combination. I thought about the draw function which constantly listens, but that doesn't seem ideal.

Found it through the modal operator. There were other posts touching on this, but basically it will keep Blender's keymaps but still execute your custom code.

import bpy

class ModalOperator(bpy.types.Operator):
    bl_idname = "object.modal_operator"
    bl_label = "Simple Modal Operator"

    def execute(self, context):
        print("This is the modal operator")
        return {'FINISHED'}

    def modal(self, context, event):
        if event.type == 'ESC':  # Confirm
            print("This is finished")
            return {'FINISHED'}
        elif event.alt:
            if event.type == 'M':  # Confirm
                print("This is a Blender Shortcut key")
            return {'PASS_THROUGH'}

        return {'PASS_THROUGH'}

    def invoke(self, context, event):
        print("This is the invoker")

        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

bpy.utils.register_class(ModalOperator)

bpy.ops.object.modal_operator('INVOKE_DEFAULT')


How to copy object(s) to another layer I am building a model for a game and have decided to copy part of it into a separate layer. How do I copy one or more objects to a different layer?

To copy an object you have to be in Object mode, right click on the object that you want to copy and the press Shift + D to duplicate it first.

The duplicate will be in grab mode so right click to get out of grab mode without changing its location.

The object will still be selected but if it isn't, you can look in the Outliner for it. It will have the original object name followed by a number indicating that is a duplicate such as Object.001.

You then press M to bring up the layer move popup menu and click the button for the layer that you want to move it to or alternatively type the number corresponding to the layer.


PNG transparency shadow issue for graphics on a coffee mug After finally figuring out how to apply a transparent PNG only to specific faces of a mesh, I spent forever trying to figure out why I was getting a shadow and finally realized it was because my coffee mug is hollow and a shadow is being cast on the inner wall of the mesh.

Is there a better way to add transparent graphics and logos to solid objects like this?  Ultimately, I want to be able to do this for cars and characters.  Thanks!

EDIT: I do not believe this is a duplicate of those other issues as my problem was a shadow casting onto the interior of a mesh due to the transparency.  I tried both of the solutions shown below and here are the results.  I believe the shrinkwrap mod is the best solution for me right now (thanks @masterj2001), but I will continue to tinker with the other solution (thanks @thibsert) to try to get rid of the lighter background, and I did try all the blending modes in the MixRGB node.

Your node setup mixes two different materials, one solid, one transparent. What you want is a single material (ceramic) with a base color and your picture painted over it. Something like that :


What is the best workflow for dealing with modifiers and complex objects? I'm coming from Cinema 4D and a new user. I'm trying to figure out the Blender version of this kind of workflow:

Download car (for example) model from Turbosquid (made of hundreds of objects in a complex hierarchy)
Apply subdivision (or bevel) to the entire hierarchy non-destructively (in C4D this would be putting the entire Car hierarchy under a Subdivision Surface.
Apply effects to the entire hierarchy: For example, 'bending' the entire car using a single bend deformer.

I initially tried to use modifiers in Blender like this, but I'm confused by how they seem to only affect single objects and don't flow through the object hierarchy. Again I'm new to Blender so I'm probably missing something basic.

For bending an object (yeah, it's simpler if you combine all into one), you can use Mesh Deform modifier.

Make the cage around the car, simple box with subdivisions. Make it wire viewport visibility
Add the Mesh Deform modifier to the car and select the box and bind
Put Simple Deform modifier to the Cage object, or some other modifier


Make force field only affect objects while they are within a specific area I'm trying to emulate an object floating to the surface of a liquid within a soft body simulation using a wind force field, but I have discovered to my dismay that wind force fields don't care about the position of the object and I can't find a way to make them do. Is there a way to make wind fields area-specific that I missed, or a better way to accomplish this sort of effect?

You can set a max distance on the force field, after doing that the force field will only affect the objects if they are within the set distance rather than affecting the whole scene.


Clock with single hour hand to show current local time on running script? It's a clock with only one single hour hand. 360 radians turns the selected handle the whole circle, but how to script it to read local time and calculate the degrees and assign it to the handle? I know there are quite a few steps to get there, but maybe some advice where to start?
import bpy
import os
import math

bpy.context.active_object.rotation_euler[2] = math.radians(0)

Q: Is it possible with bpy?

Rotation by Driver
Some small sample to look at some of the numbers and a simple Driver
import datetime
import bpy
n = datetime.datetime.now()
print(n, n.hour, n.minute, n.second)
#allow this new rename of an existing function to be seen in Blender Drivers

bpy.app.driver_namespace["mytime"] = datetime.datetime.now

#in the driver called as mytime().hour (minute second)
#mytime().second * 2 * pi/60 the formula in the driver please improve
#your correct formula would use hours and minutes

In the text window we inform the driver namespace of a function that we can reference in the  driver.  This script needs to be run once.  You can investigate further enhancements.
In the image you see a driver that refers to that same function. Please click on the image to see it larger. You can see the driver options by context clicking on the rotation value. Please improve the formula. The driver is on the rotation and is seen as the purple color.  The driver window indicates this at the top.  Please excuse my second rate registration.  You see the formula which refers to the same function reference we created in the script. The function will only update when you move the frame position.  The animation is to get you started with some discovery on your own.  Perhaps you can show your improvements.
If you do not know the basics of using a driver then there are examples here at Blender Stack Exchange BSE and the website that has a name that rhymes with noonoob. What is written in this proposed answer is not a tutorial.


Very spotty render. Fireflies? I'm creating a model, and getting a lot of fireflies. I've read that these can be caused by poor lighting and by low render samples, and can be reduced by clamping.

However, I've got 2 lamps going, and I don't want to keep adding lamps until I have no shadows. I'm using 500 samples. I tried 1000, didn't help. (Using cycles render). I've tried all combinations of setting direct and indirect clamping to 1. The last helps some, but not enough to justify the reduced picture quality.

 Note the inside of the drive ring and the back of the radio antenna.

Edited to Add:

Thanks to Todd's suggestion below, I redid the render using Branched Path Tracing, and the result was much better. Only thing I changed was upping the samples to 250.

The best way to trouble shoot a noisy image, is to render all the main colour render passes (Dif, Gloss, Trans, Sub, Emission and AO) out, and inspect each one. You'll see one or two that are really noisy, and then you should be able to adjust your samples to clear them up.

I'm a big fan of Branch Path Tracing mode, because it lets you reduce samples in passes that don't need it and increase samples in those that do. I'm fairly certain you should be able to get something looking decent for 500 samples, but you may have to redistribute them differently.


Remove Unused Keyframes? I would like to be able to clean unused keyframes from my dope sheet, ones that aren't doing anything.

I read online that you press 'O' in the dope sheet to do this, but I tried it and it didn't work. So, I looked for the hotkey and preferences, and it isn't there!

Is there a way to do this?

I do believe pressing O used to run this tool in the Dope Sheet, but for consistency with the other editors O now seems to enable proportional editing. Now the 'Clean Keyframes' option resides in the Key> Clean Keyframes menu.

WARNING This will reset ALL interpolation back to the F-Curve default Interpolation.


How do I get a very soft lighting effect in the Game Engine? I'm creating a game that I would like to have very, very soft lighting. Here's an example of a game with a similar lighting to how I would like it:
What sort of render effects could I use to make a similar lighting effect in the Game Engine?
(I will be having a lot of questions about the game engine, thank you for putting up with me.)

Soft shadows like that are hard to calculate with standard approaches.
The only out-of-the-box realtime solution i know for Blender is using a sun- or spot-lamp with a low-resolution variance shadow map in GLSL shading mode. Note that this technique might "detatch" the shadow from an object.
Lamp settings:

Result:

If you do not need real-time solutions you can also bake all the lighting of the scene into textures. Then you have the full rendering capability of Blender at your hand and can use lamps with soft shadows. But you will only be able to apply this effect to static objects in your scene. You would probably still have to combine baked shadows with the variance shadow map approach for your characters.


Camera - follow path and change rotation I created the camera moving by the curve using parenting and follow path option. However, how to do so that the camera moves on this curve, simultaneously changing the rotation so that all the time it  observes the other object (moving along a second path beside)? I have tried to add "track to" option, but the camera was adjusted completely not in this direction what it is necessary.

For the object add a Follow Path constraint and select the curve you want the object to follow as target. Enable Follow Curve and Enable Animate path.

Your object will follow that path:

Add a second curve.

Place your camera at the same in the same origin point of your second curve (the you want to use as travel path) and add a Follow path constraint with the curve as target, and animate path enabled:

Your camera will travel on that path.

On the camera add a Track to constraint with the object as Target, To -Z and Up Y.


Overlapping faces : how to create new faces (interception and complements) with Python API? Suppose I have a mesh with two overlapping faces (in general, all vertices are different):

import bpy
import bmesh
if bpy.context.mode != 'OBJECT':
     bpy.ops.object.mode_set()
# Create circle #1
bpy.ops.mesh.primitive_circle_add(vertices=10, radius=3,
                              location=(0.0, 0.0, 0.0), fill_type='NGON')
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action="DESELECT")
# Create circle #2
bpy.ops.mesh.primitive_circle_add(vertices=10, radius=3,
                              location=(1.0, 2.0, 0.0), fill_type='NGON')
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action="DESELECT")
# Apply all transformations
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)

If possible, how can I create a new mesh with three faces : one face associated with the interception, and two faces representing the original faces with the interception removed.

I tried to use bmesh.utils.face_split_edgenet, but do not fully understand how to define "edgenet". At least, I can get it working. If I run

bm = bmesh.new()
bm.from_mesh(context.object.data)
bm.select_mode = {'FACE'}
bm.faces.ensure_lookup_table()
tmp = bmesh.utils.face_split_edgenet(bm.faces[0], bm.faces[1].edges)

"tmp" seems to be the same as bm.faces[0].

My goal is to assign different colors to 'area in circle #1, but not in circle #2', 'area in circle #2, but not circle #1', and 'both in circle #1 and circle #2'.

Bmesh script

For the case of overlapping circles.

Define two circles on z = 0 plane with centres and radii c1.xy, r1 and c2.xy, r2.

Add them as bmesh circles, edges only no fill. Select the edges of circle 1. Circle 1 needs to be at (0, 0), edit to translate to and back if need be.

The distance between the centres is R the length of the  vector N = c2 - c1. Using the triangle with sides R, r1, r2. apply the  cosine rule (given we have SSS (side, side, side)  to get angle "alpha" opposite r2. rotate the r1' length unit vectorN` by +/- alpha around Z axis to get the two points of intersection **

Using N as the normal and one of these points as a plane coordinate can bisect the circles, and move the cut points to their respective "perfect" circle intersection points. Notice the operators to add emties at the intersection points, will show that they rarely fall on an edge of what is really a regular ngon

Remove doubles.

Fill all edges on either side of and on plane to give non intersection parts.

The non selected edges on circle 1 side plus the selected edges of circle two side give the edges intersection in the middle.

Pass the bmesh contextual create operator the edges. Akin to pressing the F key in UI.

Assign materials 0 1 to circles and 2 to intersection.

Realign the normals.

Test script. run in object mode, first add some simple mesh at (0, 0, 0), assign it three materials, select and run script

import bpy
import bmesh
from mathutils import Vector, Matrix
from mathutils.geometry import distance_point_to_plane as dp2p
from math import sin, cos, acos, degrees, radians, pi
bm = bmesh.new()

me = bpy.context.object.data

segments = 25
# circle 1
c1 = Vector((0, 0))
r1 = 8

bmesh.ops.create_circle(bm,
        radius=r1,
        segments=segments,
        matrix=Matrix.Translation(c1.to_3d())
        )
for e in bm.edges:
    print(e)
    e.tag = True
    e.select = True
# circle 2
c2 = Vector((4, 5))
r2 = 9

bmesh.ops.create_circle(bm,
        radius=r2,
        segments=segments,
        matrix=Matrix.Translation(c2.to_3d())
        )

N = (c2 - c1).to_3d()
R = N.length
R2 = N.length_squared

# half angles

a1 = (R2 + r2 * r2 - r1 * r1) / (2 * R * r2)
a2 = (R2 + r1 * r1 - r2 * r2) / (2 * R * r1)
a = acos(a2)
# circle 1
rot = Matrix.Rotation(a, 3, 'Z')
loc1 = r1 * (rot * N.normalized())
#bpy.ops.object.empty_add(location=loc1)

rot = Matrix.Rotation(-a, 3, 'Z')
loc2 = r1 * (rot * N.normalized())
#bpy.ops.object.empty_add(location=loc2)
# three cases

ret = bmesh.ops.bisect_plane(bm,
        plane_co=loc1,
        plane_no=N,
        geom=bm.edges[:])

for v in ret['geom_cut']:
    if (v.co - loc1).length < (v.co - loc2).length:
        v.co = loc1
    else:
        v.co = loc2
bmesh.ops.remove_doubles(bm, verts=ret["geom_cut"], dist=0.001)

c1_geom = [e for e in bm.edges
        if all(dp2p(v.co, loc1, N) <= 0.001 for v in e.verts)]
bmesh.ops.contextual_create(bm, geom=c1_geom)

c2_geom = [e for e in bm.edges
        if all(dp2p(v.co, loc1, N) >= -0.001 for v in e.verts)]
bmesh.ops.contextual_create(bm, geom=c2_geom)
# intersection
all = set(bm.edges)
tagged = set(e for e in bm.edges if e.select)
untagged = all - tagged
inter = list((set(c1_geom) - tagged).union(set(c2_geom) - untagged))
for e in bm.edges:
    e.select = e in inter
ret = bmesh.ops.contextual_create(bm, geom=inter)

#recalc normals
bmesh.ops.recalc_face_normals(bm, faces=bm.faces)
for f in bm.faces:
    f.material_index = f.index

bm.to_mesh(me)
me.update()

Notes:

Tagged edges seemed to be lost after remove doubles bmesh op, had to use select instead.

Perform some tests to see if circles intersect.

if r1 + r2 == R: # touching
    # fill both circles
    pass
elif r1 + r2 > R: # intersecting
    # do above
    pass
else:
    print("circles don't intersect")

As in a previous question, and this one I've used bmesh rather than operators.  See Python performance with Blender operators Your script in this question (using 9 operators) could be achieved with 3 operators add circle x 2 and join.  However I would recommend not using them at all if possible.

For non circular shapes getting tricky with solidify and boolean modifiers might get the job done.


Bone Heat Weighting: Failed to find solution for one or more bones? Whenever i try adding automatic weights to my model i get that error. i recently had this problem with another model, however that didn't help me with this one. I have tried various things like dissolving vertices in Non Magnifold mode with only boundries ticked. I've removed all doubles and i have no clue anymore. Here's the blend file

One of the problems that the automatic algorithm is not good at is dealing with characters maden of spare parts and not an unique closed manifold mesh.

You can separate all spare parts and rig them one by one: it works but you'll have to tweak  the automatic weights manually, because the algorithm doesn't know which part should be moved by which bone.

As your beautiful character is so complex, I would absolutely go with manual weighting, which is less complex than it seems, see this answer for some weighting tips: Rigify : skin overlapping clothes


Round Edges on solidified mesh I am trying to create a piece of clothing.

As you can see I created a simple shirt which has nice smooth round edges. Around neckline, arms opening and the bottom piece.

However the mesh topology in edit mode is bad. Many verts are not connected and the sheer amount of verts which create the round edges is too high. Total vert count is 8776. There are simply too many verts and edges and no way for me to connect and merge all of the verts.

Any way to create these round edges? I have tried using bevel modifier but that doesnt create anything but highlist the quads.

I would like to create a similar look from mesh on the last picture. The edges and faces on it are flat. The vert count is 886. I dont even mind 8000 verts as long as I dont have to go through 5000 merging them.

Any ideas?

Did you try proportional editing mode? If not, that might be worth a shot. Rough outline of how I would go about it:

Bridge the edge loops (works best if both loops have the same number of verts)
Do several loop cuts on the face loop added to create the bridge
Turn on proportional editing mode and set it to "Sphere" or "Smooth"
Select the inner most ring of the loop cuts
Grab and move or scale the selected loop


Cycles Viewport Render not updating while Texture Painting Is there a way to enable/force Cycles Viewport Render to show live updates while Texture Painting?

It does only shows changes on Viewport Render restart.

My answer to this question explains most of the issue.

The key points to make texture painting work while Cycles is set as the render engine are -

The 3DView shading mode should be set to Texture
The object needs to have a UV Map
The object needs to have a material that has an image node set to the desired image

When the material has multiple image nodes the selected image node defines the active image being drawn to. The image node does not need to be connected to any other nodes.

The UV Map selected in the UV Map list is the one being used to display the image selected. Any UV Maps linked into the image node are ignored with the 3DView set to Texture shading.

While you can switch the render engine to Blender Render while you do texture painting, the only real difference is that Cycles chooses the image from an image node were Blender Render links the image in the UV Image Editor to a UV Map while in edit mode.


Cloner Object (like in C4D) in Blender Solution

The Array Modifier is basically equivalent to the Mograph Cloner in Cinema 4D. I was a bit confused since there is also a Mography Array in Cinema 4D which I would not need for this case.

To stack objects vertically you have to:

Go to the Modifiers Tab
Choose Array
Uncheck Relative Offset
Check Constant Offset
Change the Z value

Problem

I would like to duplicate an object and stack it. The current scenario is that I have a business card and I would like to stack the business cards. Here is a screenshot of the project, it is quite simple:

In Cinema 4D (I have used it before Blender) there was a function called "MoGraph Cloner Object" you can see the function of it in this tutorial:
https://youtu.be/2rWnJzf8O0w?t=43s

Of course I could duplicate it and just stack it but this does not feel like a good solution since I have to change EVERY duplicated object instead of just one.

I have tried to google it but I was not successful.  Thanks for any help that is provided.

Kind regards,

Fabian Lins

I think you are after instancing. How this works in Blender is explained here:

What is a Duplivert, or a Dupliframe, internally?

You can also use the Array modifier to make copies, then deform them with another modifier (lattice for example).

The equivalent of MoGraph node system in Blender is the Animation Nodes addon.


creating a mesh similar to the image: Help me to create a mesh similar to that of the drawing in bold below.  Excuse me for my bad drawing skills.

Add a UV sphere (Add>Mesh>UV Sphere)
set selection mode to faces :

select the faces you want to keep
press Ctrl+I to invert the selection
press X, and select delete faces.


Custom Icons, script path register I'm struggling with implementing a custom icons into script. As my level of Python is low, I did try others suggestions but without any luck. Addon never show up in Blender, but it's installed in blender addon folder.

Always tested with zip file, as zip file contain a script Selection.py and folder "icons" with init.py script inside.

I always get error - ImportError: No module named 'icons'.

I believe that I never register a init.py script and Selection.py script can't see it. ?

Scripts

Selection.py script

import bpy
import bpy.utils.previews
from icons import get_icon_id
from bpy.types import (
        Panel,
        Menu,
        Operator,
        )
from bpy.props import IntProperty, FloatProperty

bl_info = {
    "name": "IPG",
    "author": "InvisibleParrot",
    "version": (0, 0, 1),
    "blender": (2, 77, 0),
    "location": "View3D > Edit Mode",
    "description": "IPG tools of trade",
    "warning": "",
    "wiki_url": "",
    "category": "IPG Tools"}

class SelectionPanel(bpy.types.Panel):
    """Selection"""
    bl_label = 'Selection'
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_category = 'IPG Tools'

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

        col = layout.column(align = True)

        col.operator("object.unwrapobject", text="Unwrap", icon_value=get_icon_id("C_Black"))

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

    bpy.utils.register_module(__name__)

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

    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()

and init.py script

import os
import bpy

icons_collection = None
icons_directory = os.path.dirname(__file__)

def get_icon_id(identifier):
    # The initialize_icons_collection function needs to be called first.
    return get_icon(identifier).icon_id

def get_icon(identifier):
    if identifier in icons_collection:
        return icons_collection[identifier]
    return icons_collection.load(identifier, os.path.join(icons_directory, identifier + ".png"), "IMAGE")

def initialize_icons_collection():
    global icons_collection
    icons_collection = bpy.utils.previews.new()

def unload_icons():
    bpy.utils.previews.remove(icons_collection)

class IconsMock:
    def get(self, identifier):
        return get_icon(identifier)

icons = IconsMock()

Thanks for response.

Ok, now everything works..

Is there cleaner way for doing this or I need always register new icon ?

import os
import bpy

bl_info = {
    "name": "IPG Selection",
    "author": "InvisibleParrot",
    "version": (0, 0, 1),
    "blender": (2, 77, 0),
    "location": "View3D > Edit Mode",
    "description": "IPG tools of trade",
    "warning": "",
    "wiki_url": "",
    "category": "IPG Tools"}

preview_collections = {}

class PreviewsExamplePanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = 'Selection'
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_category = 'IPG Tools'

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

        col = layout.column(align = True)
        this_icon = preview_collections["custom_icons"]["custom_icon"].icon_id
        col.operator("render.render", text="Unwrap", icon_value=this_icon)
        this_icon = preview_collections["custom_icons"]["custom_icon2"].icon_id
        col.operator("render.render", text="Unwrap2", icon_value=this_icon)
        this_icon = preview_collections["custom_icons"]["custom_icon3"].icon_id
        col.operator("render.render", text="Unwrap3", icon_value=this_icon)
        this_icon = preview_collections["custom_icons"]["custom_icon4"].icon_id
        col.operator("render.render", text="Unwrap4", icon_value=this_icon)

def register():

    # Note that preview collections returned by bpy.utils.previews
    # are regular py objects - you can use them to store custom data.
    import bpy.utils.previews
    pcoll = bpy.utils.previews.new()

    # path to the folder where the icon is
    # the path is calculated relative to this py file inside the addon folder
    my_icons_dir = os.path.join(os.path.dirname(__file__), "icons")

    # load a preview thumbnail of a file and store in the previews collection
    pcoll.load("custom_icon", os.path.join(my_icons_dir, "C_Black.png"), 'IMAGE')
    pcoll.load("custom_icon2", os.path.join(my_icons_dir, "C_Blue.png"), 'IMAGE')
    pcoll.load("custom_icon3", os.path.join(my_icons_dir, "C_Yellow.png"), 'IMAGE')
    pcoll.load("custom_icon4", os.path.join(my_icons_dir, "C_Red.png"), 'IMAGE')

    preview_collections["custom_icons"] = pcoll

    bpy.utils.register_class(PreviewsExamplePanel)

    bpy.utils.register_module(__name__)

def unregister():

    for pcoll in preview_collections.values():
        bpy.utils.previews.remove(pcoll)
    preview_collections.clear()

    bpy.utils.unregister_class(PreviewsExamplePanel)

    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()


Make duo-tone illustrations by seperating colors I'm working on a workflow to make duotone illustrations. I like to work with emission shaders for this, because they eliminate all lightbounces, thereby it requires almost no rendertime and gives me a vector-like illustration. In the image below I put a Fresnel Node in the Mixshader to seperate colors, but what I actually want is to replace this Node for the information of the lighting in the scene. Got any ideas?
I also tried to use a Toon node and a Glossy node with roughness to 0, but I really like the Emission shader because the color isn't affected by background or lighting. Maybe there is a way to convert a material node to color data and to set a colorramp on that?

In order to calculate scene lighting, try shader to RGB node.


How to get a high resolution image of the material preview? How can I create a simple scene setup that looks like material preview? I want to render the material preview (specifically the flat XY plane) in a higher resolution. I've tried to copy the setup in a Blender scene, but it doesn't look the same. Are there any addons or ways to export the material preview in any resolution?

Note that I need it to look exactly the same as the material preview.

You can adjust the DPI, zoom in, and full screen the Materials panel to make it bigger, then take a screenshot.

Make the Properties editor full screen by hovering over it and pressing Ctrl↑

Increase the DPI in User preferences > System

Zoom in on the panel by holding CtrlMMB and dragging the cursor

Result: (click for full size)

The obvious limitation being that you can't go larger than the maximum zoom, or larger than your monitor.
Get the blend:
Alternatively, you can download the blendfile from the GIT repo with your browser via Phabricator:

Blender Internal preview file

Cycles preview file

To download a file, go to the link above and click Download raw file on the right:

Then click Download:

The different preview scenes are on the following layers:
Layer 1: Flat XY plane
Layer 2: Sphere
Layer 3: Cube
Layer 4: Suzanne (Monkey)
Layer 5: World Sphere
Layer 11: (the first layer on the second row) Hair


How to model a ribbed pattern along a body In Blender, I am trying to replicate the clothing (in the picture) on my high-poly model. Specifically, I am looking for help in how I can replicate the texture along her belly and inside-breasts.

My successes and failures so far:

I did a decent job with the seams by using a bezier path which I drew on my model and then extruded. This gave a similar appearance - but would love to hear other ways.

The belly pattern I have tried doing the same way. Drawing individual bezier paths with mirror modifiers. However, as the path was extruded into a flatter shape and had to be rotated to try to fit to the model - it just wasn't working out so I abandoned it.

Next I made a cube into a cross section of the design which I applied an array modifier to and a curve modifier to anchor it to the bezier paths. This I've met with a little success with, but it's far from perfect and would take lots of proportional editting to get onto the body and then wouldn't look anywhere as clean as in the picture below.

Thanks in advance for any help and suggestions.

You can model your pattern flat and use Shrinkwrap modifier and then add thickness and bevel to it with other modifiers. As long as you have enough of geometry in your pattern, it will follow the surface of another object:

You can also edit the deformed mesh easily if you enable modifiers for edit mode:


Why I am I unable to mix matrix nodes multiple times with Animation Nodes? I have some nodes setup that make use of the "mix Matrix" node with a specific factor input. It works great. Then I wanted to mix that mixed matrix with another combined matrix, but at that point it wont work anymore. So I guess my question is, is it possible to use multiple mix matrix nodes to mix "mix matrix" nodes? (sorry if it sounds convoluted)

Okay, So, after some testing I realized that the output of a mix matrix node is actually a "result" (mind you im not a programmer) which gets inputed into an "object matrix output" node, so I simply connected an "object matrix input" immediately after the former and began a whole new sequence of Matrix calculations and it seems to work perfectly as I wanted. –


How do I find the closest point on another mesh to a vertex with Python? I know that the closest_point_on_mesh function in BPY can be used to find the closest point on any mesh to an arbitrary point in space.  However, I am working on a project for which I need to take a vertex on a mesh object, and find the closest point on any other mesh object.  Is there a method that can be used to do that?  Thanks.

Using closest point on mesh.

Similarly to the answer here https://blender.stackexchange.com/a/40979/15543 code hacked together to find the closest point on mesh of    all other mesh objects in the scene to vertex[0] of the active mesh object.  Adds an Empty on the hit point.

import bpy
import bmesh
context = bpy.context
scene = context.scene

edit_obj = context.active_object
me = edit_obj.data
mesh_objects = [o for o in scene.objects if o.type == 'MESH']
bm = bmesh.new()
for sphere in mesh_objects:
    if sphere == edit_obj:
        continue
    smwi = sphere.matrix_world.inverted()

    bm.from_mesh(me)
    bm.verts.ensure_lookup_table()
    vert = bm.verts[0]
    v1 = edit_obj.matrix_world * vert.co # global face median
    local_pos = smwi * v1  # face cent in sphere local space

    (hit, loc, norm, face_index) = sphere.closest_point_on_mesh(local_pos)
    if hit:
        v2 = sphere.matrix_world * loc
        bpy.ops.object.empty_add(location=v2)
        print(sphere.name, (v2 - v1).length)
    bm.clear()


Put Node Groups into Premade Categories So I was making node groups the other day, and had a thought...  "Hey, could I put these into one of blender's premade categories?"  I searched far and wide, climbed mountains, ventured across multiple landscapes, but found no answer.  So what I want to do, is put these node groups into the default blender categories, or possibly make my own category.  I do not want to go into "Group" every time.  How can I do this?

The simplest way to do it is using a python script.

First thing to do is to changing your node group name to have a '.' at the start, i.e: myXptoNodeGroup >> .myXptoNodeGroup. This way, the nodegroup will no longer appear in the "Group" menu.
The second thing to do is editing the following script by adding your nodegroup(s) to the items list of the ShaderNodeCategory instead of '.myXptoNodeGroup', and run the script:
import bpy
from nodeitems_utils import register_node_categories, unregister_node_categories, NodeItem
from nodeitems_builtins import ShaderNodeCategory

node_categories = [
    ShaderNodeCategory('SOMENODES', "Some Nodes", items=[
        NodeItem('ShaderNodeGroup', "myXptoNodeGroup", {"node_tree": "bpy.data.node_groups['.myXptoNodeGroup']"} ),
    ]),
]

def register():
    register_node_categories('MYGROUPNODES', node_categories)

def unregister():
    unregister_node_categories('MYGROUPNODES')

if __name__ == "__main__":
    register()

Of course, this is not exclusive to ShaderNodeGroups, it's just a matter to change the corresponding NodeCategory, and the NodeGroup type for the NodeItem.


How to render invisible objects casting their z-depth alongside other visible objects I've been looking for some sort of way of rendering invisible objects as transparent pixels depending if they're in front or back of visible objects in the scene.

For example, I have a clothed character like this:

And my goal is to render every clothing attached to the character independently, this is for making a spritesheet I can use in a 2D game but I have a problem with that and is that when I try to snap a single clothing, some parts that should be hidden by the character body itself are being renderer.

IE: let's say I want to render the character's hair only, when I take the snapshot I get something like this:

As you can see, there is a part of the hair I wouldn't like to be rendered after all, like the part where the character's face should be:

I've been thinking of simple hacks like making some sort of chroma by using a green background and a green texture in the head, so then I can use a tool like Photoshop or Gimp for replacing the green part with transparency, but I'd like to make it in a simple and faster way if possible.

The sprites are going to be produced in a automated way by using a Python script, I also use Cycles as my rendering engine for this purpose.

Thank you...

Using render layers might help you.
I have created these two planes, and put them in seperate layers. The light grey in layer 1, and the blue in layer 2. In the render layer tab settings there is a "mask layer" where I chose layer 2 as a mask layer.

Please note that the shadows of layer 1 still render, you can remove these by unchecking the "shadow" box in the "cycles settings" under the object tab

finished result, a masked grey plane in all its glory

If the blue plane on top is moved below the grey plane. It will not mask the plane.


How can I properly form text from particles? I'm using cycles and particles that form text. I've got every letter separated, and while the particles form the shape, it doesn't properly 'fit' the shape or cover all of the surface of the object, so it doesn't work properly for me.

I've already tried making another particle system on the same object, with more particles, but it looks weird...is there any solution to this?

Thanks in regard, I'll be waiting for a response.

To change the shape of an object using particles, use the physics type Keyed.

Create an emitting object, cube or whatever.
Create a text object, convert it to mesh Alt-C and add another particle system.
Create a controller (e.g. simple plane with a 3rd particle system) and add the previously created particle systems as keys.

Here with a tiny version of the cube used as Dupli Object.
Use a massive number of particles not just a few hundred.

Tutorials

Blender Keyed Particle System Tutorial
Blender 2.68 Tutorial - Various Text Reveals
Blender 2.6 Tutorial - Keyed Particles versus Curve Guides


What is the box that appears around this mesh in edit mode? I am watching a YouTube tutorial on sculpting and I can't seem to figure out how he suddenly created a box around his mesh...

I don't believe it is bounding box because when I searched up how to create bounding boxes, it sounds like multiple steps to do so. All the guy did in the video was change to edit mode, unless he pressed a shortcut key. Can anybody tell me what this guy did to get the box around the mesh for editing?

PS: I'm fairly new to Blender but I know the basics.

Here is the video I was watching:
https://youtu.be/tZnUgt659oI?t=3m5s

What you're seeing is the original mesh - the cube. In the tutorial they add a Subsurf modifier and the cube immediately turns into a low poly sphere. However, the modifier has not been applied to the cube, meaning the original cube geometry still exists, which is what you see when they enter Edit Mode.

This allows you to move the original geometry of the cube and see the Subsurf result update in real-time. The original geometry is called the Edit Cage when there is a Subsurf modifier present.

Here I have added a Subsurf modifier to Blender's 'Monkey' mesh. You can see the original, low-poly cage (the black wires) around the smooth Subsurf geometry (the grey surface):

So, in short, it was simply changing to edit mode that made the box (the original geometry) appear.

You can read more about modifiers, how their results are displayed in the viewport and their visibility options, here.


How to extend curve on another curve I'm trying to get something like this

Now I'm struggling with extending this curly spring on a circle

When I try to use array and curve modifiers it doesn't work the way I want.

For example, if I use fixed count with array modifier it works better, but the problem is that the final mesh is divided into independent parts.

I guess, if I was able to modify(increase its length) this curly spring after its creation it would be much easier to do. Is there a way to do it somehow?

These both object is periodic by themselves.
And if I use "Array" and "Curve" modifiers I get something that is not periodic

Should I manually make it as a whole?

This should work for the latest release of 2.80 beta.

For one thing, your original curve is not periodic--this means that if you try to link them end-to-end, the ends aren't going to match up. I would create a new curly object so that it will connect end-to-end with itself without having to perform additional rotations.

After this is done, make sure that the origins for the curly and and path are centered to geometric means and that their rotations and scale transformations have been applied.

Apply an array modifier to the curly object. choose "Fit Curve" as the "Fit Type:" and select the path object as the "Curve:".

Next apply the curve modifier and select the same path as the curve you are fitting to.

Using the X Axis as the "Deformation Axis:" tends to work best for the curve modifier but experiment with other axes if the curly's aren't arranged end-to-end. Here's something you might not have tried that I needed to do (although probably not since your path is closed): You can move and rotate the curly object to fine-tune its position on the path. I had to do this when I made these balusters follow a path that was curved like the banister:

Turn on "Merge" in the array modifier. Keeping the "Relative Offset:" value at "1.00" should string the curly end-to-end but you can adjust it if you have to. If you are close but the ends don't meet up, convert the whole thing to a mesh under the Object -> Convert To menu and move the vertices manually.

Comment if you have additional problems or questions.

Don't overthink "periodic", we are just talking about a repeating pattern. Here is a piece of the sin(x) wave function that repeats, for example:

Any piece of this function that is this long will repeat end-to-end.

HOW TO CREATE PERIODIC CURVE THE EASY WAY:

1) Create a Path object (Nurbs path or Bezier, doesn't matter, just make sure it is straight). Rotate the object so that it is oriented parallel to the z axis. Offset it from the z axis by 1 unit and move the object's origin to the world origin, as shown:

I decided to scale the path in the z-direction by half (personal choice):

Now add a SimpleDeform modifier. Make sure the option is set to Twist, the axis is set to X and the angle is set to 360 degrees (which is a complete revolution). Now your path is periodic.

Top view:

yet another view:

Now you can give the curve some bevel depth and convert it to a mesh (Object -> Convert To).


I want to make a spiral in a sphere shape that has endpoints which are close together I am attempting to make a spiral in the shape of a sphere that has endpoints closer together than a default sphere. I followed Gorgious' answer to this thread:
How do I make a sphere out of a spiral?
I like the result of this process, but I cannot figure out how to move the endpoints.
I have tried a simple deform modifier, but it warps the model out of the spherical shape.
I am more than willing to provide any additional information if needed.
Any advice you would give would be greatly appreciated.
Blend file as requested:

Destructively: apply all modifiers and scale in one of the object's axes.  (Alt c convert to->mesh is a quick way to apply all modifiers.)
Non-destructively 1: Create an empty at the center of your sphere.  Designate this empty as the "object" for your Cast modifier.  Check "Use transform" on the modifier.  Scale this empty in one of its axes.
Non-destructively 2: create a single bone armature, weight your vertex (lol) to the bone, and use an armature modifier.  While armatures are typically thought of as animation tools, they can easily be used as modelling tools to create non-destructive, arbitrary transformations.  (Animation is just modelling over time, after all.)
Destructive (left) vs non-destructive 2 (right):

In that pic, I've placed the armature modifier above the solidify modifier, which keeps your proportions nicer than the leftmost cube (demoing the destructive option above, although you can be slightly less destructive to achieve the same mesh as on the right.)


How to parent a *bone* to *vertices*? Nope, not vertices to a bone, a bone to vertices. I have an armature already rigged to a mesh, but I want its IK controls to move with specific vertices of another mesh. Is there a way to parent the IK bones to the vertices directly or do I need to use empties?

Combine desired vertices into Vertex Group
Add a Child Of constraint to the bone
Set this Vertex Group as a target in constraint settings


How do i make a brick wall? I'm kinda new to blender and I'm trying to replicate a living room for studying reasons.
https://imgur.com/a/DuowjH8
The wall in question lies in the right side of the room along with some windows and I do have a PBR material that fits my needs.
https://imgur.com/a/h2aSCJE (texture I'm trying to use)
I've tried a bunch of stuff, but none worked the way I thought it would. I tried using modifiers subdivision surface + displace with texture I mentioned above and I created a material along with the provided textures, but the material was too flat for my liking and I was having a really hard time unwrapping the mesh and in the end it became a mess.

The quality of the PBR material that you are using is quite poor if the image you uploaded is what you're using. I would try something along these lines:

These were found on the popular site Poliigon.
You can probably get away with only using the normal maps and displacement.
As far as unwrapping, I'm not sure what you have to unwrap exactly. It's a wall... just unwrap it like you would any other rectangular object and try to hide seams where possible.


Python Scripting: remove animation from mesh/object Somehow? I seen Remove Animation action in action list(space), but was unable to call it on object I need. Console traced Cancelled so I think I did it wrong and called a ui method.

I seen animation_clear() method somewhere not sure if it's related

obj = bpy.data.objects["Cube"]
obj.animation_data_clear()

works fine, it seem to remove animation data, but doesn't update timeline immediately visually.


Skeletal animation for multiple meshes I was wondering how do you make one full body armature, animate it and then apply it to different humanoid character. Currently I am working on several characters that will feature the same movements so I was looking for a way to do one skeletal armature and apply it to different rigs, that way I won't need to do the animations for each character. I've heard about the motion capture files that can be applied to already rigged characters however I was looking for a more personalized way of doing this by myself, if there are add-ons that can help me do that I'll appreciate the information a lot.
P.S. I'm new to do this so please no hate.

Every animation you do will create a - so called - "action" which is a datablock that can be transfered to any other rig. All the bones involved must share exactly the same names.

To understand the thing, try create a simple rig from scratch, parent it with a simple mesh, Shift D duplicate both object and armature and move the new obj-rig away from the original position.

create an animation of the first rig-object;
select the second rig, go to pose mode, open a dope-sheet window, in the header change the drop down menu from "dopesheet" to "action"; change the dropdown menu from "new" (2nd rig has no actions, by now) to the only one you have created.

Now, moving the timeline, both objects move together, as they share the same action and the same bone names.

Note that the action is referred to the local space of the object, so, if the 2 object have different positions, they will move as twins, in their respective position.

The same you can apply with complex models and rigs, if they share the same bone names.


Why are my bones bendy? Rigging I also figured out the reason it didn't work in the first place, I didn't name the bones and vertexes the same name.

I had an issue when my mesh was not moving with my bones, I've managed to fix it but now I have another problem.

Now when my bones bend it kinda looks like that scene from harry potter where the teacher tries to fix harrys broken arm. Actually it's kinda funny because in this situation I'm that teacher.

Is there a solution to this?

I think doing what's described here How do rigs relate to weights? will help.

If you parent the mesh to the bones 'with automatic weights', it should try to correctly weight paint the mesh to the bones fairly well. And if still looks 'weird' on some parts such as 'too sharp' bending, or 'too soft' (like what you're experiencing), then you need to adjust the weight painting a bit.

hope it helps!


animation nodes with follow path object contraint not possible? Is there a restriction with animation nodes and follow path constraints?
I have made a sphere which distance to the single plane controls the angles of the underlying plane grid. Works great. If i move around the sphere the planes turn accordingly.
Now i wanted to animate the sphere by a curve (because i am to lazy to keyframe it) and i added a curve and added the object constraint "follow path" to it. Now i keyframe the offset 0 to 100 at the beginning and the end of my animation.
Unfortunately now animation nodes does not react anymore to the movement of the sphere.
If i move the sphere manually in 3d view it works like a charm.
what am i missing?

Follow path animation can be done inside AN without any constraints.


Sequentially Enable Rigid Body Control I would like to have a number of active RB objects set to animation so that they do not fall until their respective animation check-boxes are key-framed off.  For a few objects, this can be done manually, one-by-one.  My objective is to have perhaps hundreds of such objects with their respective key-frames corresponding to certain actions in the scene.  For example, as an animated object gets close to one of the RBs, the RB's animation check-box gets keyed off and the object falls.

Can a driver be used but reacting based on distance from the RB instead of some rectangular coordinate.

Any ideas would be appreciated.

You can use Deactivation for this instead. Make the rigid body objects that you want to enable sequentially Active with Deactivation and Start deactivated enabled:

The rigid bodies will then start stationary, and only activate if another rigid body comes close to them. Even an animated rigid body can activate them:


Find meshes recursive I have a root element with some objects that could be a variable level of depth, but it mostly just goes 2-3 levels deep.
I am trying to get all the meshes within the root object but doesn't seem to be able to reach them?
I also admit I am not good at this recursive thing.
structure:

function:
def findMeshObjectsRecursive(searchObject, levels=10, meshList=None):
    def recurse(searchObject, parent, depth, meshList):
        if(meshList == None):
            meshList = []
        if(searchObject.type == 'MESH'):
            return searchObject
        if depth > levels:
            print('return list 1')
            return meshList
        print("  " * depth, searchObject.name)

        for child in searchObject.children:
            meshList.append(recurse(child, searchObject,  depth + 1, meshList))
        return meshList

    try: return recurse(searchObject, searchObject.parent, 0, meshList)
    except Exception:
        traceback.print_exc()
        return meshList

output
 mrotxhi_1
 EMPTY
 shaftxhi_1
 EMPTY
 trotxhi_1
 EMPTY

I would expect it to print more objects, because later in the code I add blend modes and transparencies to these objects but it is not working now because it cannot find any MESH type objects... I previously tested this with a different structure that did work.

More Python thing than Blender's one, but you can:
import bpy

def find_meshes_recursive( root, levels=10, meshes=None ):
    # Initialize the result once
    if meshes is None:
        meshes = []

    def recurse( parent, result, level, levels ):
        # Does nothing if level is reached
        if level < levels:
            # Keeps meshes
            if parent.type == 'MESH':
                result.append(parent)
            # Look over children at next level
            for child in parent.children:
                recurse( child, result, level + 1, levels )

    recurse( root, meshes, 0, levels )
    return meshes

root = bpy.context.object

meshes = find_meshes_recursive(root, levels = 10)
print(meshes)

Note that you can also do it in non recursive way:
def find_meshes(root, levels=10, meshes=None):
    meshes = [] if meshes is None else meshes

    parents = [root]
    while levels > 0 and parents:
        meshes.extend([obj for obj in parents if obj.type == 'MESH'])
        parents = [child for obj in parents for child in obj.children]
        levels -= 1

    return meshes


Rendering a cube as png file using Blender's Python API I am new to Blender. I create a cube and want to render it. Since, we are later going to do this for large number of shapes, we are working with Blender's Python API. I want to save this rendering as a png.

I have the following code:

image = bpy.ops.mesh.primitive_cube_add(radius=1, location = (0,0,0))
image.save_render("/Users/tarun/Work/check.png")

But it gives an error :

  AttributeError: 'set' object has no attribute 'save_render'

Although when I do only bpy.ops.mesh.primitive_cube_add(radius=1, location = (0,0,0)), it shows the cube in the scene.

How can I create and save a shape like cube from the Python console in Blender?

Please invest time into researching about the Blender API and Python interface, before asking questions!

image = bpy.ops.mesh.primitive_cube_add(radius=1, location = (0,0,0))

This line does not make any sense at all. primitive_cube_add is an operation, which returns a status set. In this case it returns {FINISHED}. {FINISHED} is most definitely not a python object with a  save_render method.

To tackle the problem requires several steps.

Avoid using ops.
Create the cube.
Avoid using ops.
Create a camera, only cameras can render images.
Avoid using ops.
Create a light, otherwise your unlit cube is going to be black.
Render an image (this can only by done with bpy.ops).

First import the necessary modules. Store the current scene inside a variable, that way we can access it later on.

import bpy
import mathutils

scene = bpy.context.scene

A method for creating the cube is found here. I have blatantly copied it. We will have to import the bmesh module.

# Create the cube
mesh = bpy.data.meshes.new('cube')
ob = bpy.data.objects.new('cube', mesh)

scene.objects.link(ob)

import bmesh
bm = bmesh.new()
bmesh.ops.create_cube(bm, size=1.0)
bm.to_mesh(mesh)
bm.free()

Creating the light need a lamp data-block and an object block as well. light.location changes the position of the lamp object. If it is at (0, 0, 0), it will not affect the result, because it will be stuck inside the cube.

# Create a light
light_data = bpy.data.lamps.new('light', type='POINT')
light = bpy.data.objects.new('light', light_data)
scene.objects.link(light)
light.location = mathutils.Vector((3, -4.2, 5))

The camera has to be repositioned and reoriented.

# Create the camera
cam_data = bpy.data.cameras.new('camera')
cam = bpy.data.objects.new('camera', cam_data)
scene.objects.link(cam)
scene.camera = cam

cam.location = mathutils.Vector((6, -3, 5))
cam.rotation_euler = mathutils.Euler((0.9, 0.0, 1.1))

Set the render settings of the current scene, and render it. write_still is necessary if you want the result to be written to the filepath. There will be no visual feedback during the render process.

# render settings
scene.render.image_settings.file_format = 'PNG'
scene.render.filepath = "F:/image.png"
bpy.ops.render.render(write_still = 1)

I'd post a result image, but it's just the default cube.


Blender crashes when selecting object and I can't leave object mode Alright, so I have no clue what's going on here... The project was perfectly fine, I saved, closed Blender, reopened the project in Blender, and now I'm having all these problems with it. The file is important to my problem because I'm not having this problem with any other objects I make, in either the same file or a different one.

So here's a link to the file:

.

And here's a screenshot:

So the first problem is, if I right click on the anvil to select it (or left click in my case, because I switched the left and right click assignments), Blender crashes. I've tried running Blender from the command line and when it closes out after trying to select the anvil it says: error: EXCEPTION_ACCESS_VIOLATION.

The second weird thing is that I can't leave Object Mode. If I make another object and select it I can enter Edit Mode just fine, which is normal, but if I press a when looking at the anvil in Object Mode, it gets this orange outline around it, instead of the usual yellow, and I still can't leave Object Mode, and Blender is acting as if the object isn't selected because I can't edit it in the right hand pane by clicking on the Object section because it isn't there and if I click on the menu on the bottom to try to leave Object Mode, it doesn't give me any other choices and pressing tab does nothing. If I press n I get shown grease pencil stuff rather than the usual object properties when something is selected.

Hopefully someone knows what's going on here.

Some other info:

There's a half made anvil on the last layer that I can select/edit just fine
The main (finished) anvil has a subsurf modifier on it with a very high tri/quad count
The main anvil has a mirror modifier on it
I know the screenshot shows I have two layers selected, I've deselected the second layer and it does nothing
I'm on Windows 7 with an Intel CPU and no GPU :(

If there's anything else I can add to help anyone figure out what's going on, please let me know.

Reduce the number of subdivisions in your anvil subsurf modifier.

It has 6 subdivision iterations giving it an impossibly high poly count.
Not only is that unnecessary, it will give poor performance, consume large amount of RAM, and as you experienced already, possibly cause crashes on lower end machines.