Is it possible to add spring/jiggle physics to a rigify metarig? As the title says. I have found plenty of addons to do spring physics for bones.
But all the ones I tried rely on custom properties that wouldn't carry over through the rig generation, and I could add those properties to the generated rig, but it being a much more complicated one and losing the ability to re-generate the rig if I want to add more things to it afterwards is a drawback.

Didn't actually find an answer to my own question but did find a workaround, so I am posting in case it shows in search results.
Basically, while applying the addons to the bones in the metarig don't work as far as I see, you can apply it to the drivers in the generated rig and those do survive a regeneration of the rig.
I found that works best to apply it on rig types for single bones (like basic.super_copy or basic.raw_copy) or bone chains controlled in a FK fashion (like basic.copy_chain)


Cannot scale or rotate objects I choose the scale or rotate option that's on top of the render timeline, but every time I left click, the red circle with the 4 black lines sticking out (3D cursor) is selected, and not the scaling or rotating options. Is there any way I can fix this?

EDIT: I have posted this on blender as a bug. Can someone who has enough reputation close this question as not constructive (ie this question is something that needs to be discussed not answered)? Thank you for all your help.

EDIT 2: This is my computer specific, please check my solution below.

This is my computer's OpenGL issue, according to people at blender's bug support.
Downloading this file and putting it at the same folder where blender.exe is will fix the issue.


View Last Frame Outline While On Current Is there a way in blender to view the last frame as an outline while on the current in adobe flash it's called onion skin this is useful so we can animate better and know where the last frame was instead of going back and fourth

When animating an armature you can use the ghost feature in the armature tab. The range value determines how many frames it will show at once.

And the result:

Update:

New result with your .blend:


How to get rid of corners rounding on blender? I'm a beginner with blender and not sure why my corners are rounding off? I would like them to create a square face, I've added reference images below. Thanks in advance :)

The shape has a subdivision surface modifier.
A possible way to obtain sharp corners is to change the way this modifier uses the edges with "edge crease", ShiftE.

Go in edge select mode
Select the surrounding edges
And use edge crease


Camera projection without generating UV's? I'd like to project an image sequence onto arbitrary geometry without touching its UV's. I already tried the UV project modifier as well as a lamp as projector. Using the Mapping node within the shader plugged into Camera/Object is working somehow but I have problems getting an accurate result.

Q: Is there any way to properly project/map an image without generating UV's? OSL?

The answer to Projecting Texture onto surface from point produced a material that would project an image from an arbitraty point in the scene through a second point and onto the surface. The same principle can be used to project from the camera by simply constraining the 'origin' point in that example to the location of the camera by way of a Copy Location constraint.

This can produce the following result :

The bottom-right window shows the setup of the scene with Empty representing the 'source' of the projection - constrained to the origin of the camera. Empty.001 is the location of the centre of the 'image plane' to be projected.

The top-right shows the view from the camera - with the projected image showing no distortion (and edges highlighted using Freestyle), while the left-hand windows show the scene from other viewpoints so you can visualise the projection.

Blend file included

EDIT

You can use the following script to automatically position the empty (Empty.001) used to position the projection image plane centred onto the plane of the camera, taking into account the focal length and sensor size. The empty is also scaled based on the aspect ratio of the render image dimensions.

import bpy
import mathutils

def setup_empty(cam, obj, obj2):

    camobj = bpy.data.objects[cam]
    camera = bpy.data.cameras[cam]
    object = bpy.data.objects[obj]
    object2 = bpy.data.objects[obj2]

    render_width = bpy.context.scene.render.resolution_x
    render_height = bpy.context.scene.render.resolution_y

    if render_width > render_height:
        camera_size = camera.sensor_width
        camera_horiz_scale = 1.0
        camera_vert_scale = render_height / render_width
    else:
        camera_size = camera.sensor_width
        camera_vert_scale = 1.0
        camera_horiz_scale = render_width / render_height

    object.matrix_world = camobj.matrix_world * mathutils.Matrix.Translation((0,0,-camera.lens/camera_size))
    object2.matrix_world = camobj.matrix_world * mathutils.Matrix.Translation((0,1,0))

    object.scale = (camera_horiz_scale, camera_vert_scale, 1.0)

setup_empty('Camera', 'Empty.001', 'Empty.002')

The last line of the script calls the function (setup_empty), passing the names of the Camera, the object to use for the centre of the projection and the object to use to indicate the orientation of the projection. The script will move the two objects into suitable positions around the camera - you can then Parent them to the camera to keep them in place as the camera moves and rotates.

Note that the actual camera dimensions are too complicated to include in the above calculations (I don't know enough about the intricacies of the camera or how to interpret those details in Python) - there are many factors that are included (such as Aspect Ratio, Shift, etc.) - but this script should cope with most 'standard' setups. See also Is there a way to get the dimensions of the camera?

Note also that if you change any significant camera properties (such as Focal Length or Sensor Size) you'll need to re-run the script.

A minor change to the material will allow the scale to affect the image texture by way of two drivers :

The Combine XYZ node takes the X and Y scale of the empty and scales the vector (via the Divide node) to adjust the aspect ratio of the image to match the camera. The X and Y values are populated via drivers to simply capture the X and Y scale properties of Empty.001.

In addition, the other empty (Empty.002) is used to determine the orientation of the camera plane - this is important to correctly orientate the plane of the image so as to align it precisely to the camera. Again, this is fed into the material via a Combine XYZ node and associated drivers for the XYZ coordinates - to calculate the vector from the camera to Empty.002 :

Amended Blend file included

Assuming you've parented the empty to the camera, moving/rotating the camera should automatically update the projection into the scene.

Taking this a little bit further, you can filter out the 'backfacing' faces (those that are facing away from the camera) by combining the vector from the camera to the surface (we already calculate this) with the surface Normal using the Dot Product. The Dot Product will produce a positive output if the two rays are in the same direction and a negative output if the two vectors are in the opposite direction. Adding the following (selected) nodes will therefore mute the emission for those faces that are facing away from the camera :

This produces the following result :

Note : This is not a raytracing solution and therefore objects will not cast 'shadows' in the projection - neither cast onto other meshes or cast onto themselves. Also, meshes must be manifold with correct orientation of surface normals.

In order to obscure the projection we need to be able to trace rays back to the camera from the surface point - just like a shadow ray. Normal nodes are not capable of doing this but OSL can (but using OSL means your shader will be CPU only (no GPU rendering). For this you'll need to enable Open Shader Language in the render settings, then paste the following into a Text Editor block :

shader probe(
    vector Point = P,
    vector Direction = N,
    output float HitDistance = 99999999.99
    )
{
    if (trace(Point, normalize(Direction)))
    {
        getmessage("trace", "hitdist", HitDistance);
    }
}

Name it something like 'probe.osl' and you can now add a Script node to your shader and select your new 'probe.osl' text block. If all goes well, Blender will compile your OSL and give you a new node that can be used to probe out surrounding geometry as follows :

The vector from the camera to the surface point is first negated using the Subtract RGB node (so it points the correct direction) and is also passed into a Dot Product node followed by a Power(0.5) node to determine its length (the distance from the point to the camera). The Script node executes the OSL to trace a ray from the point towards the camera, returning the distance to the nearest surface along that ray. If the 'hit distance' is greater than the distance to the camera then there is nothing obscuring that ray, otherwise it is blocked by intervening geometry - this is used to control the emission of the projected image to create the 'shadow'.

Here's the result - note how the objects now project shadows into the projection :

Blend file included


Project Video onto Sphere in Video Editor I have a specific request where I want to project a video onto a sphere, or simply put: warp a video so that it seems like the camera is inside a sphere.

The goal is to emulate a VR experience for a concept video, where I want the actions (menus and interactions and such) to be "sphere-projected"/warped and overlayed on to the camera where the actor interacts accordingly.

Here is an example of what I mean with spherical projection:

Can this be  done with some sort of simple effect and inside of Blender so everything stays in one piece ?

In this example I have created a simple UV sphere in 3D and subdivided it a lot to make it smooth.
Then I used the addon "Import Images As Planes" to make a plane with the picture. I rotated that 90 degrees to vertical then oriented and placed it at the surface of the sphere.
I apply 2 modifiers of "simple" subdivision set to 3. This will make the plane smooth when it deforms to the sphere. Then I applied the Shrinkwrap modifier set target object to sphere.

I created an Empty object at the centre of the sphere to do the rotation work, then I parent the plane to it (remember to select the parent object last then press CTRL+P). To move the image plane simply rotate and keyframe the Empty object. In the scene properties make sure that it is set to Transparent.

In the VSE I add the prerecorded video of the actor or scene, then I add a "Scene Strip" on top. I set the strip to Alpha over and change the blend amount to approximately 0.5.

If you want the wrapped plane to go behind the actor you will have to shoot them on green screen and key them via the compositor or use a mask to draw around them and hold out the 3D imagery.


How can I remove dark area in a render? When rendering (blender render, version 2.76) a fire animation, it leaves a dark field/area in the rendered picture. The size of the field seems to depend on the size of the domain around the animation.

Does anyone know how to remove this, as it kind of spoils the final result?

The blend.file can be downloaded via below link:
http://www.mediafire.com/download/1kgzxbti2b7y0g1/World+ANI22.blend

You can uncheck "Receive" in the Shadow Section for the material of the earth.

Alternatively for the fire, you could uncheck the 'Cast' checkbox.
Whatever works for your situation.


How can I add multiple points on a circle without changing its shape? I have created a circular curve and I'd like to add two points to it.

I know I can select two points and then hit subdivide to get a new point in between these two points, but that is not a very efficient way to create extra points as it will change the shape of the circle. I then have to move them to position, which requires quite a bit of work of adjusting all the handles and move the point itself.
Is there a way to create the desired point by clicking on the circle so it won't change the shape of the circle?

I have tried installing the Curve Tools add-on as suggested, but I still can't find a way to make it work for this purpose.

Set the handle type to Aligned
I should have read the question better, re subdividing, to have a new point remain on the circle to change the handle type.

After adding the Bézier circle, select all in edit mode and Control Points → Set Handle Type → Aligned (Or only the two handles being sub'd.) The default Bézier curve has handle type 'AUTO' (look for a link to the handle type.)
After which the result of subdividing produces handles on the tangent.

The active object is the default Bézier circle section subdivide, over the result above.
For a circle, after adding a point as above, can then "point slide" it in its two original handle quadrants by rotating about the circle center pivot point and adjust the handle points to make a sine, cosine ratio.
The left-to-right handle length will be constant. The alignment after rotate will be correct. To keep as a circle is a matter of sliding handles. For example, it would be all horizontal right handle if rotated back to the top, and all vertical left handle clockwise to right original point...
It is somewhat reminiscent of the position in a slot of
How to do Trammel Of Archimedes Animation?
About to add the handle fix to How to rotate bezier control point (viewport not updating) ...
However, for the answer to the question marked as a dupe has gone above and beyond - What is the fastest way to add vertices to a curve at a specific point?


Wood Splitting By hitting object How can i animate a wood splitting into 2 parts? Just like by hitting some axes.
I tried rigging and also Boolean modifier ,but it did work as i want.In rendering ,It show that they already are separate objects.

I didn't try that, but I think you can use use a complete version of the wood object and when the axe hit it, hide it (by a keyframe) and show that splitted one.


Why might I not be able to activate my drawing canvas grid guide? As you can see in my screenshot below -- my overlay "canvas Grid" is greyed out, despite being check-able. I'm new to Blender and still getting my bearings, so forgive the dumb question here! Thanks!

It looks like Grid is the grid that is displayed when you are both in orthographic AND perpendicular view, it allows you to view the units when in ortho front view, ortho right view, etc... it always displays a grid perpendicular to your view, whereas Floor is the floor, it's only an horizontal plane, and it is seen whatever is your view, orthographic or not, but it's still an horizontal plane.

In your case the option is grayed because you are not in orthographic AND perpendicular view. It will appear when you'll be in both.


How to add node in the center of the Shader Editor with python? I would like to create a node, and center it in the node_tree view that is the "Shader Editor".
Keeping in mind that this operator is only executed by a button in the context of the Shader Editor, so the context is correct.
I was wondering if it was possible to obtain the coordinates of the view, and find the center of it, to assign the coordinates to the new node created, so that it is placed exactly in the center of the view.
Below is an example of an operator creating a simple node, waiting to be positioned in the center of the Shader Editor view. (If possible)
I'd like to understand how you can get the position of the view, or something useful to position it correctly.
Simple test Creation of a node by operator:
class ADDNODE_OT_Test(bpy.types.operator):
    bl_idname = "node.test"
    bl_label = "Test"

    def execute(self,context):
        mat = bpy.data.materials["My_Material"]
        nodes = mat.node_tree.nodes
        bsdf = nodes.new(type='ShaderNodeBsdfPrincipled')
        #bsdf.location = (?,?) <--- Is possible to get and set the center of the view location into the Shader editor?
        return{'FINISHED'}

Feed it into the transform operator.
Rather than place the node into the editor at the location of view centre, suggest: make active and  feed the created (and / or other selected) nodes into the transform operator.
If you add say 3 nodes in your operator could make them relative to each other and let the user place them.
The script in the answer https://blender.stackexchange.com/a/197449/15543 creates a menu to add any of the math nodes from an expanding menu.  Use commented return instead

class AddMathNode(Operator):
    ''' Add Math Node '''
    bl_idname = "node.add_math"
    bl_label = "Add Math Node"
    items = [
        (p.identifier, p.name, p.description)
        for p in ShaderNodeMath.bl_rna.properties["operation"].enum_items
            ]
    #print(items)
    operation : EnumProperty(
        items=items,
        name="Operation",
        default='ADD',
        )

    def execute(self, context):
        # the material in the node editor
        mat = context.material
        # add a new math node to its nodes
        n = mat.node_tree.nodes.new("ShaderNodeMath")
        # set some properties
        n.operation = self.operation
        n.name = self.operation.lower().title()
        # make active
        mat.node_tree.nodes.active = n

        return bpy.ops.transform.translate('INVOKE_DEFAULT') # use translate

Putting in 2d region centre.
Most spaces in blender have a 2d region which is the window we look into. The tool panels, headers and other parts making up the area. Others like the 3d view have a 3d region.
If need be will supplement answer with how to place node right in the middle, but alas think that having the option to move and drop where I want feels more consistent with default behaviour.


Advanced navigation mesh? Hey if an enemy AI is following you on a nav mesh, he will stop if you get off of it. How could I make the nav mesh be everywhere, and where the AI could keep running even if I get off.

I assume you're needing to handle when the player goes off-mesh for something like... elevated platforms or other unreachable areas.

The key is notifying the AI when the player is no longer on the navigation mesh.  Here's one way to go about it:

Duplicate the nav mesh
Set the physics type to static, ghost, invisible, and give it a unique property
Put a downward ray sensor on the player that sends an onmesh/offmesh message to the AI
Have the AI switch states from path following to [insert desired behavior] depending on the message.

Here's an example where the AI runs straight at the player when you leave the navigation mesh.

The main problem with this method is that your AI could get stuck if the player goes offmesh without having line of sight.

For better results, I imagine you will need a very case-specific Python script that manipulates navmesh.findPath
http://www.blender.org/api/blender_python_api_2_72_1/bge.types.KX_NavMeshObject.html


Principled BSDF + Substance Painter: change metallic colour So i've been fooling around with Substance Painter and Blender. My idea was to make this old fashioned or classic teacup and try to create the material in Substance. I do not have any experience with Substance, just fooling around.
Attached the cup and my question is: how can i change the metallic edge to a gold tone? I've searched all over the web but did not find any satisfying results.
In Substance i get the nice gold tone that i'm looking for, after export i end up with some kind of mask (it's grey-toned actually). So i would like to get the result from Substance into my Blender file for render.
I hope someone overhere can help me.
- Image cup in Blender with materials: https://imgur.com/h0DUaKh
- Substance material: https://imgur.com/MD3z2dh

It works fine for me when I export textures with these settings.

The main difference between the textures I exported and those you provided is the base_color.

In the textures you shared

When I exported


How do you convert Weight paint to new mesh layer in blender? I used weight painting tool to select specific area of an dental model object and I want to convert that selection to new separate mesh layer, is there any way to do so in blender 2.8?

Please advise.

I'm not exactly sure what you are after, but if you want to get a new, separate mesh of the teeth weight painted red, there's a simple way to do it.

In edit mode, you could Circle select (press C, mouse wheel changes brush size) and then "paint" the faces you want to select.

Then Shift-D to duplicate the selection.  Then, P will Separate the selection into a new object.

Hope that helps.


Model does not move with bones after auto weights are applied So I followed an animation rigging video on YouTube but how come my mesh doesn’t move with the bones? I’m in pose mode and nothing happens to the mesh but only the bones were moving... been stuck for this problem for days. Need serious help.

Bones don't know how to deform the mesh until you give them instructions on how to, basically. This is done by parenting the mesh object to the armature. Select the mesh object, then the rig, and use the hotkey ctrl + P to bring up the parenting types. You should choose "with automatic wieghts". By doing this, blender calculates distances from bones to vertices of the mesh, and pretty accurately decides which bones will move which parts of the mesh. Keep in mind, you may have to paint some wieghts manually if the mesh deforms in an undesired way.

Anyway, once you've parented the mesh to the armature, you can select the armature, go into pose mode, and move the bones, which should move character as well.

If you'd like to see another good video about all these things, give this a look: https://youtu.be/mhQY2_gVoVg


How can one be sure that 2 objects are exactly at the same base height level in blender? How can I be sure that the two objects below have their respective bases at the exact height from the green (y) line or one another in blender?

In the upper right corner of the 3D viewport click Options then Transform only Origins.

Enable snapping and in the adjacent menu pick Face.

Rotate to a view on the underside of each object, select them in turn and [G]rab the origin and move it anywhere to a bottom face where it will rest because of the snapping.

Select the Item tab on the right side of the 3D viewport and change the Z Location for each object to zero. You do not need to deselect the Origins transform from the first step for this procedure as the Item values do not change the position of the origin in relation to the object, but rather the object as a whole including the origin, and this location points to the object origin.


Uv map vertex = mesh vertex My game engine ask me to create some specific Uv map.
I need to have the same number of vertex in the mesh and in the Uv map.

Creating seams and unwraping always create double in the Uv map.
To fix this, i have to select my seams, mark the seams, split the edges then unwrap.
This way, i create double in the mesh as well and it's working for my game engine.
But, when i use an object found on the web and i want to keep it's original Uv map, i have to work hard to find the seams and split the edge.

Question is, is there a way to delete the double edge in the Uvmap.
The final result might look bad in blender, but will look perfect in my game.

Thanks

You can merge the selected vertices by pressing W and selecting Weld or Remove Doubles


How to get hip/buttocks armature to bend correctly When my model bends forward and squats down, its buttocks disappears. I'm wondering how I can get the buttocks to look more like the red line in the attached picture.

I've tried weight painting, but at best I can get the buttocks to be flat, not curved like the red line.

Any help is highly appreciated. Thank you.

You need extra bones to controll the inner part of the gluteus, the lower part of the butt and the buns. All of those extra bones are child of the leg. Then you can further deform the butt according to the rotation of the leg. Most principal you need to have distributed weights between all 4 new buttock bones.


Shader changes behavior near mesh edge Is there a way to have a shader behave differently near a mesh edge?
For example, if a shader generates a checkered pattern, is it possible to detect the edge and make the squares that intersect the edge transparent?

Some clarifications:

The solution can be for a single face. In other words if the edge can be detected on a signle face.
The solution should work even if the face is not a simple shape like a circle, square, or triangle.

I'm not at my pc at the moment, so I can't test it, but I can point you in the right direction, I would use a colorramp-node and mask out the dark squares so they are transparent, then use the geometry-node (docs.blender.org/manual/en/latest/render/shader_nodes/input/…) to create a mask for the position, use another colorramp to set the threshold, and then blend between the original and the transparent texture using a mix-node and the factor comes prom the mask. I hope that helps and I'm sorry that I can just be theoretical at the moment. All the best – Marco Vitale


Simple code to modify material of an object I got a simple piece of code here which I want to change the current material of an object to a pre-made material I have named "Light"

"
ob1 = bpy.data.objects.get("curtains12")

mat = bpy.data.materials.get("Light")

ob1.data.materials.append(mat)
"

The code doesn't work /: For now I simply want to change the material of the object 'curtains12' (A plane with its own material already) to the material I have named "Light". Can anyone help me?
Note: I intend on this happening with the click of a button, which I will implement later

Thanks for anything!

You can:

import bpy

#Get the object
obj = bpy.data.objects['Cube']
#Get the material
mat = bpy.data.materials['Material']

#Check all is ok
if obj and mat:

    #If a material is already assigned (material slots is not empty)
    if obj.material_slots:
        #Assign the material to the first slot
        obj.material_slots[0].material = mat
    #If no material is assigned
    else:
        #Create a new material (link/slot) for the object
        obj.data.materials.append(mat)

Explanations:

Materials are stored at two levels: object and data

'data' contains an array of materials (obj.data.materials) that allows to link the material to the object's data.

'obj' contains an array of material slots (obj.material_slots) that contains slots which give a link to the material itself (obj.material_slots[0].material) and other properties (name and link). This material is not necessarily the same as the corresponding obj.data.material (see 'link property' below).

These two lists are internally maintained coherently.

The 'link' property of the material's slot can be either 'OBJECT' or 'DATA'.
That corresponds to this is the UI:

This distinction is useful when you 'duplicate linked' AltD an object. In this case:

If the link is 'OBJECT': each duplicate can have its own material in the material slot
If the link is 'DATA': all duplicates will share the same material

So, if we come back to the code:

#If a material is already assigned (material slots is not empty)
if obj.material_slots:
    #Assign the material to the first slot
    obj.material_slots[0].material = mat

In the first case above, using a previously created slot will assign the material coherently to the link property.

#If no material is assigned
else:
    #Create a new material (link/slot) for the object
    obj.data.materials.append(mat)

In this second case, we assign a new material which will correspond to a new slot and a default 'DATA' link mode.


Arrange UV maps of multiple objects without joining them I am trying to arrange multiple pieces of an outfit to fit onto the same texture. Some of these outfit pieces are already unwrapped before being imported to Blender, and so cannot be re-unwrapped as they have no seams. Some pieces have mesh caches on them, so they cannot be joined into other objects without destroying their vertex indices, and thus breaking their caches. Other objects are being unwrapped for the first time in Blender.

In order to properly arrange and optimize my UV islands, I need to be able to view all of these object's UV maps at the same time. I could export all their UV maps as images, arrange them in photoshop, then re-import that and align their UV maps to the image, but this is imprecise and inefficient.

My googling has turned up that the usual method is to join objects together, but I can't do that. Is there any other way I can work on multiple object's UV maps in blender at the same time?

There is a tool that will allow you to visualize the islands from other objects that are still separate.  To use it, select all the objects and enter Edit mode for the primary selection that you are currently working with and check View->Draw Other Objects.  Now all UV Islands for the secondary selections should be visible with a faint outline in the UV Image Editor.

If you would like seams for objects that are already unwrapped: Enter edit mode for the object and select everything; there is a tool available UVs->Seams From Islands that will add seams to all the islands.


I want to put text inside of rock and have an object drop on it and make the rock crumble leaving only the text I'm using Blender 2.76 and I have the text inside of a rock textured cube but I want to make a bottle come down crash on it to crumble the rock so that the text is now visible. I did the wood chipper text tutorial so I have a basic grasp of how to do the text within a cube and perform the particles and physics just not sure how I could replicate the bottle smashing down and have it break open and crumble down leaving the bottle resting on the text.

If I understand what you are wanting to achieve correctly, this can be accomplished using rigid body physics. First you need to have an object suitable to crumble, or shatter, the cell fracture addon works well here.
If you do not have it enabled, then go to user preferences and enable it.

Fracture your object, then add rigid body physics to one cell first. In the (tool panel under physics>add active) Next, go to the physics tab, and select enable deactivation and start deactivated.

It also may be useful to adjust the friction settings here as well. Then B to border select all the fractures and click copy from active in the tool panel.

Now, select your text and add physics to it. This time click add passive.

Lastly, select your bottle and add it's physics which will be active. In the physics tab, select animated.

Now you can hide the rock object for now, keyframe the bottle's location at frame one, and it's final location upon resting on the text. When you are done setting your keyframes, unhide everything, and that's it!

I just used a cube and Suzanne for my example, but you will be to achieve these results and more after following these steps.


Clean sphere separation with a sphere created from a cube I would like to achieve a clean sphere separation with a sphere created from a cube.

Actually i got some kind of hatched egg effect, but that's not what i need

I was able to achieve that from an UV sphere, but i don't like the pinching effect at the pole :
When textured, i need the sphere to react with lighting effect the same way everywhere. The sphere  will be spinning in a webgl application, and the pinching effect at the pole will be visible.

Is there a way to do it?

I guess i need to add vertices to permit this separation. I tried to play a bit with the knife tool but without success so far.

As Martin Z says, you don't say enough about your problem, also, what problem did you meet with the knife? To cut with the knife, press K for activate, then Z to cut through, then C to cut orthogonally

But if we keep your request, it looks like if you select an edge loop (alt right click), then scale it to 0 on the Z axis with S Z 0, then W > LoopTools > Circle, it works fine. Don't forget to activate the LoopTools addon in the Preferences.

And to separate a mesh in two parts, select the edge loop and press V.


Link current frame between scenes I am new to blender scripting. so, If I have two scenes open, one being the master scene with VSE only, and other scene with animation. Is there a way to link their play-heads so that if I move current frame on VSE, it moves on animation scene as well ?

This important for in-context changes during animation, when multiple scenes are composited. I have been trying to replicate functionality of After Effects in Blender.

Or is there a better way to do this?

Was given the solution by @batFINGER, in another post.

add driver to Scene.current_frame?

by using app handlers.


How do I add more than 8 channels to the VSE? I am struggling with the audio track (it refused to save the fade in markers I’d placed). I muted the first because I wanted to use it as a guide for the new one, but didn’t realize one a transition was in Channel 6 (original audio in Channel 7, the top most I can see). It never appeared, so I moved stuff around and made room for the new audio in 6. When I pressed playback I could hear two audio tracks playing, slightly off synch. I deleted all audio tracks, but the audio still plays (out of place from where it needs to be).

I’ve spent hours watching videos, and scanning tutorials and the help guide, but can’t find anything to tell me how to view the rest of the 32 channels where I think the errant audio strip is hiding.

The VSE can have a lot more than 32 strips. You will find a scroll bar to the left of the VSE that you can use to scroll up/down through the list of strips.

Use  MMB to pan around the VSE.

Use ⎈ Ctrl MMB to scale the vse display, so that strips may be smaller/larger so that more strips can be visible at the same time.

This same control works the same in most editors.


Affect explode modifier with force field I'm trying to explode an object gradually with the explode modifier. I used the "quick explode" to get the initial setup. Then I turned particle physics off so that the the pieces stay in place. My plan was to now create a force field object and use it to gradually move the particles away from their initial position. I can't seem to get a force field to effect the particles in any way though.

Is this because I turned physics off? Am I approaching this wrong? How could I make the explode modifier explode my object in a gradual and controllable manner, for example from top to bottom?

The explode modifier uses the particle system to guide the shards. To have the shards remain in place, set everything under Velocity and the Gravity influence under Field Weights in the particle system to zero.

Now the particles won't fall due to gravity, and they will have no initial velocity, but they can still be affected by other force fields.


Texture stretching at edge even though UV map says it's fine Why is this happening and how do I fix it? I'm still new and following this anvil tutorial but the texture is stretching  over one edge and also sort of looks like I've put a seam where I haven't. It's fine on the other side and both sides are clean blue in the UV map on the right where the edge is selected

Bad side

Good side

The distortion in your unwrap may be caused by:

modifier options: some modifiers (e.g. solidify) can add som distortion to your unwrap
geometry errors: for example duplicated vertices or overlapping faces
uvs are not relaxed enough

So, first of all check your geometry. If your model is perfect, then you have two options:

unwrap again the faces which have the distortion
pin the borders of your shells and update the uv coordinates (a pinned vertex will keep it's position also if you try to unwrap the entire model)

I would suggest to apply the last option, and to do that:

in UV/Image Editor select the border edges of your shells and press P to pin these vertices (now are red colored)

select all the shells (with A for example) and then press E, so you will update the uv coordinates for all vertices except the pinned ones


Heel bone twists strangely under rotation, need to resolve in order to progress I have about 13 animations already made for an armature and now I am getting a very alarming, unexpected result that I need help identifying the cause of and fixing: When I try to rotate the entire model 90 degrees in pose mode, all of the bones rotate together EXCEPT the feet, which rotate in a weird position. Trying to manually correct the feet by rotating the IK bones doesn't rotate the foot bones in the plane of rotation. Instead they twist.

You can see me here trying to turn the foot in a plane parallel to the ground plane (that is, about global z-axis) so that it stays flush with the ground. This is the result:

Here I am showing how misaligned the feet bones are under rotation:

Now, that first foot bone is technically a child of the lower leg, not the IK bones I use to position the feet. But that caused no problems for Sebastian Lague, whose tutorial I followed to rig this guy a couple of months ago:

https://youtu.be/jp_SqjB0468?t=893

My pole targets seem to have no effect on the feet, whereas they do in the video. The feet also rotate in the plane in the video, but not in my project.

Can somebody please help me identify what is causing this problem? I have been fiddling with parenting and constraints for this all day with no success (YES, ALL DAY--like, I woke up working on it, worked on it at Starbucks, and hit nothing but walls until dinner). Every fix I have tried has not resolved the problem, and every other constraint change has ripple effects in existing animations that I will need to correct manually. I am willing to do this.

Here is my file:

It has to do with the Copy Rotation constraint you've given to your feet, if you rotate your IK controller on the Z axis, the foot will go up,  because it's rotating on its Z axis... I don't know if you can fix it with this constraint, but anyway you could simply delete this constraint and parent the feet to the controllers.


Exporting camera crane alembic I'm using blender's crane camera rig to get a shot however I need to export the camera to an external program but because the camera is being controlled by the crane it doesn't have any transform information itself. Is it at all possible to export this camera with it's motion while using this rig?
Thanks,
Mitchell

Didn't take long to find the solution. You just have to select the rig itself and export that as an alembic. Rather than doing what I was doing and selecting the camera.


Transparency problem with tga material/texture I am having a problem with a material/texture not showing up transparent as it should in blender 2.69. The material is from a tga file. I have a video showing the problem here where the hair should be mostly transparent, but instead shows the default model color of gray.

It looks like it should when I right click on it, but when I select a different part of the model, it show incorrectly again.  I followed the steps in this tutorial and it got it so that it works when it is highlighted at least which is a nice, but it is still not working as can be seen when some other part is selected.

The blend file can be found here. Thank you in advance for any help that can be offered.

Tick Transparency under Display in the Object tab. This will have the object's material display any transparency it has in the viewport sans the gray placeholder.


Deleting a specific edge without affecting the face The white edge is the one I am trying to remove, but when I try doing so via delete > edges,
It deletes the whole yellow face with it.
How can I keep the yellow highlighted face and delete the white edge only?
Thanks always community

I was trying to bevel the right bottom edge of the selected orange face, but the white edge was causing the bevel to result in a crashed shape. I apologize for the lack of elaboration in the question
A side with a hole must consist of two faces.
So I solved this problem by using knife tool to add a vertex somewhere else far from the side I was trying to bevel.


Is it possible to push an object when I touch it by moving another object in Object Mode? I have created 2 cubes and I want to know how to consider each cube, in Object Mode, as a real solid (without gravity) and so:

when I move one cube to another cube this second cube moves too when the first cube touch one of its faces.
and this second cube stop to move as soon as the first object no longer touches the second object.

Here a solution using RigidBodies:

add a ground (large cube), make it a passive ridig body
add rigidbody to the two other cubes sitting on the ground, check the "Rigidbody/Animated" box for the 1st cube
hit space to play the animation then move the first cube toward the second. Collisions should happen...


Smooth the jittering colors of smoke simulation A recent project of mine involved smoke sims and materials. This is the result, and it's mostly what I was aiming for.

However, its colors are jittery and seem to move around.
Here is the material:

How can I make it smoother and more natural looking?

I believe your simulation was made with "Adaptive Domain", so the boundaries of your smoke object change with time, therefore the texture space used by the Noise texture (which is implicitly the Generated one) changes with it, at discrete steps.
To solve the problem, you must not rely on the shape of your domain for your Texture generation, but rather rely on something you control directly and you can make as smooth as needed.
To do so, you have to override the implicit Texture Coordinate assignment by using one of the options from a "Texture Coordinate" input node.
In your case, I believe that the "Object" socket is the most useful, using an Empty as your "Object" (linked in the Texture Coordinate node).

You can scale/move/rotate the Empty to set the spatial resolution of the noise, and if you want you can animate these variables to make the colors move, as smooth as you like.
One possible "animation" for the Empty (easier if of the "Arrow" type) is to make it roughly follow two points in your smoke cloud (like, the advancing front and the back), with the head and the tail of the arrow.
Original setup (no Texture Coordinate node)
It jitters a bit at the beginning, while the Adaptive Domain size is adjusting

Result (with Texture Coordinate node)
Here, the mesh arrow displays the size/orientation of my Empty (I was lazy and I didn't move the tail).
No jittering because the color animation follows the Empty, which is smooth because I designed it to be smooth!


Blender scripting: Circle Selectiong in the "3D View" In Blender2.74, I want to circle-select the vertices in the "3D View", using this: circle_select(x = 300, y = 400, radius = 30).

I found this question. So I know how to get the xy positions in the camera coordinate system.

Now I don't know how to use the API "bpy.ops.view3d.select_circle()".
When I used the command in python console, the following error occured.

bpy.ops.view3d.select_circle(x=500, y=500, radius=10)
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "C:\Program Files\Blender Foundation\Blender\2.74\scripts\modules\bpy\ops.py",
line 189, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.view3d.select_circle.poll() expected a view3d region

Can I use this API in the "Python Console?

And, I will probably have to convert the xy positions in the camera-cood to those in the "3D View". Please teach me this also.

You have to override the context to be able to call this operator outside of the 3d view :

import bpy

for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':

        override = bpy.context.copy()
        override['area'] = area
        override['region'] = area.regions[4]

        bpy.ops.view3d.select_circle(override, x=300, y=150, radius=300, gesture_mode = 3)
        break

Update : Finding the camera corners coordinates

import bpy
from bpy_extras import view3d_utils, object_utils

scene = bpy.context.scene
cam = scene.camera

for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
        viewport = area.regions[4]
        rv3d = area.spaces[0].region_3d
        P1 = (0,0)
        P2 = (viewport.width, viewport.height)

        depth_location =  view3d_utils.region_2d_to_vector_3d(viewport, rv3d, P1)
        p = view3d_utils.region_2d_to_location_3d(viewport, rv3d, P1, depth_location)
        P1cam  = object_utils.world_to_camera_view(scene, cam, p)

        depth_location =  view3d_utils.region_2d_to_vector_3d(viewport, rv3d, P2)
        p = view3d_utils.region_2d_to_location_3d(viewport, rv3d, P2, depth_location)
        P2cam  = object_utils.world_to_camera_view(scene, cam, p)

        cam_width = int(P2[0]/(P2cam[0]-P1cam[0]))
        cam_x = int(-1*P1cam[0]*cam_width)

        cam_height = int(P2[1]/(P2cam[1]-P1cam[1]))
        cam_y = int(-1*P1cam[1]*cam_height)

        print(cam_width, cam_height, cam_x, cam_y)
        print("\nP(0,0) at (%d, %d) and P(1920, 1080) at ( %d, %d)"%(cam_x, cam_y, cam_x+cam_width, cam_y+cam_height) )


Getting Error "CUDA binary kernel for this graphics card compute capability (8.6) not found" I have a new NVIDIA RTX 3080 FE and I just started having issues where I'm unable to render via Cycles when in CUDA - GPU Support. When I first installed the card I didn't have any issues initially. I rendered an old project no problem. But I did a NVIDIA driver update to Geforce V 456.71 and since than I get this error - "CUDA binary kernel for this graphics card compute capability (8.6) not found."
I'm running Blender 2.83.8 Windows 64. I also downloaded Blender 2.90.1 thinking that might support the card, but that version simply crashes and I don't even get an error.
Has anyone else encountered this issue yet? Is this simply because the 3080 isn't supported for Cycles yet.

Official builds of Blender currently use CUDA Toolkit 10, but support for Ampere GPUs was added in CUDA Toolkit 11. If you're compiling Blender yourself, you can use CUDA Toolkit 11, but it's not officially supported yet.


Stack identical uv islands on top of each other So imagine I have a spherecircle face divided into four identical slices. I want to uv unwrap them so they are all top of each other. I found one solution for blender 2.79 but it uses keyboard shortcuts that have changed for 2.8. I've also tried snapping but the islands are just super jittery and never even try to line up.

Install blender 2.79 from www.blender.org
Open the preferences and go to the input tab.
Change the pull down menu showing "name" to "key-binding".
Enter the shortcut you used with blender 2.79.
Go to the relevant part of the list ("UV Editor") and look up the name of the function,
which is called by that shortcut.
Remember that function namen. Exit blender 2.79.
Start blender 2.80.
Enter the preference dialog and select "keymap".
Search for the function name (or a shorter version of its name. If the blender devs
renamed it it will shurely be named similiar. Play with the function name a little
bit.) Find the new short cut.
And finally: Use that shortcut... ;)


How to flip the view from the camera horizontally? Many Photoshop concept artists flip their canvas horizontally from time to time during painting for a few seconds to better judge the composition. Is it possible in Blender's viewport, using the camera settings maybe?

Of course I could render the image first and then flip it in compositor or any external image editor, but it would be much slower solution than flipping the viewport live.

You can scale the camera negatively along it's local 'x' axis to acheive a flipped view (while looking through the camera).

Select the camera and press S,X,X,-,1

Pressing X twice will scale along the 'local' axis instead of the 'global' axis.

Alternatively just enter '-1' into the 'x' scale in the object panel:


Hair not growing in the direction of the direction of normal So I am trying to make some simple bunny ears and adding hair to them, but when the hair is added it doesn't grow in the direction of the normals of the faces of the mesh, instead they seem to grow straight up or straight down in the global Z axis and I have no idea how to fix it.

Also the hair is impossible to comb or straighten as you can see in the gif below where I an trying to comb it, but the hair seems to be stuck in the Z axis.

I made the mesh by placing a cylinder, making a bunch of loop subdivides on it, flattening it in the Y axis and then scaling each edge loop to look like a rabbit ear and finally giving them some curvature by moving the tip of the mesh with proportional editing enabled.

Maybe you have uniform scale on your model? Try to use "apply scale": Ctrl + A -> Scale in object mode. When recreate hair.

Learn why is it important to apply transformation to an objects data?


Blue spots in compositing after color mix I use different pass for specular in BI, make Glare for specular and try to combine it with original picture with Mix node. When I use screen or overlay mix i get final picture with ugly blue spots instead white. What I'm doing wrong and what kind of Mix should i use to combine specular with original image?

You should be using the Add mixing mode when you want to add more white pixels to the image, then plug the specular image in the top (so it adds to the bottom image).

Example:


UV map not applying to certain faces As you can see, certain faces are not being textured, despite the map covering them. On the UV view there are vertexes which are unselected, but selecting them manually makes no difference - they are unselected as a result of an unmapping, and I suspect the issue is linked to those vertexes, although deleting them and remaking them only makes the problem worse. Please note, the textures are not invisible, but white, so I know the normals are all fine (I checked them anyway, and they are all the correct way round). There are no doubles either. I'm genuinely stumped by this. Any help would be greatly appreciated. Thankyou.

That part of the UV map is not assigned to an image. If you just select the face, you'll notice that the image in the UV/image editor disappears.
Select the face and then select the image in the UV/image editor to "assign" it. To be sure of this not happening again, you should probably do this with the entire mesh selected (A).

Note that with proper materials/textures setup, this won't affect the render.

Also see How is this blendfile hiding textures?


Blender Game Engine: Why don't shadows appear? I'm using Ubuntu 32bit 16.something. Blender isn't showing shadows in the viewport or bge. I can render shadows but I need to use them for the game engine. I'm on blender game, textured view, glsl, shadows/shaders enabled in both render and light data panels.

You need to activate shadows in lamp property.

If that not the problem, change the energy in the second lamp.

Reduce energy.


How to turn off mirror to Image texture in UV editor I'm a programmer trying to put an image texture on the face of my character model. I used the mirror modifier to model my character. When I UV unwrap the face the image is mirroring on both sides of the face. When I turn the mirror modifier off, I can only see half of the body of my character. Can anyone guide me on how to turn this mirror texture stuff off?
I'm using blender 2.8.
Many thanks in advance

You can't have custom texture coordinates for both sides of a mirrored object, since they - as well as the geometry are created by the modifier.
You can however choose how to mirror the UV islands in the modifier's settings, using the checkboxes for flip U and flip V. They should about get you there.
If you need to apply completely idependent UVs, you will have to apply the modifier. If you want to texture paint, and issues with the modifier arise, you can safely duplicate your object, apply the modifier on the copy and paint on that one, deleting it once you're done.


How to let Mesh Deform modifier work as expected I wanna use the Mesh Deform midifier. I created an own cage mesh and set the modifier, but it seems not working. I don't know what the problem is.

There is a pic:

The cage: http://speedy.sh/xaajq/alice-cage-mesh.obj

Thanks a lot.

For very rough cage, especially when using larger cage to control smaller target mesh, you need to set a higher value for Precision.

So, two ways to solve this:

Try to scale down the cage object;
Try to set a higher Precision value in the Mesh Deform modifier panel. (5 might be relatively appropriate for this particular case)

Note:

Normals on cage mesh are used to determine the inside/outside of the cage, so make sure they are pointing outside. Flip them if not.
The cage mesh has to be a closed mesh (manifold) to work well. When in Vertex or Edge selction mode, You can press ShiftCtrlAltM to find the non-manifold edges.


Can fire be made stationary? I am attempting to render an animation where the camera rotates around an object that is engulfed in flames. My goal is to have the camera rotate but for the flames to be immobile throughout.

Is this possible? I have seen tutorials where the flames are made to slow down, but none where they are motionless.

As long as you don't need the smoke to start animating again after it has stopped you can set the start and end frame for the bake to before the set animation frames start.

Above I have set the start frame to -50 and the end frame to 1.  Once baked, the smoke animation will be done by (and freeze) at frame 1 and stay frozen for the full animation.  (For some reason the end frame can not be set lower than 1, but the start frame has no such limit.)


How to render over the previous frame to create trails When you use code on a 2D canvas to draw in an updating loop you have to draw over the previous frame or wipe it or else you get these trails of moving objects. In blender you don't have to wipe the previous frame because each frame is rendered from scratch, so I was wondering if there was a way to achieve the same effect in blender because you would be able use it to paint by moving objects around in 3D space.
So imagine you rendered each new frame on top of the result of the previous render as your background, that's basically what I want to do.

The answer posted by Rich Sedman is the answer:
motion trail effect on video in VSE
Rather than doing this in the VSE you can create this effect using a feedback technique similar to How to do this type of trailing effects where the previous frame is held over to include in the current frame. The only real difference is in masking out the current frame so as to overwrite all but the background each time.
The setup of the scene is the same (ie, a camera pointing at the plane) with the following material on the plane :

material
Here the feedback is handled by the bottom branch - with the Image Texture pointing at the location of the render result, offset by 1 frame to pickup the previous frame. The top branch injects the video (filed infront of a black background) with the Subtract used to darken the image (this was used as a crude way to remove background artifacts since my video background wasn't perfect) with the Less Than used to detect the 'foreground' so that the feedback can be cut out wherever the new image is above a certain threshold. The images are combined and the Emission with a value less than 1 effects the fade out as the trail ages.
This produces the following result :


How to make an (open) object behave like rubber when penetrated by another So uh i've got this problem with a penetrating object and another object that serves as something like a condom if you will

So what I want, is for the penetrating object to not deform while moving into this "rubber cylinder", while the rubber cylinder does deform and reshape itself to the outer form of the penetrating object. That is, if the pen. object is bigger than the entrance hole ofc.

Also, when the object leaves the "rubber cylinder" I want the outer edges to follow (mid object in picture) and then jump back (right object in picture)

Parenting the size and position of the "rubber cylinder"-entrance to the position of the penetrating object would work i guess, but I think it'd create problems when the pen. object enters from another angle (not perpendicular to the entrance).
I just read another post where someone mentions Vertex Weight Proximity modifier in a combination with a cast modifier. Don't know if thats gonna work yet. Couldn't find the time to test it.

You could use cloth physics for the deformation part.

Pin the corners or edges of the rubber object so it keeps its shape by adding it to a Vertex Group. Let the physics do the rest.

Not sure how one could do the holes. Weight Proximity could help fake it, I don't think there is any elegant solution with Blender.
You can also assign each hole size to a shape key and manually control its diameter as necessary by keyframing the influence.


animation nodes sorting object list by XYZ I have a 3x3x3 grid of objects in a collection (intended to be used with non-duplicate objects), I want to sort them by x y and z and have them fed into a loop and animate transformations. I previously did this with index id keys and 3 sort list nodes; one for each axis fed through each other. but the sort list node has since been removed hence why I'm stuck.
I've tried separating the list vectors, running them each through an expression node with sorted(e) but but I'm stuck at how to take X list and sort it by Y, and then Y by Z. any solution or help is greatly appreciated :)
Download my .blend
this is all working except it lacks the control im looking for as to what axis and direction the process begins with

rather than it going from left to right, I want the control to set it so the order is back to front, and then upwards
EDIT: after many hours of tweaking i finally came to a solution using the expressions given to me by gorgious and some extra tweaks:

I used gorgious's method nearly exactly but before feeding the object list into the expression nodes, I created 3 sets of id keys for each axis, input them with object id key nodes, combined them into a vector list and output them into an object transforms output node. the result is full control over direction of animation.

I think you almost got it. I initially started designing loop subprograms but the sorted method and the expression nodes are your friends.
Remember you can chain expression nodes. Add an input of type "Object List"
The 3 expression nodes you should write are like so :

The 3 lines of code:
sorted(objs,key=lambda obj:obj.location[0])
sorted(objs,key=lambda obj:obj.location[1])
sorted(objs,key=lambda obj:obj.location[2])

To visualize it, create a loop subprogram to change the viewport color of the object depending on their order in the new, sorted list.

Add the subprogram at the end of your expression nodes :

Result :

Additionally, as a stand-alone python script :
import bpy

objs = bpy.data.objects; # Replace by relevant objects or collection
for axis in (0, 1, 2):
    objs = sorted(objs, key=lambda obj: obj.location[axis])

objs_len = len(objs)
for i, obj in enumerate(objs):
    fac = i / objs_len
    obj.color = (fac, 1 - fac, 0, 1)

Edit after comment asking for another way to sort the list (right to left, back to front, bottom to top)
You just have to add a slice operator at the end of the 2 first expression nodes to reverse the list : [::-1] See this doc for example (example 2)
So the expressions become :
sorted(objs,key=lambda obj:obj.location[0])[::-1]
sorted(objs,key=lambda obj:obj.location[1])[::-1]
sorted(objs,key=lambda obj:obj.location[2])

Result :


Using VideoTexture.ImageRender to get camera image I am currently building a simulator using the Blender Game Engine. I got stuck at the point where I need to extract the camera image from the virtual camera.

I've found the VideoTexture.ImageRender class but this class does not provide any image.

The code I am using is the following:

import GameLogic
import VideoTexture

scene = GameLogic.getCurrentScene()
cam = scene.active_camera

imageRender = VideoTexture.ImageRender(scene, cam)

imageRender.refresh()

if(imageRender.valid):
    print(imageRender.image)
else:
    print("No image available")

The output imageRender.image is always None. Am I missing something? Anyone knows where the problem might be?

Thank you very much for  your help.

Okay. I looked into the source code of Blender and it seems that ImageRender only works when rendering to a texture and it is not the currently active camera.

What I did was to add an additional plane, create a material along with a texture rendered it to that plane. After that, I was able to store the image.

In addition to that, I set the new camera as the active camera for the scene. Hope that this answer will help other people.


How to modify something in two dimensions at the same time? One of the biggest mysteries which I cannot understand is how do you modify something in two dimensions at the same time. I tried to solve it myself by pressing two keys at the same time but unfortunately it doesnot help me. If someone doesnot understand what I am talking about: I want to do something like this artist on this video on 0:44 time. The Artist is modifying the mesh in two dimensions at the same time but there are no tips in left-bottom corner so it is still the mystery for uninitiated pupils like me. I searched in Google but it seems to be a secret. If someone of you can reveal this magic power, please tell me and I swear I will use it in good deeds.

0.44
https://www.youtube.com/watch?v=qrYngJmrEFA

As I see.
If you want to move the object by 2 dimensions.
1. Select the object
2. Press G
3. Press Shift + Z (Or Shift + Y, Shift + X demand on which dimension you don't want to change)
4. Move as much as you want.
Do the same with Scale.


keframe error: no suitable context info for active keying set I am trying to animate Minecraft with a rig, but every time I press I, or G, it comes up with the error message.
no suitable context info for active keying set

Why, and how do I fix this so I can animate?

I know this is an old question, but I figured I'd answer it anyways. I recently ran into this as well. The problem could be that you had multiple layers selected when you created the keying set, so when adding additional keyframes you have to have all of the same layers selected. At least, this was the case for me.


Import freestyle line style from other .blend file I know you can import other stuff like object from another .blend file. I am wondering if you can do the same of the line styles and how?

Yes we can import/append /link the freestyle
save the file with freestyle
When import / append with the with the other folder of texture lamp mesh object you get the folder of Freestylelinestyle

Open the folder and append/link

In the Render -> activate the freestyle option

After import/append under Render Layer in properties panel -> Under Freestyle Line style select the line from the drop down.


How to compose alpha information on a render result with transparency? I would like to compose in Blender a very simple result (actually simple...)
Attached you see what I have.

How to do this in Blender?!

Thank you in advance.

Chris

I think the Alpha Over node will do what you want?  Here are some quick results:


Modify degree of Bezier interpolation between keyframes for animating an object I'm trying to animate motion of objects. For this, I'm setting the location and rotation of the objects at certain frames and marking them as keyframes. By default, blender uses Bezier interpolation so that the motion starts slowly, increases speed in the middle and then starts decreasing to 0 at the end keyframe.
However for certain cases, the initial motion is too slow that there is hardly any motion between the frames, but the motion in the middle to too high. Is it possible to modify this slightly such that there is some initial motion and the motion in the middle is not too high?
I know I can use linear interpolation. That will be my last resort. But if Bezier interpolation works, it'll be great. Additionally, I can't do this manually. I have about 200 blend files and I need to do this for every one of them. So, I would prefer if there is some setting that I can change via python.

This can be achieved by right clicking the timeline and choosing the option "Interpolation mode".

To the right are all the interpolations that are available. In your case since you do not want the Bezier interpolation, you can choose Linear interpolation which interpolates with constant speed. There are bunch of other interpolation modes too if you want to try them out (check image).


Why is my texture not showing up in 3D view? I've tried every display mode possible and nothing happens. What do? Here's the blend:

To enable textures in object mode (can skip if you're working in Eevvee Rendered mode or LookDev) :

To enable the texture to appear, click use nodes, then click on the little circle next to the color to select your open image:

Hope that helps.


Small errors when baking displacement maps I am baking a simple displacement from several Bezier curves. The curves are beveled and set to full. Whenever I bake the displacement map, I get several small errors. Here is the baked .exr applied via a displace modifier to a heavily subdivided plane. Several of the baking errors are circled in the image below.

What is the cause of the errors? What can I do to get rid of them during the baking process? Because I can not edit the image externally with out compression artifacts.

The blend file, just open and press bake.

Looks like a baking bug to me.

Investigation shows the artifacts are already present in the .exr and the displace works as intended. I just subdivided a plane to 16.78M polys for 4096 texture and it showed the same result as you posted.

Artifacts in .exr:

Then I tried converting the curves into mesh, different curves resolutions and smoothings, normalized/unnormalized bakes but I always got black pixels at different random spots.

When I plug the raw bake into compositing nodes and inspect it it has artifacts, so it is not the exr.

The only solution that worked for me are smooth modifiers after the displacement, which is not really a solution.


Blender 2.78 release doesn't start in ubuntu 14.04 I usually use the PPA: thomas-schiex/blender for installing Blender. I had never problems before with it. In September 2016 I used Blender 2.78 RC, and it worked well. But in October I've installed Blender 2.78 release (using apt-get install command), and my Blender is not starting now. What to do? Thanks!

You don't need to use apt-get at all! Just download the zip from blender.org, extract it somewhere, then run the blender executable you will find inside the folder. That's what I did and it worked from the first time!


Lock A Bone To a Slope Angle I want to be able to have a bone locked to a particular slope vector and use another bone to control its length. The image below shows the armature and two bones. The Target Horz bone can be moved on the world X-Axis. The Slope bone's tip should extend/retract to Target Horz's position while holding it's vector orientation.

Blend file here: Fixed Slope Bone

Thanks!

You could use a transformation constraint. Where a copy transform constraint always connects the same axis between bones at a fixed ratio, the transformation constraint allows you to mix axes and ratios.

In this example, I have set the X location of the target bone to control the Y scale of the slope bone.

The mapping in the middle is set to have the X axis affect the destinations Y axis.

The minimum location of 1.0 will map to the minimum scale of 0.5 and the maximum location of 4.0 will map to the scale of 2.0. I chose these amounts visually to keep the alignment of the bone over the distance.

That gives the following result, note that enabling the extrapolate option will extend the result past the given limits.

Also note that constraints are really just a visual way of configuring a premade list of drivers, you can configure your own drivers to get more control if you wanted to.


How do i set the base to control the entire character? I have a controller called base, but i can't seem to make it control the entire character (i want to move and rotate the character without any of the other bones deforming).

I set it as top bone in the hierarchy and parented the pelvis to it but this made it move just the pelvis. If i set it to parent all the bones in the rig all hell breaks loose (the character rotates uncontrollably).

I added the bone after i already started animating as i realized i was missing the control.

Screenshot

Be sure to visualize all bone layers, then select the pelvis bone and move it (in pose mode). You'll have to set the controller bone as parent of the pelvis and of all the bones not moved by the pelvis (tipically all IK controllers and poles).


How to put a mask into 3d space I'm trying to make a vfx scene where a mesh I created passes behind an object in real life/the video. I've tried to make a mask around the real object, but that makes all of the objects that are supposed to be in front of the real object also disappear. How would I put the mask into my 3d viewport so that anything behind it disappears/is covered by the video, but anything in front of it isn't. I've heard of id-masks, and think those may be able to help, but honestly I have no clue how to use them. (I'm sorry that is worded so poorly, I'm not sure how to go about this.)

**edit I'm rendering/compositing using cycles render. It would be hard to render the objects separately because what I'm trying to do is make a rubix cube shatter and launch the pieces everywhere using some simulations. Because only some of the pieces fall behind a chair or under a table, it would be hard to select all of those and render them separately because they are all part of the same simulation. Also they all start on top of the table then some move under.

Load the background image in the image editor

Set the editor in mask mode

On on the image click while pressing the Ctrl key and draw a mask for the area you want to use as foreground.

Then in the compositor use that mask to combine the foreground and background elements.


Why is the bone Tip and Root separated from the body of the bone in blender 2.8.Kindly assist When I add a bone in blender 2.8 the bone body happens not to be connected to the Tip and Root of the bone. How can I solve this problem?Kindly assist. I have also included a screenshot.

I experienced the same thing while using windows 7, I tried it on windows 10, and the problem was solved.

Also tried on Linux(Ubuntu) it works fine. It might be a bug associated with windows seven on certain hardwares.


Density texture in Voxel to mesh? Hi ,

I am working on a scientific illustration.
This is a porous structure of a membrane.

How can I create the bottom part of the block?
Can I convert the density voxel to mesh?

I've tried it this way:

Create bezier curves with bevel, convert to mesh, you have pipes.
Create a cube, Boolean it with the pipes.
Sculpt with Dyntopo to give it smoothness and bumps.
Decimate the mesh to reduce the amount of vertices. Give your object a Shading > Smooth.
Give it its surface bumps with a Noise Texture.


Can't figure out why this looks so grainy I'm trying to do a project for one of my classes and i keep trying to fix the lighting and graininess (if that's a word). I've already watched a ton of lighting videos by blender guru and how to fix fireflies and im pretty sure im missing some key parts to fixing this image so i was wondering if anyone knows some things to help me out.

These are the fastest ways.
If you are not in Cycles Render then switch to Cycles and on the Render Layer tick mark Denoising.

If that does not give you the desired effect then increase the Render Samples as well , at the Sampling section, but will increase your render time.

These two settings usually solve the problem.

Sometimes I find that unticking the Reflective Caustics and the Refractive Caustics will improve some scenes. These settings are under the Light Paths settings under Sampling settings.


How do i start the rigid body dynamic in the keyframe i want? I’ve been trying to animate a blowing skull, but, when i try to add the active rigid body dynamic, it stars from keyframe 1, when what i want is to start it in the keyframe 267.

Go to frame 266.  Select your rigid body.  In properties/rigid body/physics/settings, check Animated and keyframe it.  Go to frame 267.  Uncheck Animated and keyframe it.


Why isn't the render showing realtime progress? Sometimes when handling scenes from other users I get a render that doesn't show until it's completely done.

It's probably just a setting that's ticked on or off but I can't figure out where to find this or even what it's called nor what the purpose of this is.

Operating system: Windows 7 professional
Blender version: 2.78
Render engine: Cycles
Occurs both on CPU and GPU (msi GEFORCE GTX 980Ti)  rendering

Some in depth explanation on this matter would be greatly appreciated!
(advantages/disadvantages/...)

EDIT: (included a screenshot that shows the settings I'm using.)

Try to turn off "Save Buffers" in Properties -> Render -> Performance. It helped me in Blender v2.79


Meshes going berserk when extruding I'm working on a project and need to build a house. The basics of the 1st floor is done, but I have to add a foundation to it due to the landscape around the house is uneven, like on a real house.

To make the foundation, I select the bottom vertices of my outer wall on the house, and extrude them downwards, to later separate the extruded part into what will be the foundation. However, when I extrude, the mesh goes berserk, throwing and stretching faces to infinity and beyond.

Anyone know why this is happening?

Ah, I found the issue.

I have two entrances to the house, a front door and a back door. To prepare for the extrude for the foundation, I added a edge below the doors, so it would make a face when extruded.

It seems that extruding non-faces is causing issues in Blender, and that's what was causing my issues.

Removing these edges before extruding works. So I can simply fill the faces after extruding.


How make hair using textures A while back (could have been 2 summers ago at this point), I discovered this great piece of software on Steam called Fuse. It's a piece of software that allows you to create custom 3D characters. This was interesting to me because I'd always wanted to make my own characters, but I didn't know how to model. Fuse took care of that. I found a great tutorial that showed me how to put a character that I made in Fuse into a Blender workspace. It really introduced me to texturing and how to plug in things using material shaders, mainly because Fuse just took the textures of the model and exported them as high-resolution PNG files in a easy-to-use folder along with the object for me to plug into the website to have the model automatically rigged for me.
However, there has been one thing that I think is missing. The textures work great on the body, the clothes, and the eyes, mainly due to them including many different textures that fit in nicely. However, one piece was seemingly hard to do, and that was hair. I should mention that the hair and clothes and basically everything is established as it's own object, but they are tied to one singe armature. Anyways, I was wondering if anyone has any idea how to set up the hair for a character model I already have with the textures, or if it's better to try and figure out how to do emissions.
Details:
-I have 4 different textures for the hair: Diffuse, Specular, Gloss and Normal.
-The screenshot of the shader layout shows how I have it set up for each of the parts of the character (Shoes, pants, shirt, etc.) but obviously with different textures.
-I am comfortable with working with either Cycles or Eevee, and do not have a preference. I will take what I can as long as it works.
-I am just looking for a way to have the hair look as natural as possible. Physics are not my concern. I'm just concerned with the look for the moment.
-Also, I'm fairly inexperienced with many different types of lingo, so I'd prefer a somewhat simpler answer rather than a massive spew of information that wouldn't make sense to someone who isn't a professional modeler or texture designer.
Any help that anyone can give me is appreciated.
This is a screenshot of the hair itself:

And this is a screenshot of the shader layout I use:

The biggest thing missing in your screenshot is transparency.
To achieve this you probably want connect up the hair texture alpha channel to the alpha channel of your diffuse texture (I am assuming this is where it is stored, otherwise you may need an extra texture from somehere). Additionally, if you are using Eevee, you will also need the set the blend mode to Alpha Hashed in the material settings.
You may find this answer useful:
How can I make an image plane have transparency in Eevee with nodes?
And as @ChristopherBennett mentioned in the comments, you shpuld set your normal map strength to 1.


Iterate over CollectionProperty with blendfile.py Over on this question I found out about io_blend_utils/blend/blendfile.py, which is a one-file-module to read a blender file without actually loading it into blender. I need to read the elements of a CollectionProperty, which I am currently only able to do for the first element.

I fear this is a very specific and advanced question. I am hoping @ideasman42 may be able to help?

My use case

I need to crawl through a bunch of .blend files to find all the texture atlases (created with the uv_texture_atlas plugin) contained in them.
Since there are many and large .blend files, I do not want to have the overhead of loading all the files into blender.

My code so far

    def group_iterator(block):
        """
        Iterate over a IDPropertyGroup BlendFileBlock.
        :param block: block to iterate over
        :return: All IDProperty blocks in the group or list
        """
        i = block.get_pointer((b'data', b'group', b'first'))
        while i is not None:
            yield i
            i = i.get_pointer(b'next')

    atlases = collections.OrderedDict()
    for blend_file_path in blends:
        with blendfile.open_blend(blend_file_path) as blend:
            scenes = [block for block in blend.blocks if block.code == b'SC']

            for scene in scenes:
                # get custom properties
                properties = scene.get_pointer((b'id', b'properties'))

                if properties is None:
                    continue

                # iterate through all the property groups
                for itor in group_iterator(properties):
                    if itor.get(b'name') == "ms_lightmap_groups":
                        group = itor.get_pointer((b'data', b'pointer'))

                        if group is not None:
                            # iterate over all the properties
                            for prop in group_iterator(group):
                                name = prop.get(b'name')

                                if name == 'name':
                                    offset = prop.get((b'data', b'pointer'))
                                    length = prop.get(b'len')
                                    blk = blend.block_from_offset.get(offset)
                                    blend.handle.seek(blk.file_offset, os.SEEK_SET)
                                    atlas_name = blendfile.DNA_IO.read_string0(blend.handle, length)
                                elif name == 'resolutionX':
                                    resX = prop.get((b'data', b'val'))
                                elif name == 'resolutionY':
                                    resY = prop.get((b'data', b'val'))

                            atlases[atlas_name] = (2**(resX+8), 2**(resY+8))
                            print("Found atlas %s" % atlas_name)

Thank you so much in advance (I have been trying to figure this out for over a day now)!

Regards, Jonathan.

blendfile.py actually supports getting elements of a collection property with some super neat and simple API!

    for blend_file_path in blends:
        with blendfile.open_blend(blend_file_path) as blend:
            scenes = [block for block in blend.blocks if block.code == b'SC']

            for scene in scenes:
                # get custom properties
                properties = scene.get_pointer((b'id', b'properties'))

                if properties is None:
                    continue

                # iterate through all the property groups
                itor = properties.get_pointer((b'data', b'group', b'first'))
                while itor is not None:
                    if itor.get(b'name') == "ms_lightmap_groups":
                        length = itor.get(b'len')

                        for i in range(0, length):
                            group = itor.get_pointer((b'data', b'pointer'))

                            if group is not None:
                                # iterate over all the properties
                                # (!) i specifies the index in the collection
                                prop = group.get_pointer((b'data', b'group', b'first'), base_index=i)
                                while prop is not None:
                                    name = prop.get(b'name')

                                    if name == 'name':
                                        offset = prop.get((b'data', b'pointer'))
                                        length = prop.get(b'len')
                                        blk = blend.block_from_offset.get(offset)
                                        blend.handle.seek(blk.file_offset, os.SEEK_SET)
                                        atlas_name = blendfile.DNA_IO.read_string0(blend.handle, length)
                                    elif name == 'resolutionX':
                                        resX = prop.get((b'data', b'val'))
                                    elif name == 'resolutionY':
                                        resY = prop.get((b'data', b'val'))

                                    prop = prop.get(b'next')

                                atlases[atlas_name] = (2**(resX+8), 2**(resY+8))
                                print("Found atlas %s" % atlas_name)

                    properties_itor = properties_itor.get_pointer(b'next')

BlendFileBlock.get(...) and BlendFileBlock.get_pointer(...) both have an optional base_index parameter which is gets you exactly this.

May this be of use to someone else out there :)

Happy blending! :D


python: pie menu to display the pivot center modes I would like to create an operator that would trigger a pie menu containing the "pivot center modes" in it (median point, individual origins, 3d cursor, ...).

Now I could get started with the code below (from that topic: bpy: how do I list the "pivot center for rotation/scaling" items?

import bpy

def piebut(self, context):
    layout = self.layout
    op = layout.operator("wm.context_pie_enum")
    op.data_path = "space_data.pivot_point"

def register():
    bpy.types.VIEW3D_HT_header.prepend(piebut)

def unregister():
    bpy.types.VIEW3D_HT_header.remove(piebut)

if __name__ == "__main__":
    register()

The code above will add a button to the 3dView header, and when you press that button, it will display a pie menu with the "pivot center modes" items in it.

However, I would like to convert this to an operator, so that I can ultimately press a shortcut key to open the pie menu directly (without having to click a button).

Now I've tried this without luck:

import bpy

class LING_OT_PIEMENU_PivotCenterModes(bpy.types.Operator):
    """A pie menu to select the pivot center for rotation and scaling"""
    bl_idname = "view3d.ling_piemenu_pivot_center_modes"
    bl_label = "Pivot center for rotation/scaling"

    def execute(self, context):
        bpy.ops.wm.context_pie_enum("space_data.pivot_point" )
        return {'FINISHED'}

# just for quick testing inside the blend file
bpy.utils.register_class(LING_OT_PIEMENU_PivotCenterModes)

I've changed those lines:

layout = self.layout
op = layout.operator("wm.context_pie_enum")

to this line:

bpy.ops.wm.context_pie_enum("space_data.pivot_point" )

because layout = self.layout was returning a None type, so I thought the layout property was not available from the operator class, and so I tried to call the context_pie_enum method in a different manner, but now I've got this error:

TypeError: Calling operator "bpy.ops.wm.context_pie_enum" error, expected a string enum in ('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS', 'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT', 'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA', 'EXEC_SCREEN')

It already is an operator.

There is no need to create another operator to call an operator, so it can be given a shortcut.

Can add a keymap to it directly. The field to data_path ignore if appears disabled, select and type in the required RNA path from context.

shortcut set to  ⇧ Shiftz (disabled the toggle render shading)

or created via code (example)

import bpy

wm = bpy.context.window_manager
kc = wm.keyconfigs.user

km = kc.keymaps['3D View']
kmi = km.keymap_items.new('wm.context_pie_enum', 'Z', 'PRESS', shift=True)
kmi.properties.data_path = "space_data.pivot_point"

Alternatively it can be added as an expanding pie menu item in your original question code via

op = pie.operator("wm.context_pie_enum")
op.data_path = "space_data.pivot_point"

To call an operator from code, all operator properties must be passed as  keyword arguments

bpy.ops.wm.context_pie_enum(data_path="space_data.pivot_point")

The first argument of an operator call can be a string if it is one of the operator context enums, eg 'INVOKE_DEFAULT'. See error message in question for full list.  Another type of argument is a dictionary of context override members.

bpy.ops.wm.context_pie_enum('INVOKE_DEFAULT', data_path="space_data.pivot_point")
c = {"area": context.screen.areas[4]} # will need more than just area.
bpy.ops.wm.context_pie_enum(c, data_path="space_data.pivot_point")


How do I animate the position of my character's hair randomly? I'm trying to create an effect where a character's hair moves randomly (using hair particles) and in a stuttering fashion. The closest I have come is using force field settings with a turbulent field, but the hair particles' movement amplitude isn't large enough. The animation of these particles also only lasts 100 frames, after which the hair returns to its stiff spawn position.

Ideally, I would like to use the hair seed to essentially teleport the hair around the body. I can keyframe the seed, and changing the seed changes the hair's position, but when I play it back the hair particles are stationary.

How can I animate the position of my character's hair randomly?

For reference, the effect I'm going for is similar to this:

Adding a force field works with the correct settings.

I use a turbulence field with a large strength and small size. I added a #frame driver to each location and rotation channel, to make it change transformations frame by frame.

In the hair dynamics, make sure to set mass, stiffness and damping to low values. Since my low stiffness value would cause the particles to completely loose their shape, I increased the goal weight.


How to make the trees on the grid not through the grid? (Speedtrees, origin problem) The trees and the grid are joined somehow and I don't know how to undo this.
This is the tutorial I'm following Large Scale Forest Flyover in Blender 2.8 - Quick and Dirty
1:30 is what applies to me the trees appear halfway through the plane and I don't know how to fix this. I want the trees on the plane NOT halfway through.

The orange dot in the center is the object's origin (the root of your tree). To move it down to the Z=0 position (the ground), switch to Edit mode and move all vertices of the mesh up.

Another option is to use the 3D cursor (and Shift+S menu), or move the origin directly in Object mode.


trying to put a hole in a rigged character for animation For an animation I'm making, my character grabs a piece of his chest and removes it from his body, leaving a hole. I'm struggling to accomplish this, I'm currently trying to use the add-on AnimAll which allows key-framing in edit mode but when I try to put in the hole, it ruins the whole character and I'm not sure how I could achieve this effect without ruining the rigged character.

You can go into edit mode, select the vertices that should create the hole and press P to separate the selected elements. This creates a new object which retains all previous behaviours: parenting, armature, weights, modifiers, ecc ... You will have to add a bone for this new feature and do some manual weighting..

Another way is using shape keys: create 2 new shapekeys, then with the second selected go into edit mode and change the shape of the mesh until the hole looks the way you want, then in object mode you can animate the shape key value.

Using AninAll on vertices that have been animated by a rig can lead to unpredictable results.


Add renderable axis object I made a nice (imho) visualization of my data that can be rendered using cycles, but is there a way to display the x,y,z axes? (what about adding text along each of them?)
I guess I could create my own solution, it just seems strange there is no way to visualize the axes.

I see in a lot of images evidence that there should be at least some way to visualize the axes.

I ended up creating an axis object... Here is the model link in blend swap.
It can create an axis and a few other interesting vectors. To create the axes,
it uses e.g. the input

vectors = [
 [(4,0,0), (0,0,0), 'red'],
 [(0,4,0), (0,0,0), 'green'],
 [(0,0,4), (0,0,0), 'blue'],
]


When I use the Subdivision Surface modifier on a basic cylinder, it turns into a weird-shaped sphere How do I use the subdivision surface modifier to simply soften the cylinder, not create a new shape?

Two things;

Edge Crease

If you would like to tighten up the edges of a cylinder, you can look at the second and third meshes below;

The first one is unmodified (other than making it taller than a default cylinder, which is why yours is more of a sphere).

The second one was created by selecting the edges and using shift+e, which adjusts what blender calls the "edge crease".

The third adds two edge loops near the top and bottom (which can be added with ctrl+r)

Poor subdivisions and ngons

But what do we do about the odd tops? These are poorly subdivided because the top is a non-regular face (called an ngon, which is any face with more than 4 edges). The simplest fix for this is extruding the face, then merging all the faces into the center;

Extrude the face with e;

Right click to drop it back in place;

Then hit alt+m and select "At Center";

Roughly the same process can be applied to the edge loop version. You'll notice that the results are a lot cleaner in rendered view;

Note: I didn't fix the bottom of the cylinders in these examples


How to animate a growing plant with branches? I was trying to animate a plant. For that purpose I created a curve, gave it a bevel depth and animated start bevel factor, but then I got a problem - curves can't have branches. There are various ways to fake branches but I need them to start growing exactly in the moment when trunk reaches the branch height. Do you know how to make a plant with controlled shape to properly grow without animating all and every branch separately?

You'll need to do some manual tweaking and timing, no doubt. Automating this would make sense if you had a massive amount of plants to process.

I've used the following method when animating growing plants with branches which I've found relatively easy to do. Admittedly it was on 3dsMax, but I believe the same steps applies to Blender.

First off, I always work with a mesh. Then I build a quick rig/armature loosely following the branching of the plant. Usually automatic skinning works fine.

To animate it grow, I take the starting pose and scale each bone to zero. I flip the starting and ending keyframes so the plant grows instead of shrinks. And since every bone inherits the scale of its parent, you get a nice, gradually cascading effect.

Things to tweak at this point are the timing of when the branches start to grow (wait for the parent bone to grow to full size before beginning its own scaling, for example), and slight rotation of each branch.


Object vertices coordinates are returned as an empty list occasionally I am trying to get the furthest/closest vertices on both the X and Y axis for a mesh object. However, Blender returns empty lists for the coordinates for the same object. I initially thought the mesh has not been loaded into blender but then I realized that although the object has been loaded, I still might get an empty list. I may note that the problem occurs for random meshes and not only for an specific mesh. Below I post the relevant codes:

Here's how I load a mesh:

    obj_file = os.path.join(model_path)
    bpy.ops.import_scene.obj(filepath=obj_file)

###############################################################
## obj file comes as a bunch of different meshes, unify them ##
###############################################################

    obs = []
    for ob in bpy.context.scene.objects:
        # whatever objects you want to join...
        if ob.type == 'MESH':
            obs.append(ob)

    if len(obs) > 1:
        # Join the meshes
        ctx = bpy.context.copy()
        ctx['active_object'] = obs[0]
        ctx['selected_objects'] = obs
        # we need the scene bases as well for joining
        ctx['selected_editable_bases'] = [bpy.context.scene.object_bases[ob.name] for ob in obs]
        bpy.ops.object.join(ctx)

    for ob in bpy.context.selectable_objects:
        #if ob.name.startswith('simplified_model'):
        if ob.type == 'MESH':
            obj = ob            # this is for scoping reasons
            obj.select = True
            bpy.context.scene.objects.active = obj

    if dissolve != None:
        if dissolve:
            # This is to be used for simplifying mesh models
            bpy.ops.object.mode_set(mode='EDIT')
            bpy.ops.mesh.dissolve_limited()
            bpy.ops.object.mode_set(mode='OBJECT')

            obj.collision.use = True

And then setting up the scene:

        bpy.context.scene.render.resolution_x = 448
        bpy.context.scene.render.resolution_y = 448
        bpy.context.scene.render.resolution_percentage = 100

        s = 1.25
        bpy.context.scene.camera.location.x = s
        bpy.context.scene.camera.location.y = s
        bpy.context.scene.camera.location.z = s

        empty = bpy.data.objects.new('empty', None)
        bpy.context.scene.objects.link(empty)
        bpy.context.scene.update()

        camera_follow_constraint = bpy.context.scene.camera.constraints.new(type='TRACK_TO')
        camera_follow_constraint.target = obj #empty
        camera_follow_constraint.track_axis = 'TRACK_NEGATIVE_Z'
        camera_follow_constraint.up_axis = 'UP_Y'

And finally here's how I get the coordinates. Sometimes, the xs or ys lists are returned empty and I haven't been able to find out why:

mat = obj.matrix_world
coords = [mat * vert.co for vert in obj.data.vertices]

xs = [co.x for co in coords]
ys = [co.y for co in coords]

I am using Python 3. I would appreciate if someone can give me some help on this.

Here are two links for two meshes for which I experienced the problem. I may note again that the problem does not only occur for these two models. I have thousands of meshes and each time it occurs for a bunch of them:

Model1
Model2

Thanks

Here is a take on this.  Removed the context override on the join op, the import wavefront obj operator returns all imported objects as selected.  This is the list context.selected_objects  whereas scene.objects is all the objects in the scene.  Not sure why you would want to use context.selectable_objects for this case.

Simply deselect if not a mesh, assign first mesh obj as active (if there are mesh objs) , and then call bpy.ops.object.join().

Used bmesh for limited dissolve, takes away the need to pop modes.

Tested fine on object1.obj

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

# make a bmesh
bm = bmesh.new()
dissolve = True
filepath = "/home/batfinger/Downloads/model1.obj"

bpy.ops.import_scene.obj(filepath=filepath)

mesh_objs = []
for o in context.selected_objects:
    if not o.type == 'MESH':
        o.select = False
        print(o.name, "not a mesh")
        continue
    if dissolve:
        # use bmesh to dissolve
        bm.from_mesh(o.data)
        print("Pre dissolve", len(bm.verts))
        geom = bmesh.ops.dissolve_limit(bm, angle_limit=0.082665,
                                        verts=bm.verts,
                                        edges=bm.edges,
                                        delimit=0)
        bm.to_mesh(o.data)
        print("Post dissolve", len(o.data.vertices))
        bm.clear()
    # append the mesh object
    mesh_objs.append(o)
bm.free()
# if no mesh objs do nothing
if mesh_objs:
    scene.objects.active = mesh_objs[0]

    bpy.ops.object.join()
    # newly joined obj
    obj = scene.objects.active
    # look at verts
    verts = obj.data.vertices
    vertsx = [v.co.x for v in verts]
    vertsy = [v.co.y for v in verts]
    print(len(vertsx), len(vertsy))


How can I converted a linked collection to a local collection? I would like to switch some materials of my linked collection, but how can I instanciate it so I can edit those materials?
Will the meshes remain linked?

Thanks!

You can run the command 'Make Duplis Real' which can be found under the F3 key since blender 2.8. However, it works correctly only sometimes. The biggest problem is it breaks parenting of objects in the collection.

The add-on BlenderKit has a command in its panel called 'Bring to Scene', which converts linked collections into appended data also with hierarchy. It's in Blender 2.8 directly in add-ons. It does several steps for you and most of the time makes what you need.