OSM skillion roof with bmesh... need an alternative to ray_cast OSM buildings with the skillion roof shape, are often tagged with only direction and levels.

{'direction': '357', 'shape': 'skillion', 'levels': '1'}
{'direction': '267', 'shape': 'skillion', 'levels': '1'}
{'direction': '87', 'shape': 'skillion', 'levels': '1'}

The direction Vector can be obtained using

tag_direction = 270
a = radians(tag_direction)
v = Vector((sin(a), cos(a), 0)) # west (-1, 0, 0)

For example the default Cube could be considered a building, and given a 1 bu height, direction 0, skillion roof would look like

Here is some code to produce skillion roof from default cube, alter height and direction d to test.

The code adds a new cube, uses its top face as the roof, from the centre of the face, ray casts in the slope direction for low point and in negative slope direction for the high point.

These intersection points are then used to project the roof verts to the pitched plane which is defined by low point and the resulting normal of the pitched plane.

import bpy
import bmesh
from math import sin, cos, radians, degrees
from mathutils import Vector

from bpy import context
bpy.ops.mesh.primitive_cube_add()
cube = context.object
mesh = cube.data

d = 90
a = radians(d)
b = radians(d + 90) # ortho to direction
height = 1

up = Vector((0, 0, 1))
# direction vector
v = Vector((sin(a), cos(a), 0))
# ortho to direction vector
vo = Vector((sin(b), cos(b), 0))
bm = bmesh.new()
bm.from_mesh(mesh)
# roof face is index 5
bm.faces.ensure_lookup_table()
roof = bm.faces[5]
centre = roof.calc_center_bounds()
# use ray cast to find low and high point.
low_pt = cube.ray_cast(centre, v)
high_pt = cube.ray_cast(centre, -v)
print(low_pt, high_pt)
# add height to high point
high_pt[1].z += height
#Vector Across roof
V = low_pt[1] - high_pt[1]
print("Roof Pitch", degrees(v.angle(V)))

# define a plane at low point with normal n
# n is normal vector of pitched roof
n = vo.cross(V).normalized()
p = low_pt[1] # low point
# project verts in up direction to plane.
for v in roof.verts:
    v.co = v.co - (v.co - p).dot(n) * up
# check out result
bm.to_mesh(mesh)
mesh.update()

The rub is that I don't believe I can use ray_cast when building the objects as a bmesh, without having to to_mesh, which for potentially thousands of buildings could be expensive.

What alternatives would I have to the ray_cast call that essentially find the intersection of a line with a polygon.

Finding the intersection between a plane and a line could be done using the mathutils module. There are a few nice functions in there, the most interesting one for you is mathutils.geometry.intersect_line_plane(). It basically takes four arguments, all of them Vectors, describing the setup as follows:

mathutils.geometry.intersect_line_plane(VecLineStart, VecLineEnd, VecPlaneOrigin, VecPlaneNormal)

it returns either the intersection point or None (if line and Plane are parallel).

Example:

x = mathutils.geometry.intersect_line_plane((0,0,0), (0,1,0), (0.33, 1.12, 2.44), (0,1,0))

gives you

Vector((0.0, 1.1200000047683716, 0.0))

which is the Intersection Point between the line from (0,0,0) to (0,1,0) - extended to infinity - and the plane defined by the origin at (0.33, 1.12, 2.44) with its normal pointing at (0,1,0).

More info can be found in the API docs here: https://www.blender.org/api/blender_python_api_2_78_release/mathutils.geometry.html?highlight=mathutils.geometry#mathutils.geometry.intersect_line_plane


The soft bodies are attracted to each other. Why? I created a scene with a rope (SoftBody) and two box with Collision only. The rope attracted to the boxes but I don't know why.
I created two videos: https://youtu.be/CWTQKD52Csg and https://youtu.be/BQJUS1dK6Vg
The Blender file: https://drive.google.com/file/d/1-33uqCH0g1cX0kcNvaC0VoW6tJxqkfVA/view?usp=sharing
Thanks.

I checked your file and first, I fixed the normals of the wire cube.  (flip normals)
I also applied the scale to the wire cube >  (ctlr+a) apply the scale.
But what really fixed it was altering the soft body and cloth physic :
Keep thickness outer the same but set inner to 0.001
That was a kinda weird problem to solve, I've never seen anything like it before.
In fact, I think this might be useful as well, lightning strike effects or so..


shrinkwrap ("decal") around entire object? I just want to (shrink) wrap a plane with an image over (around) the entire object, not just one face / plane.

[EDIT, after two answers] Many have said that original question is unclear. So now that I understand what I was asking %-/, here's the translation:

How do I cover an object with a picture without using UV Mapping -> unwrap?

[EDIT] Skip down to the accepted answer from Duane Dibbley.

Perhaps superfluous details, an example of an only partially successful attempt:

Start Blender with factory defaults (will use default cube).
Create Plane.
Drag drop some arbitrary image onto plane.
Set parent of plane to cube (via drag drop plane to cube in Outliner).
Click plane.
Add Modifier: Shrinkwrap.
Set target to cube.

At this point, it's just on the top face of the cube. How can I get it to cover the entire cube (all faces), e.g. "folding" it around the whole thing? If this turns out to be more complicated, e.g. requiring some UV / mesh mapping things, can you please point out a link or two that might assist?  (I've looked a bunch of tutorials, blender wiki, and blender docs (which I wish had examples, not just parameters :)), but I seem to be denser than that cube! Thank you!
- H

[EDIT:] Requested Screenshot --- the "brain" should cover the entire cube, but not multiple same images on each face, i.e., the cube should look like a brain in the shape of a cube.

It is completely unclear to me what you are trying to accomplish, or why you want to use the tools proposed in the question. So I'll post an answer as blindly as trying to break a piñata:

(photo: AlejandroLinaresGarcia, Wikipedia)

If you want a cube with a texture, use the texture directly on the cube using UV coordinates:

If you need the cube to have different front and back, the images mapped have to correspond with those views:

To have some geometry converted to the shape of another, then you'd use the shrinkwrap modifier. Have the brain object be larger than the cube, the you can shrinkrwrap it around the cube using nearest surface point:

Brain model by mahesh downloaded from  http://www.blendswap.com (login required)


Multiple meshes per object I'm fairly new to blender but I've write some python to import some old models from triangle data with UV texture images.  Some of the models have more than mesh so each mesh has its own UV texture.

In blender would I create one object per mesh or create 2 meshes under one object (and if the latter - how is that done in python?)

One mesh in blender can have multiple materials, so you can join your input meshes into one for blender. Simply assign a separate material for each input mesh.


Delete parent object hierarchy in code How can I delete hierarchy of objects in code?
When trying to delete the "parent_obj", it's written in the GUI tooltip:

bpy.ops.outliner.object_operation(type='DELETE_HIERARCHY')

I tried to select the "parent_obj" using this code:

context.scene.objects.active = bpy.data.objects['parent_obj']

But got this error:

File "~/blender-2.76-rc2-linux-glibc211-x86_64/2.76/scripts/modules/bpy/ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.outliner.object_operation.poll() failed, context is incorrect

Edit

Ok, I've found how to bypass this problem. Instead of using bpy.ops.outliner.object_operation(), I first select the objects hierarchy, and then used bpy.ops.object.delete():

bpy.data.objects[obj_name].select = True
for child in bpy.data.objects[obj_name].children:
    child.select = True
bpy.ops.object.delete()

Your own solution probably works fine in your case, but the general case where the hierarchy is a bit more nested (children of children) might still deserve a solution.

perhaps something recursive:

import bpy

def delete_hierarchy(obj):
    names = set([obj.name])

    # recursion
    def get_child_names(obj):
        for child in obj.children:
            names.add(child.name)
            if child.children:
                get_child_names(child)

    get_child_names(obj)

    print(names)
    objects = bpy.data.objects
    [setattr(objects[n], 'select', True) for n in names]

    bpy.ops.object.delete()

delete_hierarchy(bpy.context.active_object)

This function assumes no objects are currently selected, and accumulates the names of the hierarchy starting with the main object ( i used active_object, but you can pass any object reference there ). Then it selects all the found names, then runs the object_delete operator.


How to remove background? I wish to remove the background of these videos: https://skydrive.live.com/redir?resid=117AB4E465BB25B0!25610&authkey=!AFwzaPNg8TirZQ8

However, sometimes the camera moves up and other things can be seen. How can I remove that too?

You can use masks to isolate your objects from the background. These masks can be animated with keyframes or attached to a tracker to stay on the objects. But it is quite cumbersome.

Masking tutorial: http://learningblender3dsoftware.blogspot.de/2012/10/blender-264-tutorial-intro-to-masking.html

Video tutorial which covers masks in combination with Trackers: http://www.blenderdiplom.com/en/tutorials/all-tutorials/424-tutorial-sin-city-effect-in-blender.html (click the third link below the video: "8:50 - 12:40 ...")

Blender wiki: http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Mask_Editor


How to import an object into an Armory game scene while the game is running? How can one import an object (an obj) in an Armory game while the game is running? For example, I want to import an object (car.obj) when I press a key and remove that object if I press another key. I wonder how this would be possible using a Haxe script or a logic node set up?

In case it is not possible to import an obj file directly into the scene I don’t mind converting the objects to another format that Armory supports. I just need to be able to import my objects into the game environment and remove them. Is that possible?

The closest things I found are this and this Armory example scripts but they do not import objects that are stored on disk. For my work, I need to be able to dynamically manipulate objects, store them on disk and load them into the game and these scripts seem to not be helpful for me.

If you mean add an object into the scene, you use the import. Click file in the top right, hover over import, and click wavefront for an OBJ, Then import what you want to. If you mean have it go into the game at a certain point, that'd take other scripts. I don't really know what you mean by a game, I assume you're making a game.


Why does it render smooth? I know I did by mistake a key combination in sculpt mode but i dont know how to reset this. I just want a low poly image of this tiles:  but in sculpt mode and the rendert image (not render mode!) are smooth like u see in the picture

I know I did by mistake a key combination in sculpt mode....

From looking at your image, and from your description, it sounds like you most likely pressed Ctrl+2 or otherwise activated the Multi-resolution Modifier while sculpting.

This modifier has separate preview/ sculpt and render settings much like the Subdivision Surface Modifier as seen in the left column of the modifier settings.

From the manual:

  Levels

  The left column of settings control the general quality generated by
  the modifier in various contexts.

  Preview

  Set the level of subdivisions to show in Object Mode. Sculpt

  Set the level of subdivisions to use in Sculpt Mode. Render

  Set the level of subdivisions to show when rendering. Quality

  How precisely the vertices are positioned (relatively to their theoretical position), can be lowered to get a better performance when
  working on heavy meshes.

If the render and preview amounts do not match, you will see a different result when rendering, although performance may be improved with lower sculpt/ preview amounts in some cases.

In your specific situation however, needing a low-poly object you can simply remove the modifier. (click the x icon)


How do I import a Second -Life Avitar (XML file) into Blender? I have recently downloaded Blender 2.71 as I thought maybe it would have the import/export option for xml that 2.70 did not. I have only been using blender for two months. I have not used any other game engine software. I'm learning this for rigging purposes for a job that I just got.

I need to import a .xml into blender since that is the type of file the platform uses.

Is there an addon that I can put into Blender for xml and if so, how do I install it to blender? (<<< this is the VERY specific question) Every tutorial on rigging avatars shows how to get the avatar from Second Life into Blender and EVERY single video shows exactly what I commented. They then go into Blender and have the option in their older versions of Blender to IMPORT .xml. So.... again, even though I asked very specifically, is there an addon that I can put in my Blender's Addon folder that allows Blender 2.71 to use/import/open/(whatever other word you would like to use here for the same meaning) .xml so that I can actually begin learning how to rig SecondLife avatars.

Thanks so much!

I have tried using this tutorial: https://www.youtube.com/watch?v=fJIrQw-RMd0&list=PL11D6E99BB51A2BB2&index=1

However that website does not work anymore.

I then tried using this tutorial: https://www.youtube.com/watch?v=ELC4B0PAXDs&index=2&list=PL11D6E99BB51A2BB2

However Wiz Daxter's pluggin does not work either. After extracting the files to the addon folder for blender, the next step is to open blender, go to user preferences, go to addons, choose import/export and enable pluggin. The pluggin is not in the list.

So I'm out of ideas on how to download a pluggin, addon, or extension thing to make Blender accept the Appearance to xml avatar. Second Life only allows you to take your avatar from game in this fashion.

As you said the Wiz Daxter addon is perfect for the importation of secondlife XML file.

If you have trouble for the installation here are some advice:

First this addon work only for 32 bits version of blender.

After downloading the Wiz Daxter addon, the 1.0.9 version, extract it in you blender folder. In my case it's :

C:\Program Files (x86)\Blender Foundation\Blender\2.71\scripts\addons

/!\ Put only the SLAV folder and not Blender263_SLAV_109 in your addon folder!

Now you can enable your addon in the user-preferences that you can acces with ctrl+alt+u.

Then the addon is in the Impot-Export Section and its name is Import Secondlif Mesh and Skeleton.


How do I make a face swap animated character in Blender? I don't really know what to call this post but basically, I saw this cool kind of animation style where the animators used premade faces and then swapped them out in order to make an animated face. The style looks really cute and I would really like to replicate it. Here is an example from True And The Rainbow Kingdom:

As you can see, the face is animated with multiple premade models that seem to be switched out every few frames when a new sound is made from the mouth. Is there any easy way to do this in Blender?

This is what my character looks like:

There are multiple ways to do this.

Assuming your three faces share topology, the simplest is to join them as shapekeys to a base version of your mouth, and animate the shapekeys with constant interpolation instead of bezier handles.

If you need to use multiple models, you can control the visibility of a mesh using drivers, driving either Cycles settings or material transparency.  Because Cycles doesn't handle coincident meshes well, even transparent coincident meshes, you may have to combine this with simple shapekeys that shrink the hidden meshes.  Again, you will want to animate with constant interpolation-- you don't want to fade in and out, and you want hard switches.

Your drivers should probably all use the same ultimate control.  A good example would be via a bone, where you set the mix node between a regular shader and a transparency shader based on, say, the global Z position of a particular bone, and you set the expression to be (var>= 1.0) and (var <2.0) .  That way, you make sure that you're never showing two meshes at the same time.


Cloth Filter with Collisions Today I tried out the Cloth Filter in Blender 2.9 while in sculpt mode. I was hoping the filter would collide with other objects as they would with the cloth settings under the physics tab, but so far no luck. I was hoping to drape some shorts over a character’s legs using the cloth filter to get a few natural looking wrinkles, and then keep on sculpting afterwards.
Basically, what I am trying to do is the same as what is posted in the video here: https://developer.blender.org/D8019
Is this collision capability just not released yet, or is this something I should be able to accomplish today?

It appears that collisions while sculpting will arrive in 2.91..not 2.90: https://wiki.blender.org/wiki/Reference/Release_Notes/2.91/Sculpt


Select linked with duplicate vertices I have a model in which sharp edges are achieved with duplicate vertices. I would like to be able to select linked vertices, in such a way that duplicate vertices are considered 'linked'. Is there any way to do that?

(I can of course remove duplicate vertices first, but then these edges become smooth, which is not what I want).

Place your Cursor on the Linked vertex in the Edit Mode and Press L on your keyboard, it should select the linked vertex


RuntimeError and TypeError when trying to call wm.event_timer_add I'm currently working on a script for blender and I used the Modal Timer Template.
The problem is that one line is constantly giving me errors.

Here the source code:

def execute(self, context):
    wm = context.window_manager
    self._timer = wm.event_timer_add(0.1, context.window)
    wm.modal_handler_add(self)
    return {'RUNNING_MODAL'}

And I get the output message:

Traceback (most recent call last):
    File "/home/tobias/Datenablage/Programmieren/python/Artnet_Visualizer/Blender_implementation.blend/sniffer_timed.py", line 62, in <module>
    File "/home/tobias/Temp/blender-2.80-f36efe0e2ad-linux-glibc224-x86_64/2.80/scripts/modules/bpy/ops.py", line 200, in __call__
        ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
    File "/home/tobias/Datenablage/Programmieren/python/Artnet_Visualizer/Blender_implementation.blend/sniffer_timed.py", line 41, in execute
TypeError: WindowManager.event_timer_add(): required parameter "window" to be a keyword argument!
location: /home/tobias/Temp/blender-2.80-f36efe0e2ad-linux-glibc224-x86_64/2.80/scripts/modules/bpy/ops.py:200

I'm kinda new to scripting in Blender so I have no idea what I should do.

Thanks for your help

The comment above by batFINGER worked:

There are many changes in 2.80 and it appears this could be one. Given the error message try wm.event_timer_add(0.1, window=context.window) ie make it a keyword argument.


exported .obj files have now 3 seperate parts I have an object with 3 separate layers/meshes. I need it to be only 1 layer to import and attached various scripts in unity.
I have brought it into blender and joined the separate meshes so now only one mesh and also one UV layer.
But when I export it out again as a.obj file and then import the .obj file to unity it separate it again into 3 separate layers. am I exporting it incorrectly?

I'm sorry, I'm not allowed to comment questions, so I have to answer:
I was not able to replicate the problem with different export settings, so I'm guessing it's how you join the meshes.
Did you combine them by pressing 'ctrl+j'?
What are your export settings?


How can I export .mesh files? I'm using blender2Org to export .mesh file but what I get is .material, .mesh.xml and .scene. How can I get the .mesh file? My game engine use only .mesh.

I've found the solution :

download the Ogre Command-line Tools
create a new folder in your root directory named OgreCommandLineTools ( C:\ for me )*
copy paste what you have downloaded from Ogre command-line Tools in the previous folder

now when you export your 3d model with blender2Org you will find the .mesh file


bisect_plane not clearing in python API Here is my bisect plane command, which does infact produce new verticies along the bisected plane (Blender 2.90):
print('Nverts0',len(bm.verts), len([v for v in bm.verts if v.is_valid]))
bmesh.ops.bisect_plane(bm, geom=bm.edges, dist=0.0001, plane_co=point, use_snap_center=False, clear_outer=True, clear_inner=False)
print('Nverts1',len(bm.verts), len([v for v in bm.verts if v.is_valid]))

However, niether the clear_outer nor clear_inner option has an effect on the geometry or on how many vertices are there are (the printouts). And the v.is_valid flags aren't set false either. Why aren't clear_outer and clear_inner working?

Set the normal
The default values of cutting plane coordinate and normal are (0, 0, 0).  A zero length normal is invalid and quite likely does nothing.
Test script
Here is a minimal working example of a script, adds a cube, runs the operator with plane coordinate at origin and its normal as the x axis. Recommend setting up a little script like below when asking questions
import bmesh
import bpy
from bpy import context

bpy.ops.mesh.primitive_cube_add()
ob = context.object
me = ob.data
bm = bmesh.new()
bm.from_mesh(me)

print('Nverts0',len(bm.verts), len([v for v in bm.verts if v.is_valid]))
bmesh.ops.bisect_plane(
    bm,
    geom=bm.edges,
    dist=0.0001,
    plane_co=(0, 0, 0),
    plane_no=(1, 0, 0),
    use_snap_center=False,
    clear_outer=True,
    clear_inner=False,
    )
print('Nverts1',len(bm.verts), len([v for v in bm.verts if v.is_valid]))
bm.to_mesh(me)

Result
Nverts0 8 8
Nverts1 12 12

Effectively bisecting all x axis aligned edges, creating 4 ngons with 6 verts.  Nothing to clear as faces are not "ripped".
Input geometry
For clear to work on a mesh that has faces, we are going to need to add the faces and verts to the geometry input of the operator.  Recommend with geom giving all geometry of a region of interest will make all options work as expected.
    geom=bm.verts[:] + bm.edges[:] + bm.faces[:],

making this change an running again
Nverts0 8 8
Nverts1 8 8

Has bisected cube, same vert count one less face.  The "outer" is cleared, ie all resultant geometry on the input normal's side of cutting plane.

Return Dictionary
Bmesh operators return information in a dictionary.
ret = bmesh.ops.foo.bar(blah)

in the case of bisect plane it has members "geom_cut" the edges and verts of the cut and "geom".
Some Examples of using bmesh bisect plane operator.
Python: Bisect mesh into n parts, without separate 'LOOSE'
using bisect but still failing
Slice up terrain mesh into chunks
How to get part of a mesh with Python API, which requires breaking down some faces?
Cutting a mesh in half
How to extract side-view outline (e.g. top view) of a 3D object to 2D surface?
Transform cylinder to flat plane - cylinder maze map


How do you join two models together without messing up existing shapekeys? first time asking a question on here so I'm sorry if I leave anything out of my question.

Getting straight to the point, like the title says, how're you able to do that? In my case I have a Head Model that contains many shapekeys on it (like expressions). I just want to simply connect it to a body mesh/model without the shapekeys basically getting destroyed.

I've tried some common methods such as bisecting the body model around the neck and then bridge edge looping the head and body after joining - as well as going by each and every one of the vertices of the head and the neck and joining them that way. I mean, both methods end up looking nice after some smoothing but the shape keys I had on the head are practically destroyed and cause weird deformations (even around places that don't have anything to do with the original shape key).

Thanks for your time!

There is no problem in joining two meshes with shape keys: you only have to be sure that - before entering edit mode - the "basis" shape key is selected in both the meshes. If some shape keys share the same name, change one of them or they will be merged.
All Shape keys are retained as long as you don't modify the vertices moved by shape keys.

If a shape key moves some vertices that you want to stay still: select all vertices you want to stay in the "basis" position, Ctrl V "Blend from shape", in the left bottom corner of the "T" toolshelf panel select "basis" and uncheck the "add" option. This method works also for copying part of a shape key into another.


My armature is not connected with bones I follow every Step which given in tutorial, but my armature is not connected with bone. After creating armature and bone, I tried to move my bone and armature in pose mode, but it's not working.

Make sure the parent bones are set correctly


How do I get an object to ensure it is perfectly in line with the x, y and the z axes? I created this object by creating an ico sphere (for the main body) and cylinders (for the legs and eyes).  When I joined everything together it is showing a different number for the rotation on the y axis.

How do I ensure that the entire object is perfectly in line with the x, y and the z axis?

Yes I know I could just press Ctrl + A  and then click on rotation to set its current rotation as 0, but what if while I was constructing this I have accidentally rotated a tiny bit?

As shown in the 2nd image, specifically where I have circled and selected the current vertex, I know that this is the center of the front face. I want to use this point to determine if it is point completely straight along the y axis, how do I do that?

My guess is that you joined one of the legs as the final active selection. The final active selection becomes the new origin (and orientation) for the combined objects. The left middle leg looks like it's rotated 48 degrees on Y. Start again, select the body last. If you have accidentally moved it in the process, AltR, AltG will set it back in place.


How to edit my second object only?(instead of edit the first and second objects together) I have two objects in the same collection. How can I edit(like transform) the second object only? I can only edit both objects in the same time.
(for example, I have object1 from mesh1, and object 2 from mesh2, and I use codes below)
ob = bpy.context.edit_object

me = ob.data

bm = bmesh.from_edit_mesh(me)

for v in bm.verts:

    v.co.z *= -1

bmesh.update_edit_mesh(me)

The codes seem only edit the whole meshes and objects.
I only want object2 to be done like this, and leave object1 the same as before.
Thank you

Thank you for your answer! However can you show me the resolution using my style of codes below? I only want to change obj2 but the codes changes obj1 and obj2 at the same time.
mesh1 = bpy.data.meshes.new('mesh1')
obj1 = bpy.data.objects.new('obj1', mesh1)
bpy.context.scene.collection.objects.link(obj1)
mesh2 = bpy.data.meshes.new('mesh2')
obj2 = bpy.data.objects.new('obj2', mesh2) ;
bpy.context.scene.collection.objects.link(obj2)
bpy.context.view_layer.objects.active = obj2
bpy.ops.object.mode_set(mode='EDIT')
ob = bpy.context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)
for v in bm.verts:
    v.co.z *= -1
bmesh.update_edit_mesh(me)

And the two meshes( or two objects ) change at the same time, how to correct my codes to make changes to obj2 only? (this code is only an example, what I want to see is the way to edit the obj2 instead of both obj1 and obj2, so can you please just write some codes in general, thats enough for me, not for specific codes to create real obj1 and obj2)

A way to do its is to use bmesh.ops with mirror.
import bpy
import bmesh

# Get the object and its mesh
obj = bpy.context.object
mesh = obj.data

# Give the mesh to a bmesh
bm = bmesh.new()
bm.from_mesh(mesh)

# Call the mirror operation with Z axis
bmesh.ops.mirror(bm, geom = bm.faces[:], axis='Z')

# Back to mesh
bm.to_mesh(mesh)

# Force update (if not the screen won't refresh immediatly)
mesh.update()


Turning off texture smoothing in Blender Render (Exclusive to Blender Render) I want to make a render of a PSX model and the model's render looks horrible. It's really just the textures, and all the answers I look up and people deal with it in Cycles, which I don't understand one bit.

Disable 'Interpolation' will make the image texture pixel-sharp.

Result:


How do I color the shading of a material? Some art styles increase the saturation in their shading, I'm trying to achieve this effect as seen in cell #2 of my example image. Right now it looks like cell #3, which lacks this and looks dull in the render.

I just have #1 as a default frame of reference, and #4 is an exaggeration of the effect I want; using color for darker areas instead of just darkening. If I could achieve the effect in cell #4, I could easily change it to be like cell #2.

So far I have tried creating 2 material nodes with one of them inverted, and then mixing them. This doesn't show in render mode, and it still doesn't let me change the color where needed. I'm not sure how to go about creating the effect shown in cell #2, because I'm quite new to nodes.

This is something you can do very easily in the Blender Internal renderer, where, unlike Cycles, you can feed the output of light's interaction with a surface back into the calculation.

In Cycles, this would lead to a feedback loop: (lighting affects surface affects lighting affects....), so there, you would have break the loop by baking the outcome of one light/surface interaction as, say, a diffuse texture,  and use it to influence a  second.

Simplest sort of node setup:

(You can use the shading output any way you like)

Result..

In Cycles, you could find a more physically-based route to a specific effect you were looking for .. perhaps subsurface scattering, translucency, fresnel...


Custom property panel not showing I try to display a custom property of a 3D object belonging to scene A in a panel that only appears in scene B.

At the time of the initialization : The scene A (that will be set by the user) it's not defined yet. So the panel shouldn't be shown. Also, when no object is active in the scene A, the panel should be hidden.

So far, here's my code :

class tags_panel(bpy.types.Panel):
    bl_space_type = "SEQUENCE_EDITOR"
    bl_region_type = "UI"
    bl_label = "zebra"

    @classmethod
    def poll(cls, context):
        if bpy.context.screen.scene.name == 'B':
            return

    def draw(self, context):
        global main_scene
        try:
            self.layout.prop(main_scene.objects.active, "my_prop")
        except NameError:
            print("something wrong...")

For now the panel is not showing.

Can someone explain me the use of poll() and how I can manage to display the panel only if all conditions are met ? Thank you so much !

A panel disappears if poll() returns False:

    @classmethod
    def poll(cls, context):
        return context.scene.name == 'B'

If Scene.name is equal to 'B', it will show.


Colour mixing in Blender Game Engine I want to create a game which is to choose two parents to generate a child with the mid-point of colour from parents.
For example: There are two cube, A is RGB(255, 0, 0), B is RGB(0,0,255). When I click a button, then the system will generate a new cube which is C, C is their child with parent colour mixed, C is the mid-point colour of its parent RGB(128, 0, 128).
Then, if I have many parents with different colour, I select two from the parents pool and hope the system to generate the child with the mid-point colour from parents. How can I do it?

As the RGB color space is 3Dimensional I suggest to directly set the object color via Python.

import bge

object = bge.logic.getCurrentController().owner

red = ... # value between 0.0 and 1.0
green = ... # value between 0.0 and 1.0
blue = ... # value between 0.0 and 1.0
alpha = 1.0

object.color = (red, green, blue, alpha)

You can calculate the "mixed" value by calculating the average:

def mean(*numbers):
    return sum(numbers)/len(numbers) if numbers else None

usage:

red = mean(0.3, 0.7)


In compositor 2 images overlay each other I have two objects on two different layers. Gem and surface plane. I also use HDRI and because of that I can't disable "Use environment" option in Render Layers menu. I followed this tutorial in goal to achive glare effect on gem stoune. But in the compositor I either loose surface or loose gem stone. What nodes should I use to preserve either surface mesh and gem.

Use a Color > Alpha Over node to combine both layers, then use the Diamond layer Alpha channel map as mixing factor.

Make sure you created a proper alpha map in the Gem layer so it can be properly combined.


How do you texture with a photo taken from an angle without distorting it based on the polygons? Recently I ahve been trying to take a more "quick and dirty" aproach to 3d design, and one of the problems that I have encountered is that making uv projections without much thought (aproximating the position of vertices a lot) in an image taken from an angle produces distortions because it is calculated in a per-polygon basis, which forces me to make a lot of subdivisions (which I have seen done in the tutorials I have watched, but it makes it hard to modify geometry later). Using the subdivision surfave modifier and extra vertices in edges (to keep them sharp) doesn't work (or I'm doing it wrong), as it makes the corners stretch. How should I aproach this?
Quick example of what happens:
How it looks:

With subdivisions:

With subdivision surface:

I am maybe misunderstanding what you are trying to do but will ask anyways.If all you are trying to do is map the 2D image to the 3D box shape why are you using any subdivisions at all ?
Surely the simplest approach is to select the 3 appropriate faces of the simple cuboid and U to open the UV Mapping menu and choose the Unwrap option, then reposition the 7 vertices in the UV space as accurately as you can over the image.


What does "change" "repair" or "remove" mean in the blender installer? When I try to install blender, it says change, repair, or remove. I tried clicking change and repair, and install after that but it does nothing. When I delete it and try again the same thing happens.

Sounds like you are using a Windows installer. If that is so, Change, Repair, Remove are the options the installer is giving you. Remove would be un-installation, Repair would be like a re-installation. It should be noted that there is no reason to install Blender on your system, and in fact it is desirable not to. Instead download the compressed archive of Blender for your OS and you can drop the program into your root project directory. This way you can keep whatever version of Blender you are using for each project along with addons/settings on a per project basis and it will be fully portable to other computers. Helps ensure you maintain project compatibility and prevents you from ending up with a dozen Blender installs on your system as each version comes out. Especially true if you ever use developer builds or branches.


How do I find the users of a datablock using the Python API? Given a datablock foo, how do I determine which other datablocks are referencing it? foo.users will tell me how many references there are, but do I have to loop through every other datablock in the file to find those references? If so, can anyone recommend a reasonably generic way of doing this given the different interfaces of various datablock types?

For my specific application I'm trying to find and delete (or modify) datablocks with names matching a pattern. I'm mostly interested in node groups and images, which seem to acquire hidden users more easily than other objects, but this type of functionality seems generally useful.

There is no way, internally Blender also doesn't store this data for easy access.

However some data types have convenience properties added to them to access some of the users.

Object.users_scene
Object.users_group
Object.children

Are handy in many cases, but specific to object types.


How can I animate the visibility of a face? I am making an animation where the character is shimming across a ledge, and the ledge starts to crumble.  I would have to delete faces of the ledge to make them crumble.  How can I do that?

You could use a Mask modifier if you really want to delete certain faces on a certain frame, however I'm not sure this is really what you want to do.
Mask modifier:
If you really want to delete a specific face (or faces) on a certain frame, then you can use the Mask modifier.

Select the faces you want to hide and assign them to a vertex group in Properties > Object data > Vertex groups

Add a mask modifier and select your vertex group and enable Invert by clicking the button next to the vertex group selector:

Keyframe the visibility of the modifier by hovering over the eye icon and pressing I.

If you want more variation, try using a reversed Build modifier. This will delete all faces in the object over time, either randomly or in order.
Fracturing:
If you are trying to make a more complex/realistic
You might also want to try the Cell fracture addon (see this post):

Or the explode modifier.


How to python script "Scale B-Bone"? I want script "Scale B-Bone" to be in proportion to Bone Length.
How do I access this property?

Note I am interested in Scale BBone and Scale please refer to bellow image

The pose bones can be found at bpy.data.objects['Armature'].pose.bones with each bone having a length property bones['Bone'].length which represents the visible length in pose mode.

The bbone size that you change when using "Scale BBone" is two properties of the armatures bones which can be accessed through bones['Bone'].bone.bbone_x and bones['Bone'].bone.bbone_z

import bpy

ratio = 0.3
pose_bones = bpy.date.objects['Armature'].pose.bones
b = pose_bones['Bone']

b.bone.bbone_x = 1 / b.length * ratio
b.bone.bbone_z = 1 / b.length * ratio


Subdivision modifier fails on cylinder FYI I am very new to Blender.

I need to:
Create a cylinder with a cavity - just like a cup.

What did I try:

Created a cylinder.
Created a cylinder within it.
Used "Boolean" "difference" to create the cavity.
Smooth result using "Subdivision modifier".

The problem: the "Subdivision modifier" creates a very weird result (see images).

Two questions:

Why this is happening?
How should this be done properly?

No need to use Subdiv modifier which gives you more details but not necessarily smooth shading (unless you have high enough subdivision which is overkill).

How about starting from a cylinder, inset, extrude down, shade smooth and auto-smooth?


How to create geometry with "point and click" and set number of vertices? I am trying to devise a way where I can "point and click" to create a line geometry and specify the number of vertices in this line.

So, this would look like me setting a "start" point / vertex by clicking, and then clicking at some other location to finish the shape (forming a line) but then being able to specify the number of vertices in that line (equally spaced) so that I do not have to go through the long process of extruding and dragging each time I want to create a vertex or trying to subdivide after I have made a line.

This way I could just click two points in 3D and say "join these points with a line that has X vertices".

Is there a pre-existing or relatively straightforward way to do this? The reason I am interested in using a "line" is that I am trying to make a correspondence between each vertex and a light, so I do not need a grid which would have two vertices at each point.

This is a rather trivial problem. In edit mode, in the 3D viewport, locate the 3D cursor where you want the first vertex (starting point) and while holding down the CTRL key, click the left mouse button. Then, move the cursor to the location at which you want the other vertex (end point), hold down the CTRL key, while clicking the left mouse button again. Now, select the first vertex, and while holding the SHFTkey, click the vertex that you chose as the start point, and press the Fkey to join the two vertices with a line segment. With the line segment selected, use the subdivide tool (press the spacebar, and enter "subdivide" in the search bar) to create the number of intermediate vertices desired. The default behavior of the subdivide tool us to space the intervenient vertices equally between the end points.


Making inside of glass Both of the yellow spheres are exactly identical, but the one in the glass cube looks more bleached than the right one.
Which variables should I be looking at to make the color of the left sphere look as vivid as the right one?
Thank you all always!

The trick here seems to be environment reflection.
When I use World with simple white color seem to be fine.

Doesn't matter if object is solid glass volume or a shell.
Alternatively you can place black Plane behind Camera so there are not lights reflected in front surfaces.


Displaying keyframed opacity / transparency in Material mode in viewport? If I drag to change the Alpha value for a material, it updates continuously in the viewport when viewport_shade is set to Material; the object appears to fade in and out.

However, if I use keyframes to change that same value, the display does not update. What's going on? Is this a bug?

Notes:

I don't think this is a duplicate of this question because the asker seems to be referring to Rendered mode rather than Material mode. It's a little unclear what mode he was referring to, but there is no useful answer to my question there, and that question is 2 years old.
I have enabled Transparency under Display in the object properties.
I have set Shading to GLSL.
I'm using Blender 2.7.4 on Kubuntu 14.04 64 with a Nvidia GTX 750 Ti.
You can replicate this simply by creating a cube, giving it alpha transparency and doing as described above.

I am fairly certain this is a limitation of the current system. Simply put the changes in material settings don't trigger updates in the viewport. Manually altering values in the node editor or the material properties causes the UI to deliberately send an update event to the viewport, keyframed changes during playback don't. The keyframed changes do pass through to the render engine though.

I wouldn't expect this to change until the new dependency graph work is finished.


Color of curves and their control elements, question 2 When I draw Bezier curves, they get initially displayed as thin black lines or curves, which can't be seen well against a dark background.

Then, later, they are displayed as thin yellow or orange lines or curves.

Where can these two colors be changed? Where can their thickness be changed?

Also, can I change the size. length, or color of vertices and control points and lines?

I'm not sure if I need this for object mode, edit mode, 2d, or 3d, sorry. I just want to change these in general, at least for now. In case it isn't obvious, I'm a beginner.

(There is a question with duplicate title that seems to discuss something not quite the same. I don't understand the answers to that question, but I cannot create comments there.)

Yes, I have tried finding this in the Manual but haven't read all of it. I have also searched the Web before posting this question. I'm posting this out of the hope that there is an expert out there who might want to help a beginner.

I don't know about the bezier curve thickness, but for the rest of the changes take a look below.

Go to user preferences (shortcut: Ctrl + Alt + U).Go to themes on the top and 3d view on the side.

Among these options,(10th row from top), 'vertex select' and 'vertex' will change the vertex colors for selected and non-selected vertices respectively.(both for bezier curves and mesh objects)

And in the 24th row, 'align handle selected' will change the handle colors of bezier curves in edit mode. Other settings for bezier curves, start with 'NURBS'

Scroll down until you see something like this.

'Vertex size' is for the size of bezier vertices and the usual mesh object vertices.


Errors in baking normals. I'm either doing something super dumb or I'm not using normals the way they're supposed to be used. Please help Just can't seem to bake normals the right way. I've tried multiple tutorials and read quite a few blog posts. I'm trying to make a whole mech. Best outcome would be to bake the complete mech in a 1-2k texture. However, that is turning out to be a nightmare so I'm thinking of doing 512x512 or 1k textures for different parts of the mech. Now the problem is even the smallest parts are getting errors which I can't seem to solve. Am I doing something wrong? Is Blender not suited for this job? Or are normal maps not viable here and I MUST use geometry? I've been stuck on it for a week now and I'd really appreciate it if you guys could help me fix this ASAP. Here's the image with (hopefully) all the relevant information:
File
PS:I'm trying to make a mobile game and that is why I want to keep the textures small.

The baking works fine, the problem is that all your details are completely parallel or perpendicular to the low poly faces normals. Baking the normals will only be able to scan the faces normals that are not parallel or perpendicular to the rays, bake normals save the faces normals direction, not the faces height.
Here, no bake possible:

Here, the oblique faces are not perpendicular or parallel to the ray so they will be baked:

If your high-poly ever go through the surface of your low-poly, tweak the Ray Distance value so that it nows begin a bit before the low-poly surface (you may also need to tweak the Extrusion value):

In your case, if I scale down one of your details and bake, as the normals are now oblique it will be saved on the normal map, the other ones won't:


Rotating a mirrored object by 90 degrees doesn't work as expected See I am trying to make a window for a skyscraper and I almost got everything but one of the bars of the window frame. When I try to rotate it by 90 degrees it behaves weirdly. I want it to be perpendicular to the horizontal bars in the center.

with that bar selected I hit and release r on my keyboard and type in 90.

Make sure that the Pivot Point is located in the centre of the selected bar.

To ensure that, hit Ctrl+Space to make it visible. If it's already, than skip this. You can also see that using this button:

Then either hit Ctrl + , (it will snap the pivot point to the median point, that is what you want) or use this menu:

In this case it is appropriate to select any of these opitons except 3D Cursor.

Then select your bar, hit R, type some number and release left mose button or hit Space.

Option Clipping in mirror modifier prevents vertices that are on the mirror plane from being moved from it. You would really like to use it if creating any characters, cars etc, when you wouldn't like vertices on the mirror plane being doubled. See this for more info.


Is there a simple/concise explanation out there of script manipulation of mesh objects? I have run out of luck just copy/pasting other peoples code, and now I want to understand (at least somewhat) how to "do some things" to mesh objects. For example, I often do this to make various complicated meshes:

# make a custom purple mesh object
me = bpy.data.meshes.new('tim_the_mesh')
ob = bpy.data.objects.new('tim_the_object', me)

bpy.context.scene.objects.link(ob)

me.from_pydata(verts, [], faces)   # generated earlier

ob.active_material = purple
bpy.ops.object.shade_smooth()

# then, for some reason, I do this to make sure it remains selected
bpy.data.objects['tim_the_object'].select = False
bpy.data.objects['tim_the_object'].select = True

Now I want to make a matching purple sphere

ob2 = bpy.ops.mesh.primitive_uv_sphere_add(size=1, location=(3,3,3))
#ob2.active_material = purple  # Nope!
#me2 = ob2.data   # Nope!

bpy.ops.mesh.primitive_uv_sphere_add(size=1, location=(3,3,3))
ao = bpy.context.active_object
ao.name = "tim_the_sphere"
ao.location = (x,y,z)
#ao.active_material = purple  # Nope!
#bpy.ops.object.shade_smooth()  # Nope!

Each "Nope!" is something I thought might work, but without a decent grip on what is what.

Of course there is more than plenty of documentation all over the internet. But is there something concise, maybe even a block diagram, that will help me see how to "get at" the various properties easily within a script environment? It will be much easier for me if I can get a grip on how these things are accessed.

it's simple in that case.

ob = bpy.ops.mesh.primitive_uv_sphere_add()
print(ob)
>>> {'FINISHED'}

The docs for mesh.primitive_uv_sphere_add don't explicitly mention a return type, and that's a first hint that it won't have a very useful return value.

There are 2 main ways to get object references. Either by:

# getting the reference by object name
ob = bpy.data.objects['Sphere']

# or using the fact that calls to bpy.ops.mesh_xxxxx
# place new objects as the active_object.
bpy.ops.mesh.primitive_uv_sphere_add()
ob = bpy.context.active_object

unlike objects of type BlendDataObjects. These are found in bpy.data.

data.objects
data.meshes
data.materials
# etc

The new() method for those Objects does return an Object reference.

ob = bpy.data.objects.new('tim_the_object', me)

A good approach to learning the bpy is to use that print() statement on objects, or dir(). I'm fairly confident in my bpy-knowledge, but I still use those methods to understand the return values on occasion, and I use dir(whatever) constantly.

Hit control+space after typing this in the python console:

>>> bpy.ops.mesh.primitive_uv_sphere_add(

It will return a lot of information about the function signature, and that works for most functions. But not all functions have elaborate docstrings to tell us the return values (then you use print() )

active_material

your code

ao.active_material = purple  # Nope!
bpy.ops.object.shade_smooth()  # Nope!

assumes that purple is a reference to a material, if that failed, then the next line will also fail.

# this assumes you have a material, called 'purple'
ao.active_material = bpy.data.materials['purple']
bpy.ops.object.shade_smooth()  # probably works with an active object.

this does work:

import bpy

bpy.ops.mesh.primitive_uv_sphere_add(size=1, location=(3,3,3))
ao = bpy.context.active_object
ao.active_material = bpy.data.materials['purple']
bpy.ops.object.shade_smooth()


Trouble with rendering hair I've had a lot of trouble rendering hair on my first character. I can't figure out how to get it to render. The hair looks just how I want it on the 3D view page and I've tried several of the suggestions from other posts but they just don't seem to work for me. (in one case crashed my blender). What I've tried so far is making the hair into it's own object and adding tried and failed at adding a screw modifier. Below is a screenshot comparing the render to the 3D view. Is there any way I can fix it?
Help will be much appreciated! :-)

Just a wild guess here, but it might to do with your settings under the hair particles.  If you are using Child Hairs (Children) there is a setting for "Display" and "Render" - if you have render set to zero, you won't get any hair rendering.

Another possibility is that you have shut off the rendering of the hair by clicking on the "camera" icon beside the name of the particle system in the particle list at the top of the particle property tab - it should NOT be greyed out.

A third possibility is that you have inadvertently turned off hair rendering in the Render tab by un-checking "Use Hair" (under Geometry).


Assign Materials to specific faces in a mesh via Python I have the following arrays (everything inside a structured array data):
Inside i have a struct called material, which has the following information:
face_start: The index of the first face that the material will be assigned
face_count: The amount of faces that material will be assigned to.
So for example: If face_start is 5, and face_count is 3, the code should assigned the faces 5, 6 and 7.
However it does not seem to apply, which i think it's an issue with the API and i can't seem to figure out properly how to assign said  materials to the specific faces.
This is how i am attempting to assign said faces:
bpy.context.view_layer.objects.active = obj
bpy.ops.object.mode_set(mode='EDIT')
#This is to set select mode to faces
bpy.context.tool_settings.mesh_select_mode = [False, False, True]

for j in range(len(data[i].materials)):
    #Here i create a material, for example:
    mat = bpy.data.materials.new(data[i].name + " Material" + str(j))
    obj.data.materials.append(mat)
    #After assigning all the material stuff, i proceed to assign it to the specific faces.
    obj.active_material_index = j #I assign the recently added material as the active one
    #I make a for loop where k is the first index (face_start) and goes to face_start + face_count, so it goes from face X to face X+Y
    for k in range(data[i].material.face_start[j], data[i].material.face_start[j] + data[i].material.face_count[j]):
        #I tried both of this, individually and at the same time, but none of them seem to work.
        face_list[k].material_index = j
        face_list[k].select = True
    #This should assign the materials to all the faces where select = True, but it doesn't seem to
    bpy.ops.object.material_slot_assign()
    #I deselect everything so the selected faces are not there in the next loop
    bpy.ops.mesh.select_all(action='DESELECT')

With changing things a little bit, i have achieved to either Assign all the faces to the very first material (aka probably nothing has been done), or it assigns all the the very last. But there doesn't seem to be an inbetween.
I'm probably not understanding the API properly, or there's something that i'm missing, but i'm a bit confused as of how to make it work to assign it to specific faces in a loop. What could i do in this scenario?
Thank you for reading!

Based on your description of desired effects I've put together a couple small examples of how you may want to approach this.
You didn't really show what your materials should be or how you have them setup in your data structure so I provided a simple function to make basic materials around a hue wheel.
The other 2 functions will either evenly distribute materials to the faces of an object or as you described given a face start and run length of faces apply a specific material index to those faces.
You need to have all the materials you want to apply to an object's faces assigned to the object, then you can assign the material_index.
import bpy
import colorsys

num_colors = 3
repeat_color = 2
face_idx = 2
runlength = 4
mat_idx = 2
obj = bpy.context.object

def make_mats(obj, num_colors):
    hsv=[]
    for i in range(num_colors):
        hue = i/num_colors
        sat = 1
        val = 1
        hsv.append((hue, sat, val))
    # clear current materials
    while len(obj.material_slots) > 0:
        bpy.ops.object.material_slot_remove()
    for col in hsv:
        if f'{obj.name}_{col[0]}' not in bpy.data.materials:
            mat = bpy.data.materials.new(f'{obj.name}_{str(col[0])}')
            r,g,b = colorsys.hsv_to_rgb(col[0], col[1], col[2])
            mat.diffuse_color = (r,g,b,1)
        else:
            mat = bpy.data.materials[f'{obj.name}_{str(col[0])}']
        bpy.context.object.data.materials.append(mat)

def assign_mats_even_dist(obj, repeat_color):
    for i, face in enumerate(obj.data.polygons):
        face.material_index = i // (repeat_color))%(len(obj.material_slots)

def assign_mats_idx_runlength(obj, face_idx, runlength, mat_idx):
    if mat_idx > len(obj.material_slots)-1:
        return {'CANCELLED'}
    faces = [f for f in obj.data.polygons if f.index >= face_idx and f.index < face_idx + runlength]
    for face in faces:
        face.material_index = mat_idx

make_mats(obj, num_colors)

#assign_mats_even_dist(obj, repeat_color)

assign_mats_idx_runlength(obj, face_idx, runlength, mat_idx)


ModuleNotFoundError: No module named 'bpy' I am attempting to use blender from the command line including bpy functions using https://pypi.org/project/bpy/
I have completed a pip installation and have had no errors or warnings, however when I try to run a script I get ModuleNotFoundError: No module named 'bpy'. I had this working on a previous machine but have not been able to get this working on my current machine (Im assuming im missing a step).
I have downgraded to python 3.7.6 and pip version 20.2.4, I was able to install bpy version - 2.82.1 by pip install bpy (I followed an answer from https://stackoverflow.com/questions/63178840/cannot-install-package-bpy-using-pip).
I then also followed the advice of https://github.com/TylerGubala/blenderpy/issues/13, which is an issue I recognized from the last time I tried to get this working.
I am using windows (as I did on the previous install which worked). Im wondering if im missing something in path or similar. I have checked and my conda environment (base environment) lists bpy as an installed package, yet it cant be found.
Any advice is greatly appreciated.
EDIT: I have checked and my bpy install (2.82) is in the location where the python.exe is for the environment (base) im using (so maybe not a path issue?)

After multiple hours of searching, the issue was due to the python interpreter not being automatically changed when activating a different environments within visual studio code.
The bpy module must use python 3.7.6 (for my version anyway) otherwise the module is not found.


Looking for help with my Ngons So in my attached .blend file, (I have also attached .jpgs of my original design for you to see what I'm trying to model) you can see that I have two separate meshes. I can bevel the bottom one properly, but the top mesh cannot be beveled; this is most likely due to bad geometry on my part from creating too many of the top faces and crevices with curves (please note that no booleans were done on this model). I've already done a quick and dirty way of making all the faces into tris and quads with a few clicks from a youtube video tutorial. But of course that didn't solve the problem either; it still didn't bevel (likely due to the tris).

Should I just go in and manually change all the ngon faces to quads? And even then, would that truly make it possible to bevel, or would I just be wasting time? Is there a faster way that I just don't know about, or is this unsalvageable? It's the only option I can think of at the moment besides relying on the Bevel Node, which I'd rather not as I want to solve the root of the problem and not just hide it with a node.

Blender file: https://drive.google.com/open?id=1kKDFScmYSetTtOO8_wSyaIiJJBMm27r6

May be the possible solutions :

Best option : Manually edit and make it quads.
Option 2 : convert to
triangles-> decimate modifier(try planner)-> convert to tris->convert
to quads-> remove doubles  ( try adding bevel modifier)
option 3 :
remove doubles if any -> add a bevel modifier
option 4 : subdivide
too much-> export to zbrush and use decimation process


No animation in Curves on using Bake sound to fcurves In Blender2.9 , on adding location drivers to the origin of a Curve, there is no animation eventhough the location values are generated by baking sound to fcurves.
Also using a Hook driver to drive the curves,creates no animation.Even trying with a Cube ,gives no result.
Also, there is an  Error - "Invalid python expression " . Since the location values are derived from sound , there is no option to link the driver "var" to this value.Tried using "self",but no result.
How to resolve this?

In the 3D window go to the menu Object - Animation - Bake action, so to bake the sound created animation into an editable curve.


BGE[Python], how to combinde modules? Im trying to get 2 modules to work together and get executed from MainScript
MainScript:
import Map
#calling the "Map.module" from mainscript
def map():
    Map.module()
    return

This is what "Map.module" looks like:
import bge
import Functions
class module():
    def __init__(self):
        self.cont = bge.logic.getCurrentController()
        self.own = self.cont.owner
        self.openmap = self.cont.sensors["m"]
        self.oooopenmap()
    def oooopenmap(self):
        if self.openmap.positive:
         ###Add Functions.py module here:
            Functions.module()

And this is what "Functions.module", getting executed when openmap.positive is true, looks like:
import bge
class module():
    def __init__(self):
        self.cont = bge.logic.getCurrentController()
        self.own = self.cont.owner
        self.pause = self.own.actuators["Pause"]
        self.pausee()
    def pausee(self):
        self.cont.activate(self.pause)

The console gives me this keyError:

Traceback (most recent call last): File "test.py", line 14, in  File "test.py", line 10, in functions File
"\Functions.py", line 23, in main KeyError: 'requested item "Scene" does not exist'

Or to probably point a finger at my problem this ValueError:

Traceback (most recent call last):   File
"Main.py",line 18, in map   File
"Map.py",line 27, in init   File
"Map.py",line 36, in oooopenmap   File
"Functions.py",line 22, in init   File
"Functions.py",line 26, in pausee ValueError: Pause not in this python controllers actuator list

can someone help ?
greetz

Your question and your issues have no real relation to each other. Therefore I split them into separate sections.

KeyError

Traceback (most recent call last): File "test.py", line 14, in File "test.py", line 10, in functions File

"\Functions.py", line 23, in main KeyError: 'requested item "Scene" does not exist'

Analysis

There is an error in file test.py. As the error says you try to find an item with key "Scene". But there is no such item. I guess the code is supposed to find a scene. But there is no scene "Scene" loaded.

Suggestion

Check the scene names and what scenes are loaded at the moment of execution of this code. Ensure the scene is loaded and has the name "Scene".

ValueError

Traceback (most recent call last): File

"Main.py",line 18, in map File

"Map.py",line 27, in init File

"Map.py",line 36, in oooopenmap File

"Functions.py",line 22, in init File

"Functions.py",line 26, in pausee ValueError: Pause not in this python controllers actuator list

Analysis

I did not had that error in the past. I guess it is pretty much the same as the KeyError. You try to get an actuator called "Pause", which is not connected to the current actuator.

Suggestion

Ensure the currently running controller is connected to an actuator called "Pause".

How to combine modules?

This is a plain Python question.All you need is "import" as you already do.

You can import any module into any script/module. The imported module can be in

a text block
a file that resides in the python search path
a package that resides in the python search path.

Caching context

I strongly suggest to avoid storing context data (current controller, current scene) when it is supposed to be used as context. You can't be sure this is still valid within any subsequent uses of the class.

To be more specific: you store a reference of the current controller inside of the object "module". But when you call any function of that object from another controller, this class still refers to the original controller.

This can be the reason why you get the ValueError (see the section above).

Example: your controller "Python" executes Python code that creates a new object of class "module".

myModuleObject = Map.module()

A controller "Python.001" executes Python code that uses with this object:

myModuleObject.oooopenmap()

This can fail as the current controller (Python.001) is not the stored controller (Python). You can only activate actuators that are connected to the current controller regardless what controller you store in your object.

Recommendation

Always read the current controller from context. Store it in a local variable, but not in a class or module variable. Do not store it in a game object property.

You can store the current object and the current scene when it is not meant to be used as "current". E.g. you want to store the current object as target.

I hope this helps a bit


Register Object inside of Another Object I want to register a collection of my custom CurveObjects. Every CurveObject has a collection of CurvePoints.
I'm trying to make a CurveObject with a collection of CurvePoints. But i fail to register CurveObject.

Here is my code:

class MR_CurvePoint(bpy.types.PropertyGroup):
    y = BoolProperty(
        name="y",
        description="y...",
        default=False
    )

class MR_CurveObject(bpy.types.PropertyGroup):
    x = CollectionProperty(
        name="x",
        description="x...",
        type = MR_CurvePoint,
        default=None
    )

...

def register():
    bpy.types.Scene.my_curve_object = CollectionProperty(
        name="Mira Tool Variables",
        type=MR_CurveObject,
        description="Mira Curve"
    )

My log when i try to register:

Traceback (most recent call last):
  File "C:\mifth\blender\2.73\scripts\modules\bpy\utils.py", line 600, in register_module
    register_class(cls)
ValueError: bpy_struct "MR_CurveObject" registration error: x could not register

Is it possible to register Collection inside of Collection?

Thanks.

Ahhhh! It seems I had to remove Default value from CollectionProperty. It was my mistake. Here is working code:

class MR_CurvePoint(bpy.types.PropertyGroup):
    y = BoolProperty(
        name="y",
        description="y...",
        default=False
    )

class MR_CurveObject(bpy.types.PropertyGroup):
    x = CollectionProperty(
        name="x",
        description="x...",
        type = MR_CurvePoint,
    )

...

def register():
    bpy.types.Scene.my_curve_object = CollectionProperty(
        name="Mira Tool Variables",
        type=MR_CurveObject,
        description="Mira Curve"
    )


Change starting frame of motion tracks I have a clip that needs additional frames to be inserted at the beginning. I've tried copying and pasting the motion tracks, but they always start at the same frame. I've also tried to edit in the IPO editor but they can only be slid up and down.

Is this possible?

It sounds like you want to use blender's Video Sequence Editor.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Sequencer/Usage

You will create a Movie or Image strip from your source clip.  You will then drag it to the right to open up some time at the beginning.  You can then add a strip for the added frames (whether they are an image sequence, movie clip, title card image, or solid color) in that space.


VSE How to blur a rotating tire after rendering? I have a sequence of images that show a car tire from a single camera view point with the tire at different angles of rotation. The images are similar to the picture below. If the images are animated, one after the other, the tire rotation does not look good. If there any way to fake the rotation and add blurring?

In Photoshop there appears to be a rotating blur filter (photoshop radial filter) Is there something similar in Blender? Is there another open source tool that can do this?

A way to fake motion blur would be to mix the same animation with a slight offset:


Rotate whole animation by 90 degrees I make my animation and now I realized that its pointed in wrong direction I used -y (native blender) as direction but I need to be pointed at x axis so what would be the easiest way to rotate whole animation, to switch -y with x :)

On the first frame add an empty at the same location as your object.  ShiftS > Cursor to Selected, then add the empty with ShiftA > Empty.
Parent the object or objects to the new empty (CtrlP).
Rotate the empty by 90° along the Z axis.


Why is rendering with cpu added only mildly faster even though it uses so much more power? I get 3 seconds faster rendering rate when using optix with cpu but when I render without it is about as fast. I can render 4-5 project really fast at the same time when cpu is turned off when cpu is on there is no difference and sometimes the render times are substantially longer then just using GPU making matters worse rendering a second file at the same time is mildly possible or just straight up impossible when adding the cpu.

You haven't given your hardware, but it's possible your CPU just doesn't have that much to add by comparison.
There is still some CPU load when doing a GPU render, so everything leftover is what you have to dedicate to additional CPU rendering.  Your GPU has dedicated silicon to do significant portions of the math involved with rendering, and that's what typically makes it render tiles much faster, then it hands the rest off to the CPU.
A couple of things:  If you're using large tiles, CPUs have trouble handling those.  Enable the Auto Tile Size addon, and it should find a good compromise for hybrid rendering.
You can also try rendering through command line, I've heard this reduces load on the system because you're not constantly integrating and redrawing the image for the render tab.


When i export files from blender there are some unknown shapes blocking my models I'm a new Blender user, I use Daz to Blender bridge to pose Daz model in Blender, then I export its .obj to clip studio paint, but when I import it to clip studio paint, there are some unknown shapes blocking my whole models.
I don’t know where it’s come from and how to get rid of it. I tried .fbx instead and doesn’t change anything. I tried import that .obj file that I just exported, back to blender and there are still those unknown shapes blocking my models.


Why render time in blender is increasing 10 times after rotating 3d model? I'm rendering  this scene in cycles (blender) on GPU with GTX 780 3GB
In preview mode it takes about 2mins to render 2000 samples.

In final render mode it takes about 40 seconds

But i need to rotate scene and render it from different view.
After rotation the model, render time has been increased to 20 times (to 20 mins per a frame)

But in preview mode it still renders for 2 mins

what's the problem?
Problem appears only after rotating the object. If i moove the camera and NOT rotate the object it renders for 2 mins. But I need to rotate the object and not moove camera.

I've posted at Blender's bug tracker and it seemed for first look as a bug, but
Brecht Van Lommel (Rendering Software Engineer) explained:

  This is a typical issue with raytracers, many long thin faces along one direction are difficult to fit well in a BVH unless the faces are aligned to the X/Y/Z axis.
  Also, the workaround is to subdivide the object more so the faces are not so long.

After subdivision mesh along faces render time decreased much.

LINK to this discussion on Blender's tracker.


Why one mesh is merge with array? I have just a default plane, scale down to make a rectangular shape. I have just array it with fit curve modifier. I have applied rotation scale to both curve and plane. All the mesh are equally distributed, In edit mode i can scale and adjusted it but. Why is a single mesh close / merge to each other.

Any suggestion or help whats going wrong. Thanks

Change relative offset to 1.35.
Result:

Explanation:
What shall Blender do? It is mathematics. You give a circle (curve) with a radius. You give the width of one part. You give the offset.
If it doesn't fit - it doesn't fit. Blender can just overlap or leave a bigger gap. Blender cannot change mathematics. ;)


How to remove a protrusion from a surface? Let's say I have a head object and a sword object.  I move the sword so that it is placed through the head.  The part of the sword that is sticking out of the other side of the head I want to delete.  The rest of the sword, including that part inside the head and the contact points between sword and head inside, I want to keep.  How do I do that?

This is what everyone's talking about with Booleans: The Boolean modifier.

using the "difference" operation, wherever the sword object intersects the cube object, its volume is excluded.

Here's what it looks like without the head:

The surface of the volume you subtract from the sword can be as complex as you need; you could use the head object, for example. Be careful though because the boolean modifier is computationally expensive and prone to error. Stick to simple, unsbdivided manifold meshes with only one part to them for the best chance of success.

Edit: Here's the .blend file :


Left click selects everything on my minecraft rig (blender 2.8) So im a newer blender user, and recently I've upgraded to 2.8. I redownloaded the 2.8 version of my rig, but when i try to move (lets say the eyes) it selects everything and moves those with it, any fixes? Im using the Boxcape Studios Character Rig V3.

Make sure you're in pose mode rather than object mode. It can be found at the top left in your screenshot ( in the dropdown menu that says "object mode").
Pose mode allows you to move bones. In object mode, the entire armature is considered one object.


Differences between dissolve and delete? Does dissolve works the same way as the delete operator? And what does dissolve and limited dissolve mean?

Delete removes vertices/edges/faces and leaves nothing/a hole in their place.

Dissolve combines faces into one big face (ngon) or removes edges only as a separator between faces.

Dissolving an edge between two vertices can be reversed by re-connecting them by pressing J with both vertices selected.

Limited dissolve dissolves (combines into big NGons) all faces that have a certain angle between them (less than 5° by default). Limited dissolve therefore turns large areas filled with many faces into one large face.


Artefacts with Eevee I try to learn Eevee and I noticed that I have a lot of artifacts in my viewport when I opened old projects. These artifacts can also be found in newly created scenes.

When I render this scene, there are big "holes". Why is that?
Is this a bug or is it due to my computer (I don't have a graphics card, just a laptop with Core i5 -7200U CPU)?
It's not the normals, they're correct.

It was a driver problem. The affected computer model is from the ASUS UX410 series. The Intel update refuses to install the new driver and refers to a customized driver from the manufacturer. However, the automatic update function of the manufacturer does not find the new Intel driver, but it is listed on the manufacturer's website.

I installed the driver and the problem was fixed. There are no artifacts in the viewport now and the render is clean.


Missing toolbar and cannot resize areas? My first problem is the toolbar. My toolbar is hidden and not showing File, Edit etc..

By mistake I just remove the center image to get the tool bar but the timeline covers my model working area now and it's now re-sizing. When I drag my mouse pointer to that bar where pointer changes to up, down arrows to re-size the window, but when I click and drag pointer to make my working area bigger and timeline smaller than nothing works, the areas are not moving, just split in more and join.

To split or join areas, you can either drag on the shaded corner with  LMB, or you can  RMB on the edge between areas and select Split or Join.

Once you have done that, move the mouse over the area you want to replace and you will see an arrow appear which indicates which area will replace which.

To confirm, either release  LMB (if you were dragging from the corner widget), or click with  LMB if you use the  RMB method.

To resize areas, drag the edge of the area with  LMB:

To change an area's type, click the drop down on the far left of the header and select an editor type:

So, to fix your layout:

Change the top 3D view to an info area and resize it so that only the header is visible.
Change the timeline to a 3D view

For more information, see the wiki.


UV coordinates to XYZ coordinates As the title indicates, I'd like, from given UV coordinates, to find their corresponding XYZ coordinates.

I wanted to use the following function (see bellow), to know the UV index (and therefore the corresponding vertices to later do an interpolation) of the UV surrounding triangles before realizing that it may return too many triangles (since more than 1 triangle actually surround a point).

mathutils.geometry.intersect_point_tri_2d(pt, tri_p1, tri_p2, tri_p3)

So... I don't really know if it is possible to do, but if you have any leads on how to find where a random point on the UV texture is going to map on the 3D object please share.

Every point within a UV face describes a point on the mesh face's surface. Every point outside describes a point in the same plane, but outside the face's surface - usually not very useful.

Therefore, a particular UV face should be provided for the interpolation. If the entire UV map contained no overlaps, then any UV coordinate that lies in any of the UV faces will be mappable to a point on the mesh surface, with no ambiguity - in this case, you wouldn't have to specify which UV face to use for the calculation.

But if there are overlaps, then there will be multiple solutions (different XYZ coordinates for every overlapping UV face at the specified UV coordinate).

Every point outside any UV face will not correspond to a point on the mesh surface (but around or inside the mesh). You may want to clamp UV coordinates to [0, 1], so that the given UV coordinate falls within that range again, if texture repetition is desired.

In order to transform the UV coordinate to a 3D space coordinate based on a certain UV face, use barycentric_transform().

Below you find a script that utilized this function.

Note a couple of requirements:

the script expects one Image / UV editor to be visible
a mesh must be selected and in editmode and have a uv map
UV mesh selection sync needs to be enabled in UV editor
2D cursor needs to placed at the location you want to get the 3D coordinate for (in UV editor)
the UV face around the 2D cursor location needs to be selected (this will also select the corresponding mesh face in 3D View because of selection sync)

Then run the script. It should place the 3D cursor at the 3D coordinate. The coordinate stored in "co" is in object space, but turned into world space to place the 3D cursor correctly by multiplying with the object's matrix_world.

import bpy
import bmesh
from mathutils.geometry import barycentric_transform, intersect_point_tri_2d

# this will use the 2D cursor of the first UV editor found
for area in bpy.context.screen.areas:
    if area.type == 'IMAGE_EDITOR':
        space_data = area.spaces.active
        loc = space_data.cursor_location
        norm_coords = space_data.uv_editor.show_normalized_coords
        break
else:
    raise Exception("No UV editor found")

# mesh UVs are always normalized, but not the 2D cursor!
def uv_normalize(tex, uv):
    if tex.image is None:
        x, y = 256, 256
    else:
        x, y = tex.image.size
    return (uv[0] / x, uv[1] / y, 0) # to_3d()

ob = bpy.context.object
assert ob.type == "MESH", "Selected object not a mesh"
me = ob.data
bm = bmesh.new()
bm.from_mesh(me)

# tag selected faces, because triangulate may clear selection state
for f in bm.faces:
    if f.select:
        f.tag = True

# viewport seems to use fixed / clipping instead of beauty
bmesh.ops.triangulate(bm, faces=bm.faces, quad_method=1, ngon_method=1)

# re-select faces
for f in bm.faces:
    if f.tag:
        f.select_set(True)

uv_layer = bm.loops.layers.uv.active
tex = bm.faces.layers.tex.active

def find_coord(loc, face, uvs):
    uv1, uv2, uv3 = uvs
    x, y, z = [v.co for v in face.verts]
    co = barycentric_transform(loc, uv1, uv2, uv3, x, y, z)
    bpy.context.scene.cursor_location = ob.matrix_world * co

random_face = None
sel_faces = [f for f in bm.faces if f.select]
for face in sel_faces:
    uv1, uv2, uv3 = [l[uv_layer].uv.to_3d() for l in face.loops]
    if norm_coords:
        loc_normalized = loc.to_3d()
    else:
        loc_normalized = uv_normalize(face[tex], loc)

    # remember the first face for possible fallback
    if random_face is None:
        random_face = loc_normalized, face, (uv1, uv2, uv3)

    #print("trying", loc_normalized, "vs", uv1, uv2, uv3)
    if intersect_point_tri_2d(loc_normalized, uv1, uv2, uv3):
        print("found intersecting triangle")
        find_coord(loc_normalized, face, (uv1, uv2, uv3))
        break
else:
    print("trying random selected face for extrapolation")
    find_coord(*random_face)

The mesh does not need to be triangulated, but the script may fail especially on non-planar quads (couldn't figure out why exactly).

Due to the triangulation, we do not know which triangle is the best option to use as input for the transformation - we potentially want a point on the mesh surface, and thus we need to chose the triangle the user-defined input point lies within. Otherwise we would extrapolate a coordinate, which is an issue if the target mesh face is a non-planar polygons. We would end up with a coordinate not on the surface in that case, it should still work for planar target polygons however.

To determine that triangle, the script does triangle-point intersection testing for all triangles the triangulation generated from the input face. If the UV-space coordinate the user wants to calculate the 3d coordinate for isn't within the selected UV face, no intersection test will return true. The only option is to abort, or use a random triangle to extrapolate a (possibly unwanted) coordinate - my script does the latter.

The face selection + sync requirement could be lifted by some code to automatically find all intersecting uv faces for the chosen 2D coordinate. You should probably handle overlapping faces, e.g. return one 3D coordinate for every intersecting face.

For some more details, see http://blenderartists.org/forum/showthread.php?379027-Get-3D-location-of-mesh-surface-point-from-UV-Parameter (which was the base for this answer)


How to orient the camera to show the object exactly in the same way your eyes are looking at it Do you know if there is a way to align automatically the camera to the user persp view that I have at a certain moment,so that the camera can view exactly what I see in that persp view ? For example,let's see the image below. I want to orient automatically the camera on the x;y axis and with the right rotation needed to show the object exactly how my eyes are looking at it. Thanks.

Having your Camera selected press CtrlAltNumpad 0.

When objects are clipped you need to increase Camera Clipping range in Camera tab (you will need to have Camera selected):


How to Change Grid subdivisions (2.81) The subdivisions options in viewport overlays is greyed out in 2.81. Any changes in this have no effect on grid display. Maybe, I have set some system option by mistake. How do I enable grid subdivisions in 2.81?

Go to Scene Properties> Units> Unit System and set Metric or Imperial to None.

Then the option to change the subdivisions in the Viewport Overlays will be enabled again.

I'm using Blender v2.82.


Get list of attributes of a bpy.data struct? Is there a way, in python, to get a list of each of the attributes that are part of a data struct? For example, I know you can get Object.data, Object.name, Object.location, etc. I've tried doing a basic for loop, but it says that the "object is not iterable."

I know of 2 options : Either looping through object.bl_rna.properties.items() (I think this is the preferred way since this is supported by the API) or looping through dir(object), which is the python way so you might break things if you try to use these attributes if they are not exposed to bl_rna.

Actually I see a third option, which is looking in the official documentation, which at least gives examples and explanations about each attribute.

import bpy

obj = bpy.context.object

print('Using bl_rna :\n')
for prop, value in obj.bl_rna.properties.items():
    print(prop, value)

print('\nUsing dir(object) :\n')
for attr in dir(obj):
    print(str(attr), getattr(obj, attr))

etc.

etc.


How to limit object rotation (transform) only on x-axis on my rig? so i want make that object only rotate on x-axis just like mechanical joints.

i have lock all this object transform except x-axis but still not work. how to solve this?

The axis locks are a UI feature that only provides a simple lock in the 3dview and they are easy to work around. To completely limit transformations you should use constraints. Constraints are the last thing applied to an object, they will limit the transformation values even if you have keyframes on the value that are outside the constraint settings.

For your example the Limit Rotation constraint will prevent rotation on a specified axes, you can also limit the rotation to a range so that you could only rotate the joint 45 degrees.

A limit with min and max at 0.0 will prevent any rotation, you may also set both at a certain angle.


How to set direction of spin tool blender I want to create a pipe with multiple curves see image below:

I have done this with the spin tool but now i want my curve to follow the blue arrow instead of what it does now.. How do i do this i cant find any menu to change this :( or is this not possible?

Simply invert the rotation to -90d in the Transform pane ('T' by default)


Best way to mark seams and unwrap this mesh? I want to unwrap and texture paint this mesh,but as you can see it looks like a mess in the uv editor right now. Where can i add seams? what is the best place ? when i tried it as it is (with smart uv unwrap), it just stretches my texture and looks awful.

Apply scale CtrlA to your model before unwrapping it with Smart UV Project to prevent the texture from stretching.


Can I use Source Filmmaker models in Blender? I'm a mac user, so I can't get Source Filmmaker, so I'm using Blender to make gaming animations. I found a whole bunch of Source Filmmaker models on the Steam Workshop website that I wanna use for my animations. Is there any way to get these models and load them onto Blender? Any help will be appreciated.

It took me a while to figure this out but I finally figured out how to do it.

First you need to download WineBottler (https://winebottler.kronenberg.org/) This program allows you to run Windows applications on Mac.

Once WineBottler has been installed, download Noesis (http://www.richwhitehouse.com/index.php?content=inc_res.php&rescat=File%20List)
-I'm not sure if the version mattwers, but I download v4202.
Once you install Noesis open the noesis.exe file in the Noesis folder. A Wine window will open up, press go. Now the software will open up and all you need to do is locate the file for the model you downloaded and click file>export. Then you can convert the model to a format importable to Blender (like .dae or .fbx)

Also, if you are going to use models from the Steam workshop you can only download them via: http://steamworkshopdownloader.com/


How to add an object at a specific posistion in Blender Game Engine I plan on building a game where enemies are randomly generated throughout the game. I plan on using an empty to run a Python script where it will add a predefined object at a given position (using random.randint to place them randomly around the map).  Is there a specific Python command where I can say something like "Create this object at this given x,y,z position"?  If so, can you please tell me what it is and how to use it?  Also, what is the difference between a Module and a Script in the Python controller?  Thanks so much for your help!

Alternatively, is there a Python function that sets an object's X,Y,Z coordinates?  If so, the empty can jump around randomly dropping enemies off at it's position.

Move emitter to desired location

If you move the emitter (with whatever method you want) before adding the new object will be added there.

Move added object to desired location

You let the emitter create the object at one place and move it later (even in the same frame)
example:

import bge

scene = bge.logic.getCurrentScene()
object = scene.addObject("Sphere","Sphere")
object.worldPosition = [1,1,1]

to find out more about module/script mode please have a look at the BGE Guide to Python Coding


Is it Possible to have Two Alternating Pistons in Blender Physics? I am trying to do a two-slider animation using Blender Rigid Body physics.
I want each slider to go on opposite direction at any time.
I tried using Force fields but to no avail. Almost every video on youtube about Blender Physics is about Demolition.
This model is for the ailevon (aileron+elevator) mechanism for a jet aircraft I am designing.

Currently, with the current settings, the ailevon (the Green cube on your left), is only going up, that is, in one direction. I want it to swing up AND down.
I first tried using only one slider. But it didn't work. So, I thought using two sliders would. That too is not working.
Am I missing anything.
Any idea is welcomed!

Robin Betts comment was probably the closest I was looking for.
However, in the meantime I have switched to  a more simple mechanism proposed by the students of Delf TU in Holland.
Here is how I rendered it.

They key in making this happen is by setting the piston to Animated and building keyframes on it. The rest moves by itself through Physics.
Thanks to all!


How to move pivot to center of an array object? I have copied the default cube with the array modifier.

I can rotate my camera around the center of the cubes by pressing "shift + c".

How can I set the pivot to the center of the cubes? I could do it by setting the 3D cursor in the center and then set origin to 3D curser, but how do I get the 3D cursor in the center? Do I have to calculate the position by hand and set the coordinated componentwise, or is there also a shortcut?

Here's one hackish way to do it, taking advantage of the fact that positioning the 3D cursor is not undo-able.

Apply the array modifier
Enter edit mode (Tab)
Select everything (A)
Press ShiftS> Cursor to selected
Exit edit mode (Tab)
Undo twice (CtrlZ)


Character Rigging in Blender for Unreal Engine Can anyone help or direct me to definitive tutorials on proper rigging in Blender of imported FBX files, allowing the use of included character animations? Alternately, can an FBX be rigged inside Unreal?

When I set the FBX character import option to "None" for skeleton, the character's limbs are static during game play. When I set the FBX character import option to "UE4_Mannequin_Skeleton" for skeleton, the character and rig 'explode' in unpredictable ways.

The files can be downloaded here...

Distorted Unreal File: https://www.dropbox.com/sh/mcprmjannl0lfqj/AAAY4IF4OkZwLO_bLtyrfsrIa?dl=0

Thank you in advance for your help! This is a game-stopper (pun intended).

-uenovice

I'm currently playing with this too.

To get an idea of what you want to do, take the UE4 Mannequin's skeletal mesh and export it to FBX. File should be 853KB.

Import that in blender - on the blender import settings you want 'Z up' and 'Y forward', and on the Armatures tab you want 'Automatic Bone Orientation' ticked.

Then you have a clear look at what's going on with the UE4 mannequin (which has all those premade animations) - it has a root bone in the skeleton etc. From there you can work on changing the model to whatever you want and rerigging the existing armature. Then animation retargeting should work nicely.


how to recreate microscopic diatom glass material I have been trying to recreate the material seen in the picture without success, this picture is an electron microscope image of diatom shells, they have 2 important characteristics. first, since they are microscopic and photographed using electron microscopy they have quite a bit of fresnel around the edges, this can be achieved easily enough by connecting a layer weight nodes fresnel or layer weight factor into a colorramp for color.second, the shells are made of silica (basically glass) which has very high transmission and transparency. i haven't really been able to achieve a material combining these characteristics in any way that looks similar to the image. if you know of a good way to tackle this material, please answer, and thanks in advance]1

A Fresnel node can be used as factor for a Mix Shader between a Transparent BSDF and Emission Shader, in order to achieve the glow at grazing angles. The Facing socket from the Layer Weight node allows to add a slight glow for the angles in between. Finally the Is Camera Ray output from the Light Path node is used to only show the emissive material to the camera, meaning the object itself and objects near by won't be affected by the emitted light.


Simultaneously see Eevee and Cycles renderings Since the light rendering is not the same depending on whether we use Cycles or Eevee, I would like to easily compare this difference on a small scene.

Is it possible to display simultaneously Eevee and Cycles rendering in two different windows instead of having to constantly switch the render engine?

Maybe an old question but worth mentioning that YES, it is indeed possible. Though may be seen as a workaround:
First place all your settings as you'd like them with Eevee set as your renderer. This includes activating AO, screenspace reflections, irradiance/reflection objects etc. Any setting that is relevant to Eevee basically. This doesn't include lights.
NOTE: HDRI will be independant from Cycles world settings if you're using an irradiance object to bake the lighting.
When you have it all set, split the window to have a second 3D view, then switch to Cycles as your renderer. In the one view set the shading mode to rendered (shortcut: Z) which will be Cycles, and set the other shading mode to material preview for Eevee.
In the material preview window, make sure that the extra options "Scene lights" and "Scene world" are checked.


Cloth tearing out render view I was working on a female character for a short Animated movie, I was able to manage modeling everything looks great in Blender

Dress was all fit nicely, where as, as soon as I tried to render it  (using cycles render), cloths behave abnormal and disappeared, randomly and making islands.

Any ideas why its showing different results?

Make sure that on any modifiers the viewport setting is the same as the render.


I cant get light to work with emission on render i created a plane and connected emission to materiel input and switched it to render to try and see my glass almost squid type thing but the light wasn't there and only the plane was lit up. The glass "squid" type thing has color and can bee seen but not as well as i have seen before in when put in render. Im sorry if i wasn't able to explain this very well it has only been a few days of using this and my first time trying to use emission.

Unlike Cycles, which uses path traced light-bounces to calculate lighting for a scene, EEVEE uses fast approximations, which often need a bit of assistance to look close to their Cycles counterparts.
For emissions to work "properly" in EEVEE, at least 2 main things are necessary: Bloom, and baked lighting via an Irradiance Volume.
First, make sure Bloom is enabled:

Then, add an Irradiance Volume (under Light Probe in add menu). Scale it to the shape and size of where you think the "glow" should be cast. Don't make it too big, because if there are areas unaffected by the bloom, then you're just wasting performance unnecessarily. You can up the number of resolution subdivisions (default is 4) for the probe under the Object Data Properties tab if you want better quality.
After this, you will need to go to the Render Properties tab and select "Bake Indirect Lighting". Hit the bake button and allow it to calculate the indirect influence.

The final result looks something like this. If the look seems too low quality, you can adjust the bake settings and bake again as necessary. Just remember that this is a balance of quality and performance as is the case with many things.


White Patching Over UV Unwrap Can anyone tell me what the white triangles are in the image on the left after a UV Unwrap please?

This indicates that two faces are superpose ; which doesn't seem to be true in your case. The issue is some of your faces are Ngons (they have more than 4 vertices), and 2.8 UV editor acts weirdly with concave Ngons.

As far as I know, you can safely ignore it, it shouldn't cause any issue.


Painted Texture does not appear when rendered I painted this Amazon figure after creating an image called 'metallic'. I painted this material and the figure looks the way I want. However, none of this paint shows up when I render it. I realize there's another image called _17054_Amazon which didn't get painted.

I'm new to Blender and I'm this is a noob mistake. I'm confused there are two images, but one figure. Can I replace image _17054_Amazon with the iamge 'metallic'?

are the materials set correctly?
did you save the image? last version that I used only renders the saved file.


disable render of all collections with python in blender 2.8 I am trying to disable all collections in the render with python in Blender 2.8

It works on top-level collections with the code below, but ignores nested collections.

import bpy
coll = bpy.context.view_layer.layer_collection
for x in bpy.context.view_layer.layer_collection.collection.children:
        x.hide_render = True

Is there a way to get all collections, regardless of hierarchy?

With recursion

As well as setting attributes on all collections in bpy.data.collections can recursively walk the children.

This will only set the property on descendants of the collection. In this case bpy.context.view_layer.layer_collection.collection

import bpy

def traverse_tree(t):
    yield t
    for child in t.children:
        yield from traverse_tree(child)

coll = bpy.context.view_layer.layer_collection.collection

for c in traverse_tree(coll):
    c.hide_render = True


How to make the grooves shape Im making computer mouse and i have made the base and i want to make the grooves cut. How can i achieve that grooves cut. Any addon or how it works. Blend file attach

Model base model

Reference image

The fastest way may be using the bevel tool and some simple extruding and scaling operations.

Select the desired edge loop with Alt+RMB, then press Ctrl+B. Drag the mouse to set the beveling thickness and use the Mouse Scroll to set the number of subdivisions. In this case I set it to 5, then hit Ctrl+- twice and scale it a bit (S). This way I created a creasing edge to make the groove look smooth with the subsurf modifier enabled.

To make the smooth t-shaped groove just select the edge loop as pictured below and repeat the beveling proces mentioned above.

To make the recess just select some faces, extrude them inwards (E), then scale a bit (S) and translate if needed (G).