Move wave texture along object with keyframes (in cycles) I want to create a wave texture on an object (which worked so far) and move it with keyframes. Therefore I created a Wave Texture and used Mapping for the orientation. The first strange thing is that I have to use Scale in order to achieve the correct orientation (instead of Rotation like I would expect). The second thing is that Location within Mapping does not seem to have any effect. Do I have the correct order of the nodes or is there something else wrong?

In the mapping node choose either "Texture" or "Point" options.
Then adjust rotation to the angle you want and then animate the location for the desired effect.
I am attaching a screen shot of how.


how can I align a line a vertices evenly preserving the angle? I would like to know how I can align a group of vertices at an angle without having to resort to scaling to zero on an axis. in the picture below how would you make it the vertices circled in green line up the same angle the end points? I know I could just dissolve them and add them again but that would require reconnecting everything again.

in situations like this You could use the "Relax" function from the "LoopTools" as shown on the image below.

It will correct the line even if the inside verticies are moved vertically. LoopTools could be activated in Preferences/Addons section. Sometimes You need to use the function more than once to get a desired result so for speed things up select more Iterations (10, 25). Hope it helps buddy.

Sincerely, Jan


Add subtitles to Blender with scripting I'm trying to insert subtitles in Blender the "oldschool" way, because I want to have a precise control over the text properties, such as the font, an evolving location, etc. I tried to follow this workaround:

Can I (easily) add text to a movie?

and wrote a Python script out of it. But for some reason it doesn't work as expected when I then add a clip and try to render. Any idea why?

Many thanks,

import bpy
import math
import random

str_text = "Waiting for the sun"

for i in range(0, len(bpy.data.objects)):
    bpy.data.objects[i].select = True
bpy.ops.object.delete()

bpy.ops.object.camera_add(location = (0, 0, 10))
bpy.ops.object.text_add(location=(0, 0, 0))
text_obj = bpy.context.object
text_obj.data.align = 'CENTER'
text_obj.data.body = "I'm awesome"
mat = bpy.data.materials.new('MAT')
mat.use_shadeless = True
text_obj.active_material = mat

bpy.context.scene.game_settings.material_mode = 'GLSL'
bpy.context.scene.render.alpha_mode = 'TRANSPARENT'

old_type = bpy.context.area.type
bpy.context.area.type = 'SEQUENCE_EDITOR'
bpy.ops.sequencer.scene_strip_add(scene = "Scene")
bpy.context.scene.sequence_editor.sequences_all["Scene"].blend_type = 'ALPHA_OVER'
bpy.context.scene.render.sequencer_gl_preview = 'TEXTURED'
bpy.context.area.type = old_type

EDIT: There's something wrong when I do the script approach. When I use the manual approach everything goes well, I can see the text over my video clip in the VSE, but it doesn't appear at all in the script case. Something strange happens to my text and my scene options, see screenshots. What could explain this?

Manual:

Script:

Simply create your required text objects by hand. Use Python to change the text data of the object and its location.

Simpler would be better.  Create objects manually in your case today.  When objects are placed in a group it is convenient. Group copying can easily be done in logarithmic steps. Double. Double. 2,4,8,16,32.  In Python one can interate over the members of the group.

I assume you are not trying to create some [ornate] user interface.

I suggest you create no new text objects via Python or cameras via Python at all.  Text objects set to empty string == "" will not be rendered.
I suggest you do not interact with the VSE editor by Python at all.

At least [copy] a finished text object, or its properties.  It  has the visual properties appearing in Blender 3D View.  Creating a new one from scratch, without huge overhead, gives you no visualization.  Since the render state of any object can be animated, visibility of the text need not determine its lifetime.

Thus you keep the Blender interface for attribute assignment.
Render out your text sequence as transparent .PNG file types.
Then import your .PNG sequence as a normal strip in the VSE manually. You stated [old school].
I know you will have more flexibility using the Blender 3D View [text] interface and [VSE] interface already present.

Know there are probably ten scripts or nodes that will change your text. Here at BSE or elsewhere with no monetary cost.  So you may need to write no Python.  Of course some Python is fun.  Of course if you are particular, none will achieve your most exotic cases.  Of course in the lastest version of Blender the VSE has simple subtitling.

At a Blender Python level many users who need to change something with a frame change use

frame_change = bpy.app.handlers.frame_change_post

The only part of the Python I would keep are a few lines.  Below is your software edited as a new starting point. Pseudo Code. No evaluation performed.

import bpy
import math
import random

str_text = ["Some Text","More Text"]
font_ob.data.body = str_text[0]
font_ob.location = (1.0, 2.0, 0.0)


Humanoid Rigify help: I tried everything but still getting: Warning: Bone Heat Weighting I know this is a duplicate issue, but could someone help me to understand why I'm getting this Bone Heat Weighting Failure.

I've gone through the forums and youtube and tried around 8 or so different suggest fixes, but no luck.

I'm fine with the module being one mesh. I've tried loosening vertices and I noticed it broke the mesh into parts with the finger and toe-nails separate. I'm not sure if this has anything to do with the issue but I'm certainly fine with that all being one mesh.

Here's a couple different links to download my latest file post fix attempts:

or
http://pasteall.org/blend/index.php?id=48571

or the same via google drive:
https://drive.google.com/open?id=1h5clTGbx5VgVXsM_of0sWlLiA1JV-adi

Also, if it's helpful, here is a blender file with the metarig before I generated the rig:
https://drive.google.com/open?id=1J7K-05I6SjhW6dz2TkWKgoT3RJXrzX0W

If it turns out the issue has something to do with the fact that I deleted the meshes for the eyes and inside of the mouth. Here's the original model I was using:
https://drive.google.com/open?id=1xFYN7ueDiSUrRH8BI1XkZPzgifNrJ5yq

I simply deleted all the extra meshes to try and simplify my issue. Ideally I want to work with those other meshes and rigify, but I'm starting out simple.

I am not sure what is problem but I face this issue mostly when object has non uniform symmetry  while applying automatic weights so if u can make your object symmetrical your problem may solve


Achieve Damascus steel style with Cycles so I'm modeling a katana, and I would like to give it a proper "Damascus" style to the blade, and I was wondering if it's possible to achieve this in a way that doesn't involve me opening GIMP/Photoshop.

The desired effect is this:

So far I got this material:

Ignore the red tint.

So my questions are:

How to "mask out" the black so I can control it, and apply the Principaled on top of let's say a brushed metal shader.
Is there a way I can make the noise/musgrave/voronoi start in stripes and then go wavy? Maybe aWave texture and use a ramp to fade them?

Thanks for any input!

Final

Node setup

Setup is fairly easy to understand. We will use only Wave Texture with Distortion controlled by vector driven by Color Ramp. Then we will use output of this for Roughness in Principled BSDF.

First Color Ramp (left one) can be used to control how many stripes should be on bottom of the mesh and blend between stripes and pattern. Black is straight, white distorted. Second one controls Roughness value and here colors are important. Black is shiny, white is matte.

Output of the texture

Final with UV mapping and mask for blade


Normals - Adding an edge loop improves smooth shading Searched for an answer but could not find one.

In the image I have 2 cubes. One has loop cuts and with shade smooth it looks much better.

Looking at the normal direction then both cubes are the same. Does the one with the additional cuts work better because the surface area of the faces is smaller at the 90 degree edge?

thank you

By smoothing normal direction is overriding by 'fake' normals which interpolated from surface area between edges.

There are detailed answered questions, one of them How to smooth shade an object while retaining hard edges?

And a little bit of theory Normals, Vertex Normals and Facing Ratio


Why are the 2 key frames connected? Hello!
I have copied 1 key frame, then pasted it at an empty space.
Now when I click the new key frame, it is automatically connected to the keyframe that I copied it from.
And when I clear the pose on this key frame and propagate it, it is automatically transferred to that other key frame, too.
I don't want that.
How do I resolve this connection?
Thank you.
Here is a video that shows how changing one keyframe affects the other.

When you see a line like that between two keyframes it means that there is no change: the values for the keyframes are the same. The keyframe is duplicated.


Creating Materials to Scale from image? Firstly, I'm using blender 2.8 and the cycles rendering engine.

I work for a company what sells PVC bathroom paneling and want to create a bathroom with these panels on the walls...

I have images of all of our wall panels to a scaled size (1m wide to 2.7m height)

I was wanting to create an image based texture on blender which would use these images as a scaled reference (So if the material is applied on a 2.4m standard wall it will not squash it down) likewise, if it is applied on a 5m wall, it will repeat 5 times and not stretch it.

I'm sure previously in Maya i've seen that you can actually define a material size.

How would this be achieved in blender?

This will be a base material which i will then add the diffuse and gloss textures to accordingly to show the reflectivity or the non reflectivity of these panels.

Kind Regards

Andy

Just connect mapping node and texture co-ordinate node to your image texture as shown in screenshot below and scale the texture to your desired size


How do i remove noise? I tried to make this scene from blender guro tutorial, but i got problem in my lamp which is to noisy. Is there a solution without increasing my samples render?
Im beginner for this stuff.

Use the denoising feature in Blender 2.79.
The noise might be caused by a glass material in your scene so I recommend deleting the object with the glass shader.


Need advice on how to make chain link shape I'm trying to make this chain:

The general shape of the link is like this:

I just need some direction on how to make this shape as its giving me a bit of trouble.

You can start with a simple shape 3x mirrored:

Once done, apply the mirror so that you can rotate the shape and add an array modifier (I was not able to find a way without applying the mirror):


Creating a Stick man with rectangular sticks I tried creating a stickman rig with rectangular sticks. For easier understanding, this is what I have so far:

The Problem with it is, that I just used rectangular object and added some caps to them. Than I strapped each element via an empty to a bone. During render though I found out that Blender Render cannot render overlapping faces.

-> how would I go about modeling such a model without overlapping surfaces?

This is my first Blender creation, that's why I tried picking the simplest way to do things, as it is also the only way I know how to do it.

Thank you very much for helping me out :D

You need to make a single mesh instead of many small overlapping ones.

Start with a cube.

Then press "Tab" to go into edit mode
Then press "Ctrl + Tab" and select "Face"
Right click the top of the cube, press "G" then middle mouse button
then pull up, then right click

I can go on and on, email me at psuheena@yahoo.com
and we can set up a teamviewer so I can show you one on one if you want.

[]
[]2


How to retopologize my model? The model I make is all messed up and probably has too many vertices. I tried subdividing too many times.

Here's your retopologized mesh.

I'll show you the alternative method to Bsurfaces based retopology. Add a single vertex, enable a snap tool and change a snap element type to Face. Snap the vertex to the mesh and keep extruding it (E) to form a very rough head basemesh. Now make a basemesh model of a body (model it the same way as head). Add a cirle with 8 vertices and keep extruding it to form a tail. Join a body with a head (match the number of vertices and use Bridge tool to join them). When finished delete one half of a mesh and give it a Mirror Modifier.

Use loopcuts (Ctrl+R) to add more geometry to your mesh. Select newly added vertices and snap them to the mesh again. Correct the geometry moving vertices in proper direction. Repeat the process until you get a desired density of a geometry. Use proportional editing if needed. Think of the edge flow. Change it if needed.

Using this method I achieved the final geometry, which I polished a bit (relocated some vertices to smooth the shape and changed the edge flow).

Remember, that you can easily check the errors in geometry (like tris or ngons) using a MeshLint addon (you can download it here: https://github.com/rking/meshlint). After installing it, select the whole mesh (A) and press Select Lint button to display the errors.

TIP: Next time try to start modeling with a very simple mesh. Add a Cube and give it a Subsurf Modifier with subdivision level 1. Apply the modifier, then select one half of a mesh and delete it. Give it a Mirror Modifier and keep extruding vertices until you create a very rough character basemesh (I included it to the .blend file). While modeling try to add as little loopcuts as posible to define the shapes. I guess the biggest mistake you made with your model is you subdivided it too much too early so it lost the proper shape.

Here's the .blend:


Hooking a series of empties along a curve Right, so:

This is for a game where you can grind rails, and the rails function with waypoints which I generate from Blender empties. So far so good, I've already got a handful of scripts to automatically place them on curves and certain meshes.

Next though is those curved walkways, made up of multiple meshes and multiple curves. I've already figured out a way to combine each connected curve into one and then place my waypoints from there, but it's kind of inefficient and while technically non-destructive to the meshes and curves, it'll require me to delete and re-generate my grinds every time I move the walkways. What's more, the trick relies on superimposing edge-only meshes onto my walkway meshes, which makes tilt unpredictable.

What I'm looking for is a way to automatically place empties in such a way that they'll follow the curves. I don't necessarily mean an arbitrary number, so long as I can get it to roughly correspond to my rails.

Requirements include:

It must be non-destructive.
The waypoints must be real, or at the very least real once exported to FBX.
They must follow along the curve as it's moved.
They must all be children of one empty separate from the curve.

Possible avenues include:

Secondary empties, if real, can be parented to the curve, and then I can get their location into my waypoints via a Copy Location constraint.
The fake curve meshes can be actual curves. Currently looking into that.
Following that, the curves being followed by the waypoints don't necessarily have to be the same as the walkway. I'll be trying secondary curves following the primary ones.

Thanks in advance.

edit: A visual example from another model:

The grind waypoints move with the model, copying the location of empties parented to the model's vertices. This allows them to be parented to a separate object and each to automatically face the next via Damped Track. What I'm looking to do with curves is either this or, even more ideally, directly influencing their positions via curve.

There is a workaround to emulate dupliframe.

Add a curve.

Add a plane. In edit mode scale it way down.

Add an "Array" modifier to the plane, set the length to 'fit curve' and select the curve. Deselect "Relative offset" and select "Constant offset", set the value to the spacing you want between each empty.

Add a curve modifier and set it to the curve.

Create an empty object. In object mode, select it then select the arrayed plane (not the curve). Go to Object > Parent (or press  CTRL  + P) and select "Object".

Select the arrayed plane and go to object info > Instancing and select "Faces". Uncheck "Render instancer" so that the plane doesn't get rendered. (Useless in your case since you are only interested in exporting it)

Now when you export your file, for example in fbx, it will contain the individual empties. Just delete the "plane" object to get rid of it. No need to apply the modifiers.

If you want for example your empties to be 2 meters above the curve, just move the original empty 2 meters along the z axis in object mode.


Track to bone constraints lag behind animation/don't update correctly I am trying to make an animation for a friend that involves a robots arms that move together and a third arm attached rotates with the arm on hinges:

The second arm copies the rotation of the first and the third is parented to the first. There is an empty parented to the second, and the third arm always points to the empty.

When rotating the arms or moving the armature at all the constraints lag behind and don't fix until updated.

This wouldn't be a problem if the issue were exclusive to the viewport, but when rendered, it fails to update the armature per frame and still lags behind.

Does anybody know a fix/solution to this issue, the project deadline is in a few days and I'd be very appreciative of any help.

Idk if I got your setup, but imho you can do something like that with 2 armatures:

A first one-bone armature, and an empty parented to it (tip of the bone)

then another 2-bones armature, where each bone has different constraints: the bottom bone copies rotation of first armature bone

and the horizontal bone tracks the empty

to show it working, I parented 3 cylinders each to its bone, and key framed rotation of first armature only

in viewport:

and rendered:

gif timing seems weird but I rendered to h264 avi and it works really well, no lagging

here the .blend


Is there a quick way to unwrap an image texture onto a complex mesh? Just like the topic title says, does anyone know if there is a quick way to unwrap an image texture onto a complex mesh?

Is marking seams and manually placing the UV islands the only way to go?

I have a Foosball table and associated image texture (attached below) and it doesn’t line up. What's strange is when you download the model and import it, some edges are highlighted a neon blue color. Could it be that I'm supposed to mark those edges as seams? That seems really inefficient.

The Mesh:
https://sketchfab.com/3d-models/foosball-table-1303a318d4584639acef729b9fd296fc

The Resized Image Texture

I downloaded the file myself and checked, the folder contained another zip file in the source folder with the fbx and textures, those i used. The png files in the texture folder seem no different, except their size due to the file-format, up to you which you wanna use.

In Blender, after importing, the last object in the outliner (marked red in the picture) got a new material and i used the Albedo, Roughness, Metallic and Normal textures as "Image Texture" nodes.
The use of the "Texture Coordinate" and "Mapping" nodes are not needed for this to work, just used to use them. Added a picture to show that it's working even without the "Mapping" node.

The uv-coordinates are fine and all there. The textures align as well.
The picture shows the Object with it's textures applied.


PIE menu inside PIE menu I want to make in my addon PIE like that (next GIF PIE's made by PME addon), when PIE menu item call another PIE menu.

I have no ideas how PME do this and dig inside not the best option - ton of stuff going on under the hood. I can't find such examples across the internet - 100 500 tutorials for just PIE, but not PIE inside PIE.
When I try to put just menu it gives me menu like this. Not what I looking for.
class FRP_MT_PIE_Menu(bpy.types.Menu):
bl_idname = 'FRP_MT_PIE_Menu'
bl_label = 'FRP_MT_PIE_Menu'

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

    sc_frp = context.scene.frp_props
    an_a = sc_frp.frp_angle_a
    an_b = sc_frp.frp_angle_b
    to = sc_frp.frp_transform

    #LT
    pie.operator("fgt.frp_rotator", text="- 90", icon='LOOP_FORWARDS').R_Angle = -90.0
    #RT
    pie.operator("fgt.frp_rotator", text="90", icon='LOOP_BACK').R_Angle = 90.0
    #TO
    pie.operator("fgt.frp_rotator", text="180", icon='FILE_REFRESH').R_Angle = 180.0
    #BO
    pie.menu("FRP_MT_PIE_SMenu_TO", text="TO - " + to, icon='NONE')
    #LTTO
    pie.operator("fgt.frp_rotator", text='- ' + an_a, icon='LOOP_FORWARDS').R_Angle = -1 * float(an_a)
    #RTTO
    pie.operator("fgt.frp_rotator", text= an_a, icon='LOOP_BACK').R_Angle = float(an_a)
    #LTBO
    pie.operator("fgt.frp_rotator", text='- ' + an_b, icon='LOOP_FORWARDS').R_Angle = -1 * float(an_b)
    #RTBO
    pie.operator("fgt.frp_rotator", text= an_b, icon='LOOP_BACK').R_Angle = float(an_b)

Using some menu_pie or pie instead of just menu give error like this:
layout.menu_pie("FRP_MT_PIE_SMenu_TO", text="TO - " + to, icon='NONE')
TypeError: UILayout.menu_pie(): takes at most 0 arguments, got 3"

Any ideas guys how to make it work as on first GIF - PIE menu inside PIE menu?

Call pie menu operator.
Example using the Text Editor > Templates > Python > UI Menu Pie
template.
Calls itself if clicked on and expands as another pie menu.
Note. Does not auto expand as a pie menu.
import bpy
from bpy.types import Menu

# spawn an edit mode selection pie (run while object is in edit mode to get a valid output)

class VIEW3D_MT_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label = "Select Mode"

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

        pie = layout.menu_pie()
        # operator_enum will just spread all available options
        # for the type enum of the operator on the pie
        pie.operator_enum("mesh.select_mode", "type")

        # this one expands as a regular menu
        pie.menu('VIEW3D_MT_PIE_template')

        # this one when pressed expands as a pie menu (of self)
        op = pie.operator("wm.call_menu_pie")
        op.name = 'VIEW3D_MT_PIE_template'

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

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

if __name__ == "__main__":
    register()

    bpy.ops.wm.call_menu_pie(name="VIEW3D_MT_PIE_template")


Lighting and shading Orange juice Reference image:

(larger versions here)

Attempt 1

Simple SSS shader:

setup:

Less simple SSS attempt:

I also tried a absorption shader: (the absorption node group is from this tutorial)

My main question is, how to get that lightening effect around the edges, as there is less juice between the light and the camera.. (and also make it more transparent/refractive)
like here:

(and in general, make it look more like orange juice)

Thanks

The SSS material is the one your going to want to use. The reference is showing light scatter. The issue your having is lighting. There's not enough light for that edge to show.

Here's what I got after a few minutes of experimenting:

I have a large light source has a strength of 10.0 and I have an environment map in the background. That's what gives it enough light to scatter.
Here's the scene setup:

Your shader looks OK, but if your interested, here's mine:


Glass casting shadows and not looking real I'm trying to make these glass planes on the ceiling but something weird is going on with the glass shader. I tried couple of different ones but nothing seems to do the job. I'm talking about shadows that these glass planes are casting, especially the dark areas on the walls, I think this is not how it would look like in real world and these shadows are way to dark.

node set ups i tried:

I also tried just glass shader or principled BSDF shader but with IQR set to non 1 value the glass looks wrong so I mixed it with glossy shader. With these shaders by themselves the problem also occurred.

If you look at reference photos online, it does appear that glass casts a shadow of sorts.  What happens is that some areas are darker and some are lighter due to refraction and reflection.

In blender, it looks like the default settings don't allow the full amount of light through, so I ran a series of tests.  The scene is a simple drinking glass and a small area light.

I've raised Glossy and Transmission bounces to avoid any issues with total internal reflection a la this talk, but otherwise the first image is with the default settings.  You can see the shadow is very dark.  I unclamped Indirect Light and unchecking Filter Glossy both gave interesting results.  Doing both at the same time, however, seemed to be on the right track.
Here's a render at 100,000 samples.

And this, to me, does appear physically correct.  The downside is that it takes a lot of samples for cycles to fill in an area with light.  Denoising works to cut down the samples required, but it still helps to run a higher number of samples to get clearer refraction effects.
I  pulled the light in to get some more dramatic effects.  Here's a glass Suzanne at 1000 samples denoised.

And here's the same Suzanne along with some other examples at 5000 samples denoised.  If you were wondering if the Glass BSDF and Principled BSDF gave different results, they don't appear to.

That and the next hexagonal prism are examples of how adaptive sampling can work against you.  Here are a few renders at 100,000 samples denoised.

I'm legitimately impressed at Cycles' results here, it's actually quite nice if you're willing to give it the time.  If you're unable to do that, you need to fake it.
You've tried one of the popular workarounds which is a Transparent BSDF on Shadow Ray.  I applied it to the glass panes in this test scene just for fun, but when I did I ran into a problem that you might be running into.

As you can see the shadow on the final pane is much darker.   Since we introduced transparency, we must raise the number of transparency bounces a bit.  I have 5 planes here, so 10 was enough for me.

When you use this shader to approximate glass, you can control how much shadow displays by changing the Value of the Transparent BSDF's Color.  I found that a value of .9 to .95 is pretty close.

Just to wrap up, I should explain why the default settings are the way they are.  Prior to all these settings, a really common complaint was that any glass added a lot of noise to the scene.  These would eventually resolve into those light rays, but the fix at the time was just to disable caustics.
The blender developers added these settings to clamp the light added to the scene, but unfortunately this has caused an issue for your use.


Alphas are "blurry" when sculpting? So all my alphas when I apply them to a model with plenty of multi-res levels just come out looking "blurry". I've used Zbrush before with these alphas, and they turned out awesome but in blender they aren't working so well. So any help on how to resolve this would be great.

I've already messed with the strength, but that didn't seem to help.

Edit - After reviewing comments it was just a weird occurance that I cannot re-create. Multi-ressing a cube and than sculpting it works just fine!


F12/devtools like JavaScript in browsers I'm mostly a JavaScript developer and I enjoy to explore objects and quickly write new source code via F12/devtools in browsers like Chrome/Firefox. The browsers even allow to set breakpoints and single-step through the code etc.

I search something like that for Blender, but I only found the Python shell, which is more like a "text only" interface. Is there any powerful Blender/Python devtools like JavaScript devtools in browsers?

Using an external IDE for Blender dev.
In this example, I am going to show you my setup using VSCode on Win 10. You can use any other IDE you want and it should also work on Mac and Linux too (I never tested).
Install Python and put Blender in your environment variables
I won't explain these steps as you can find great and easy tutorials on internet. Also, you can skip this part if you already did this.
You need to install Python in order code for Blender and you need to put Blender in your environment variables in order to launch it directly from your IDE (we'll see that later).
Create an addons directory
On your computer, wherever you want, simply create a directory called srcipts and a sub-directory inside called addons.
In my case, my directories are D:\Dev\Blender\scripts\addons

Your script or addon folder will be here as shown on the image. Using a folder to organize your addon is a good practice as you will be able to add sub-folders for libraries, icons and so on.
Specify the Scripts folder on Blender
Open the User Preferences on Blender via File menu or using Ctrl Alt U.
Under File tab, complete the Scripts path in order to point to the scripts folder we just created before (do not point to addons, just to scripts).
Save the User Preferences and close blender.

Open VSCode, start to code and launch Blender
Create your code inside VSCode. In this example, I created a simple script my_script.py called My Hello Addon that prints "Hello World!" when activated using the Operator my_script.hello.

bl_info = {
    "name": "My Hello Addon",
    "description": "",
    "author": "Yann Masoch",
    "version": (0, 0, 1),
    "blender": (2, 78, 0),
    "location": "3D View > Tools",
    "warning": "", # used for warning icon and text in addons panel
    "wiki_url": "",
    "tracker_url": "",
    "category": "Object",
}

import bpy

class MyHelloClass(bpy.types.Operator):
    bl_idname = "my_script.hello"
    bl_label = "My Hello Script"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        print("Hello world!") # Replace this line by your own code
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

Now, simply type blender or blender.exe in the terminal to launch Blender.
Activate the addon
At the first start, you have to activate the addon. Open the User Preferences on Blender via File menu or using Ctrl Alt U.
Under Add-ons tab, search for our addon My Hello Addon and make it active by checking the box.
Save the User Preferences.
You don't need to do this step every time. Once the addon is registered/activated, this step become optional!

Launch the script
Now, you just have to launch the script we registered as an operator by pressing Space and searching for its name.

On VSCode, Hello World will appear in the terminal section.

The terminal section will show all the outputs from Blender and/or Python to help you to debug your code.
In my code, I decided to register the class as an operator (search via Space) but you can launch it from a button, a menu or more. You will find addon examples or tutorials on internet.
Reload your code with F8
Every time you change your code, save it on VSCode and press F8 on Blender. It will reload all the Blender addons such as when Blender is starting.
That's it!
It looks a bit complicated and long but not really. Most of the steps have to be done only once. If your setup is done, you just need to open Blender from VSCode, update your code and press F8.


flat area to sphere or turn to half of sphere I recently made a flat surface and turned it into a rounded shape and sadly forgot on how that was achieved within Blender.
the wished result is on the far right.

I tried to make it now with the "to sphere" function but that gives me really crappy results.
I just know that I haven´t used the proportional editing nor a real sphere back then.

To sphere is actually the correct way if you do not want to use proportional editing, but you have to make sure that yout pivot center is set to where you want the center of the sphere to be.
The easiest way is probably to set the pivot point to be at the 3D Cursor

and then placing the 3D Cursor where you need it. You can either set its coordinates directly

or select a set of vertices or objects in whose center you want the cursor to be and press Shift+S and selecting 'Cursor to Selected'.

Btw: The radius of the sphere is the median distance of the selection to this pivot point.


Grow tree and animate I'm trying to build a tree using multiple tiers (circle, extrude, scale), like a pine tree and their layers, and then animate it.  Any suggestions on how to proceed??
Thanks.

You can apply the array modifier to stack the shapes you described on top of each other. And, then, use the curve modifier (but don't apply it) to bend the stack in order to make an animation of the wind blowing on the tree like this:

Now, just add the top, the trunk and setup the materials:


What is the point of Blenders camera sensor width? Forgive me for my lack of camera knowledge. There's an option for sensor width which zooms the camera in and out. The focal length option seems to do the exact same thing. What is difference and functional purpose of these two similar options? (Note: it's slightly confusing when attempting to match cameras and one is different from the other even when checking to make the focal lengths the same. My confusion prompted this question.)

Cameras in Blender are made to resemble cameras in real world. The size of the sensor is important when you need to match content created with a real camera with your CG, and that happens really often. Obviously, you might have a hard time to match your camera if you don't enter the correct sensor size. You should search for it online for the specific camera model your content is captured with.

You may also be used to real world cameras so it is easier to reach some desired result if you already know what to expect from some settings or parameters because they match real cameras.

If you have a look, you can see that Blender even comes with lot of presets matching real cameras:


Is it possible to project texture across object instances with Animation Nodes? I'm trying to project a logo texture across a grid of instances so that I can control it's movement with the Object Controller Falloff node.

Here's an example of what I'm trying to accomplish that was just done with a bunch of separate cube objects without Animation Nodes.

When trying to place the UV texture on the instanced objects using Animation Nodes, it applies the texture to each cube separately like below.

Is there are way to project the texture across all the cubes like the first example using Animation Nodes?

At the very least, is there a way I can use the the Object Controller Node as an effector on the separate cube objects so that they move the same way as they would if they were instanced? I've tried using translation matrices to move them but they don't snap back into place after I move the effector away like the instanced objects do...

Any help would be much appreciated! Thank you!

You can use fragment position as you texture coordinates as follows:

Alternatively, you can make the instances as a single object as follows:


How to exclude smoke from collision mesh I am trying to achieve an effect where I drive an invisible cone through a simple smoke domain, which clears the smoke from the cone-shaped region. I'm planning to make the cone invisible by disabling "Camera" in its Cycles settings.

The problem I'm having is that even though the cone is a collision object for smoke physics, and although it does indeed disturb the smoke, there is new smoke appearing inside the cone as it advances. I need the inside of the cone to be a smoke-free region.

I've tried Boolean modifiers on the particle emitting plane, and on the smoke domain cube, but to no avail. I still get smoke inside.

Any idea how I can achieve this?

Ah. It looks like I was misled by the viewport. In the viewport, I see smoke inside the cone (I've got the cone set to wire). However, when I render in Cycles, the area where the invisible cone is has no smoke in it. Confusing, but I can live with it... :)


How to fix this verterx which sticking out I have my crharacter which is riged and waight panted but pinky finger have one verterx sticking out even its 100% painted in red

An other bone has also influence on that vertex. Turn on the "Vertex selection masking", then select that vertex, and remove it from all vertex groups, then reassign to the pinky or repaint it with the weight brush.


Tips on Making a Dress I am trying to model a 3D dress for a friend. The dress should look similar to this.

The problem is, I can't figure out where to begin. I've watched a few tutorials on youtube, but most are based around simple t shirts or shoes, or make a very simple cape using the cloth modifier. Any help on making this possible? Should I just use a plane and extrude / rotate to fit the dimensions and then try and wrap it around my figure's body? How could I make the bottom of the dress ruffle like the image? Thanks for any insight you can give!

You will need a model human to place the dress on. If you don't have one of these you can use the makehuman blender plugins to bring a human female into your scene.

You will also need to find or make a pattern for the dress, Ideally something that shows where to place the individual pieces on a sheet of cloth for cutting out.

Model the parts of the dress individually as flats pieces of cloth.

Place the parts around the model, you might want to either bend or cut your cloth to for larger pieces of cloth that need to be on more than one side of the model.

In the places where pieces of fabric are sewn together attach each piece of cloth using bridge edge loops in the specials menu (w) then delete faces only using the delete (x) menu. you should now have the segments of cloth attached by edges everywhere the dress will need to be sown.

head to the physics tab and place a cloth modifier on your dress (you may need to add a collision modifier on your human - I can't remember), from the cloth presets menu choose a stiff fabric (leather or denim) enable "Cloth Sowing Springs" and add a sewing force.

now try running the sim (hit play on the animation bar). You might need to turn gravity off and you will probably want to play with the quality settings.
You may also need to scale your dress object or reposition it to get it to sew together correctly.

This first cloth sim is to get the dress to stitch together not to get the final shape exactly right. Once you are happy with the stitching apply the cloth modifier, use "Remove Doubles", "Merge" and "Bridge Edge loops" to remove the edges without faces. Either mark the areas where the seams are supposed to be as hard edges or add geometry if you want those seems to be visible.

Now you are ready to do a second cloth sim, this time we want to apply it to only parts of the mesh which don't contact the body closely and need to fold realistically. This time choose cotton or silk as your preset and run the new sim.

Hope that helps


How to make glass more reflective? So I created a space scene and I have a glass windows on one of the shuttles.
I want this window to be extremely reflective and glossy. Kind of like it just got waxed, polished, then polished again. When using a glossy shader, I almost achieve this:

Notice how the reflection is just as bright as the image itself

The problem here is that the glass isn't transparent. This is what happens when I use the glass shader:

How do i make it more reflective but still transparent?

The correct way to add reflective coating is to mix in a Glossy shader through Fresnel:

This is what it does - it coats the surface with more reflection, becoming fully reflective at grazing angle (it is influenced by the Fresnel IOR):

The result is less-transparent more-reflective, denser looking glass. Which can be done with glass IOR itself as glass already has reflection:)

But we can apply this generally to any shader, to add a reflective coating (clear-coat) on top. Such coating is usually so thin it is fully transparent and only it's reflective properties matter (the reflection is of dielectric nature - so white).

This has also the benefit of ability to change the base reflectance of the coating if really needed. Here, let's have base reflectance just 20% of the normal Fresnel node (also note that base reflectance of dielectrics don't change much):


how can i make a robe that follow leg movement without wasting too much memory on collision? so i made a character, and i have been rigging this for a while fixing many (calling it many would be an understatement at this point ...) problem that arise with it, and i just find it hard to control while this late in the game what i want to ask is how i can make this robe rig to follow the movement of the leg, and easier way to move the rig itself :)

to something like this

Any suggestion, i.e would be really appreciated :D

Try Copy Rotation Constraints. Place them on the bone chains of the skirt bones and make them follow the leg bones, adjusting their influence based on how closely you want the skirt to follow the movement.

For extra control, you could create one set of skirt bones to auto-follow the legs and make them the parent of an additional bone for manual control.

The included .blend only has two bone chains for the coat, and they were done with automated weights, but it should guide you right.


Use quaternions/remove gimbal lock from blender view This took me a while to find so I'm adding it here.

I was trying to use the Project From View UV Unwrap and because 1. there's no way to roll the view camera and 2. the camera gimbal locks at the poles I was having a lot of trouble getting the correct direction to match my texture.

The answer is of course to put the camera in quaternion mode, but I had no idea how to achieve this. There's the Transform Orientation selection box which has the Gimbal option but this is not for the camera's transform.

What I wanted was to change the TrackBall/Turntable option in File->Preferences->Input

(source: blender.org)
Also see:

What is the difference between the trackball and turntable style view modes?


How would you approach a shader for a glittery eyeshadow Something like this. Probably some kind of noise mask with some metallic, low roughness?

A good way to approach a glittery material that I've found works well is using voronoi cell noise as an input for a normal map:

By changing the strength of the normal map, you can change how non-flat the glitter effect is, and the size with the Voronoi scale.

If the object will be moving or animated, it would be recommended to plug a UV Map Node into the Voronoi Texture

Here's an example node setup with some basic blending via vertex color:

This method also works great for snow, car paint, and anything else that has a glitter to it!


Difference: Caching and Baking I've been playing with smoke and fluid simulators lately and I noticed that sometimes you can cache simulations while playing (Alt + A) the animation (but it only works at a very low fps) and sometimes you can't.

What is the expected behavior of this feature? I found it really useful for tuning properties, but sometimes the only way to see the simulation is by using the bake button instead of playing.

Caching is done with any type of physics (except for fluid simulation) while playing animation (files are being written to disk while animation is played) and everything will be cleared once any changes of settings are made. Note that you'll be able to edit settings of physics simulations on the fly, and previous cache will be cleared once animation playback started again (new values will be initialized).  It will not start if animation playback was started after starting frame of simulation.
Because of amount of computations done in real time, caching will last longer and speed of animation might be quite slow.

  Caching

  As animation is played, each physics system writes each frame to disk, between the simulation start and end frames. These files are stored in folders with prefix blendcache, next to the blend-file. Note that for the cache to fill up, one has to start playback before or on the frame that the simulation starts.
  The cache is cleared automatically on changes - but not on all changes, so it may be necessary to free it manually e.g. if you change a force field.
  Cache and Bake

Baking will pre-calculate animation taking into account every option set up and animation will not be changed unless bake freed or deleted. Once simulation is baked it is impossible to change most settings of objects used; meshes changes won't be taken into account and old results will be played instead.

However, no computations will be done in real time and animation playback will be faster.

  Baking

  The system is protected against changes after baking.
  If the mesh is changed the simulation is not calculated anew.
  Cache and Bake

Note also that baking physics simulations can be different in options depending on type of simulation, so several settings will depend on what you bake.


How to do this in Blender and select multiple things at ones or is there a better way to do this? In the end it will be a video, for a music track of mine, a fly though through the corridor.
Let met start with a few picture to explain what I am trying to achieve.
( and a vid )
My question is not about the fly through part, it's about how to model the corridor around the bends.

https://www.youtube.com/watch?v=fbJrFz2nKls
The problem I am having , is how to get not just the hull around the bends, but also the pipes and other details.
The bends I made in edit mode, select edges, then spin (45 degrees) then fill (F)  then extrude, and again spin.
Then delete the faces I used to extrude.
Wiling to share the blend file if that helps explaining my problem.
I hope the answer won't be, I will have to do this part for part.
I am getting the feeling I am doing it too much the 3D cad way, not the Blender way.
I thought I had figured it out so I made the hull a parent, and the details childern, but this does not work for edit mode, only for object mode.

I guess that you are using an array modifier since your pattern is repeating itself. I think you can very easily achieve your goal with a curve and a curve modifier.
Create you hull-block.

Create a curve and tweak it as you need. You can force the control points to be linear by selecting them and the shortcut V > Vector.

Add an array modifier to your hull, set the length to "Fit curve" to your new curve.
You may need to tweak the direction depending on in which direction you modeled your hull.

Add a curve modifier and set the object to your curve. You may need to tweak the axis or rotate your object in edit mode to get the correct result, You can also tweak the "Roll" parameter of your curve's control points.

Result :

Let's say you have a multitude of different objects to add to the array, you would have to use a "Constant offset" instead. Let's say the block dimensions are 2 meters in the Y axis :

Now you have your pipe elements which are 2 meters long and some kind of repeating thing on top.

Select all these elements and set their origin to the world origin. Make sure you apply the transforms with CTRL + A > Apply all. Now keep them selected and select your hull object as the last object, and choose Object > Make Links > Modifiers.
Result :


why does my TimeOffset modifier not work after rendered? I made an animation with the TimeOffset modifier in the grease-pencil.It can loop in the blender.But when it output ,my TimeOffset doesn't loop anymore.The Loop only plays once when rendered.

I had the same issue. The TimeOffset modifier is completely functional during renders in Blender 2.91. It looks like the discrepancy is limited to Blender 2.92 which means that if you use one of the earlier versions from this link, it should work. https://download.blender.org/release/. Hopefully this bug will be fixed in version 2.93


I could use some help finding the scripting tab Hello I am just starting out with blender. I am taking the animation class on bloop one of the lessons calls for using the scripting tab to find rigify I think its called. My problem is I can't find the scripting tab. I am using blender 2.8.
Thank you for reading.

All the “tabs” are at the top of the window in the default layout. The scripting tab is farthest to the right-hand side, so you may need to scroll if your monitor is small.
For more information on Blender’s UI, check out Blender’s Documentation


Material node - increase saturation one color? How can you increase the saturation of one or two colors using nodes? I would like to increase the saturation of blue(s) and also the orange just a bit. This is in a material using nodes.
Thank you

you can separate by adding a math node, setting it to greater, and and add the solid color you want in the bottom input. Put your image texture in the top input and this will separate your image into black and white anywhere were there was blue (or any color you choose) will be black and the rest will be white. you can take the output of this node and put it into the saturation of a Hue/Saturation node. If you want to control the amount of saturation just put a math node between the Greater Than node and the Hue/Saturation node. I hope this helped you. :)


Snap bone back to an offset relative to another bone I am creating a reload animation for a rifle where the left-hand needs to move to grab the magazine and replace it. I currently have the magazine set up with a child of constraint on the left hand so the mag will follow the left hand when it needs to. However, I need a way to snap the hand back to the holding position on the rifle after the reload has ended. Copying the keyframes on the left hand when the rifle was being held doesn't allow me to snap the hand back to the holding position if the rifle isn't in the exact same location/rotation as it was at the copy. Is there a way to dynamically do this?
This is the resting position I would like the hand to return to    (relative to the rifle location/rotation).

This is when I would like to snap the hand back to the resting position shown above considering the rifle's new location/rotation.

Consider adding another Child Of constraint, but put this one on the hand itself, and for the target, make an empty or bone that has been placed near the hand rest position (and which is also parented to the gun). Keyframe the influence slider for this "hand rest" Child Of constraint so that the slider is in the fully off position when the hand is currently reloading, and then keyframe the same slider so that it is fully on when the hand needs to be at full rest under the gun. The influence slider will interpolate smoothly when keyframed, so the hand will gradually become more and more the child of the empty or bone under the gun as time progresses. If this looks wonky animation-wise, you could leave the influence off until you have keyframed the arm manually returning to the gun, at least until the hand is very near to the gun. Then you could keyframe the Child Of constraint influence slider to be fully on only at that point. You will still get the advantage of knowing for sure that the hand will end up in the final rest position, where it belongs.


Is anyone using MySQL in Blender / python For a project I'm thinking on using a small database to store information on objects, then extract this information with a Python script. The Python script then would use this data for generating 3D (geometric) objects. The database would function for (intermediate) storing info with an easy programmable update interface (HTML, PHP).

Searching for the three components (Blender, the underlying Python, MySQL) I do run into a myriad of possibilities and especially different versions.

Before embarking I would like to know if somebody has already done something similar and could brief me on my journey. Or point me to similar ideas?

Thanks for reading and answering!

Regards,
Wim.

Unless your objects have a ton of data points, a DB as beefy as mySQL would likely be overkill. A 'sql lite' version might be more effective.

Google: mysql lite python   where you'll find many possibilities, including frontends.

RE Frontends, see also Has anyone hooked up PySide to Blender?


How to mix shaders depending on the direction normals are facing? How to make a gradual transition between two shaders, depending on the normal of the surface against the angle of the view.

The use case is I want to make bubbles of a white, somewhat opaque, liquid. When passing through the center (from the camera) it will pass through minimal liquid so it is most transparent there. When a ray passes near the rim it will pass through maximum liquid and be most opaque there.

I will just mix a transparent and opaque material. If the normal faces the camera, select the transparent material. If the normal is perpendicular to the camera, select the opaque material.

I have tried fresnel but it is meant for items refracting light.

I have tried the normal node but can't get it to work. I think that if I just use this correctly, this is the right way.

I have tried taking the normal of the object, normalize it and dot-product with the camera normal (normalized). It gives the result below. It is in the right ballpark, but not correct. Nevermind that it is black.

If I reverse the shaders I will get something like a puff of smoke, gradually becoming transparent at the edges.

Try using the Layer weight node with the Facing value as a mix factor:

The Layer weight node gives a map based on the angle of the surface to the camera:

When used to mix a diffuse and a transparent shader:

Blending:

The Blend value controls the blending between angles:

With a low Blend value:

With a high Blend value:

As mentioned by CharlesL you could further control the blending with a Color Ramp node:


How to get lists of UV island from Python script? Is there any API or method to get lists of UV island from Python script?
It seems there is no API to get lists of UV island in bpy module.

Thanks.

The API doesn't provide an operator or a data structure that specifies the list of UV islands as far as I know, but you can use the bpy.ops.uv.select_linked operator as a basis for a script that finds all the islands.

import bpy
C = bpy.context
o = bpy.data.objects[ C.object.name ]

# Go to object mode to read UV data
bpy.ops.object.mode_set( mode = 'OBJECT' )

uvLayer = o.data.uv_layers.active
uvs     = [ uvLayer.data[i] for i in range( len( uvLayer.data ) ) ]

others = uvs.copy()

islands = []

def select_island( uv ):
    uv.select = True

    bpy.ops.object.mode_set( mode = 'EDIT' )
    bpy.ops.uv.select_linked()
    bpy.ops.object.mode_set( mode = 'OBJECT' )

    return [ i for i, uv in enumerate( uvs ) if uv.select ]

for i in range( len( uvs ) ):
    bpy.ops.object.mode_set( mode = 'EDIT' )
    bpy.ops.uv.select_all( action = 'DESELECT' )
    bpy.ops.object.mode_set( mode = 'OBJECT' )

    flat = [ idx for isle in islands for idx in isle ]
    if i in flat: continue

    island = select_island( uvs[i] )

    exists = len( set( flat ).intersection( set( island ) ) )
    if island and not exists: islands.append( island )

print( islands )
print( " number of islands: ", len( islands ) )


How to make 2 objects not intersect each other? I have made an animated rigid body active character and the ground is passive rigid body. But the character's feet passes the ground that I don't want to happen.I want to move character so I don't want its feet sunken in the ground.
I am a newbie so please explain in details.

If you're trying to animate a character that is to behave as normal, I don't think you want to try to use physics to solve problems with floor interaction. I personally don't know such an approach to be a recommended workflow in any 3D package. Floor collision difficulties are just something you are going to have to learn to deal with. One way to do it is by taking care when animating. If you simply ensure that all your foot keyframes are in the right position, and set in the correct order, no drifting through the floor plane will ever happen. For example, if you set the extreme forward and extreme back positions for an IK foot in a walk cycle, and do this before setting any other keyframes, then the foot has no choice but to slide straight back and forth between these two positions, and could be counted on to perform absolutely no movement along the vertical axis. Such an approach can be an essential foundation for all the keyframes which follow, as these two will ensure that no movement below the floor plane takes place.
Alternatively, you can use location constraints to help ensure that undesired behaviors never become possible, instead of relying on keyframes alone. But even here, care will have to be taken, particularly while setting up the character itself, so as to ensure that the bone positions of the armature properly meet with the floor plane at the same time that the character's foot geometry meets it.
Physics is a resource intensive operation. It is slow, prone to bugs, and not at all ideal for the purpose of general character rigging, in my opinion. It's certainly not a one-button alternative to planning your rig.


Display length of object to render, dynamically I have an object that is a line that fallows the animation path of a bone. Is there a way to display the length of the arm in text (that can be rendered) that changes the numbers as the arm stretches?

edit.

I tired this:

import bpy

def distance(p1, p2):
    return sqrt((p1[0]-p2[0])**2 + (p1[1]-p2[1])**2+ (p1[2]-p2[2])**2)

def update_size(scene):
    point1 = scene.objects['Vert.000'].location
    point2 = scene.objects['Vert.001'].location
    point3 = scene.objects['Vert.002'].location
    len1 = distance(point1, point3)
    len2 = distance(point2, point3)
    scene.objects['Length1'].data.body = '{:.3f}'.format(len1)
    scene.objects['Length2'].data.body = '{:.3f}'.format(len2)
    scene.objects['LengthTotal'].data.body = '{:.3f}'.format(len1 + len2)

bpy.app.handlers.frame_change_pre.append(update_size)

But it does not seem to work when run from the text editor, and when copy pasted and run in console, only updates the first frame.

We can use a frame change handler to alter the text objects content before each frame during playback.

import bpy

def distance(p1, p2):
    return sqrt((p1[0]-p2[0])**2 + (p1[1]-p2[1])**2+ (p1[2]-p2[2])**2)

def update_size(scene):
    point1 = scene.objects['Empty.001'].location
    point2 = scene.objects['Empty.002'].location
    scene.objects['Text'].data.body = '{:.3f}'.format(distance(point1, point2))

bpy.app.handlers.frame_change_pre.append(update_size)

# to disable
# bpy.app.handlers.frame_change_pre.remove(update_size)

Instead of using distance between two points you may prefer to add the length of the pose bones between shoulder and hand.

format(scene.objects['rig'].pose.bones['upper_arm.L'].length +
        scene.objects['rig'].pose.bones['forearm.L'].length)


How to reduce polygon of a wire model i created a wire using curve (grease pencil) and givi it a skin. The problem is when i convert to mesh, it become too dense. What is the best tips to reduce the poly. What should i do before i convert the curve ? and what is the best way to uv unwarp this very high poly ?

Thanks

Maybe Skin is not the best tool to build your mesh, anyway there is a efficient way to simplify a mesh:

In Edit / Edge Selection mode, select an edge ring with ctrl alt right click.
Got to Select > Checker Deselect. Now only one of two edges is selected (or even less if you want, play with the factors at the bottom of the T menu, on the left of the 3D view).
Go to Select > Edge Loops. Now the edge loops of these edges are selected.
Delete these edge loops with X > Edge Loops


Ho to emulate Grab/Move (G) with python script? After a few hours of searching, I have not found documentation on how to emulate the pressure of the "G" key that allows you to move an object freely with the mouse. I have a modal function and I would like to insert this command to select an object and keep it on the mouse.

the command on blender suggests bpy.ops.transform.translate()
but I can not find options for this.

I've found this question searching solution for same one. I use this line : bpy.ops.transform.translate('INVOKE_DEFAULT'). It  emulates the "G" key for me.


import PhysicsConstraint not working The code below is not working.
In the system console it says no module named PhysicsConstraints

import PhysicsConstraints
from bge import logic

cont = logic.getCurrentController()
c  = cont.owner

if (c["init"] == 0):
    c["init"] = 1
    physicsid = c.getPhysicsId()
    vehicle = PhysicsConstraints.createConstraint(physicsid,0,11)
    c["cid"] = vehicle.getConstraintId()
    vehicle = PhysicsConstraints.getVehicleConstraint(c["cid"])

# Wheels

    act1 = cont.actuators["wheel1"]
    wheel1 = act1.owner

    act2 = cont.actuators["wheel2"]
    wheel2 = act2.owner

    act3 = cont.actuators["wheel3"]
    wheel3 = act3.owner

    act4 = cont.actuators["wheel4"]
    wheel4 = act4.owner

    wheelAttachDirLocal = [0,0,-1]
    wheelAxleLocal = [-1,0,0]

    wheelRadius = 0.8
    suspensionRestLength = 0.28

    hasSteering = 1
# wheel1
    wheelAttachPosLocal = [1.0 ,1.5, 0]
    vehicle.addWheel(wheel1,wheelAttachPosLocal,wheelAttachDirLocal,wheelAxleLocal,suspensionRestLength,wheelRadius,hasSteering)
# wheel 2
    wheelAttachPosLocal = [-1.0 ,1.5, 0]
    vehicle.addWheel(wheel2,wheelAttachPosLocal,wheelAttachDirLocal,wheelAxleLocal,suspensionRestLength,wheelRadius,hasSteering)

    hasSteering = 0
# wheel 3
    wheelAttachPosLocal = [1.0 ,-1.4, 0]
    vehicle.addWheel(wheel3,wheelAttachPosLocal,wheelAttachDirLocal,wheelAxleLocal,suspensionRestLength,wheelRadius,hasSteering)
# wheel 4
    wheelAttachPosLocal = [-1.0 ,-1.4, 0]
    vehicle.addWheel(wheel4,wheelAttachPosLocal,wheelAttachDirLocal,wheelAxleLocal,suspensionRestLength,wheelRadius,hasSteering)

else:

    vehicle = PhysicsConstraints.getVehicleConstraint(c["cid"])

    #vehicle.setSteeringValue(steer,0)
    #vehicle.setSteeringValue(steer,1)

# Acceleration

    vehicle.applyEngineForce(c["force"],0)
    vehicle.applyEngineForce(c["force"],1)

# Brakes

    vehicle.applyBraking(c["brake"],0)
    vehicle.applyBraking(c["brake"],1)
    vehicle.applyBraking(c["brake"],2)
    vehicle.applyBraking(c["brake"],3)

# Suspension

    influence = 0.1
    vehicle.setRollInfluence(influence,0)
    vehicle.setRollInfluence(influence,1)
    vehicle.setRollInfluence(influence,2)
    vehicle.setRollInfluence(influence,3)

    stiffness = 10
    vehicle.setSuspensionStiffness(stiffness,0)
    vehicle.setSuspensionStiffness(stiffness,1)
    vehicle.setSuspensionStiffness(stiffness,2)
    vehicle.setSuspensionStiffness(stiffness,3)

    damping = 0.5
    vehicle.setSuspensionDamping(damping,0)
    vehicle.setSuspensionDamping(damping,1)
    vehicle.setSuspensionDamping(damping,2)
    vehicle.setSuspensionDamping(damping,3)

    compression = 0.5
    vehicle.setSuspensionCompression(compression,0)
    vehicle.setSuspensionCompression(compression,1)
    vehicle.setSuspensionCompression(compression,2)
    vehicle.setSuspensionCompression(compression,3)

    friction = 1.0
    vehicle.setTyreFriction(friction,0)
    vehicle.setTyreFriction(friction,1)
    vehicle.setTyreFriction(friction,2)
    vehicle.setTyreFriction(friction,3)

The logic editor window looks like this:

What should I do to run this code?

replace

import PhysicsConstraints
...
vehicle = PhysicsConstraints.createConstraint(physicsid,0,11)
...

with

import bge.constraints
...
vehicle = bge.constraints.createConstraint(physicsid,0,11)
...

and so on.


Placing text on a curved surface in 360 degrees 0

I am still very new to modelling, and have been scratching my head on how to make this thing work. I am trying to model a guitar knob. I want to engrave a font on the front surface with numbers like this:

The problem is, the extruding part of when I engrave the font is not perfect. I could not make the text curve inwards, so it lays perfectly like the sample shown above. Here is mine currently (very horrible):

And here is the horrible view from the side:

I am using Blender 2.8X by the way. The method I have used is to add a text, and created a circle curve and let the text follow the curve.

Thanks a lot guys!

3 Solutions!

1. Non-destructive method

Add a curve "Circle"
Add a text object and edit it to represent the text, font and size
Set it to Vertical alignment to center, to have the text align at it's center along the circle

Select the curve and adjust the Resolution U of the curve to a reasonable high value to get a smooth text later

With the curve stil selected, go in edit mode and press Ctrl+T
You can now move the mouse to change the tilt of the curve, kinda like how the street is tilted in sharp curves in car races.

The arrows show the direction of the curve, so it may be that you need to switch the direction if your text ends up upside down. For that go in "Segments" -> "Switch Direction".
Go in object mode and select the text object
Add a solidify modifier, this will allow you to use different materials for front, rim and back faces (if you don't need this, just use the text objects "Geometry" -> "Extrude" parameter)
Add a curve modifier and select the circle as target, the axis should be set already to "X"
Now we need to add a heavy modifier to make sure the text will be smooth and not glitchy from the bending, the Remesh modifier. Once the remesh modifier is added, move it between the solidify and curve modifier!
Set the remesh modifier to "Sharp" mode, then the "Octree Depth" will need to be increased til you are happy with the result.
BE careful though, the higher the value the more your machine will have to work. A value of 9 or 10 gave me the best result, while i would go with 9.

It should look somewhat like this:

A little advice, this method is for an as clean as possible (to this point non-destructive) result and it's heavy on the machine, so saving first is highly recommended.
For boolean operation you will need to convert the text into a mesh though.

2. To generate something more like in your first picture:

Everything up to step 8, then:

In the text object set the fill mode to "None", this will make the text disappear, don't worry, soon we'll see it again
With the text object selected, go in the "Object" menu and use "Convert to"-> "Mesh from Curve/Met/Surf/Text"

Now with only the outline of the text, add a shrinkwrap modifier to the text and select the knob, activate the "On Cage" visual helper (4th right to the shrinkwrap modifier name) and it should look something like this (that knob is just a placeholder based on the first picture)

Step 11 and 12 can be left out, if the text is close enough to the surface by tilting the curve, otherwise it helps to make the text stick as close as possible to the knob geometry.

Go out of edit mode and apply the shrinkwrap modifier
Go back in edit mode and press A to make sure all the text objects elements are selected
Go in object mode and first select the text, then the knob while holding Ctrl thus having the knob as active (brighter outline)
Go in top view, then toggle back in edit mode
Go in the "Mesh" menu and use "Knifeproject"
You should now have the text/numbers cut in the geometry/mesh of the knob and can adjust your camera to a view you like again

Deactivate the text object and make sure that the knob object is selected
Back in edit mode
The result usually leaves you with the faces of the cut text
selected, i recommend to go over the result and correct eventual
problems, as it seems to never be 100% clean, after that...
Press RMB and select "Extrude Faces Along Normals" to push the text faces in the knob and get the engraved look

To get cleaner results, use a higher subdivided knob to knifeproject on.

3. And lastly (should not be forgotten, even if we like to build everything in Blender) using a texture you can safe yourself a lot of heavy geometry:

Select the faces of the ring-section on your knob make sure they are kept as a circle, marking inner and outer loops as seams for circular shaped surfaces helps.
To get the best results for the situation at hand, i created the 3 flat surfaces like mentioned and broke up the borders with one cut/seam each, resulting in a rolled out stripe and 3 circular parts like in the picture below.

Note: Donating more texture space to certain surfaces of a mesh can in this case ensure the best resolution where it's visible, as the rest is pretty much just color, but in case borders of the surface need some details, you may need to ensure that at least the affected islands (UV-map parts representing the surface) are scaled equally (for example island 1, 4 and 5 as they would otherwise become blurry towards the island 4 and 5 due to lower resolution given to them).

You can export the unwrapped UV-Map as template for the Numbers to fit on
Create the Text/Numbers arranged in a circle in a program of your choice
Numbers in black, background in 128,128,128 grey (medium value) saved as .png
Use the .png file as (non-color/raw) texture and use it for the bump/displacement (displacement best with either high subdivision on the knob, OR if you use cycles you can go experimental and activate "Adaptive" in the subdivision modifier, which gives great results without you having to increase the subdivisions too high. You may only need to adjust the "Dicing scale".

Here a Screen full with the essentials for the texture approach:

Top left: UV-Map exported

Top right: Evee render

Bottom left: Bump/Displacement texture generated with Inkscape

Bottom middle: UV-map above the texture

Bottom right: Shader for the knob, using both bump and displacement (cycles/evee output) as well as color from the one texture.

Might be better to read.

Fine tuning is fun each should have for themself ;)


Cube Emitter: the cubes emitted pass through the ground plane instead of rest on it I would like to animate a great number of Cubes, falling from a surface at a determined height one after the other. The problem is that in doing this, the cubes emitted pass through the ground plane instead of stick on it. Also I would translate this surface, in order to create a sort-kind of grid with the falling cubes.

Has someone a tip how to do it? Thanks.

This answer is just regarding your ground plain and having objects stick to it. I am assuming that this is a particle system. For your ground plane will need to have:

A collision modifier added, then
In the physics field to make them "stick" an option is that you could set Damping to 1 and Friction to 1. However, play around with the fields.

Note, this image is just using default particles with no mods.

After downloading your blend file I did the same and it worked as expected. Again noting this is only the getting the cube to 'stick' the other part is a bit vague for me.


Fluid sim not working, no liquid is being made I've been trying to make a sim of oil flowing out of a pipe onto some objects I made for a school project. The problem is that no matter what I try, the domain doesn't seem to want to show up while it's baking. I've tried scaling up the inflow object and moving it out of the tube it was in and that didn't work. Then I tried changing another object into an inflow and still the domain doesn't create any liquid.

Earlier when there were less obstacles and the domain was smaller it did work.

All obstacles must be completely enclosed by the domain.  If not then the fluid won't bake. This quite often catches people out, me included.

I strongly encourage you to read the documentation at blender.org as it details what to watch out for in the Fluid Simulation section of the blender manual.  Good advice for any time you get stuck.


Lagging IK joints in Playback and Exports I'm having this issue with this rig I worked on.

https://media.giphy.com/media/3o6nV1hsQYg2ID2ANO/giphy.gif

If you notice, the legs and arms are delayed from the rest of the body in the viewport. I thought it would be ok once I exported this as fbx, but apparently this lag gets baked into my exports and I end up having to import my fbx file, and cleaning up the raw Deform joints to make the animation passable.

This rig has an IK/FK slider along with the ability to match FK controls to the IK controls and vice versa. So I figured all of that would be an issue, so I've tried a version where I delete all the set driven keys, but it still lags.

I read on a few posts that suggest a rebuild of the IK constraint fixes it. So I did that too, but once I close Blender and open the file up again, the issue comes back.

I've tried opening this file in Windows 7, Linux Mint and Fedora 26 and the issues is still there.
My specs are:
AMD FX-8320
16GiB RAM
NVIDIA GeForce GTX 950

Original scene with all constraints on rig:

Deleted all constraints except for IK:

It turns out I had my DEF joints constrainted to joints that were constrained to other joints.
When I was originally building the rig, I had to import the rig from MotionBuilers auto-rig set up where I ended up parenting the bones to the IK controls the entire time. So when I switched to FK, my IK controls would just follow the FK. So my DEF bones were constrained to my IK cntrls, then to my FK cntrls.

So after fixing the orientations, and connecting all my DEF joints(Except for the feet), I set my set constraints and switches to the actual DEF.
So instead of DEF -> IK -> FK, I set it up like DEF ->IK and DEF -> FK. Then I used drivers to switch.


How do I select multiple items in the outliner or file browser without selecting all the items in between? When I try to append multiple files at once, or when I try to select multiple objects in the outliner window that aren't right on top of each other, every file or object between the ones I select are selected as well, and there is no way to un-select them and choose the files I want.
To combat this, I've been using the drag and drop feature when I can, and other times, I append or select the objects one by one or in the viewport. Sometimes, in the outliner, I can make collections invisible, but that doesn't work if I have multiple items in multiple collections. It's annoying because I've always been able to just select whatever I needed and get it done in every other version of blender except this one, and turning on an old laptop to work on some blender files lately in v2.69 reminded me of just how much many new minor changes in 2.81 have slowed down my workflow.
Is there any way to change this?

It seems like you are trying to Select the different Objects withShift+Click.
Try to use Ctrl+Click on the different Objects to select multiple Objects.


How do I in object mode, cull back faces? Where is "Back-face culling" turned on for object mode?

Please indicate a path for reaching this control. eg: click on ____, then press ____, then scroll down to ___, etc. As I find it difficult to find my way around Blender.

In 3D view > Properties Region (N) > Shading > Backface Culling:


2.79 Hair dynamics bake didn't write in cache I have a big problem with particles cache, when i try to bake my hair simulation, it calculate normaly, but after ended (and it's long) i see 0 frames on disk and my disk cache weighs 1 ko.

I try to delete this, remake with diferent folder, files, nothing do it.
Actually i use 2.79 for this scene because 2.80 have many prob for baking.
But I didn't think to block like this on this stage.
Need help please, I had to forget one thing!

It's ok for me.

For other people, think to not check "Regrow" when you want animate hair, and you didn't loss a time like me ^^

Care this !


transparent overlay over image The effect i want achieve looks like this where there's an image moving in space with particles (dust, grain, dirt, scratches) moving over them.

The Video is here: https://www.youtube.com/watch?v=altvY5rt6oc

You can see the effect in action here in this video at 0:40-0:49.

So far I've got stock footage of dust particles but I don't know how to find out if it has an alpha channel and whether one is needed to achieve the effect?

I believe I would set up the scene in the 3D view and then overlay the footage over my images using the compositor. But as i'm still fairly new to the compositor i'm not sure if it's possible and was wondering if anyone knew how to achieve the effect?

I'll experiment and put down what my experimentation with the compositor results in later on today.

I'll probably ask another question on how to achieve the image distortion thats used as well which ill link to this question.

Many thanks to anyone who helps me out.

As requested the Blend file I used some time back has been placed here.

It's nothing more than a particle emitter with very few particles over a very long time - typically 50 particles over 1000 frames, their lifetime also 1000.

Physics settings were typically with a Size of 0.05, Brownian of 12.68, Damping of 0.224 .

The resultant alpha layered output (single frame .png files) can be an overlay for a video or image.  They can also be adjusted for further visual effects in the compositor or VSE as one would any image or material.

Don't forget to nominate your own folder for the video output -
there'll be 1000 files going somewhere if you don't !

Glad you've got your project going as things are...


Reconstructing the Principled Shader SSS with standard nodes I am trying to reproduce an SSS shader that I created using Principled BSDF with standard nodes. (I want to add some complexity to the shader but I really like basic results of Principled).

In the image below you can see my attempt to recreate the Principled shader with individual nodes. As you can see in the monkies the results are not the same. The results of Principled appear to have more variation of the scattering effect depending on the volume thickness.

According to the Blender manual the "Subsurface" slider in Principled mixes Diffuse and SSS. So in my custom shader I Mixed diffuse and SSS shaders with the same mix factor of 0.1.

What I am I missing? Does the Principled SSS do something else under the hood?

(The rest of the shader attempts to recreate the glossy/roughness part. This one is fine. I am interested in recreating the SSS component exactly).

Unfortunately, the Principled BSDF node does not use the same subsurface scattering algorithm as the algorithms accessible through Cycles nodes. The paper  that the Principled algorithm comes from states:

  Our subsurface parameter blends between the base diffuse shape and one inspired by the Hanrahan- Krueger subsurface BRDF. This is useful for giving a subsurface appearance on distant objects and on objects where the average scattering path length is small; it’s not however a substitute for doing full subsurface transport as it won’t bleed light into the shadows or through the surface.

Cycles supports Christensen-Burley, Random Walk, Cubic, and Gaussian algorithms. Hanrahan-Krueger is not one of them. Additionally, the paper states that the algorithm is "inspired by" the Hanrahan-Krueger algorithm, so it doesn't even utilize it exactly.

Looking at the above quote, though, it appears that the Principled subsurface algorithm is not as accurate as those within Cycles, so it may suit your purposes better to just use one of algorithms already included in the Subsurface Scattering node1.

If you really need to use the subsurface algorithm in the Principled shader, you can find the .brdf code here on GitHub. The relevant code begins on line 110. You can convert this to OSL code and then add it into the NodeTree with a Script node.

1 Interestingly, the author of the paper that details the Principled algorithm is Brent Burley, namesake of the more accurate Christensen-Burley algorithm included in Cycles.


Strange shadows on the model I'm getting strange shadows on the model: the normals are ok (already tried to recalculate them) so I have no idea what this could be.
Any suggestion?

Add an edge split modifier, should clean up the messy normals.


How can I make a closed flat base for an object? I've made a 3d model of an ancient sculpture with its nearest surrounding. Since I want to publish it on Sketchfab, I need to make a base for it, make it nice and clean, plus reduce it's size to make it more comfortable for further review.

This is how it looked in the begining:

And this after extruding edges:

Better but there is still long way to go. This is how I do have some questions. Hope You can help.

I was able to extrude edges of the model along z axis to make a base. But - even I was strictly following the tutorials - I was not able to create single face that would close the model from below. Are there any requirements regarding side faces that need to be fulfilled to get this done? Since the mesh was created in Photoscan, not blender - it does not have straight edges, but it resembles saw or something (unfortunately). Is this a problem?

Thanks in advance!

In Edit Mode, select all the bottom vertices and then press SZ followed by 0 then Enter.

This scales them all to zero on the Z access which will flatten the bottom edge.

Now press F to fill a face for the base.


Mesh moves to origin on animation So basically I am using Mixamo for animating characters (First time using it) and when I try to put 2 animations onto one mesh, It seems that once the first animation is over (which is a walking animation) the second one (which is a falling animation) refers back to the origin which is where the mesh was before it started walking, meaning that the mesh teleports back to the origin before it falls. I would supply a blend file but I'm not sure how.

Any help is greatly appreciated,
Thanks

Character when the falling animation starts

I've had a simmilar problem. While by all means I'm not a Blender pro, in my case the problem was simply solved by applying the transform.

Have you tried it?


How can a bone's tail be changed by a script? I want to calculate a rotation matrix from two vectors, in order to check the steps are correct I have setup 3 armatures.

A reference bone (arm_org),
One that is directly rotated by applying a rotation matrix (arm_rot) and
Another (arm_mat) that should be rotated by a matrix that has been calculated from the rotational difference of the 1st and 2nd.

Why are the bones tails not updated?
Unfortunatly ArmatureEditBones isn't well documented. I also tried to set the active bone. But the changes are not reflected in the 3D view. Only the currently selected bone can manipulated.

def setBone( name, v ):
    arm = bpy.data.armatures[ name ]
    print("set arm=" + name + " v=" + str( v ))
    for bone in arm.edit_bones:
        print( bone.tail )
        bone.tail= v

def getBone( name ):
    #bpy.context.scene.objects.active = bpy.data.objects[ name ]
    arm = bpy.data.armatures[ name ]
    print("get arm=" + name + " arm=" + str( arm ))
    v = None
    for bone in arm.edit_bones:
        print( bone.tail )
        v = bone.tail
    return v

def vec():
    mx = mathutils.Matrix.Rotation(math.radians(15.0), 4, 'X')
    my = mathutils.Matrix.Rotation(math.radians(30.0), 4, 'Y')
    mz = mathutils.Matrix.Rotation(math.radians(45.0), 4, 'Z')
    m = mx * my * mz
    print( "m : " + str (m ))

    # get and duplicate original tail pos of reference bone
    vo = getBone("arm_org")
    if vo == None:
        print("arm_org not found")
        return
    setBone("arm_mat", vo.copy() )
    setBone("arm_rot", vo.copy() )
    vr = vo * m
    setBone("arm_rot", vr )

    # recalc and apply matrix from rotational difference
    q = vo.rotation_difference( vr )
    mr = q.to_matrix()
    mr.resize_4x4()
    vm = vo * mr
    setBone( "arm_mat" , vm )
    print("mr: " + str(mr))
    print( "-" * 20 )

vec()

Blend file (works only in edit mode with arm_org selected)

To change bones in an Armature, you need to use the EditBones, and the Armature has to be in editmode. As only a single object can be in editmode at a time in Blender, you need to change mode if you wanna access different Armature's EditBones.

Your script doesn't change mode and the .edit_bones property will be None if the owning Armature is in Object or Pose Mode. Thus for bone in arm.edit_bones will end immediately (nothing to loop over) and v remains None (the initial value).

I tried to make your script working, and it will have a visual effect now, not sure if it's what you want though:

import bpy
from bpy import context
import mathutils
from mathutils import Vector,Quaternion
import math

def dump2(obj, level=0):
   for attr in dir(obj):
       print( "obj.%s = %s" % (attr, getattr(obj, attr)))

def setBone(name, v):
    arm = bpy.data.objects.get(name)
    if armature_prepare(arm):
        print("set arm=" + name + " v=" + str(v))
        for bone in arm.data.edit_bones:
            print( bone.tail )
            bone.tail= v

def armature_prepare(arm):
    if arm is not None and bpy.ops.object.mode_set.poll():
        bpy.ops.object.mode_set(mode='OBJECT')
        bpy.ops.object.select_all(action='DESELECT')
        bpy.context.scene.objects.active = arm
        arm.select = True
        bpy.ops.object.mode_set(mode='EDIT')
        return True
    return False

def getBone(name):
    v = None
    arm = bpy.data.objects.get(name)

    if armature_prepare(arm):
        print("get arm=" + name + " arm=" + str(arm))
        for bone in arm.data.edit_bones:
            print(bone.tail)
            v = bone.tail
    return v

def vec():
    mx = mathutils.Matrix.Rotation(math.radians(15.0), 4, 'X')
    my = mathutils.Matrix.Rotation(math.radians(30.0), 4, 'Y')
    mz = mathutils.Matrix.Rotation(math.radians(45.0), 4, 'Z')
    m = mx * my * mz
    print( "m : " + str (m ))

    # get and duplicate original tail pos of reference bone
    vo = getBone("arm_org")
    if vo == None:
        print("arm_org not found")
        return
    setBone("arm_mat", vo.copy())
    setBone("arm_rot", vo.copy())
    vr = vo * m
    setBone("arm_rot", vr )

    # recalc and apply matrix from rotational difference
    q = vo.rotation_difference( vr )
    mr = q.to_matrix()
    mr.resize_4x4()
    vm = vo * mr
    setBone("arm_mat" , vm)
    print("mr: " + str(mr))
    print("-" * 20)

vec()


Blender Game Engine logics sensors and python script I'm trying to build a simple user interface in Blender Game Engine. 2 buttons (launch and quit).

Each button got a "Mousse Over" and "Left Button" sensors connect to a one Python controller.

Here my script menu.py:

import bge

cont = bge.logic.getCurrentController()
own = cont.owner

OverLancer = cont.sensors['Over.Lancer']
ClickLancer = cont.sensors['Click.Lancer']
OverQuitter = cont.sensors['Over.Quitter']
ClickQuitter = cont.sensors['Click.Quitter']

if OverLancer.positive and ClickLancer.positive :
    print("lancer")

if OverQuitter.positive and ClickQuitter.positive :
    print("Quitter")

Nothing works as expected. I got the error "sensor not found" for all of them and I don't understand where I'm wrong. I saw as well something strange. My sensor names change like that .Blender add .001 sometime ...why?

And there is old deleted code line in the error message, again strange.

Python script error - object 'Bouton lancer', controller 'And.002':
Traceback (most recent call last):
  File "menu.py", line 6, in <module>
    print (cont.sensors)
KeyError: 'requested item "Over.Lancer" does not exist'

For example "print (cont.sensors)" is not present in menu.py !?!?

If anybody got an idea, it's will be great.

Thanks!

Each object has a self "scope" or "namespace", so the (object 1) controller can no access sensors from (object 2) controller even if they are using the same script, which is your case.

BUT you CAN CONNECT SENSORS from multiples to one (or more) CONTROLERS

Simple select all objects which sensors would be used and at the last select the object with the controller. to select multiple objects keep press Shit and Mouse Rigth Button on objects.

objects: Sphere has "Mouse_Sphere" sensor while Cube has "Mouse_Cube" and i want to use each sensor in one script and the controller is in Torus.

[


why is playback really slow, but scrubbing really fast? why is playback really slow, but scrubbing really fast?  This is in a scene with nothing but a single character and armature.

i'm getting 4 fps when using alt a or pressing play, but when I scrub by hand,  everything updates just as fast as I scrub up to around 80fps (for a guess).

When you manually scrub you´re forcing the playback to update on current frame. But when playback is set to play by default it will calculate vertices, deformations (armature) and other effects.
If you´re on 2.79 blender, make an OGL capture from the Render menu or by pressing this icon:

That will render a capture sequence to the OUTPUT directory you´ve set your files to OUTPUT from on your properties->scene->render output on your blender file (panels to your right side of the screen).

Thank you for your consideration to vote me as the answer by clicking to the left :the icon with a check mark and upvote this answer.

BFCT_Schiller


How to switch texts in Text Editor by script Cannot find proper bpy.ops command to switch texts in Text Editor(normally you do that from area header by clicking and selecting text block).

bpy.context.space_data.text is read only.

Is there a way?

Edit: the property is writable, my mistake, everything is fine.

You can change it via bpy.types.SpaceTextEditor.text

So if you run an operator from the text editor you can change it in the execute method like this:

def execute(self, context):
    context.space_data.text = bpy.data.texts['your_text']

Otherwise you have to find the text area in screen.areas (given there is a text editor in the screen):

for area in context.screen.areas:
    if area.type == "TEXT_EDITOR":
        break
    else:
        raise RuntimeError("Nothing found")

area.spaces[0].text = bpy.data.texts['your_text']


How could I animate a plane into a pipe and then a pipe into a torus? I need to create an animation demonstrating UV wrapping. I want a rectangular plane to smoothly roll into a pipe (open-ended cylinder), and then the pipe to bend into a torus. How should I approach it? I know I can use Curve Modifier for both transformations, but how do I animate this?

I would probably do this with 2 'Simple Deform' modifiers set to 'Bend' and animate the 'Angle' value for both:

I start off with a subdivided plane (with it's scale and rotation applied: Ctrl+A):

I add a 'Simple Deform' modifier, set it to 'Bend' and set the 'Angle' to '360'. Because the bend isn't going in the right direction I use an empty (Shift+A> Empty), placed at the object's origin, and give it a rotation of 90 degrees on it's 'x' axis. Setting this empty as the 'Simple Deform' 'Origin' corrects the bend orientation:

I then repeat the previous step so the plane now has 2 'Simple Deform' modifiers, and again, add an empty. This time I rotate the empty '90' degrees on it's 'x' axis and '90' on it's 'z' axis.

You can then animate the 'Angle' properties of both 'Simple Deform' modifiers to create the animation by pressing I over the 'Angle' properties at values between '0' and 360', animating the first modifier and then the second.

I also checked 'double sided' on the object data properties for the plane, otherwise the shading will look odd as essentially the mesh is bending into an 'inside-out' position:

If you want to change where the 'seam' of the roll up is you can edit the position of the plane in edit mode relative to the object origin.

Here is the blend file:


transitions between video strips in VSE not working... am I doing something wrong? I've only been working with Blender for a few weeks and my focus at this point is on using the video sequence editor... VSE.

I am running Blender 2.77 on PC with 6 gigs of ram.
I add simple movie to VSE but when I try to add a fade-in from black, nothing happens.  I've tried wipe, cross, gamma cross etc and no joy.  I've been careful to select the video clip and color effect strip in correct order... black first... video second... still nothing.

Also tried soft cut and overlapping video strips to wipe from one to another and the preview screen just goes to black after the wipe.  I'm assuming this is operator error... but did see a reference to a Blender bug in regard to the above.  Please advise and many thanks

At the bottom of the preview window you can select the 'channel' to view. At the moment you have "channel 1" selected. The effect is on "channel 2" so Blender is not showing it to you.

This is called ch solo'ing, that is: make a strip play in solo (by itself) so you can see it without other effects.

To fix it simply change the channel selection to 0 (zero). This will force Blender to view all channels that have anything on them.


Colors from imported image in compositor aren't displaying correctly When importing images for use as a starting image in blenders compositor the colors do not display correctly.
I tried different ways to fix this issue but can't find a solution.

My guess would be that it's a gamma issue but I can't be 100% sure.

I may be colorblind but can still notice that this isn't right. :)

Any suggestions?

Import image node:

Original image:

Imported/Saved image:

Set the color space to sRGB in the image node (or the UV/Image editor) and also enable view as render. In the color management section set the Display device and Render View to sRGB


Multiple objects with equal spacing on Follow Path constraint? I want to place multiple objects with equal space on a circle to animate it later using the Follow Path constraint. Is there a easy way to achieve that?

Thanks!

Instead of a follow path constraint, use a Ctrl + P > Follow Path type of parent on your object.

Adjust framing as necessary, then go to the 3D View Menu > Object > Animation > Bake Action. Tick to activate all the options.

Then with your object selected go to the Properties Window > Object Tab > Duplication > Frames

Also see Is there a way to convert a constraint to a keyframe?


How to Export a BoxCutter mesh into a renderer? Blender beginner here.

I'm playing with MasterXeon1001's amazing BoxCutter add-on in Blender2.8, and I'm getting undesired results when I try exporting my cut-up model into Octane (see image).

Is there a certain process that I need to do while exporting for the exported object to look the way it does in Blender?  I've tried exporting as both an OBJ and an FBX, but have similar results.

Thanks in advance!

I have found a solution. Modus Destructive not Non destructive. Export as .stl file.


How to transform armature via other object's data? I want to transform an armature / skeleton of a 3D model in blender via collected data from another model. As I am new to blender I have no clue what the input data would be and how I would transform or even select the armature in blender, how do I do that?

For example by modifying bpy.context.object.data.edit_bones.head when in edit mode you can change the position of the bone head. Here is a code sample how this could be used to translate the bones of a selected armature object with three bones:

import bpy
bpy.ops.object.mode_set(mode = 'EDIT')

myObject = bpy.context.object ##Active Selected Object

##### Make a Matrix with your translation values
myBoneTranformMatrix = [  [0,0,0],    ##Head Bone0
                          [0,0,1],    ##Head Bone1 (=Tail Bone0)
                          [1,2,3],    ##Head Bone2
                          [4,5,6]  ]  ##Tail of the last bone...

if myObject.type == 'ARMATURE':
    myArmature = myObject.data

    boneCounter=0
    for currentBone in myArmature.edit_bones:
        currentBone.head = myBoneTranformMatrix[boneCounter]
        currentBone.tail = myBoneTranformMatrix[boneCounter+1]
        boneCounter+=1

bpy.ops.object.mode_set(mode='OBJECT')

Happy Blending! :)


Why are faces in my model fine in the viewport but distorted in the render? I didn't find the mistake in my properties, perhaps somebody can help me.
This is my object in the viewport ('Rendered' shading mode):

This is the rendered result:

The problem are those distorted faces. It looks like the faces are getting shrunk.

I'm using Cycles Render, HDTV 720p, Aspect Ratio 1:1... If you need further information, just ask.

It looks like you have a Subsurf modifier on your object that has been disabled for the viewport, but not the render. Either delete the modifier or disable it for rendering as well by clicking the camera icon on the modifier:


Composite two scenes for only a short period? I have a scene with a particle emitter
and a second scene with the actual particles.

I separated them so I could have more control over motion blur.

When I try to render the animation, it renders both scenes on every single frame, but the particles are only in the  scene for a couple frames in the end.

So my question is: can I tell the compositor to render and combine two scenes for only a few frames at the end instead of rendering and combining both scenes for the entire clip? I imagine it would save render time.

You can enable and disable rendering Render Layers by clicking on the checkbox for a layer in the Render Layers tab in the Properties area.

You're also able to create keyframes for this setting by either clicking on the checkbox with the right mouse button or pressing I while the mouse cursor is over the box.


Offer animation - Blender or some other program I know this question is not directly related to Blender but I don't know where else to ask it.

I am working in a small company which should make a presentation of an assembly line that we have constructed in 2D and 3D CAD software.

The presentation should look something like the ones from the next links

https://www.youtube.com/watch?v=9fpdeLxUBPk

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

1) Is Blender good enough to make something like this?
I should present line to non-technical educated people so I only need to show them concept instead of details.

2) I am thinking of hiring someone from UpWork community or similar sites (I don't have time to learn modeling in Blender), do you have a better idea?

Best regards!

Blender is good for this type of presentations.

You can make video like this:
https://www.youtube.com/watch?v=L__2suWPk9s

or interactive 3D-presentations like this (using addon blend4web): https://www.blend4web.com/apps/dairy_plant/dairy_plant.html?v=9e5dd2c40ed17b48ebd949bf7f8d9d0c