How to change the display_channel with python? Neither
    bpy.context.space_data.display_channel = 5
nor
    bpy.types.SpaceSequenceEditor(display_channel = 5)
seems to be working?

Make sure you have the correct context.

The context area needs to be a video sequencer. Quick console code, find the VSE and set the property from py console.

>>> for i, a in enumerate(C.screen.areas):
...     i, a.type
...
(0, 'INFO')
(1, 'PROPERTIES')
(2, 'CONSOLE')
(3, 'VIEW_3D')
(4, 'SEQUENCE_EDITOR')

>>> C.screen.areas[4].spaces.active.display_channel
0

If your script is invoked via a button or menu in the VSE area use

space = context.space_data

or

space = context.area.spaces.active

If it is not a VSE area / space then you will get an error (unless another space has a display_channel property.

Each area can have at least one up to  a space for each of the editor types. (SEQUENCER, CONSOLE, etc)  The one you are seeing is the active one. area.spaces.active Others you have had active at some stage are stored in area.spaces.

EDIT:

Find all preview VSE's in screen, and set display channel.

previews = [a.spaces.active for a in context.screen.areas
        if a.type == 'SEQUENCE_EDITOR'
        and a.spaces.active.view_type == 'PREVIEW']

for s in previews:
    s.display_channel = 3

As for bpy.types.SpaceSequenceEditor(display_channel = 5) what is the expectation here?. Instancing from bpy.types classes is very rare, and is mostly done via a new or add method.


How to add surface Imperfection to Glass in Cycles? I'm looking to add a surface imperfection that I got from Poliigon.com to a glass that I'm making.

The surface imperfection is off water droplets. I want to create a condensation sort of look to my model. I'm not too sure how add it in the Node Editor though.

Can anybody help? See below some pictures of the Surface imperfection, my model, and my current Node layout.

Many thanks,

Karl.

I have figured out how to add surface imperfection to Glass. It´s pretty straight forward, and not as complicated as I made it.

Basically you add a texture image and put the normal map there and link it up with the glass texture.

See below the node Layout.


How to use the current file name as the the output name in the File Output Node and without the frame number at the end? Two questions:

How to use the name of the currently opened blendfile automatically in the File Path field of the File Output Node without entering it manually?
How to remove the frame number which is automatically appended at the end of output file (especially for static images)?

AFAIK the answer to both is No.

The frame number padding zeros can be configured by adding # to the filename:

From the wiki page on CLI rendering:

 -o or --render-output <path>
     Set the render path and file name.
     Use // at the start of the path to
         render relative to the blend file.
     The # characters are replaced by the frame number, and used to define zero padding.
         ani_##_test.png becomes ani_01_test.png
         test-######.png becomes test-000001.png
         When the filename does not contain #, The suffix #### is added to the filename
     The frame number will be added at the end of the filename.
         eg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a
         //render_ becomes //render_####, writing frames as //render_0001.png//

This works in the GUI too:

So the above becomes render01.png, render02.png etc.
A single # = no padding. (i.e. render1.png)

However, I don't think there is a way to completely remove the frame number from the file name through blender, though it's really not hard to remove it later.

As for the blendfile name in the Base Path:
You could write a python script to set the Base Path of all File Output nodes to the blendfile name:

import bpy
import os

# Get file name:
filename = bpy.path.basename(bpy.context.blend_data.filepath)

# Remove .blend extension:
filename = os.path.splitext(filename)[0]

# set the base path for all file output nodes to filename:
for scene in bpy.data.scenes:
    for node in scene.node_tree.nodes:
        if node.type == 'OUTPUT_FILE':
            node.base_path = "//" + filename


How to make rocket engine plume? I'd like to know how to make those high velocity flames that can be visible in this vdeo https://www.youtube.com/watch?v=NjZ9ly7c08s.

I've made flames myself but they dont look very realistic https://www.youtube.com/watch?v=PhE9cAXLcVc

Should i use particle systems, planes with images on them, advanced shaders or maybe smoke simulation?

If you have a nice computer, look into smoke simulation

Although, any flames that you make in space are going to look a little bit fake, because most people have never seen flames in space

Ignoring the awful camera quality, https://www.youtube.com/watch?v=FEom0G30Gic is the type of thing that it seems like you are trying to emulate. If you want realism, I would do a quick fire thing like you have, and then overexpose the video while the fire takes up most of the screen.
Your also missing the camera shake from the rocket, your footage is unnaturally smooth.


How to add faces to a flat plane? Probably a very simple question but my research hasn't turned up an answer...

I have a flat plane, comprised of two faces (A Rectangle with a line down the middle separating each face).

How do I split the faces so I have eight even-sized faces on the flat-plane rectangle?

Much appreciated.

Select all and press w
Then choose "subdivide".


GLB export has correct wireframe, but wrong render. What am I missing? Hello blender community,
After exporting a model in GLB 2.0 format and loading it in three.js only part of the faces are being rendered. Displaying only the wireframe of the model works and the triangulation can be seen.
When I explicitly triangulate the model in blender and then export it, everything is being displayed correctly, but I want to work only with quads in blender and let the export function do the triangulation. And as one can see it works, but not on all parts of the mesh.

My assumption is that my model is not prepared correctly for the export. Although I did 'merge by distance' and 'degenerate dissolve'. Does anyone have any idea why only part of the model is "working"?
Best Wishes,
James.

Per comments above, the solution was to recalculate the normals, and upgrade to the version of Blender.
In the screenshots, it looks like some polygons face the camera, while others face away.  If "Backface culling" is turned on (as a material property setting in Eevee), glTF will treat these polygons as single-sided, and may not render the ones facing the other way.  The fix could be as easy as Mesh -> Normals -> Recalculate Outside, to get them all to face the same way.  But if they need to be visible from both sides, make sure "Backface culling" is turned off under Eevee's material settings (not to be confused with a viewport option by the same name, that will have no effect on glTF export).
Also, Blender 2.90 includes several fixes to the glTF exporter, some related to normal vectors, so upgrading is recommended.


Modelling a modern dome tent I am trying to model a dome tent with four sides for an outdoor night scene but I cannot figure out the modelling approach. I have seen this question and it helps to make the basic shape, but I want to make it as real as possible with big wrinkles and stuff. I have tried sculpting and cloth sim with pinning and stuff but it doesn't look good.
So if you can tell how would approach it, it would be really helpful.
Thanks.

I think you should get something pretty good with sculpting, you just need to observe how the fabric behaves. Here's a quick try, I've given the object a Multiresolution modifier, when you're fine you can bake the normals, delete the Multiresolution modifier and use the normal map on the original low-res version.


Unique and invariable ID (within the session) for an object? I have tried print(context.active_object.name_full), but that seems to be just the object name that I see in the Outliner. If I change the name in the Outliner, then name_full changes, too.
Is there any unique and invariable ID to identify an object at least within the session? That is, the unique ID should not be changed even if the user changes the object's name. The ID does not have to be same if the user opens the file again next time.

Use a pointer property
Can set up a pointer to any blender ID type objects, in this case bpy.types.Object instances of which can be found in bpy.data.objects collection.
Assign the property to class
import bpy
from bpy.types import Object, Scene
from bpy.props import PointerProperty

Scene.target_obj = PointerProperty(type=Object)

Test.
>>> C.object
bpy.data.objects['Cube']

>>> bpy.ops.object.duplicate()
{'FINISHED'}

>>> C.object
bpy.data.objects['Cube.001']

>>> C.scene.target_obj = C.object
>>> C.object.name = "Foo"
>>> C.scene.target_obj
bpy.data.objects['Foo']


Import Zbrush model to Blender and retain polypaint, materials? How do you prepare a zbrush model with polypaint and materials so it can be opened in Blender and retain the polypaint and materials. Is this possible?
Thanks

I think that you'll need to bake your polypaint in Zbrush, so you can import the diffuse into Blender. If your model is too high poly you might want to create a low poly version so you can bake the polypaint of the high poly to the uv of the low poly.


2.8 Installed addon not in list I'm trying to install MB-Lab which is an addon that is listed as working,  according to this list. When installing it, a confirmation message is printed. I've tried all 3 versions for 2.8 and I'm using a blender version from the 14.02.2019. I also had success installing other addons in 2.8.

It would help too, if you to install it yourself and comment whether it worked.

If you have the same problem: Unzip, rename the folder without any dots (-> . <-) in it and insert it to the other addons manually


ScriptingText Ascii Art to 3d Text Mesh - Ways to preserve spaces when converting txt to 3d Object So I'm trying to import some actual ascii art into the scripting window's txt editor, aiming to convert it into an extruded 3d mesh to create the basis for some quick mazes.
But upon conversion despite the looking fine in the text editor, the formatting is completely thrown off when it turns into a 3d Object, and messing with the alignment didn't help much.

I feel there is a logical answer to this problem, but have found no way to resolve my issue, any feedback on this would be nice

You need to set the font to a monospaced font.  BFont is proportional and so the characters are different sizes.

I used Consolas which is a monospaced font, and the text is exactly as it looks in the editor.  I believe Consolas ships with Windows.

This is with the default BFont:


Z-Pass to After Effects How can I get the Z Pass from an animation to After Effects?

The normalize node is only usable for Stills, so that's not it.

The map value node seems to sort of work, but I find it pretty tricky to setup, and I would love to find a solution that can be setup within a few clicks.
Also, it would be great if the focus point can be controlled by an object(empty) this would normally be the focus object in the Depth of field panel, but I cant get it to work with the Map value node.

In our company we use AE for compositing, otherwise i would just use Blender.

Also, the Mist pass works great, also the way you setup the limits.    fortunately there is no way to turn of the Anti-aliasing.

Most Images are encoded form 0 (black) to 1 (white).

The Z pass, being the distance from the camera to every given pixel, will contain values larger than 1, that's why it can't be enclosed in a regular image format. OpenEXR will contain the information perfectly, not only preserving the correct values but keeping it linear.

You are right in that the Z pass information cannot be visualized unless is normalized, ie. converting the lower and higher values to 0 and 1 respectively, and remapping everything in between. But the Z pass was not designed to be visualized...

So do yourself a favor and DO NOT MAP THE Z PASS INFORMATION using a Map Value node or Normalize node in order to save it as a "visual" representation, you'll end up distorting, compressing and ultimately loosing the accuracy of the Z-Depth information.

Instead, bring the Z pass intact into After Effects in a 32bit linear container (OpenEXR or OpenEXR multilayer). Make sure you enable the Z Buffer.

How do you set up your scene in After Effects to use the Z pass for 3D channels?
The use of the Z pass might vary depending on what you are intending to do with it.

If you must use it as visual information you could use the 3D EXtractoR and assign the color channels to use the Z information and set black and white points:

For more info on how to use Z depth... please ask in a site devoted
to After Effects...

Now, dealing with the second part of your question, on how to exprot the focus point. You can set up an empty to track focus in blender. Then you'd need to export the blender scene using this plugin: https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/Adobe_After_Effects. That will create a .jsx script that can be run in After Effects. The script will create a 3D composition with a camera and Null Objcts that correspond with the origin of the objects on the blender scene. You would then need to create some expression in After Effects to use null object that corresponds to the empty on the blender scene, and have the null control the focus point in the After Effects composition.... again, something to ask somewhere else...

More information on OpenEXR here: http://www.openexr.com/TechnicalIntroduction.pdf


Can tell me how to get this weight paint option in Blender 2.8 (screenshots inside) The guy in the video - https://www.youtube.com/watch?v=YSj1kksmY3I&list=PLyDqgzz1CZ31H5SDLg1j6YCSUJqyMZtnb&index=7&t=6m40s - describes it as "masking mode by vertex" and it lets him edit the individual weight of specific parts of a model by selecting vertices and inputting a number for the weight.

Any ideas of how to get this in 2.8? Thanks!

You need to enable Vertex Selection Masking For Painting, then you can only paint the selected vertices. Now maybe I miss something but it looks like, unlike 2.7,it doesn't display any vertex, selected or not, so maybe the best way is to Show Wire in the Viewport Overlays panel, it still won't show any vertex though...

So if I'm right, to do what you want to do, it may be easier to switch to Edit mode and to use the Weight value and Assign button under the Vertex Groups list?


How to project a face to another face? I am doing arch. work and I need to project the top face of wall to the bottom face of the ceiling for further modification (like Revit). But, these two faces are in two different objects. Is there any python code can do it?

[

I have try shrinkwrap modifier, but it seems that it cannot do well at drop edge of the ceiling.

Also, Boolean modifier is not good because it is unstable. If the dropline of the ceiling is overlapped with the wall, the modifier will be crashed.

See my second example:

You can extrude from  a cut in the ceiling rather than trying to project the wall to it.

ShiftD duplicate off the top surface of your wall, and make a clean profile of it using X limited dissolve, but not so harshly as to damage the curvature.

From orthographic Z, Header Menu > Mesh > Knife Project the profile
onto the ceiling, checking 'Cut Through'

With Snap set to Vertex and Active, and a convenient vertex active, EZ Extrude a duplicate of the resulting selection in the ceiling downwards in 2 stages, snapping on the way.. (Take care not to create internal faces)

SZ0 scale the bottom of the wall to 0 about its median, AltM > By Distance merge out redundant vertices.. You can tidy up again with Limited Dissolve.)


Is it possible to convert movement animation of the floating object into animation keys? I created an Ocean simulation, with an object "floating" on it.

https://www.youtube.com/watch?v=mZUkHyDC1lk&feature=youtu.be

Now I need to export this to Nuke, so I need to convert the movement of the floating object to animation keys - floating object repeats location and rotation of the ocean, in the area that I'm drawing using invisible object (dinamic paint).

Can I somehow convert movement animation of the floating object into animation keys?

Yes, it is possible! :) You can use the "Bake action"!

If you have an ocean, and an object that "floats" on the surface of the ocean using the method, described in this tutorial (https://www.youtube.com/watch?v=11F1NRpqrzY)

do the following:

1) Select a floating object

2) Press T and in the left pane, select the tab "Animation"

3) Press Bake Action, select the frame range and check "clear constraints"

4) Voila! You will see a lot of yellow strips in the timeline - the key frames of animation.

Now, if you delete the ocean and sphere by which you drew in the dynamic Paint mode, floating object will continue to move as before.


How can I apply reflection texture to a material? I have made a Kit Previewer for FIFA20, which will be used by those who make unofficial patches for this game. A player model is projected through Blender, which wear a team jersey etc, so if someone wants to make a new team kit for a team, will be able to test it into Blender before throwing it into the game.
I have managed with some tools to extract the necessary meshes from the game to obj format and import them into Blender. Also I have create a material and I have applied the color texture and the normal texture.
What I find difficult to apply in Blender, is the coeff texture, which based on this tutorial, defines in the game, apart from the type of fabric (which we are not interested in at the moment) and the gloss!!! As mentioned in the tutorial, red is less reflective, brown is almost reflective, pink/purple is more reflective and cyan is very reflective.
So the question is, how can I apply something like this to a Blender material?

It sounds like blue and green together are being used to affect reflectiveness, which is why cyan gives the strongest effect - in any case it seems like red is not used for shininess purposes, so Separate RGB can be used to grab the other two channels.
You could use a ColorRamp to adjust the strength of the effect before sending it the material, I guess by reducing the roughness and maybe increasing the metallicity. I suspect that the green and blue channels might be used to control two different aspects of the material but you might just have to play around until you find something that looks decent.
I've updated my Example .blend file to send the result of adding blue+green to Metallic, and then inverted it before sending it to Roughness (so cyan is inverted to black, making it 0 roughness).


change the fluid amount in inflow I want to make the fluid go to the end of u. These are my inflow and domain settings. But the fluid is stooping here. How can I solve it? please help.Thanks in advance.

Another issue that you will likely encounter, is that your tube obstacle impinges itself in at least 2 places where there is a sharp bend.
The fluid simulator requires a well defined inside versus outside surface to function properly.
Also, you may need to increase the resolution to get a proper result.

In addition to Serge L's recommendations, you could try reducing the gravity setting under the Scene tab. Also, you don't show your obstacle settings. If the ends of the tube are open, the Volume Initialization should be set to 'Shell' and you may also want to adjust the amount of slip.


How does Blender decide in which window it shows the render This has puzzled me for years: How does Blender decide the window where it will display the rendered image when I hit F12 to render?

By default it picks the largest area, unless an image editor already exists.

You can alter this behavior by setting the Display option in the render settings:

Keep UI

Does not change the UI. The render will not be automatically shown.
New Window

Opens a separate window containing only an image editor  showing the render.
Image Editor (default)

Renders into an image editor. Turns the largest area into an image editor if one doesn't exist.
Full Screen

Replaces the UI with a full screen image editor showing the render.


Make object follow path and collide with other object My goal is to create a two objects collision while the moving object(1) won't move in a straight line before it hits object 2. In order to make a realistic collision turning off animation's property is essential. You might say ok what is the problem check in which frame the collision happens and turn it off but I'm doing this using script and different size objects (and also orientations).
Here is what I tried to do so far:
1) make a follow path constrain - the problem with this approach is when you turn off the animation the object goes off track and doesn't collide with object 2. I also tried to play with the influence parameter.

2) make clamp to path constrain - the problems here are the same as for (1) but with addition, the animation starts only in the 20th frame instead of the first one.

It seems like constrains and animations have some sort of relation between them, why can't the object follow the path after the animation is turned off?
Let me try to be clearer I want the moving object to maintain it’s direction think of it as train on track when the engine is suddenly stopped working, the train will continue to move on the track. Since the train already developed speed it will take some time until the train will stop completely.

The solution doesn't have to involve python script I will be able to convert it after implementing it using the GUI.

I explored two ways of constraining a physics object to a curve:
1: A physics constraint connected to your rigid body is set to only travel and orient in a straight line.  Animation Nodes and a python script moves and aligns that constraint to your curve every frame.
AN makes a mesh out of the curve then moves and aligns that physics constraint to the curve every frame.  A python script is needed to work around an apparent bug to get the physics object location.
It's a complicated setup.  It works ok on a roller coaster type track.  It may work better with tuning.  It may work on yours.  If you share your blend file, I'll share mine.
2: Simpler, no plugins: A hidden pipe track and ball(s) connected to your object by physics constraints.
Loft your curve with a bevel so that it's a tube mesh curve, with enough detail and room so that the ball travel in it smoothly.  (make a copy of the curve so you can go back to it if needed)
Convert to mesh and a physics object.  The track is passive, mesh collision. no friction, no bounciness.
Connect a constraint and fix it to your object, perhaps below the pipe track.  your object's location should be constrained to the track, If you want your object to turn with the track, make two balls stick them in the pipe and connect them with a fixed physics constraint and connect your physics object.  You can hide this pipe track and balls in your render.  It's more complicated to have the angle matched to the curve in 3 axis.  Perhaps have a rectangle block traveling down a square tube?  Tested briefly, may work for some cases and with tuning, but a ball works so much smoother.
I have not tested or explored this completely but it should give you some ideas.
Edit: Tested 4 connected spheres forming a flat rectangle car, sliding in a square track, seems to travel smoothly and keep orientation.
Edit2: Which is similar to giving a rectangle a collision margin, It makes the corners of the "Box" collision object smooth.  So that's easier to make and edit.


Active collision bounds in the BGE? How can I have collision bounds that are exact, even during animations. If I have a character with a simple rectangular prism, it won't be realistic. I could have an exact copy in shape but the animations will play and it will be ruined. I could have animations on the collision bounds, but then being stable to the ground won't happen. I could just have simple bounds then another set of perfect bounds, but dynamic object will hit only the simple one. There is obviously another technique for the next step in this topic. How can I have collision bounds that work with dynamic objects, and are perfect in shape to the original character that are also stable to the ground?

I would prefer solutions that do not include python.

Ok, I ignored the "no Python" requirement because the absolute simplest way of doing this requires very few lines of code.  Doing it brick-only would be loads of work and very dirty.

Attach this to your animated mesh and run it every frame.  It will update the physics to match the mesh.

import bge

def update(cont):
    own = cont.owner
    own.reinstancePhysicsMesh()

if __name__ == '__main__':
    update(bge.logic.getCurrentController())

Example blend

Of course, being parented to the armature means it wont be affected by gravity.  So you'll need the armature parented to another object for controlling movement.  Make use of Collision Group / Collision Mask to prevent unwanted interference.

EDIT - Example with collision masks


snap 3D cursor to closest vertex in 2.8 I'd like to put the 3D cursor on a vertex with a single action rather than a series of actions.
Currently, I have to switch to edit mode then switch to vertex select then select the vertex then cursor to selected than back to object mode.
It's very tedious.
I tried to hold ctrl while placing the 3D cursor near a vertex. It did not work.
I tried the magnet, chose vertex mode but it didn't work with 3D cursor.
Any ideas?

I got it now. If the magnet is active and snap to vertex is selected you need to hold and drag mouse to snap nearest vertex. If you just click it doesn't work.


Is it possible to remove Blender Render/Internal render? I want to clean up a bit in my Blender UI, and thus want to completely remove Blender Render.

Is this possible? And will it have any negative effects in working with cycles (create bugs/similar)?

I have searched in many places information about blender render and if I can deactivate as when you deactivate cycles or renderman21, but as far as I understand, it is not possible since its name indicates it is the internal render, and a basic and fundamental part of blender


My render viewport doesnt wok guys, I rendered just a scratch scene with a cube, there is no problem. But with a render of my built scene, there is not possible to gain any render. I tried default setting... but still not working. what is my scene about? There is a suburb with perhaps 20 buildings made with GIS just low poly boxy ones and in the center, there is a small garden parcel with green grass and one tree. The whole scene is white with the HDR surrounding only grass is colored and the tree textured. To have leaned grass I used a wind.
Do you have any ideas about whats going on? Thank you.

Yes, it is. Everybody told me to use open GL updater but, when I open blender with the default cube in the scene and hit F12 I have immediately rendered cube. My created scene at all. I can not find out what's going on. Thanks


Trouble with getting correct context I am brand new to both blender and python, so i apologize in advance if i'm missing something simple, but i'm having trouble with my script. The purpose of my script is to hopefully delete the default cube in the scene, scan a folder for an obj file, import that obj and then make a duplicate of the imported obj and apply a decimate modifier to it.

import os
import bpy

decimate = 0.02
resolution = '4k'

bpy.ops.object.select_by_type(type='MESH')
bpy.ops.object.delete(use_global=False)

full_path_to_directory = os.path.join('C:\\', 'Users', 'brand', 'Desktop', 'New folder (2)')
file_list = os.listdir(full_path_to_directory)
obj_list = [item for item in file_list if item[-3:] == 'obj']

for item in obj_list:
    full_path_to_file = os.path.join(full_path_to_directory, item)
    bpy.ops.import_scene.obj(filepath=full_path_to_file)
    bpy.ops.object.duplicate()
    bpy.context.active_object

for ob in bpy.context.selected_editable_objects:
    ob.active_material_index = 0
    for i in range(len(ob.material_slots)):
        bpy.ops.object.material_slot_remove({'object': ob})
        bpy.ops.object.modifier_add(type='DECIMATE')
        bpy.context.object.modifiers["Decimate"].ratio = decimate
        bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Decimate")

bpy.context.scene.render.engine = 'CYCLES'
bpy.context.scene.selected_col = True
bpy.context.scene.selected_rough = True
bpy.context.scene.selected_normal = True
bpy.context.scene.texture_res = resolution
bpy.context.scene.restoreOrigUVmap = False
bpy.context.scene.newUVoption = True

When i run the script, i get this error

Traceback (most recent call last):
  File "\Text", line 24, in <module>
  File "C:\Program Files\Blender Foundation\Blender 2.81\2.81\scripts\modules\bpy\ops.py", line 201, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.modifier_add.poll() failed, context is incorrect

However, if i delete the section that handles importing the obj from a folder and i simply apply the script to the default cube, everything works correctly and i get a duplicate with a decimate filter applied correctly. I have tried a few different ways of trying to fix this issue but i just cant seem to wrap my head around it, any help would be greatly appreciated. Thanks.

Add modifier using API, override the modifier apply.

Would use

m =  ob.modifiers.new(name="Foo", type='DECIMATE')
m.ratio = decimate

to add a modifier, and override the context of modifier apply operator, just as you have done for material link remove.

bpy.ops.object.modifier_apply({"object" : ob}, apply_as='DATA', modifier=m.name)

Questionable whether you want to add and apply modifier for each material slot, check your indenting

Alternatively can deselect all,  set as active and select the active object in loop.  To set the context to each individual object. Suggest is the Equivalent of you "simply applying script to default cube"

Eg for 2.8

bpy.ops.object.select_all(action='DESELECT')
ob.select_set(True)
context.view_layer.objects.active = ob

to give the loop object context.

However would recommend using as few operators as possible...  see Python performance with Blender operators

Note incorrect context is a common cause of problems

https://blender.stackexchange.com/search?q=context+incorrect


Slide the legs of a table Here is very simple model of a "table":

How could I easily slide the selected part closer to the inside, i.e. move it along the X axis? If I just move it, the top part will obviously be distorted:

Instead, I would like the top part to protrude like this:

How would you do this?

Press P key with the table leg selected and choose Selection,

to separate it by selection and then Shift select the table and press CtrlJ to join them back together, now you can move it however you like.
-don't forget to exit the edit mode of the table before you join them


Construct surface model from atomic force microscope data I am trying to reproduce in blender the sample surface imaged by atomic force microscope (AFM). I found the link below but cannot get it to work yet. Here is what I did (in windows environment):

Convert the AFM images to ascii files in the same format as the example in the attachment in the link below.
Copied the 'io_import_mesh_afm_ascii' folder to addons folder.
Run the .py files by the text editor in blender.
Import -> ascii text option

Now I see the error 'init.py' line 61, "system error: parent module '' not loaded".
Any idea what the problem is? Also, is there alternative ways to do this?

Thanks in advance!
JT

http://blenderscripting.blogspot.com/2012/06/atomic-force-microscope-ascii-loader.html

Probably long time since this is done but here goes:
open your AFM data with Gwyddion.net, export as ascii txt file, use open SCAD to plot the data and export as STL file. Import STL file into blender or your 3D printer slicer (to get the gcode for example).

Gwyddion and openSCAD are python scryptable as far as I remember. Will work better on *ix systems than windows.


How to make a smooth stretched grid I'm trying to reproduce a curved space-time representation, which correspond to a stretched grid as the picture below

The grid surface should look as if it's pulled from a single point. Is there a simple way to realize this? Thanks for the help!

Start with a plane subdivide it for an uneven number e.g. 11 to have it symmetric around the center vertex.

In Edit Mode / vertex select enable propotional editing O and set the falloff.

Add a grid texture (included in attached .blend) and add a subsurf modifier to make it smooth:


Does Blender have a file locking feature? Is there some way to lock files with a password or to lock open files to prevent them from being edited by others?
Use case examples:
A:
Jack wants to sell Blender models, but wants to ensure that only those who have paid and been sent a password can edit the models.
Can a password be used?
B:
Jack and Jill are making a hill for their water simulation. However, Jack wants to make sure the hill is completed before Jill tries to run a water simulation.
(How) can he lock the file?
To be clear:

LibreOffice (also open source) allows password protected files.
I do not want to sell files as described, but I do want to protect my files via password sometimes (and will need to in some situations).

No, for the same reasons ideasman42 said in his own answer. He suggests some workarounds however, here are mine..

Case A:
You can use PasteAll.org (which has natural support for blend files) to safely upload and password protect a .blend file, you can then send the link and password to the customer.

Case B:
Easy enough, they could work in separate personal files and merge them when ready. Link/Append

Ultimately, you are better off using an actual software that provides encryption such as 7zip.


how to make a limit for the loop cut tool are there any way for making the loop cut not going to certain vertex group in the mesh ? as you see in the image when i click on ctrl + r the loop cut go through all the character from her head to her foot but i want to not add any new loop cut to the character head so are there any way for that ?

Switch to Face Select Mode, select the faces you want to keep and hide them with H. Then do your loop cut. After that, reveal your faces with ALTH.

The loopcut will have added a new vertex but it will not have cut through. So, if you have hidden some quads, you will get an ngon. Not ideal but you can retopologize it later.


How to mark the seams of UV maps to edit textures in external programs? I am working on texturing a complex object, but do not like the blender's painting tools. So, I tried editing it in an external editor, but don't know how to know in the external program where the seams are. Is there any workflow for labeling different pieces of the unwrapped faces so that in the external program you can focus on painting each of those pieces? All advice is appreciated!

If you are painting some textures that are a little bit more complex, you might want to consider doing that on the 3d model in 3d. There are plenty of tools for that in a lot of 3d packages these days, Blender included. Obviously if the textures you need are simple, using an external image editor is a very valid option as well. Especially for every day simple objects.

The usual workflow is to export the UV map as an image and make the textures using that as a guide.

You would simply enter edit mode, select all to view the UV map, go to the UV Editor and choose UVs menu on the header, then Export UV Layout:

You can chose desired options and save the file then.

It is then usual to open it in an external editor and have it as a top layer while working on the texture so you can see the location of the UV islands while you work and disable it once you save your texture:


Fluid render has horizontal lines in Blender Eevee I am trying to render a fluid simulation in blender eevee but horizontal lines appear in every frame. Can someone help me out?

I was testing fluid simulation here and had the same issue. The solution was to turn off "Show Backface" in the Material settings tab, under "Settings" like in the screenshot below. Then the lines don't show up anymore.


animation character not working I made a character in makehuman and imported it in blender and then I downloaded the animation of dancing from cmuconvert and loaded it and played the animation and it shows like this

I don't know cmuconvert, but I know for sure that animations are not compatible with any rig. Basically, an animation can be used on your rig only if your rig is quite close to the rig used for creating the animation. Including bone names.

That being said, I did some research and found this thread about importing animations from cmu.
You might find the needed plugins here.


Select pass mode via python script I want to change the value of "Pass" type inside the "UV/Image Editor" area as shown on image.

 The default "Pass" value is "Combined" and I want to change the value to other available types with python script.

I was able to manipulate "Layer" type using

bpy.context.scene.render.layers[0]

but i'm not able to find mentioned "Pass" value in the python API.

Thank you for your answers and time!

With the help of @B.Y.O.B. I realized that it's not possible to change "pass" setting, because LuxCore (and also Cycles) processes all selected passess (AOVs) while rendering, so there is no point in changing that variable with python (therefore it's not exposed to the API).

Anyway, my final goal was to output only certain pass (in my case "Irradiance"), which I achieved with standard way for manipulating render output - Compositor Node Editor. I used File Output node as shown on my code example:

import bpy

bpy.context.area.type = 'NODE_EDITOR'

bpy.context.space_data.tree_type = 'CompositorNodeTree'
bpy.context.scene.use_nodes = True

C = bpy.context
node_tree = C.scene.node_tree

render_layers = node_tree.nodes.get(Render Layers)

# This command creates File Output node
node_tree.nodes.new(type=CompositorNodeOutputFile)
output_file_node = node_tree.nodes.get(File Output)
output_file_node.base_path = "save path"

# Link Render Layers to File Output node.
irradiance_output = render_layers.outputs.get(IRRADIANCE)
link = node_tree.links.new(irradiance_output, output_file_node.inputs[0])


How can I crop and export parts of STL Objects? I'm a blender beginner. I have an .STL of an anatomical figure and I need to crop a small chunk of it and export it in a separat .STL file, but so far I haven't found anything quite relevant on the web. Since I'm a blender-nobb, I figured out I don't even know what to search for exactly.

Have you tried looking into the Boolean modifier?

If you object is a closed, watertight, manifold mesh you could use Boolean operations to break it into chunks of the desirable parts.

Just create a new closed watertight mesh object that as a shape or volume that engulfs or includes the part of the STL you want to keep and use it in a Boolean operation to intersect with the existing mesh and extract the part you want.

You can also try the Knife Project operator if a simpler cutting or slicing of the original geometry in one direction will suffice to obtain what you want.
You can use something as simple as a plane or a bezier curve to cut your geometry in the desired way.

Edit If your object is already composed of separate parts but all joined in a single object you can simply enter edit mode, select them all press P to separate them and select the option All loose parts to divide them into different objects.


Can I open 2.79b files in 2.8? I'm now using blender 2.79b. So the problem is, if I change the version from blender 2.79 to blender 2.8, is all of my work in blender 2.79 lost?

Yes and no...
Yes if you have simple blend files, I saw that 2.8 opens them pretty easily. If you re-save them using 2.8, then, yeah you cannot open them in 2.79. Blender will crash.

No, if you have Armatures blend files (I've been using a simple biped rig from the internet, much like 3DS Max has) then you will have issues.
Also, I saw that collections tend to disappear from one save to another... (but maybe is because the Armature rig is coming from a 2.7x version...)


Display values of a normal of a selected face We want to see the three values of a normal of a face when we select it in edit mode.
How to do so?

Is there any add-on showing these sort of info realtime?

Update:
It seems the accepted answer does not result correct normal vector!! In the following figure the normal vector of the selected face obviously is not (0,0,-1)!

Here's a little hack to add the normal vector to the Data tab in Properties Editor. Copy, paste and run from the Text Editor (will stay until you restart Blender):

import bpy
import bmesh
from mathutils import Vector

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

    me = context.object.data

    if me.is_editmode:
        bm = bmesh.from_edit_mesh(me)
        if bm.faces.active is not None:
            row = layout.row()
            col = row.column()
            col.prop(context.window_manager, "active_face_normal", text="", expand=True)
            row.prop(context.window_manager, "active_face_normal", text="")

            if context.window_manager.active_face_normal != bm.faces.active.normal:
                context.window_manager.active_face_normal = bm.faces.active.normal

    else:
        p = me.polygons
        if p.active is not None:
            row = layout.row()
            col = row.column()
            col.prop(p[p.active], "normal", text="", expand=True)
            row.prop(p[p.active], "normal", text="")

def upd_normal(self, context):
    bm = bmesh.from_edit_mesh(context.object.data)
    bm.faces.active.normal = self.active_face_normal.normalized()

def register():
    bpy.types.DATA_PT_normals.prepend(draw_func)
    bpy.types.WindowManager.active_face_normal = bpy.props.FloatVectorProperty(subtype='DIRECTION', precision=3, update=upd_normal)

def unregister():
    bpy.types.DATA_PT_normals.remove(draw_func)
    del bpy.types.WindowManager.active_face_normal

if __name__ == "__main__":
    register()

The normals are actually read-only, but I made it so you can edit the normals in edit mode. Note that they will reset as you leave the mode to e.g. object mode!

If I'm not mistaken, there is a Normal edit addon, which should be similar to what I created. But AFAIK it remembers the normals per face, only used for exports however.


Snap all vertices to their closest grid intersection Is there any way to snap all vertices of a given model to their closest (x,y,z) point where the grid intersects?

I know that if you activate "Snap to grid" when moving vertices they snap to the grid, but I'm asking for an automated way of snapping all of the vertices to the closest grid intersection point.

Yes, you can select all the vertices and choose Selection to Grid (Shift-S, 6).
helpful question because I didn't know this until now and it's useful.


selecting multiple groups I am trying to select two groups at a time. I tryed shift + G and select a group, than select another object from another group, and hit shift + G again, but the previously selected group was deselected, how can I make to select two or more groups?

thank you

Clear selection with a
All click can be done in the outliner window
In the outliner window show groups.
Click on first group
Shift click on the second group.


Good approach to make planks for a barrel? I'm trying to make the planks in a barrel, without involving sculpting. What is a good method? I thought about an array, but haven't had too much luck.
this is what I've got at the moment,

but I'm trying to get something like this second picture.

Can I get some advice?

There undoubtedly lots of ways of doing this. Here's one of them:

Array modifier

Use an array modifier with an object offset to duplicate one board object around radially. This way all the boards can be easily tweaked later on by editing just one; changes will be copied to the other boards.

Create the board object. If you want a certain number of boards (say, 16), then you'll want to be sure the board's width is 1 16th the circumference of the desired circle. The easiest way to do this is add a circle with 16 sides:

Add a circle (⇧ ShiftA) and set the sides to 16 in the redo panel.
Extrude (E) it into a barrel shape. I used a loop cut (⎈ CtrlR), beveling (⎈ CtrlB), and scaling (S) to quickly make a basic barrel shape.
Select one face loop (⎇ Alt RMB) and invert the selection (⎈ CtrlI), then delete faces (⌦ Delete, F)
With the remaining face loop selected, extrude (E) and press Esc to cancel the transform. Scale along the normals (⎇ AltS) to give the board some thickness.

Setup the array modifier

Add an empty and rotate it 360/16 degrees (R, = 360/16 will do the math in place and rotate the empty 22.5°)
with the board selected, add an array modifier, disable Relative Offset, and set the Count to 16.
Set the empty as the Object Offset.

Optionally fatten up the board object (⎇ AltS in edit mode) to reduce the size of the cracks between the boards.

Result:


What specs are required, and what software do I need to make a Render Farm? I'm sending .blend files to a new render farm that has dedicated machines that have never run blender before.  What machine specs are required, and what software do I need to make sure is present?

Hardware:
(pictures from the blender website) https://www.blender.org/download/requirements/

Since you are running a "Render Farm," you do not need the monitors, mice, or graphics tablets.
I would recommend buying good graphics cards for your nodes, as GPUs seem to increase render speed by quite a lot.

Software:

All you need is linux, windows, or MacOS and blender (https://www.blender.org/)


How do I put a stencil-like texture across a sectioned object? I have a rough wood board crate I want to apply (UV map) a stencil on, but only on one side of the face AND I want it to disappear in between the boards --just like the attached example image (created in Photoshop). Any suggestions?

UPDATE: Secondary Problem in attempting the 2nd answer below: Following the answer below I could duplicate the nodes as outlined to get the decal on the bars however it still wraps around the edge of the bars and does not show just on the one side as I want it too. What am I doing wrong? (Please note: there is a follow up to this in the 2nd answer below) As you can see I applied the answer / solution  on test bars until I can figure out how to move that to the main wood shelf object's middle section.

UPDATE 2: For a 3rd very good answer please refer to this link https://blender.stackexchange.com/a/45708/1853

This can be done quite easily actually in the Cycles render engine with an empty and by using Object texture coordinates.

First create an empty and position it where you would like the decal to be placed on your object.

Now setup the following material nodes for the bars.

Make sure Min and Max are checked on the Mapping node, this clamps the edges of the texture so that it doesn't repeat infinitely.

Instead of the two diffuse shaders you can use whatever materials you would like for the plain bars and the stenciled text.  The bottom diffuse shader is for the text, the top diffuse shader is for the bars.

This leaves one problem however: since the texture is infinitely thick along the Z-axis the texture will be stretched across the inside edges of the bars undesirably.  To fix this amend the above node setup with some math nodes as follows.

The added nodes use a Less Than Math node to to test if the absolute value of the Z component of the mapping coordinates is within a certain range (in this case I am using threshold of 0.03).  The multiply node works like a logical AND between this test and the alpha channel of the decal texture.


Rendering as wireframe only I need a simple wireframe only render with a white background.

Any tips on how I could get it?

Set the horizon to white
Turn on freestyle
Set freestyle visibilty to QI Range
Set the objects material fully transparent.


gamma cross flashes secondary strip for 1-2 frames before fading my videos have an intro clip that fades into my content strip. to fade, i use a gamma cross effect strip. overall the result is acceptable, but the first 1-5 frames of my gamma cross flash the content strip in near-full visibility before returning to the appropriate level of fade. then the strips fade as intended. any ideas why this might be happening?

i'm not sure what the policy is for this and i'm not intending to advertise here, but https://youtu.be/s43BSKDfq14?t=4s from :04 to :07 is an example of what i'm talking about. thanks in advance for any help.

Got burned on this myself. It's sensitive to the order you select the clips. Selecting the second clip first gives you a backwards fade.


Deform a mesh object in a random manner in Blender using Python I want to convert simple plane (left) into randomly deform plane (right) using python scripting. The intented deformation should be in x,y dimension. Anybody has idea, I am newbei in blender-python.

myobj = bpy.context.active_object
bpy.ops.object.mode_set(mode='EDIT')
selected_vertices = [i.co for i in myobj.data.vertices if i.select]

for i in selected_vertices:
    bpy.ops.transform.translate(value = i*random.uniform(-1,1), constraint_axis=(True, True, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, release_confirm=True)

Using bmesh on an edit mesh (run in edit mode)

import bpy
import bmesh
from mathutils import Vector
from random import uniform
context = bpy.context
obj = context.edit_object
mesh = obj.data
delta = 0.2
# get a bmesh
bm = bmesh.from_edit_mesh(mesh)
for v in bm.verts:
    if not v.select:
        continue
    v.co.xy += Vector([uniform(-delta, delta) for axis in "xy"])
#update.
bmesh.update_edit_mesh(mesh)

bpy.ops.transform.translate will translate all selected vertices.  Using it in the loop as you had it, if all verts are selected would move all verts a random amount for each vert. (or nowhere for any vert with a 0 coordinate) You would need to copy the selection, deselect all, select them individually transform the single vert, deselect etc.  Also remember scalar vector multiplication needs to be scalar * vector.


Control Cycles material nodes and material properties in Python How can I define the different properties of an Cycles material? Such things as glossy, glass, diffuse, RGB-color, emissive via Python scripting?

Here is how to change material properties, you can see all of them here or see the python path when you hover over in the UI on some material attribute:
    import bpy

    # get the material
    mat = bpy.data.materials['Material_Name']
    # change its parameters - example viewport diffuse color:
    mat.diffuse_color = (1,0,0)

Here is how to manipulate material nodes and thus the material look itself:

Get the nodes:
  import bpy

  # get the material
  mat = bpy.data.materials['Material_Name']
  # get the nodes
  mat.use_nodes = True
  nodes = mat.node_tree.nodes

  # get some specific node:
  # returns None if the node does not exist
  diffuse = nodes.get("Diffuse BSDF")

Create driver:
  # insert driver to roughness
  driver = diffuse.inputs[1].driver_add("default_value")
  var = driver.driver.variables.new()
  var.name = "variable"
  var.targets[0].data_path = "PATH"
  var.targets[0].id = "Target_Object_Name"
  driver.driver.expression = "variable"

  # remove driver
  diffuse.inputs[1].driver_remove("default_value")

Keyframes:
  # insert key frame to roughness at frame 10
  diffuse.inputs[1].keyframe_insert("default_value", frame=10)

Create nodes, here are all the node types you can create (look for subclasses):
  # remove specific node
  nodes.remove(diffuse)

  # clear all nodes to start clean
  nodes.clear()

  # create emission node
  node_emission = nodes.new(type='ShaderNodeEmission')
  node_emission.inputs[0].default_value = (0,1,0,1)  # green RGBA
  node_emission.inputs[1].default_value = 5.0 # strength
  node_emission.location = 0,0

  # create output node
  node_output = nodes.new(type='ShaderNodeOutputMaterial')
  node_output.location = 400,0

Link nodes:
  # link nodes
  links = mat.node_tree.links
  link = links.new(node_emission.outputs[0], node_output.inputs[0])

  # get specific link
  from_s = node_emission.outputs[0]
  to_s = node_output.inputs[0]
  link = next((l for l in links if l.from_socket == from_s and l.to_socket == to_s), None)

  # remove links
  links.remove(link)

As before hower over node atributes in UI to see the python paths


How to change number of vertices in add object in 2.8? I'm very new to Blender and following tutorials with the old Blender UI is tricky in 2.8 to say the least. I am trying to find how to perform this function in 2.8
Prior to 2.8, Shift + A > Mesh > Cylinder created a new cylinder and had this menu available in the toolbox to edit the number of vertices in the object

I cant find this menu in 2.8 and I am unable to change the vertices of the starting object. Please help! Thank you!

The "Adjust last operation" menu is found at the bottom left of the viewport. You may need to click to expand it, as it appears collapsed by default.

Alternatively, you can look under Edit > Adjust last operation, or hit F9.


How to emit only one hair particle from each vertex? How to emit only one hair particle from each vertex on mesh?
Can't believe such simple thing isn't implemented.

You absolutely can.
Make particles come from verts, uncheck "random order" and input on the "number" the exact number of vertexes you object has.
8 in the case of a cube.
Crazy shape? No problem!

Just match verts and number of hairs.
Wanna use a collection of objects? No problem!
Just make sure the origins are all consistent.


How do I create slices of a topographical mesh? I've been trying to create a topographical wire mesh as shown below to convert to curves later:

Here I have a Bisect Tool Cut in Blender, but as you can see, the Tools panel really doesn't have an option to Create Multiple Cuts like I would want:

But heres an example from Cinema4D below, but I know it's possible in Blender too.

I would then like to select those edges and convert them into splines.

Apologies for the confusion.

Create a plane that is larger than your terrain and create an array in the Z direction. Add a Boolean modifier to the terrain - the plane is used as a cutter. Visually you can create the layers by then adding a solidify modifier...

...but you asked about creating curves so - apply the Boolean and then in Edit mode press P and choose by loose parts. Back in Object mode while all the objects are still selected press ALTC and convert your meshes to curves.


Cloth simulation - simulate 2 unlinked meshes together as one Gentlemen, I have a problem with the cloth simulation. The object I am simulating consists of 2 or more parts that are not interconnected. As a result, the simulation treats them as two separate objects.

How can I make them behave as a single one?

For example: I am modeling the German flag. It has 3 rectangular parts (Black, Red, Yellow). And the sews have stitches (which is another separate object).

Now, I want the entire flag to fall onto something but all these individual pieces don't interact as one. What is the solution? Do I need to merge it somehow? (If so, how? Boolean operations...?)

Let's assume the stitches or other details can be represented by some cubes close to the flag geometry.

Duplicate the Flag mesh. The FlagDupe should also do the same simulation as the original. We will create a cage from it for the extras.

Add a displace modifier, and a solidify modifier. The value of the second modifier should be twice the value of the first modifier.

Select the stitched extra object, add a MeshCage Modifier to them and bind the object to the FlagDupe by clicking on the bind button.

The bound object will follow the FlageDupe object.


How do you make a Video File Texture in 2.81? I cannot seem to find any updated information on this.

I am trying to make a plane that is a video file.  For the life of me I cannot figure out how.  I applied the video file as a texture, set the amount of frames and the start frame, but all that Blender will show is the first frame of the video.  It will not play it.

All I can find about this is old out dated tutorials.  I follow them as best I can considering the UI is totally different now, but nothing seems to work.

Every video file I try just shows the first frame and that is it.

What am I doing wrong?

EDIT:

Using Cycles Render Engine

Here is my node set up:

Enable Auto Refresh in the image texture node


My fluid domain still visible, even after baking. The FLIP particles are clipping through the box mesh My resolution is 200, after seeing so on another tread.

Yohello1's answer in image ...

to see inside domain go to Properties editor > Object > Viewport Display set Wire

or go to Properties editor > Simulations > Fluid > Liquid > enable Mesh


Material turning black in Eevee I have a peculiar problem, which has been unfortunately recurring. I create a special material in nodes so I can see both textures and blend it with vertex colors. But this sometimes bugs (or maybe I set something wrong) and I have no idea how to fix it. On the picture you can see the material being applied to the object. The body of the washing machine, the door, the drum and all the buttons including the logo are all separate objects. I applied the same material on all of them, however only on the body it works at it should showing the colors. The other are black even though the UVs are set right and they all should appear as colorful as the body. When I switch to solid mode it looks as it should but under the material preview mode it turns black. This really puzzle me since there is nothing different in the setting, it is the same material, yet on the other parts it appears black and remains so even after restarting Blender.

When I select the black parts and switch into vertex mode, it fixes it. Weird fix, but it works.


Child object doesn't move with parent bone I'm working on a game (and thus using the Game Engine) and I have a pistol parented to a bone. When I play the game, the pistol moves with the animation, but the actual location does not change with the character. Here's some images of it happening:

You can see the pistol is in the hand, and it follows the animation for rest.

When I run to another location, the pistol moves like it is running, but stays in the same place.

I can probably take a video of it if that's required.

It is not locked in any way.

I'm not sure if the same applies to the game engine, but when animating the bones don't move the body unless they share the same name as the (vertex group) they are meant to move.

this link shows how to make vertex groups
http://www.youtube.com/watch?v=w1EZZIsiIUA

I assume you already have bones, go into edit mode and make sure each one has a name which matches its appropriate vertex group.

sorry if this doesn't help.


Simulating piece of cloth between two moving points I am trying to simulate a piece of cloth with two points of control. The controllers will move towards each other, leaving the straps to loosen and fall on the ground. I want to then animate the points moving away from each other again as they straighten and lift up the straps.
I have tried using hooks, but they only move the vertices assigned to them
Then I tried using bones to move, but the whole mesh is moving with.
In the attached image, I would like to have point B stay in place while point A moves towards and away from it.

OKay. Got it working. What I was missing was adding a weight map for each hook, instead of only having the pin group as a weight map. Doh!


Need to change pivot points during animation First of all sorry for my english.
I create an animation of duplicating triangles that are ultimately to create a shape. Triangles are created by rotating around a vertex or edge. The problem arises when the first group of triangles appears (dark gray in the picture) and I would like the shape to grow. To achieve this, it is necessary to change the pivot point.
How can this be done?

If what you want to do is a series of rotations for your triangle, what you could do is use Child Of constraints with some empties:

Create an empty at the first pivot point of the triangle, give your triangle a Child Of constraint with the empty as Target, press the Set Inverse button, keyframe the empty:

Rotate the empty, keyframe the rotation, put the 3D cursor on the second pivot point, create an empty, give your triangle a second Child Of constraint with this second empty as Target and Set Inverse, keyframe this empty:

Rotate this second empty, keyframe.


Can't scrub through animation in Blender 2.8 Default behavior for LMB+drag in any timeline panel (timeline, dope sheet, action editor etc.) in Blender 2.8 is to create a selection box instead of scrubbing through animation. I have the B key to enter box select if I want to select things - I don't need this new method of selecting things.

I've managed to disable the selection box, but the scrub still doesn't work - now if I hold LMB and drag on the timeline it just does nothing. And I don't want to have to click on the frame number panel (which does what I want it to when I click and drag on that - see picture for clearer explanation).

Resolved:
Preferences > Keymap > Animation > Change Frame

Default value: shift right mouse

Change to: Left mouse

Note: No need to disable the "box selection" behavior. This overrides that. The above change is all you need to do.


What is the most efficient way to paint a 3D Sculpture? Hello Everyone,

I am new to Blender and digital sculpting, I've only been at this a month or so. Thus far I've been unable to find a good resource regarding painting digital sculpts that will be used for illustrative purposes. Therefore I do not wish to make low-poly versions. Attached are a few busts I've created of some of my characters ranging from caricature, fantasy as well as cartoon. I'm looking for an efficient way to paint these for rendering in Cycles. Does anyone have any recommendations as to best-practices for painting high-poly sculpts that will be used for digital illustration and not gaming? Is there a some additional software I could get for this purpose?

Thank you in advance for your help!
Best regards,
David Mansch
www.mansch.com

Use Vertex Paint mode to color the sculpt. To make the vertex colors renderable set the nodes as pictured below (add the Atribute node with the vertex color's name and use it as a Diffuse color). There are some limitations in this method though- you have the access to only few brushes (compared to the ones available in Texture Paint mode) and the sculpted mesh should be very dense if you want to paint some detailed strokes.


How to improve the contrast and colors without getting clamping? Is there an alternative node I could use to improve the contrast and colors while being sure it will never clamp the values?

You can use the Dodge and Burn nodes for that and they will add a glow effect too on your image.
The dodge node will brighten your image, the burn will darken it. Both have more effect on bright areas and no effect on dark areas, so to avoid clamping we will apply more dodge on the darker parts and more burn at the brighter area, then we will mix them to only have the burn from the dark value of the source image and the dodge from the bright values. If this is not clear here is a step by step.

For this example I will use this source image:

Burn node:

To apply the burn on bright areas, add a Mix node in Burn mode and plug the source image to the 3 inputs. If an area is dark the image used as a factor won't apply the burn so it won't set the value bellow 0.

Dodge node:

For the dodge add a Mix node in Dodge mode then plug the source image to the 3 inputs but this time invert the image for the factor. This is the opposite, the dodge will be mostly applied on the darker value, but at the same time it has less effect on those so you will mostly get the effect on middle gray values, you won't have any clamping.

Blending the nodes:

Now to blend the two images add a Mix node, use the original image as a factor. The first slot will be the image used for everything dark to middle gray and the second for middle gray to bright.
For the first slot connect the Burn mode, to get the slight effect he has added on the shadows, for the second the dodge.

The contrast will probably be too strong, you can add a mix node and plug the original image in the first slot and the image retouched in the second slot. Now use the factor to adjust the contrast, here it is at 0.5:


how to simulate origami properly? I have super struggled with this model and rigging for a month without weekend. I made this rigging object combining copy rotation + transformation. Because I thought some hinges should go faster than others to keep them stick together.

But as you can see in this file above,it does not work. The centre fall apart during the animation. How I can make them get together during the animation?

Look at it in Front View (Ortho). Note that with the rig you have it is designed so it will fold into a square, ignoring the end pieces. If you want something else like a pentagon maybe you should start with that shape and work backwards unfolding it. Or just change the shapes of the end pieces to be more like the rest.


Convert a curve to a mesh with a user defined resolution I know there is a setting that controls the curve resolution but it seems you can't set some precise value to get, say, a mesh replica with exactly 15 verts for example. Is there any addon capable of doing so if Blender can't do that out of the box?

Bezier Curves

The curve resolution is already an exact parameter that drives the resolution of the surface (for example in U direction), but it is taking into account the number of faces, not vertices.

For a curve without V resolution (0), the faces collapse into edges, so you'll have a starting vertex, than an edge(1) followed by a vertex (1), than an edge(2) followed by a vertex (2), ... than an edge(n) followed by a vertex (n).

At the end the number of vertices is always n+1, with n as the number of edges/faces resulting from the moltiplication of the resolution and the number of segments of your spline.

The following example consider a spline made of 1 segment (2 control points). See how in this case the resolution is equal to the number of resulting edges.

The final formula should be:

  n° of final vertices = n° spline segments * resolution + 1

Nurbs Curves

Nurbs have a different mathematical implementation from Beziers.

They require at least 3 control points to build a proper geometry. If you set the Resolution parameter to 1, you can see how the number of edges constituting the figure is equal to the number of control edges minus 1. But as the number of final vertices is equal to the number of final edges plus one (as seen before), we can say that the numberof final vertices is equal to the number of control edges that the Nurbs has.

So for example a Nurbs curve made with 5 control edges, will result in a curve with 5 vertices once converted to mesh, if the resolution is set to 1.

As the tooltip says, the Resolution Parameter controls the number of subdivision per segment. Here's a few result for the previous example:

Res: 1 -> 5 vertex (4 edges)
Res: 2 -> 5*2 = 10 vertex (9 edges)
Res: 3 -> 5*3 = 15 vertex (14 edges)
Res: 4 -> 5*4 = 20 vertex (19 edges)
....
Res: n -> 5*n vertex (5*n-1 edges)

The final formula should be:

  n° of final vertices = n° of control edges * resolution


Moving object to exact location rotation of other object I have two object one is in a slightly different location and rotation than the other. I would like to move the first object to the exact location rotation as the second object so I can animate between the two positions. Is there a easier way to do this than just messing with the location and rotation until it looks like they are in the exact same spot?

one way..

Select all the objects you want to align, with the target last, so active.
In the target's Item > Transform panel in the 3D View, select a 'Location' field, Right-click, > 'Copy all to Selected'
Repeat for Rotation.


How to make blender render a further distance When I render my project the building towards the top right is cut off and I don't know why. If someone can explain a way to fix this it would be greatly appreciated.
https://i.imgur.com/Pz3vaNt.png

Increase the End Clipping of the camera in it's Lens properties.


Which font is used in Blender's logo? Here you can download the logo https://www.blender.org/about/logo/, but the text is not editable.

What font is? It's a free font, right?

It is a special version of Helvetica. You can check the below links:

https://blenderartists.org/forum/showthread.php?67062-Official-Blender-font

https://blenderartists.org/forum/showthread.php?114438-Blender-s-Font

https://blenderartists.org/forum/showthread.php?90755-Blender-Font


Scale multiple objects in place I am trying to scale many objects that are in a circular formation around (0,0,0) but have them STAY in their respective coordinates. When I scale or transform all of the objects now, it changes the distance away from center.
In photoshop there's something like Object --> Transform Each.
Is there something similar in Blender?

I guess what you're looking for is just to change the Pivot Center to Individual Origins:

Now when you scale up your objects they stay in their position:


How do I change the shape of an object while keeping all of its data? This is my first time making a game in Blender and I've been using the cube that is the first thing on your screen as my player. The player has a bunch of code in it now and I want it to be a different shape, not a cube. How do I change it without having to rewrite all of its insides?

You can use two different methods.

Switch the meshes

Select your cube. In the Data panel, the first field allows you to select another mesh :

The object data will be preserved (logic bricks, modifiers, etc). Only the mesh data will be affected (vertex groups, materials slots, etc)

Use parenting

This method is preferable if your character already has an armature, and allows to keep the cube Physics settings.

Parent the character to the cube : select the character (or its armature if it has one), keep Shift pressed, then select the cube, hit Ctrl+P, select Object.

Make the cube invisible : in its Physics panel, tick Invisible.

To "hide" the cube in the 3d view but keep it selectable and usable, you can set Maximum draw type : Wire in its Object panel.


why is the display modifier button in blender 2.8 purple? anyone know why this button is now purple ? Just happened and I do not know from whence the maroon did come.

Purple indicates a driver.

For the most part, (unless you are using some whaky theme) purple in a field indicates a driver has been added.

To remove, right click over field and choose delete driver. (adding driver is most likely how you got there in the first place)

Oops added driver to diff prop from Q, same deal though

Note

In Q screenshot you have the apply all and viewport vis buttons etc above modifiers, which I assume is from an addon.  Possibly this is using a driver on the modifier visibility switch


Join meshes after rigifying one of them I had a model with eyes, gum and teeth and the basic human rigify was giving me errors when automatic weighting. So I separated those parts into another mesh. Now that I rigged one of the meshes, how can I join the two meshes so the entire head moves correctly?

You don't need anything bound to the armature but the body parts which need bone deformations. So eyes and teeth could most likely be parented (or Child Of constrained) to bones, rather than being skinned with automatic weights. In fact, you likely wouldn't want the eyes skinned in any case. Depending on how your rig is built, you will likely want eyes parented to eye control bones so that their orientation can be changed easily.
Note regarding parenting vs. skinning of the eyes: If you want the eyes controlled by bones that exist within your main armature, and don't want to use parenting or constraints to do it, then technically, you CAN bind them to the armature. But if you do this, the eye objects will need vertex groups. The name of the vertex groups must correspond to the name of the bones which will control them. The eyes technically don't even have to be separate objects from one another. They can be two joined spheres, provided they have unique vertex groups, with only the vertices for each eye assigned independently to each of those vertex groups. The eye bones will find the spheres if their vertex group names are the same as those bones, and control them. The important thing is to have only one vertex group assigned to ALL of the vertices for each eye (meaning no other vertex groups exist for the eyes, and so no other bones will ever influence the eye geometry). Then your eyes will move as if they are directly parented to the eye bones, even though they are technically bound to the armature in the same exact way that any other "skinned" mesh is bound to the armature. But the bind behaves as if it is a direct parenting relationship. Meaning rigid. This behavior results from only having one vertex group involved. If only one vertex group exists on an object, then only one bone can ever influence the vertices for that object.
Note on unjoining objects with modifiers: Whenever you unjoin objects, they keep all prior existing modifiers. These modifiers will now exist for ALL newly separated objects. This includes armature modifiers. Simply make sure that you only have the modifiers you need for all your objects as they now exist. Strange things can happen if you have the wrong modifiers in place, and the resulting issues can be hard to track down, since you might not be thinking of this separation step as a possible cause.


Why isn't parent offset visible? Any tools to help? Parent offset in Blender is difficult to understand, because there are obscured values that determine the outcome of user operations. See this question.

Are there any tools/addons to help with this? For example, a replacement parenting/reparenting function, or even a tool to simply display the internal values, to aid in understanding what is going on?

Secondary question, is there a stated or obvious reason for this seemingly intentional operational obfuscation? Is it something worth my time in seeking to drive change or offer to help change?

If you've worked with it for a while, and it now makes perfect sense to you, let me remind you of where others might be coming from. Here's a sample .blend I'm currently looking at:

All of these are simple, visibly identical plain cube meshes with identical rotation, and the object origin at the mesh center of each.

For starters, note that both D and C report translations of 0, 0, 0, and yet are in different locations, both in world space AND relative to their parent. How odd, I think. However, the real confusion is when I try to actually make parenting changes.

We know that there are various operations to unparent, keep transform, clear parent inverse, and set parent. However despite my goal of transferring the child relationship of D from parent A to parent B, nothing results in a destination of H. Various operations result in G, F, and E.

That means that if, historically I've moved something, I might be building objects with defects that cannot be measured through the UI. I had just this scenario recently. Rotations and multiple duplicates were involved, and I had to redo lots of work to get things properly aligned.

For me it was a cautionary tale of "be very paranoid of where things were historically", but that doesn't seem like an ideal lesson for me to learn. Or, maybe I'm just doing something else wrong.

I'm not use that I understand the question. But it seems to me that instead of using the parenting tool, you might want to look into an interactive and non destructive workflow using constraints
like Copy location, Child Of and Copy Transforms You'll have very clear control on the influence and is quite easy to create complex parent-children hierarchies.


Blender 2.79 crashes on Startup System: Windows 10

Graphics card: Nvidia GTX 1030

Hi! I'm currently facing an issue where whenever I launch blender (version 2.79) the program immediately crashes. Since this has started happening I have re-installed all relevant drivers and have uninstalled an re-installed the program multiple times. I have even gone back to older versions of blender; interestingly blender 2.78 would launch but would crash whenever I entered "cycles" mode (leading me to believe this is an issue with my graphics card.

For more information this has only started happening since I installed this graphics card a couple of days ago; also, here is the debug log of Blender from the cmd line:

Thanks for any help you guys can provide!

*****UPDATE*****

The one of the newest official nightly builds of Blender (blender-2.79-46dceef-win64.zip) seems to be working on my machine perfectly; although I would still like to figure out why the official build refuses to open.

That fail line at the top looks like an audio interface issue. Your audio interface is set to 48000Hz and Blender is trying to startup with 44100Hz. Try setting your audio interface to 44100Hz. Don't know if it will stop the crash, but at least that issue will be solved.

By what you are describing and the access violation error tho it sounds like you got a faulty RAM chip.

Remove RAM chips one at a time until the crash stops then you will know which RAM stick is bad.

AND if you haven't, download and update your graphic card drivers from the manufacturers website. You said you reinstalled drivers, but maybe you are installing old drivers from a CD or letting windows handle it. Get the most up to date drivers straight from the source.

If none of that works you could try creating a new windows user account, log in as the new user and install blender. Incase of your user profile being jacked up.


Glossy BSDF not found in Blender 2.79 Cycles Simple (and may be stupid) question - how to include (if it should be included or plugget in) Glossy BSDF in my Blender 2.79?

I'm follow a manual video (this), where user just input "glos" in Cycles search and Glossy BSDF appears at search result.

So, I can't repeat that because can't find Glossy BSDF by search menu (look at screenshot below).

Please, help!

Thank you!

Try changing "Blender render" to "Cycles render".

click at the region pointed, and select the render engine "Cycles render".


How do I move game pieces around a three dimensional board in a turn based game? I have the board made, and some rudimentary pieces. I need to figure out how to use the game engine to move the pieces around. I do not want to write script yet that actually plays the game, because it needs a lot of play testing to work out any issues. I've watched several game engine tutorials, but none I find relate specifically to moving pieces around on a 3D object like this. Any ideas about where I can look for this type of info? I will continue to work on better renditions of the board and pieces while I'm learning the rest of what I need to know.

Represent the board using a more abstract notation. Essentially, you need a way to store co-ordinates in 3D space.

One way would be to place empties at all possible piece locations. Then you can snap to them. This is quite a limited approach. A better solution is to use a mathematical representation. For example, a sphere is very easily notated in ... spherical co-ordinates (two angles and a radius). Thus to snap a piece to a location is just a coordinate conversion issue. An easy way to think about this if you don't have experience with spherical coordinate systems is if you have a single piece at the top of the board, parent it to an empty in the middle of the board, and then rotate the empty. The piece will follow the surface of the sphere.

You will need python for this for the reasons pointed out by Quacksilber. I can think of ways to do it using animations and logic bricks but it will be a huge huge huge effort that will be very tedious.

I am quite interested in your game. Looks a bit like chess? Programming chess is never easy at the best of times (aka a flat board)


How can I "convert" a blender model into a 2d drawing? As one can see, behind the "Koro" text, there is the outline of the lama.

How is this effect created? Are there any options in the compositor to do so?

How can I "convert" a blender model into a 2d logo?

Many thanks ;)

.blend file: https://mega.co.nz/#F!9QMGCTxL!PIc910mkaEhot_dlYFeQQg

Another option is to use the Material Override option in Properties > Renderlayers to override all the materials with a flat gray shadeless material.
For example:

Create a shadeless gray material:

Use it as the renderlayer override:

Result:


Freestyle not working in Blender 2.78c I understand that this type of question has been asked at least 50x, but please read me out.

This is as simple as it gets: Freestyle is not rendering in the final render. It simply does not work. Yes, I know this question already exists, but despite checking to make sure no settings were touched, despite trying this with a simple cube, it does not work. The "Include" option is running, not "Exclude".

I understand this is really ridiculous, but may I ask just what I am missing? I have previously used 2.79 builds, but I am not sure if that affects 2.78c, if that means anything. Please note that I am currently attempting this with Cycles, in case this ruins the whole thing.

I am not sure if this is a bug, though it likely could be, as I had recently discussed with user "Mr Zak". The idea is to save the file, even though "Freestyle" is checked in the Render tab, then reopen the file. You may notice "Freestyle", in the Render tab, is now unchecked. ...Strange, huh? Check Freestyle again, then render it. Confused? So am I. However, this is the current working solution, and while Mr Zak pointed out he was using 2.78a, I am currently using 2.78c, at the time of this post.

Edit 6 days 55 minutes later:
I feel like an idiot, but I needed a minute in Blender's Discord to find out the fatal mistake: ...Pressing the wrong render button.
...You read me correctly, I was pressing the wrong render button, this entire time!

This is the button I have been using to render, this entire time. As the locals in Blender's Discord have informed me, a detail I have been overlooking for too long, much less to begin with, this renders OpenGL. That means you will be given a render of exactly what you see in the viewport, completely different from when you look in rendered view.

The buttons circles in this picture here, are the buttons you should be using for final renders, as opposed to OpenGL giving simply previews. That means that the button circles in the top-left section and the button circles on the right-hand side act as final render buttons, the equivalent of pressing F12 on your connected keyboard. Meanwhile, pressing the button underlined in this picture, and pressing the button depicted in the previous picture, will render only what you see in your viewport. If you want to see Freestyle lines, as I have been seeking, you want to use F12 render.

In case anyone is wondering, I have been asked if I had messed with the keybinds. I am not sure if this has anything relevant to do with it, but no, I did not mess with the keybinds. I have simply been blindly using the OpenGL render instead of F12's render, believing to have achieved the same results. I hope this proves educational and informational to anyone else who would ever make the same mistake I have made.


What is LookDev/Material Preview mode for in 2.8? I am struggling to understand what is LookDev/Material Preview mode for and how do I render an image which I see in this mode into a picture or video.

I tweaked my material to look how I want in LookDev mode1, but rendering via F12 seems to be using the Rendered Mode2 and the material looks totally different.

What am I doing wrong and why this sudden bright pink glow in my material?

LookDev stands for "Look Development", it is the equivalent of the Material Preview mode in 2.7# with better shading and more advanced features. In fact as of Blender 2.82 it has actually been renamed back to Material Preview.
This is a viewport mode designed to develop the look and appearance of your materials and shaders, it has realistic lighting and material previews are represented textured, fully shaded, and as close as possible to the final rendered result with real time emulation.
It differs from Rendered mode by not necessarily using your scenes native lighting and environment, instead it (optionally) overrides scene lamps and scene world with a "generic" user configurable environment lighting, that is both more neutral on your materials and quicker to render, yielding faster performance for instant previews and more responsive editing.
It is harder to understand its value when working with EEVEE. Since differences to Render Mode are tenuous and blurry, and given how both are based on the same OpenGL real time rendering engine, it may seem like a pointless and redundant feature.
Its true purpose becomes more apparent when rendering with Cycles, where the Rendered viewport mode is actually produced by Cycles based path tracing. While impressively quick, it may still be too slow for preview and is unsuitable as an actual working mode while editing; while LookDev is using EEVEE based preview that is trying to match Cycles output as close as possible with responsive OpenGL based rasterization.

To render the current viewport result at any time go to the 3D View header menu under View > Viewport Render or View > Viewport Render Animation

To get pre-2.8 like render buttons in the Properties Window like in 2.79 you can install one of several available addons like Render Buttons to bring back the old workflow.


Metaballs are different colors in sculpt mode I created a few metaballs and used boolean to combine them with another mesh.

The dark purple is what were the metaballs. They are one object, but a different color from the fingers I connected to them. Already checked the normals, they're all flipped outside. And there are no materials.

I had the same issue, try turning on (Dyntopo) it worked for me.
.


Scene showing black outlines with no object faces I just downloaded a .blend file from blendswap but when i opened it in blender it is looking like graphs, i mean it looks like a bare structure, no white faces (walls). please help.

At the first sight it looks like you have Viewport shading at wireframe enabled. But I can see it is is at solid. So it should render the faces.

I suggest to check Properties/Object/Display. Maximum Draw Type should be at Textured.

You can also switch to edit mode an see if there are faces (they should become visible when you select the surrounding faces).

Overall it might be a compatibility issue. Do you know what Blender version this file was save with? I think Blender is shows a warning when you open an old blend file. This warning should contain the version.

Be aware that blend data is not necessarily 100% compatible between blender versions. Subsequent versions usually convert fine but long jumps can cause such issues.

If so download that version and load the file there. If that is as you expect you need to find an Blender version that correctly loads the file, save it there and try the same thing until you reach your current Blender version.


How to Edit Objects Independently in a Scene? I'm new to Blender and decided to practice some of the basic skills I had learned in the video tutorial I am using.

I put a cylinder in the scene and scaled it with the idea of using it as a column. I save it.

I put a torus in the scene with the idea of scaling it and using it as the base for my column.

The torus, however, is linked to the column. I cannot figure out how to edit them separately. I have not made a parent child relationship with them although I plan to do that once I finish editing the base (the torus) and a third piece, a capital.

How can I edit these three pieces separately? I've tried working with the objects in Edit and Object modes.`

Thank you!

Sabi - a noobie

It seems like you've joined the two objects together as one. When adding an entirely new object, you should have selected 'create new object' instead of 'add object'.

However, in this case, your objects are linked as one. To separate them, go to edit mode, and select all the vertices that you want to separate as an entirely new object (your torus), use the command P and click 'selected'.

Hope this helps!


My array curve doesn't follow curve I applied scale, origins of all object are at the world origin, and you see where the first and last vertices are, and where the first and last chain is. I want my first and last vertice to be right next to first and last chain so I can bend it. Thanks!

So you need put the chain's origin at the same point as the curve's origin, which is not the case currently (you don't need to put all the origins at the world centre, which was not the case anyway).
Also, as you've used an empty as object offset in the Array modifier, you also need to move it along the chain object, otherwise it will mess the Array. So:

Select the curve, press right click > Set Origin > Origin to Geometry.
Press ShiftS > Cursor to Selected
Select the chain object, shift select the empty, press ShiftS > Selection to Cursor

It should work.
Also make sure that the curve's direction is good. FIrst enable their visibility in the Viewport Overlays. To switch their direction, right click > Switch Direction.


What are my options for automatically filling in a missing vertex weight group? I have imported a pre-existing, fully-rigged model into Blender 2.79b. Unfortunately, the source model contains some bones that Blender doesn't appear to know how to import correctly, and thus drops them entirely. (I can recreate the bones correctly afterward, that part's not a big deal.) As a result, about 10%-15% of the mesh contains vertices with missing vertex weights. (I can't control the original model, I'm stuck with how it is.)

However, I know that all vertices must have exactly 1 or 2 vertex groups, and their weights are correctly set to sum to 1.0. I also know that the missing groups do not overlap. Therefore, I could go through every vertex near the bone in question and check its groups:

If the vertex has no groups, it must have a weight of 1.0 in a missing group.
If the vertex has 1 group that's less than 1.0, it must belong in a missing group with a corresponding weight (e.g. if it's already in "shoulder_R" with weight 0.35, then it must also be in "arm_R" with weight 0.65).

I could do this manually, but that's a lot of work with lots of potential for messing up.

Is there a way to automatically assign a bunch of vertices to a vertex group that "fills in" their total weights to 1.0?

I tried a few things with weight painting but I didn't find anything that seemed to be what I was looking for. I'm not averse to scripting but have no experience with it.

I managed to put together an add-on script that does what I want. It takes some tabbing between object/edit mode to "bake in" what vertices you want it to operate on (didn't look too deeply into it), and you can only access it through the spacebar menu, but that's fine by me.

bl_info = {
    "name":"Fill In Missing Weights",
    "category":"Object",
}

import bpy
from decimal import *

class FillInWeights(bpy.types.Operator):
    """Fill In Missing Weights"""
    bl_idname = "object.fill_in_weights"
    bl_label = "Fill In Missing Weights"
    bl_options = {"REGISTER","UNDO"}

    missing_group_name = bpy.props.StringProperty(
        name="Missing group name",
        description="Name of the group to fill in.",
        default="",
    )
    print_debug_info = bpy.props.BoolProperty(
        name="Print debug info",
        description="Output specific operations to console.",
        default=False,
    )

    def execute(self,context):
        obj = context.active_object
        if not obj.vertex_groups:
            self.report({"ERROR"},'Object has no vertex groups')
            return {"CANCELLED"}
        missing_group = obj.vertex_groups.get(self.missing_group_name)
        if not missing_group: # group must exist already
            self.report({"ERROR"},'Vertex group "'+self.missing_group_name+'" does not exist')
            return {"CANCELLED"}
        if self.print_debug_info:
            print('Begin weight-fill operation on group "'+self.missing_group_name+'"')
        bpy.ops.object.mode_set(mode="OBJECT")
        for v in obj.data.vertices:
            if not v.select: continue
            if len(v.groups) == 0:
                missing_group.add([v.index],1.0,"REPLACE")
                print("Added group-less vertex to group.")
            elif len(v.groups) == 1:
                g = v.groups[0]
                g_index,g_weight = g.group,Decimal(g.weight).quantize(Decimal("0.001")) # all known cases are 0.01, but just to be safe
                if g_weight >= 1.0: continue
                group = obj.vertex_groups[g_index]
                target_weight = Decimal("1.00")-g_weight
                missing_group.add([v.index],target_weight,"REPLACE")
                print('Vertex in group '+group.name+' with weight '+str(g_weight)+': adding to group '+self.missing_group_name+' with weight '+str(target_weight))
            # len(v.groups) >= 2: continue
        bpy.ops.object.mode_set(mode="EDIT")
        if self.print_debug_info:
            print("Weight-fill complete.")
        return {"FINISHED"}

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

def register():
    bpy.utils.register_class(FillInWeights)
def unregister():
    bpy.utils.unregister_class(FillInWeights)

if __name__ == "__main__":
    register()


How can I prevent an object from being too deformed when using a Curve modifier? I have used a cube with a curve modifier and array modifer to run create a set of tracks for a tank model.

My problem is that the cube appears to be at a slight angle and I can not work out why.

There is no rotation on the cube itself so I am not sure where the rotation is coming from.

As is the case with any sufficiently complex thing, it takes time for all of this to become internalized / second nature.

In your situation, the base object (the deformed cube) was not just scaled to become elongated, but at some point you also translated one of the faces giving the base object the sheered look. This is one reason to use multiple views of your object to help catch deformations which might be tricky to see from just a perspective view. (Over time you will see all of this immediately.. but it takes practice)

Once you correct the sheer (best just to use a new object, or learn how to snap edges to the (x,y,z) coordinates of other vertices) , you'll still get deformation in those parts of the track which bend a lot. This might be OK if you're aiming for non-photo-realism, else there are hefty tutorials for tank tracks.


How to use Vertex Groups to determine the distribution of an object in geometry nodes? I am using the new Geometry Nodes to put chocolate chips on a cookie. I have weight painted the cookie shape to keep the chocolate chips on the top of the cookie.
If the vertex group is named "Distribution", how would I reference this to keep the geometry nodes (choc chips) on the top of the cookie?

If you want the particles to appear only on the vertex group, choose it in the Point Distribute > Density field:


Why does my render have a gamma value different from the viewport? Blender seems to be changing the movie clip gamma after rendering. What causes it and how can I fix it?

View Port:

Render:

Here is my .blend file (including 10 frames of the clip).

I opened your file, made a render, too much exposure.
I went to the compositor, turned on the  "backdrop" functions, everything went OK, even the animation rendering!

Looks like a little bug.


Is there an option to hide/disable the "volume" display in edit mode? It seems that when the object is rotated in Edit Mode the "volume" representation will sometimes change, appear and disappear and various angles and distances.  I figure there is an option somewhere that I haven't discovered but, in the meantime, does anyone know if it's possible to turn the "volume" display off?  It's not bad but it can be distracting.

thanks

I think your issue is related to the display camera's clipping distance. Clipping distance is basically the distance the camera can view.

You can change the settings around in the properties panel (N):


Blender for virtual surgery planning I'm trying to see if I can use Blender for virtual surgery planning.
I have an STL model of the patient's skull. I would like to cut out pieces of the skull and manipulate them. Here's an example of the cuts I would like to make

What would be the easiest way to achieve this?

It seems to me that the easiest way would be if I could just draw the cut lines on the model. I think it would be enough if I could split just the outer surface with a curve.

So far I have tried using boolean operations to make the cuts. I can snap the vertices to the surface and then create a solid which I can use for the boolean operations. I'm just wondering if there's a more elegant solution to this problem.

Thank you for the advice!

I used the grease pencil to mark the cut lines and booleans to split the skull into pieces.
At first I drew the outline of the cuts on the skull, then decimated the mesh so I could edit the boolean meshes in real time. It worked quite well. It would be really nice if I could just draw the cut lines on the model.
Here is the end result-->