How to create many clips in the NLA editor I have a metarig with:

Action 1 - for example he run with ball
Action 2 - he walk and throw the ball

When I switch actions for metarig - ball goes wrong - he throws it while running.

How can I organize this actions with the NLA?

Create Clip 1 with needed actions, and Clip 2 and so on...
Except ball I have many objects, which are doing different thing dependant of the action of the metarig.

I use a new metarig with bones for each object - e.g. the ball has its own bone.

The official documentation for the NLA Editor gives you the basics of operating the UI.

How to incorporate this technology into your workflow is a little more complicated.  Likewise choosing which keyframes belong in which NLA strips depends on your experience and understanding of the mathematics of the NLA system.  You're just going to have to experiment and fool around and make plenty of mistakes.

Do not underestimate the value of setting aside time just to play around and make mistakes and then try to fix those mistakes under no time pressure and with no milestones or assets at stake.

My explanation of how to split an action into two separate NLA strips probably will be somewhat confusing on first read, but after some experimentation you should have the necessary experience to understand it and absorb the concepts within.


Collada .dae File rendering I am trying to convert .blend model to Collada .dae  format but after exporting to Collada .dae format my blender renderd model changed. How can i got same Model in Collada .dae format as it was in .blend?? Here is the images

Collada has very limited support for materials. The file format still uses the old Blinn, Phong lighting interaction formulas. Blender supports far mature material models that cannot be exported using Collada. Note that Collada was last updated in 2008, more then 10 years ago).

It is possible to extend collada to support different material models, but that only works as both applications (exporter in Blender and importer in other application) implement this extension. This is very difficult to maintain and therefore the extensions are really not useful at all.

An better option (if supported) is to use glTF. this is a file format that was created to supersees Collada and has far better material handling.


How to force a shallow copy? If I do this in a script

v = bpy.data.objects['Cube'].data.vertices[0].co

v becomes a deep copy of that vector, this is a behaviour that is common to many other places inside the Python APIs.

The irony is that in Python the method copy returns a shallow copy, and deepcopy returns a ... deepcopy; in Blender it looks like there is no real rationale for what you get, apparently everything is tuned for deep copies, but when an object has the copy method, it returns a deepcopy and not the standard python-esque shallow copy, and the method deepcopy is pretty much absent .

Inside loops you tend to get shallow copies because of Python optimizations, but speaking about the API in general, how I can enforce the use of shallow copies ?

First sentence from the link provided in the question:

  Assignment statements in Python do not copy objects, they create bindings between a target and an object

You assign / bind the mathutils.Vector object stored in the attribute co to the variable / name v.

You don't copy anything.

Use co.copy() to get a new instance of the vector and assign it to v instead.

Most vector operations and methods like +, -, *, cross, dot will also return a new instance for the result. So if you plan to use some of these maybe you don't need .copy.

This is done behind the scenes for immutable objects like strings or tuples. As soon as you make a change to a tuple or a string you get a new instance.

But if the object is mutable like a list it works the same way:

a = [1, 2, 3]
b = a
b[0] = 4
a[0] #-> 4


BlenderGIS: import Georeference Raster onto Delaunay Mesh I have two files.  One is an elevation in points (SHP file), the other is a photo GeoTIFF.  Both the elevation SHP and the photo TIF have the same exact projection and the same exact geographic coordinates in EPSG:3857 WGS84.  I import the shape file and then turn it into a Delaunay Mesh.  Looks great.  I then try to import the Geotiff as a Georeference Raster onto it and I get "cannot reproj raster."  Is there some way to do this?

From studying the code I found here, I found out that the CRS in Blender for the elevation didn't match the CRS I was importing...probably my mistake when I imported it.  I fixed that...the image then imported, but it imported on the bottom of the elevation instead of on top.  I'm trying to import it on the mesh so there must be something in the code that's selecting that face...or I'm doing something else wrong.


Import materials from another blend file: how to deal with name issues? I want to append a material from another blend file, but I have problems to get the appended materail:
#This works fine
with bpy.data.libraries.load(self.blendpath, link=False) as (data_from, data_to):
            data_to.materials = ["myTestMaterial"]
#This is the problem maker
mat = bpy.data.materials.get("myTestMaterial")

The problem is that the new material is named "myTestMaterial001" after I run the script for the secound time, is there a way to get the material object directly?

You did, but blender renamed it because the old imported data was still in this file, even if not used. You can get rid of unused data blocks in File -> External Data -> Clean Up -> Purge, then try re-appending the material.


Modify obj after import using python I am trying to modify an object after importing it. This post is related to this question

import bpy
full_path_to_file = "C:\\Users\\xyz\\Documents\\test.obj"
bpy.ops.import_scene.obj(filepath=full_path_to_file)
# create the material
mat = bpy.data.materials.new('MaterialName')
mat.diffuse_color = (1.0,0.0,1.0)
mat.diffuse_shader = 'LAMBERT'
mat.diffuse_intensity = 1.0

# get the object
obj = bpy.data.objects['Cube']

# get the material
mat = bpy.data.materials['MaterialName']

# assign material to object
obj.data.materials.append(mat)

I wanted to add a material to the imported object but that is not happening. So I tried to scale it even that is not happening.

I realized that no operation is being performed on the imported objects. But the same operations are executing on the objects that are created (i.e. not imported).

Any help would be appreciated.

Operators like bpy.ops.import_scene.obj() can't return the object name itself. If you know the name of the imported object(s) simply use this: bpy.data.objects['yourname'] and assign it to a variable to apply a material on it:

# assignment
obj = bpy.data.objects['yourname']
# append material
obj.data.materials.append(mat)

If you don't know the name of the the imported object(s) you have to select them after the import with something like this:

# single selection
obj_object = bpy.context.object
# multiple selection
obj_objects = bpy.context.selected_objects[:]

Here is a working example for importing multiple objects from 1 obj file. It appends a newly created material on the imported objects and prints out their names for error handling.

import bpy

full_path_to_file = "test.obj"
bpy.ops.import_scene.obj(filepath=full_path_to_file)

# make sure to get all imported objects
obj_objects = bpy.context.selected_objects[:]

# create the material
mat = bpy.data.materials.new('MaterialName')
mat.diffuse_color = (0.1,0.0,0.7)
mat.diffuse_shader = 'LAMBERT'
mat.diffuse_intensity = 1.0

# iterate through all objects
for obj in obj_objects:

    # print the name of the current obj
    print (obj.name)

    # set current object to the active one
    bpy.context.scene.objects.active = obj

    # get the generated material
    mat = bpy.data.materials['MaterialName']

    # if a material exists overwrite it
    if len(obj.data.materials):
        # assign to 1st material slot
        obj.data.materials[0] = mat

    # if there is no material append it
    else:
        obj.data.materials.append(mat)

    # move the object, if it's named "Cube"
    if (obj.name == "Cube"):
        obj.location = (0,0,10)


Mantaflow render with transparent background turns out be white screen So I'm rendering an animation with Mantaflow, but when I render it, even in the render result there is good render, but when I'm saving on a disk it turns out to be white screen. Why?
PS: Normal objects renders just fine.
Here's link to a blender file
https://blendswap.com/blend/27948
please help, I have done everything

Ok, I found another solution for this transparency, It seems like it's some kind of bug or workflow that for me is totally not understandable.
I render it normally as a RGB and in the compositor I'm changing the black pixels to transparent one like this:


Where are the extrude and scale values? To be specific, if I extrude by pressing E and I type 40 (for 40mm), where do I look up this value on Blender?

Same for when I scale; I'd press S and type 0.2 (for 20%).

In a situation where I would go back to see the size of a face, how do I know if it was scaled 25% or 20%, or how would I know if a face was extruded to 40(mm) and not 55(mm)?

I need to know because I want precision or accuracy for 3d Printing.

There isn't explicit construction history in Blender per se.  If you ever want to know the dimensions of your object for 3d printing, you can always go to the display properties in the viewport, and scroll down until you see the Edge Info buttons under Mesh Display.  Note that you must have fully applied the extrusion operator to see these dimensions.

Move your cursor into the 3d viewport
Press "N" to bring up the Display Properties.
Scroll down the Display Properties until you see Mesh Display
Check off whichever buttons (Edge length, angle, or Face area) applies to what you're interested in.
Select the face/edges that you want to know the dimensions of.


How do I bake a flat texture in Cycles? (2.79) I've been looking on how to bake a texture from my material colors. I found a question from the past saying that there would be a bake option for "Diffuse Color" but I don't see that in the dropdown menu. Any help is greatly appreciated.

First of all read about overall baking process in the link provided by Cegaton: How do I bake a texture using Cycles bake

Then the "trick" is pretty simple.

Connect your material colors to Emission Shader.
Select Bake Type as Emit.
Bake.


Rotate bones using a texture? I have an armature, and I want to do a "flailing limbs" effect. I figure a good way to do this would be to have a noise texture and rotate the bones in accordance with the texture.

Is this something that can be done? Is there a better way?

I don't know if it's possible, haven't found any mechanism to link texture value to bone transformation. But we can make random flailing movement by adding Noise modifier to the bone's rotation f-curve. From the manual entry on F-Curve Modifiers, this modifier

Modifies the curve with a noise formula. This is useful for creating
subtle or extreme randomness to animated movements, like camera shake.

If applied to the bone's rotation in at least one axis, it could create the effect you wanted:


Face problem on render Screenshots will explain my problem. Im talking about strange shadows.

The point here is simply a question of lamps . . . You added too many (5-6 lamps all around the mesh with a sun too) then the shadows overlap. Delete all the light point you created and let only one in front of the mesh.

Check the image:


How to change "View port" background color in v 2.8 Grease Pencil Hi and thank you in advance - I would like to draw on a dark gray or black background, but I do not yet know how to change the background color in grease pencil mode.

Go to Shading and change the color
Hope that helps.

Good Luck


How do you call `bpy.ops.clip.rebuild_proxy()` in the python api without getting a context is incorrect error I am trying to get proxy timecodes rendered for the blender nle via the python API. However once I call bpy.ops.clip.rebuild_proxy() or bpy.ops.sequencer.rebuild_proxy() instantly get the error RuntimeError: Operator bpy.ops.clip.rebuild_proxy.poll() failed, context is incorrect
I have tried tracking down the function in C but I cannot find anything that helps point towards the root cause, or how to properly call rebuild_proxy()

So it sounds like the problem is that the wrong part of the interface ('Area') is active at the moment you're calling ops.clip.rebuild_proxy() or sequencer.rebuild_proxy().

I'm working on an add-on that will allow me to add a movie strip, draw waveforms, and start a 50% proxy build all with a single action. I found that I had to iterate through the areas and override the context to rebuild proxy for a specific clip. Here's what worked for me:

ctx = bpy.context.copy()
for area in bpy.context.screen.areas:
    if area.type == 'CLIP_EDITOR':
        ctx['area'] = area
        bpy.ops.clip.rebuild_proxy()


Combining different meshes, and UV's of a character? i am new to the site, so please bear with me.

I have created a character for a game (game built in UE4). The character is already rigged and works in the engine, however the character i made is composed of different meshes (arms, legs), each with its own UV map and texture. This is a problem because the game engine treats the entire character as a single mesh, and i can only apply a single texture to the mesh. Is there any way of baking the textures already applied? or is there some other solution to dealing with this problem?

You can tile the individual textures inside one file by using GIMP or similar and scale the UVs in Blender, because they are relative to the image size. If you have only a few meshes, this is done rather quickly.
Baking all textures together will be a problem if the UVs overlap.


Don't know how to change distance for mist creation I followed this tutorial on how to create mist in blender. https://www.youtube.com/watch?v=CxNeMMZs_sM

I have this dome that will be where the camera is pointed at, but for some reason the mist is always appearing on top of it even though I set it so that the mist would appear behind it.

Any help would be appreciated.

Here are two ways to produce a mist effect in the compositor.

Mist Pass

Simply enable the Mist pass in the Render Layers. You can then adjust the depth of the mist in the World settings as in the screenshot in your question. ie,

To use the Mist pass you simply use the Mist render layer output as the Factor of a Mix node to mix between your rendered image and the mist color :

To adjust the mist you need to adjust the Mist Pass settings in the World properties and re-render the scene. You could get limited adjustability by adjusting the Mist output using Maths nodes or similar before using it in the factor but it's limited to the range of mist in your original settings (eg, if the mist ends at 500m then there's no way of adjusting it further than that). You're generally best just adjusting the Mist Pass settings and re-rendering.

Depth Pass

An alternative is to use the raw Depth pass and manipulate it using Maths nodes or similar to get the desired mist. This can be achieved as follows :

Here the Divide maths node re-scales the Depth - we need to convert the raw depth so that the desired depth of mist corresponds to the mathematical range of 0.0 to 1.0 to use in a Mix node. Adjust the divisor to get the desired depth. The Subtract node allows you to adjust the distance to the start of the mist.

Note that the Divide node is set to not Clamp but the Subtract is set to Clamp. The Subtract set to Clamp is to ensure that the value passed to the Factor is always within the range 0.0 to 1.0 - otherwise strange effects can occur since the compositor nodes do not automatically clamp the factors (as Cycles material nodes do). However, Clamping the Divide node would skew the calculation and can cause undesired effects - such as the mist not increasing to maximum value at the far distance of its range.


How to use sharp edges? Well sorry if this one is a duplicate but i couldn't find it. Can someone please list the uses of sharp edges ?
I know the very basic uses like :

They can be used in edge split modifier.

But I can't think of more is there anything else that I miss?

AFAIK the only use for "Mark Sharp" is the edge split modifier.

Technically "Mark Sharp" simply sets the mark where the modifier later has to do its job. If you don't apply the modifier, you can still add geometry with "snap onto itself" and "Automatically merge vertices" activated without having to manually edge-split the sharp edges later again.


How can I round this inward-pointing corner? Hey guys, I'm new to Blender. I would like to round the inward-facing corner where the highlighted vertex is (to achieve a smooth "slope") but I am not sure how to achieve this. I've tried bevelling different selections, adding loop cuts and removing the "screen" on the console, all with no luck. Thank you very much in advance :)

Thanks guys. I tried working on the topology after bevelling and that helped :) It was just a little tedious because I had to drag each new point out separately. Maybe there is an easier way, but at least it looks right now! I attached my blender file with the topology corrected on one side, for reference.
https://drive.google.com/file/d/1OGWpEg9oAY9P-EcaTFzprBgO84Xu9gLH/view?usp=sharing


How to do a ray_cast from camera origin(position) to object in scene in such a way that ray would pas through a given pixel coordinate in camera view? As question states, I want to "extract" global coordinates of 3D point that generated information in a specific pixel in camera view(rendered image).

I have a pixel coordinate in a rendered image as (X,Y)<=> (point P1)
I have (point O) as origin of ray

How can I get (X,Y,Z) in global coordinates of (point P2) from this setup?

You obtain the rays like this:

Casting rays from the camera into the scene for each pixel
(2nd part of answer - F12 solution)

Then you build a BVH tree from your mesh:

import bpy
from mathutils.bvhtree import BVHTree

bvhtree = BVHTree.FromObject(bpy.context.active_object, bpy.context.scene)

And you intersect this tree with the ray:

location, normal, index, dist = bvhtree.ray_cast(ray_origin, ray_direction)

You are interested in the location. The index and normal refer to the first polygon it intersected. If there's no hit, it returns (None, None, None, None) tuple.

It's wise to cache the bvhtree for performance reasons, its building is costly, but speeds up ray casting. The tree needs to be rebuild only when the object changes, this you get from the object.is_updated and object.is_updated_data flags.


How to make god rays with png transparent image Working with cycles. Can we create god rays with the png transparent image. I have setup all the scene. With sun lamp and a transparent png image. But the light is not going through the image and making the rays. Any suggestion how it works. Thanks.

Decrease the Density of your Volume Scatter down to 0.007, switch from Sun to Spot, increase its Power up to  20,000, and Alleluia!!


Cloth physics do not work with collision I have a simple model, a ball going through a basketball net. I want to have the mesh collide with the ball as it goes through but whatever settings I try I cant get the ball to collide with the mesh properly. I'm a newbie at Blender so any help would be much appreciated.

Your version will be very heavy for calculation because for such a stringy collision you will have to extremely increase "Quality Step" value in Cloth Sim. I would try simple cloth mesh baked and for your hires basket net use Surface Deform modifier with Target baked simple cloth.

Basket

add Cylinder (12 sides), add few horizontal LoopCuts Ctrl+R
Ctrl+E > Un-SubDiv 1 switch squares to rhombus net ... shape it as you like
select top vertices and Assign them to Vertex Group under Data Properties
add SubSurf modifier > Simple

Simulation

add Physics Properties > Cloth > Shape > Pin Group
Bake

From here you can use your hires basket if matches lowres model shape. For example here I just

Duplicate lowres basket
Delete Cloth Sim
Delete X Faces Only
add Skin modifier
add Surface Deform modifier > Target lowres model with cloth simulation > Bind

Like now the lowres drives highres model animation and you can anytime go to lowres and run sim independently on hires model.

Notes:

More details for diamond net see this A
Cloth Properties - preset Denim, substeps 32, Vertex Mass 0,1 kg, Stiffness 30, Self-Collsion ON
Skin modifier - select all vertices and from 3Dview properties panel (N) decrease Mean Radius to 0.05


Compositor clipping blurred matte nodes I am trying to add a vignette to a video clip, something I have done hundreds of times before, but my ellipse or box mask keeps being clipped by some setting that I can't find. It is only allowed to blur within a certain area, after that it is clipped sharply.

Any ideas what might be the cause of this?

I am using Blender 2.74, and no other parts of the compositing nodes have an effect.

What is happening is the blur node is using the render result size to determine the blur. What you need to do is set the render size to the same size as the footage:

Once this setting is set it should render correctly.


Import .mhx and export .stl on blender I am working on animation project using MakeHuman, blender and Mathematica. I use makeHuman to model a person and get .mhx file. I import this file into blender, I do some modification on pose and export it as .stl to use it on mathematica. I remark that exported .stl file seems empty because its size 84 bytes and when I import it on mathematica it does not work. So what is the problem and How can I deal with? thanks.

OK, apparently even when you export to STL through the File > Export menu, you must select all before exporting. If your mesh is not selected, it will not be exported.

Do note that non-mesh objects will not be exported either (curves, armatures, etc).

In short, select all objects in your scene (A), then export to STL.


The scene does not split for logic editing I am facing a problem with splitting the screen in half for logic editing.

Whenever I drag the top right triangle, the scene does not split.

When the cursor is in position to split the area, it should change to a cross.

If you have trouble dragging the corner, try  RMB on the edge of the editor and choosing split area.

To make clicking on the edge easier, you can change the line width to thick in the preferences.

Also of note is that in 2.80 the ability to split an area from the corners can be turned off.


How to alter operator property while it's invoking In this script, I am taking two names, and printing them. The first name should be chosen from the menu or written manually (a new one).

import bpy

class NAME_MT_menu(bpy.types.Menu):
    bl_label = "List of existing names to choose"

    def draw(self, context):
        layout = self.layout
        for name in ('Peter', 'Patrick', 'John', 'Colom', 'Jerry'):
            layout.operator(NAME_OT_names_from_menu.bl_idname, text=name).name = name

class NAME_OT_names_from_menu(bpy.types.Operator):
    bl_idname = "name.names_from_menu"
    bl_label = "Add existing name to menu"
    name = bpy.props.StringProperty()

    def execute(self, context):
        # how to alter operator property while it's invoking
        return {"FINISHED"}

class NAME_OT_get(bpy.types.Operator):
    bl_idname = "name.get"
    bl_label = "Get names"
    first_name = bpy.props.StringProperty()
    second_name = bpy.props.StringProperty()

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

    def execute(self, context):

        print("Hi {} {}".format(self.first_name, self.second_name))

        return {"FINISHED"}
        # return {"CANCELLED"}

    def draw(self, context):
        layout = self.layout
        row = layout.row()
        row.prop(self, 'first_name', text='')
        row.menu('NAME_MT_menu', text='')
        row = layout.row()
        row.prop(self, 'second_name', text='')

class NAME_PT_panel(bpy.types.Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_label = 'My Panel'
    bl_context = 'objectmode'
    bl_category = 'Test'

    # drawing menu
    def draw(self, context):
        self.layout.operator(NAME_OT_get.bl_idname)

classes = (NAME_PT_panel, NAME_OT_get, NAME_OT_names_from_menu, NAME_MT_menu)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)

def unregister():
    for cls in reversed(classes):
        bpy.utils.unregister_class(cls)

if __name__ == "__main__":
    register()

I know it can work if I will register first_name like this :

bpy.types.Scene.first_name = bpy.props.StringProperty()

and use context.scene.first_name instead of self.first_name, but it is like creating global variables, and I want to avoid this. Another issue with this solution is: when the name is chosen, the text field will not update until the user will hoover the mouse over it.

Since no one helped I changed approach.
Instead of using a menu, I used enum property, with the update function.

import bpy

def update_names():
    def func(self, context):
        self.first_name = self.names
    return func

def get_items():
    def func(self, context):
        items = [(name, name, "") for name in sorted(('Peter', 'Patrick', 'John', 'Colom', 'Jerry'))]
        return items
    return func

class NAME_OT_get(bpy.types.Operator):
    bl_idname = "name.get"
    bl_label = "Get names"
    first_name = bpy.props.StringProperty()
    second_name = bpy.props.StringProperty()
    names = bpy.props.EnumProperty(items=get_items(), update=update_names())

    def check(self, context):
        return True

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

    def execute(self, context):

        print("Hi {} {}".format(self.first_name, self.second_name))

        return {"FINISHED"}
        # return {"CANCELLED"}

    def draw(self, context):
        layout = self.layout
        row = layout.row()
        row.prop(self, 'first_name', text='')
        row.prop(self, 'names',text='')
        row = layout.row()
        row.prop(self, 'second_name', text='')

class NAME_PT_panel(bpy.types.Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_label = 'My Panel'
    bl_context = 'objectmode'
    bl_category = 'Test'

    # drawing menu
    def draw(self, context):
        self.layout.operator(NAME_OT_get.bl_idname)

classes = (NAME_PT_panel, NAME_OT_get)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)

def unregister():
    for cls in reversed(classes):
        bpy.utils.unregister_class(cls)

if __name__ == "__main__":
    register()

check() function is solving my problem with refreshing of first_name prop.

So I did not want to have global property, I have a global update() function instead. At least it is not registered as blender property. Is someone know how to make update function as a method in NAME_OT_get class?


GPU compute not working for Blender 2.78c with EVGA GTX1070 on Ubuntu Mate 17.04 First, installed Blender 2.76b from Software Boutique of Ubuntu Mate 17.04. No GPU compute option was available.
Second, downloaded blender-2.78c-linux-glibc219-x86_64.tar.bz2: md5checksum was correct. Extracted with Archive Manager. Copied the extracted blender folder recursively to /usr/lib/
Then started blender by double clicking the blender application (140.7 MB dated 2/26/2017) in the blender folder.
Selected Cycles Render.  Under Blender User Preferences set Render Device to CUDA (GeForce GTX1070(Display). Selected GPU compute as Device under Render.
However, GPU is not being used for cycles render, utilization is no more than 3%.
Third, installed NVIDIA-modprobe. GPU remains under 3% utilization.
Can someone help me to get this graphic card to do my cycles render?

I ran Blender as root and then started blender normally and now GPU render works! Resolved


How do I add physics to cartoon styled hair? I'm working on a model that has 3D cartoon hair (think Coco from Crash bandicoot or Lily from Psychonauts; if you don't know them, google them and you'll get an idea). My question is: how do I add physics to this style of hair?

I know with clothes you can add physics so that they move without having to worry about animating it to look realistic, but I have no idea how to do this with cartoon hair. I tried a similar approach with clothes physics (which I'm definitely not a pro at) and immediately their hair lost its shape and fell flat.

The hair is very curly and wavy and is hanging loose (so not ponytails or braids or the sort), so it's really important to keep this shape while allowing movement, which is why I'd like to apply physics if I can. I'm not new to Blender, but I'm definitely not a pro, so screenshots to help explain would be greatly appreciated.

Also, due to copyright, I am not allowed to upload any part of the model because of the unique style.

You have to create a flat hair mesh and apply the physics on it. Then you need to add a Surface Deform Modifier on your hair model to take the transformation information from the flat hair mesh. This method works especially well on long hair. The setup would look like this:

When working with Surface Deform keep in mind to cover your  entire hair model with that flat hair mesh. And also do me a favor and make a better flat hair mesh that I did here. It was just a really quick prove of concept.


How to make "object A" keep distance from "vehicle with physics" and follow path at the same time? This is what I have. Is there a way to make empty object keep constant distance from a car and follow curve. If not, how to make it happen in a different way if possible?

I suppose it kind of depends on how you're going to animate the car.  But one way would be to use a boolean.

If you think about, you're trying to find the intersection of a sphere centered on the car and the curve.  So start by making a (non-rendering) mesh for the curve, just a strip of planes with a curve modifier, then make a (non-rendering) sphere around the car:

Parent your sphere to your car, give it a solidify modifier, then give it a boolean/intersection modifier with your curve mesh and now you have an arbitrarily small piece of mesh that represents the intersection of the curve and the sphere:

Now you can create an empty (or a bone, or anything else), parent it to the car, and use a shrinkwrap constraint targeting the non-rendering sphere:

So far, so good.  But of course our sphere actually intersects our curve at two points, so let's delete half of it.  And let's subdivide our curve-modified path and make it more narrow to reduce our error.

Look, your car doesn't even have to stay on the ground.

One potential problem here is if you have a very windy curve, there may be multiple points of intersection.  You can always adjust the size of your sphere as necessary to improve handling on windy roads.


Texture doesn't show up on render mode I'm new to blender and I tried to follow a tutorial on how to create a house. I unwrapped the and baked the textures in blender cycles, then assigned it onto a material in blender render. The texture just becomes all deformed.

.blend file

I believe what's happening here is that it is rendering the wrong UV layout. So just select the right one.


What is the difference between NLM vs Open image denoise? What is the difference between NLM vs Open image denoise? also what is the "denoising data" in view layer properties?

Here is a nice explanation video by IBN-Blender 3d Artwork
here.
From what I understood:
Open Image Denoise and NLM are two sorts of denoising modes. OID is faster and doesn't need a high sampling rate, it is ideal for animation. NLM is slower and needs a higher sampling rate, it is ideal for single image.
You can use OID either through the Render panel or through the Compositor. The second solution gives better results.
For the first solution, enable OID through Properties panel > Render > Sampling > Denoising > Render.
For the second solution, make sure you've deactivated any denoising in the Render panel, then go into Properties panel > View Layers > Passes > Data, and activate Denoising Data, it will create all the necessary output sockets in the Compositor Render Layers node.
Now open the Compositor, create a Filter > Denoise node, plug the Nosiy Image, Albedo and Normal output sockets of the Render Layers node into the Denoise, plug Denoise into the Output and Viewer nodes.


How can i make an interesting tree trunk without having to sculpt it? I'm looking for alternatives to the sapling tree or modular tree addons, because I want to have more control over the trunk shape and I want the branches, trunk and roots to be one whole mesh instead of intersecting. Is there a way to achieve such effects without having to manually sculpt it? Because I want to make a lot of similar types of trees with different shapes to populate a forest.
Here is an example image of the type of trunk shape and detail that I'd like to create.

As I know from my expierience with substance designer you can create almost everything with a height-map and a Displacement Modifier. Since blender has the amazing possibility to create stunning procedural textures, I would go with that. Create a few basic trees, with some branches and apply a procedural displacement-map on it, you can create it in the node-editor. The big advantage of procedural textures in blender is to create many different variations by just tweaking a few parameters, in blender you can even use the position of your trees as a driver for different parameters, it's not the easiest thing to do, but it creates a lot of realistic varaitions once you've done the node setup. If you have no expierience with procedural textures, you can watch a few youtube tutorials how tree-barks are made procedural. This is what I found.

https://youtu.be/Rh5gAQLtOls
https://youtu.be/tS3D3cSgRyE
https://www.blendernation.com/2019/03/14/download-procedural-pine-bark-shader/
https://docs.blender.org/manual/en/2.79/render/blender_render/textures/types/procedural/index.html

All the best Marco


What can I do to bring my hierarchy back? I have no idea what I did, but my hierarchy is gone. I'm trying to make a VR character, but I can't finish it without the hierarchy. It shows up if I open another project, but I don't want to start over. Can anyone help me? Thanks in advance!

You must have accidentally closed that panel.  You can actually make any panel in your view an outliner by clicking on the button on the top-left corner of the panel.
To open it again as it was, simply click and drag from the top-right corner of the properties panel and drag down, then change the new panel you just created to an outliner.


How can I make a script to make Cycles load a new texture each frame? I need to load 6 cubemap images each "frame" and apply them to a cube and render that as equirectangular panorama frames via Cycles (camera inside cube, nothing else in the scene).

How would you do it?

Try this [Modified according to comments].

It assumes that:

You have one root folder (ReplaceMe1) that contains a subfolder for each cubemap. Each subfolder has 6 images, one for every side of the cube.
Your cube is comprised of 6 separate objects, appropriately named ('side' / 'front', etc. See script for full list).
Each side object has a separate cycles material with an image texture node.
You want to save all your renders to a specific folder (RepalceMe2)

Code:

import bpy
from os import listdir
from os.path import join, isdir, isfile

# Root folder which contains a subfolder for each environment map
imgFolder = 'C:/ReplaceMe1'

# Subfolders, each containing 6 images - 1 per side of the cube
mapSubFolders = [ d for d in listdir( imgFolder ) if isdir( join( imgFolder, d ) ) ]

# Output Path (where your renders will be saved)
outputPath = 'C:/ReplaceMe2'

S = bpy.context.scene

sides = [ 'top', 'bottom', 'left', 'right', 'front', 'back' ] # Object names

for d in mapSubFolders:
    folderPath = join( imgFolder, d )
    imgFiles   = [ f for f in listdir( folderPath ) if isfile( join( folderPath, f ) ) ]

    for s in sides:
        # This line will crash the script if this folder doesn't contain an image
        # for each side, with the same name (for example: 'bottom.jpg'; format doesn't matter)
        sideImg = [ f for f in imgFiles if s in f ][0]

        imgPath = join( folderPath, sideImg )

        # Open image file or apply the relevant image path to an existing image object with the same name
        if sideImg not in bpy.data.images:
            bpy.ops.image.open( filepath = imgPath )
        else:
           bpy.data.images[ sideImg ].filepath = imgPath

        img = bpy.data.images[ sideImg ]

        sideObj = S.objects[ s ]
        t = sideObj.active_material.node_tree

        t.nodes['Image Texture'].image = img # Apply current side's image to image texture node

    outputFile = d + "_" + s + S.render.file_extension

    S.render.filepath = join( outputPath, outputFile ) # Set render output path

    bpy.ops.render.render( write_still = True )


Adding random noise to a mesh -- programmatically (bpy.ops.mesh.noise) Trying to draw a scene by a script that is started by a single click, ran into problem creating bumpy terrain.

It is easy to create a slightly bumpy ground using mouse and keyboard -- create  plane, subdivide, add material, add cloud texture, and click 'noise'.  However, all attempts to do the same programmatically have failed:

bpy.ops.mesh.primitive_plane_add
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.subdivide(number_cuts=subdivisions)
bpy.ops.object.editmode_toggle()

mat = bpy.data.materials.new('INVOKE_DEFAULT')
mat.name = "GroundMaterial"
bpy.context.active_object.data.materials.append(mat)

tex = bpy.data.textures.new('CloudNoise', type = 'CLOUDS')
texSlot = mat.texture_slots.add()
texSlot.texture = tex

bpy.ops.object.editmode_toggle()
bpy.ops.mesh.noise(factor=1)
bpy.ops.object.editmode_toggle()

The above code does the noise -- sort of, it does not take the texture as input, so the plane remain plain, it is merely shifted along z-axis.

Copying code from the code console runs in the read-only constraint on the first line:

bpy.context.area.type = 'PROPERTIES'
bpy.context.space_data.context = 'MATERIAL'
bpy.ops.material.new()
bpy.ops.object.material_slot_assign()
bpy.context.space_data.context = 'TEXTURE'
bpy.ops.texture.new()
bpy.data.textures["Texture"].type = 'CLOUDS'
bpy.ops.mesh.noise()

How can I set the 'active' texture, or to navigate to the properties -> textures tab programmatically?

Ugh, found it:

bpy.context.active_object.active_material

bpy.ops.mesh.primitive_plane_add()
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.subdivide(number_cuts=subdivisions)

bpy.ops.object.editmode_toggle()
bpy.ops.object.editmode_toggle()

#mat = getOrCreateMaterial()  Does not work
mat = bpy.data.materials.new("Material")
mat.texture_slots.add().texture = getOrCreateTexture()  #works

bpy.context.active_object.data.materials.append(mat)
bpy.context.active_object.active_material = mat

bpy.ops.mesh.noise(factor=0.5)

Had to look in the C source code for clues.


What constitutes a "context" in Pose mode? I have an armature associated with a mesh. In Pose Mode I have oriented the armature the way I want, so I press A to select the entire armature and then I press I to insert keyframes.  I've done this successfully on simple models while following tutorials, but back in my real model I'm getting the following error and I don't understand what context is being looked for.

  No suitable context info for active keying set

What constitutes a "context" in Pose mode?  What should I be looking for in my model structure that is leading to such an error?

From the keying sets documentation:

No suitable context info for Keying Set
This error occurs when either:

The Keying Set requires that some specific type of data is selected (i.e. all builtin Keying Sets require that you have some selected object/bone)
When using the "Available" builtin Keying Set, and the object that you're trying to keyframe doesn't already have any keyframes/F-Curves, this error will be shown as it there are no existing keyframes/F-Curve on the selected object(s) to insert keyframes on

The keying set can be selected/cleared using the  in the header of the Timeline window.


Problem with applying the Subdivision modifier I was wondering if anyone can help with a problem I've been having with trying to apply to a Subdivision Modifier to a model that I've been working on for a while.

I asked about this problem on another website, but since this site deals with the more technical elements of Blender I thought that I would have a greater chance of getting help here with this problem than somewhere else.

Anyways, I had been trying to fix some problematic geometry on the lower area of my model's belly but since I had been trying to keep amount of overall amount of vertices to a minimum, there was a insufficient amount of geometry to work with in fixing the issue.  I then decided to try and apply the Mirror & Subdivision modifiers to the model so that I could increase of amount of vertices to work with and then use the Sculpting Tools to smooth out the problematic area. It worked as I intended, however, it is here where the main problem of this topic comes into play.

After the Subdivision Modifier is applied, everything seems fine at first but when I try to pose my model, various distortions in the mesh that weren't present before I applied the modifier begin to appear all across it.

The problem is especially noticeable here with the underside of the model, with a really nasty-looking, sharp corner forming on the back of the foot/leg that shouldn't be there.

Surely, there must be a way that the Subdivision Modifier can be applied so that it doesn't cause these distortions.  Otherwise it makes the Subdivision Modifier a rather unreliable tool to rely upon, since you have no idea how the model & the way its rigged is going to turn out when you apply it.

I've included a Blend File that contains a version of the model without any of modifiers applied and without any rigging.  I hope that someone will be able to help me out with this issue, and that any aid whatsoever would be greatly appreciated.

Link to Blend File

It's a bad idea to apply subdiv. If you animate a mesh with an armature, try to keep the topology clean and sufficient, but not redundant. Add 3 loops where the limbs are to allow the mesh stretch correctly. When you skin your mesh to the armature (weight paint), it's much easier to handle non subdivided mesh. And keep the armature modifier before the subdivision.
Yes. maybe your model has insufficient geometry, but it doesn't mean you have to subdiv the entire mesh. Just think where and how you want the model to bend, and add geometry (by hand) just there. And master weight paint mode, it will change your model skinning drastically.
As a good start I'd recommend some tutorials to get understand the basics. I like the rigging series by DanPro on youtube. Try this one, to see what matters on rigging. There are tons of nice tutorials, just find that will suit your skills and taste.


BVH Export/Import, Armature different when re-imported If I export an armature as bvh and then import it back, the imported armature doesn't look anything like the original.

Could anyone please have a look and advise?, blend file

The BVH format stores bones differently to Blender.

Specifically, it doesn't support bone-length and bone-roll, each bone is just a joint(as if you have many parented empties in Blender), so this information is lost on export, when the BVH is imported back in, the animation will match the original, but not the armature.

The bone lengths & roll have to be calculated on import (because its not in the file).

This is simply a limitation of the BVH format, or a difference at least, with Blender's armature representation.


Why is vertex drawing ignoring grid snap settings? If I want to draw some vertices on the ground plane, I seem to have to place the first vertex with Ctrl+RMB (not Ctrl+LMB as the manual states), then Extrude the rest of the vertices using E, which is fine, except that using Ctrl+RMB seems to ignore my snap to grid settings (using E behaves properly), so I can't accurately place that first vertex.

Is there a way of making that snap when it's placed, rather than having to move it afterwards using Blender 2.8?

If I want to draw some vertices on the ground plane, I seem to have to
  place the first vertex with Ctrl-RMB (not Ctrl-LMB as the manual
  states...

That's probably because Blender used RMB for selection by default prior to 2.8. WWas it on the 2.8 manual or the 2.79?

For your issue you have to extrude, cancel the moving of the extrude by using right clic mouse button, then move it with G (dont deselect anything by error) to get the snapping effect.


Normalize all objects scale and rotation transforms I have an imported .blend file, and some of the objects in the file look the same but have different scales and rotations. When I clear transform the objects wheels, frame, etc. (it's a bicycle) don't fit anymore. So my question is:

"Is there a way to make the objects vertices locations match the mesh's vertices locations i.e. make it look the same even when scale is cleared?"

before clear scale

After clear scale

It seems there is parented objects to empties.

Select all objects

Alt+P > Clear and Keep Transformation

U > Object & Data (this is for linked duplicates)

Ctrl+A > Rotation & Scale


Can't manipulate linked or appended objects that were made with 2.79 inside 2.8 I'm using Blender 2.8 and my friend works in 2.79. Whenever I append or link his files there is something like a locked logo front of those objects and I can't manipulate these. What could be the issue?

The symbols resembling a chain link in front of an Object stand for linked objects.
They definitely only appear if you link to an object instead of appending it.

If you append an object, you create a local copy of an object from another .blend file, which can be manipulated like any other object. If you link to an object in another .blend file, you can't manipulate this linked object, instead you have to manipulate it in the original file.

To create a local copy of a linked object, click on the object with the chain link symbol, click on "Object" in the "Properties" panel, then hit the chain link symbol on the right side of the Object selector dropdown.


how to check what shape key connected to bone? i'm quite new to use the shape key drivers so here my question,

by clicking the object that have shape key drivers you can know which bone connected to it by seeing the drivers tab

but how can you know what shape key drivers connected to the bone you clicked?

As far as I know, you can only move the bone and read in the properties panel, shape keys tab, which is (or are) driven.


How can I make a object follow perfectly a nurb path? I'm currently making a track for Assetto Corsa. I make the tracks with objects that follow paths but i'm always having some issues to make the objects follow properly the path. This time is this what happens:

Note: The selected object is that one which I want to follow the path without curve modifier.

So I have 2 questions:
1. How can I solve this?
2. Is there any way I  can make a object follow perfectly a nurb path?

I leave my .blend so you can check it.

Thanks in advance :)

First of all, delete all objects except NurbsCirle and Cube.000. They are not relevant to the problem and only in the way.
Set the cursor at the world origin (Shift+C). Select all objects (A) and set the objects origin to cursor (Ctrl+Shift+Alt+C).
Select you object and go into edit mode. You'll see it is not at the origin. Select all Vertices and in the Properties panel (N) -> Transform -> Median, set all values to 0 to center your object. Rotate it until it doesn't lay flat on the ground. Exit edit mode.
In the Modifiers panel of your object, make sure there is an Array modifier with its length set to "Fit Curve" (If your object doesn't fit the curve later on, remove the curve). Beneath you sould have a Curve modifier set to NurbsCurve. Test all Deformation axes until you hit the right one.
Select your curve and go into edit mode. Select everything. Press Ctrl+T to tilt your curve along its path until the object on it is oriented the right way. You may need to do this several times at several locations until it looks like you want.
You're done. Now you can try to restore the other objects and move the curve's origin without destroying everything


Animation nodes - effector pushes and attracts with falloff on multiple objects I know it's possible and have been trying to figure it out with animation nodes, but does anyone know how to take multiple objects at a starting point and have them translate away (rotate/location) from an effector object, such as an empty, as its passing through them. After the empty has passed through the group of objects I want there to be a falloff making the objects return back to its original position.

For example I am trying to take a group of objects close together and pass an empty through them. At the same time displacing each objects location and rotation away from the empty and as the empty gets farther away from each object they move back to their original form.

any help with this is greatly appreciated! And cheers in advance!

Welcome to StackExchange. This is very easy to do :)

Step-1: Put all the objects into a separate collection. Then, select all the objects and open the N-panel, click the option From Current Transforms under AN-tab. It will store the initial transforms of all the objects,

Step-2: Add the Collection Info node and select the collection in which you stored the objects (in Step-1). Then connect objects to the Object ID Key node
and in the search option select the Initial Transforms option,

Step-3: Then add an empty (I have renamed it as Effector). To move objects away from the Effector, we have to calculate the directions which are pointing toward the Effector (empty) from the objects' location. We can do that by subtracting the Effector's location from the locations of the objects. For further control, I have added another Vertex Math node (with Multiply mode) to restrict the motion of the objects in XY-plane by making Z = 0,

Step-4: Next, add the Offset Matrix node to offset the initial locations of the objects along the directions which we have calculated in Step-3, and also you can offset the rotations as you like,

Step-5: Final step is, add the Object Controller Falloff node to control falloff of Offset Matrix node, adjust of falloff node as you like,

By the way you can also combine the different falloffs.

Blend File:


Best way to tile a complex shape with a texture? I want to take a texture, say a basic black/white checkerboard, and apply it to a complex shape (a bit of level geometry for a game in this instance). At the target scale, it will be much smaller than the target object, maybe 1/5th of the width of the bottom square area in my image, but it should tile to fill.
Deformation is not desired, so for example even if there is a hill in the geometry the checkerboard texture should be the same as-the-worm-crawls distance from square to square everywhere.

I have tried fiddling with texturing options but it seems mostly it is made for simple shapes, and treating this shape like a cube or sphere leads to understandably strange looking results.
I also thought about getting orthographic projections and applying UVs but it seems like a bit of an intensive workflow and it will also lead to deformation in the shape when texturing hills and the like.
Below is the actual kind of end result I'm going for, so eventually I'll also want to find a way to tack on these "edges" to the shape, but for now I'd like to just start with a looping texture. Note that because my target end result looks like this, I only care about the top and bottom of my shape separately when it comes to looping textures and thus there doesn't need to be consistency between the sides.
Any advice would be appreciated! I'm very new but I know that I could do this already in one of several painful ways. I'd rather do it right, from the beginning since I will have to generalize this process to many other geometries later on.

Edit: Here is an example of the simple approach of getting a UV map from an orthographic projection causing some warping on slopes, which I'd like to avoid if possible.

I think a simple unwrap would do just that. You just need to set all the outer edges of your shape as seams, so the UV unwrap 'knows' where to separate the shapes (UV islands) and avoid distorting and overlaping in the UVs.
To set edges as seams: in edit mode, select only the outer edges of your platforms and then click on "edge" and "mark seam".
Then select all faces, hit "U" and "Unwrap". I think it should give a pretty good result. Might need to tweak a bit in UV editing, like rotating the islands so they align with the texture pattern and stuff like that.


Renaming bones with Python I often use Blender to port models between game engines for personal-use game mods, which means I frequently have to rename the bones in accordance with the rules of different game engines.

I already have a script that works perfectly for renaming vertex groups (should I import a mesh without its skeleton)...

import bpy

name_list = [
# old name - new name
['Bip01 Head','Bip01_Head'],
['Bip01 Neck1','Bip01_Neck1'],
## Rest of the list
## Each version of the script has a different list, specific to the game engines I'm porting between.
['Bip01 Finger41.R', 'Bip01_R_Finger41'],
['Bip01 Finger42.R', 'Bip01_R_Finger42']
]

v_groups = bpy.context.active_object.vertex_groups
    for n in name_list:
        if n[0] in v_groups:
            v_groups[n[0]].name = n[1]

... select desired object, run script, all recognised vertex groups get renamed.

However, my attempts to adapt a version that will rename bones instead...

bone_list = bpy.context.visible_bones
    for n in name_list:
        if n[0] in bone_list:
            bone_list[n[0]].name = n[1]

... simply has no effect. (I have also tried with the bpy.context.editable_bones, bpy.context.selected_bones and bpy.context.selected_editable_bones contexts).

There's no errors on the console (although I can definitely provoke errors - by trying to run the script in the wrong 3D view mode, misspelling commands, etc - so it's not that the script isn't even trying to run), and the bone names in the armature definitely match the names in the script's list (I have now copy-pasted some names to check, but the Vertex group version of the script definitely works to rename the matched groups on the associated meshes).

I'm out of my element when it comes to Python in Blender, so I'm really quite stuck as to why this is simply failing to work. Words of wisdom would be appreciated.

Probably easiest to use the armature objects pose bone collection.

import bpy
context = bpy.context
obj = context.object

namelist = [("Bone", "Head")]

for name, newname in namelist:
    # get the pose bone with name
    pb = obj.pose.bones.get(name)
    # continue if no bone of that name
    if pb is None:
        continue
    # rename
    pb.name = newname


Is there a way to group animations into one action? Is there an equivalent in blender to pre-comp in after effects?

I want to make a complex animation, with multiple animating objects, but then I want to take the whole animation (as a hierarchy) into BGE and trigger the whole thing as if it were one object?

There was (Blender 2.49) the option to trigger animations of all child objects via [child] flag at the action actuator. But there is really limited use on that.

No there is no way to have several actions of several different objects as one. The armature does that partly (animating different objects) but i guess this is not what you mean.

The way to go is to ensure all objects play there respective animation at the same time.

You can do that by sending a message e.g. "play cut scene A sequence 1". Each object involved starts playing on receipt of that message.

As all objects receive the message at the same frame the actions will play synchronously. Be aware there is no feedback (e.g. if one object is not playing the other objects do not know about it).


custom modal operator event timing I am trying to code a custom modal operator which captures key inputs. But the event queue seems to be so fast that when I hit a key it is reported multiple times. For example when I type the word "hello" it might end up in something like "hheelllloo". The modal method looks like the following

def modal(self, context, event):
    if event.type in string.ascii_uppercase:
        return self.add_char(context, event.type.lower())

    else:
        return {'PASS_THROUGH'}

What could I do to fix the problem?

There are two events for keyboard keys: When you push the key down and when you release it.
event.value is 'PRESS' or 'RELEASE'.
Run this code in Text Editor, put your mouse over 3D View and hit Spacebar.
Search for Simple Modal View3D Operator and run it, then press some keys.
import bpy
import blf

def draw_callback_px(self, context):

    font_id = 0  # XXX, need to find out how best to get this.

    # draw some text
    blf.position(font_id, 15, 30, 0)
    blf.size(font_id, 20, 72)
    blf.draw(font_id, self.key)

class ModalDrawOperator(bpy.types.Operator):
    """Draw a line with the mouse"""
    bl_idname = "view3d.modal_operator"
    bl_label = "Simple Modal View3D Operator"

    def modal(self, context, event):

        mod = []
        if event.shift:
            mod.append("Shift")
        if event.alt:
            mod.append("Alt")
        if event.ctrl:
            mod.append("Ctrl")

        if mod:
            mod = "[%s]" % "+".join(mod)
        else:
            mod = ""

        context.area.header_text_set("%s %s - %s" % (mod, event.type, event.value))

        if event.unicode:
            self.key += event.unicode
            context.area.tag_redraw()

        elif event.type in {'RET', 'NUMPAD_ENTER', 'BACK_SPACE', 'DEL'}:
            self.key = ""
            context.area.tag_redraw()

        elif event.type in {'RIGHTMOUSE', 'ESC'}:
            bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
            context.area.tag_redraw()
            context.area.header_text_set(None)
            return {'CANCELLED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        if context.area.type == 'VIEW_3D':
            # the arguments we pass the the callback
            args = (self, context)
            # Add the region OpenGL drawing callback
            # draw in view space with 'POST_VIEW' and 'PRE_VIEW'
            self._handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback_px, args, 'WINDOW', 'POST_PIXEL')

            self.key = ""

            context.window_manager.modal_handler_add(self)
            return {'RUNNING_MODAL'}
        else:
            self.report({'WARNING'}, "View3D not found, cannot run operator")
            return {'CANCELLED'}

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

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

if __name__ == "__main__":
    register()


How to make an Emission material transparent? I would like to be able to see the green cube through my yellow cube while retaining the intensity and bloom of the Emission material:

I've seen other questions that ask the same thing but unless I'm misinterpreting they all boil down to using a Mix Shader that takes mixes the Emission node and a Transparent BSDF node, which as you can see from my screenshot I am already doing.
What am I doing wrong?

one option to have transparent could be Adding a Fresnel to your Materials.
But i'm not sure if that's the look that you need for your project.

If you need more bloom, you can play with the render settings too.


I can't see color in Material tab I used to use blender a long time ago and now I started to use it again but I can't find the color option in the material. Is there anyone that knows how to fix it please? really appreciate it.

 I know that I can change the color where it says "Diffuse" but when I do that and want to add shader in the "Node editor" it doesn't show any output or input, so don't know how to do it.It would be greatly appreciated if someone can help me with this.

1.

It might be that your panels are arranged in a non-default way.

If you use Blender Render or Blender Internal renderer (which is the default in a newly installed Blender):

Find the Diffuse panel and change the color there

If you use Cycles renderer:

Find the Surface panel and change the color there

2.

It also might be that you have created the material in Blender Render and then switched to Cycles renderer, or vice versa - which makes the material color slot disappear since the Blender Render and Cycles materials are not compatible (unless you know your way in complicated node setups).

In this case, easy way is to just remove the incompatible material from the minus button and add a new material by clicking 'New'.

I hope this helps :)

If not, post a screenshot of your material panels to the first post, that would be helpful.


How to display my reference image in Wireframe mode I imported my reference via Images as plane. I can view them in material preview, but when i switched to wireframe mode I can't see my refernce images.
How can i fix that?
Two pics for proper demonstration of my problem.


How to make a particle simulation like this? So here is the reference
https://www.instagram.com/p/CHijzp2gVt7/
I don't ask for like exact guideline how to make it, but if you can throw me a few steps or tutorials for something specific as this. Or give me a few tips. Anything really would help.
I try to look around on YouTube, Google, ask around here and get as much information I can find.
I am looking into this new tools MantaFlow and FlipFluids.
So on the video he has like Triangle, Spherical, Square shapes with particles inside.
It simulates like water but it has small spheres, maybe I don't have to get it exactly like that. But getting something a tidy bit close to that, would be great. I don't have to type it all down, the reference explains it quite well.
By the way I do have slight experience with particles and simulation, I'm not completely new with it.

I suggest you to try in 2D with a plane and a noise texture. You could add keyframes to change the texture over time and make it move like in your example. Then multiply it to another noise texture (with a MixRGB node) to create this noisy particle effect. Otherwise if you want to go with particles : create the scope with a simple shape and collision property, remove gravity from particles, and add a turbulence force in the scene. Then rotate both emitter and turbulence.


How do I avoid quads appearing as triangles when twisting a mesh? Is there a trick to avoid that the triangles are visible in the reflection when I do a twist with a deform modifier?

See the file:

Method 1
You need to switch to smooth shaded mode with "auto smooth" enabled (auto smooth makes a hard normal on every edge that is greater than the set angle).

Method 2
Another method would be to manually mark the edges as sharp, then use an edge split modifier. First select all the "sharp" edges in edit mode, then hit Ctrl+E --> "Mark Sharp". (Make sure you already clicked Smooth in object mode)

Then add an edge split modifier that splits based on sharp edges.

Note: Hitting Smooth in object and edit mode do different things (you can smooth certain parts of the mesh in edit mode). For this solution, you will want to hit Smooth while in object mode.


How to render some of view layers only (instead of single or all of them) I have LOTS of View Layers (generated in Python), and I only want to render and composite several of them at once.

When I checked "Render Single Layer" in View Layer options, only the active one in the UI would be rendered.

When I unchecked "Render Single Layer", all of them are rendered, including those I'm not using in compositor. Even I have only one Render Layers node and one Composite node in the compositor, when I press F12 Blender still renders every single view layer.

Is it possible to only render the layers I'm using in the compositor? Or it can only be achieved by more scripting?

If you have several layers, every layer has an "Use for Rendering" option. Tick this on all the layers you want and untick all you do not need. That's it.

The python property is ViewLayer.use, which you can access for each layer per data-block: bpy.data.scenes["Scene"].view_layers["LayerName"].use or per scene in context: bpy.context.scene.view_layers["LayerName"].use.


Change topology with one click? Is there a way to quickly change the topology of an object with one click? I found this feature very useful in 3dsMax. Now I'm searching the same in blender.

At 03:15
https://www.youtube.com/watch?v=MpsURXZvcsU

That kind of topology can be made with Poke Faces which will reorient faces as needed and then Tris to Quads will convert triangles to quads oriented as in video.


How to make something pass behind an actor and be not visible. (Just the part behind the actor) I want to make the wings pass behind the actor during the animation, how can I do it? I need to make the wings pass behind the actor and when they are behind, the part behind him need to be not visible. I don't know if i can use an alpha on the holdout material or if there is an other way. thanks

This is a job for compositing rather than the 3D view. Send the footage into the compositor, use a Chroma Key node to filter out the green screen (you might need better lightning), and then use Alpha Over to place the footage over the render output.


Pin UVs for Pack Islands? Pin allows me to keep parts of a mesh where it is while performing a subsequent unwrap operation. Is it possible to pin objects so they do not move when performing Pack Islands?

No, currently pack is based on the selection only. It could be handy to have a way to select only unpinned UV islands so you could use them as a way to lock islands for other tools.


Can't import the 'Serial' library to connect with Arduino I'm trying to connect a blender project to Arduino but I have a problem with blender. I cannot import or use the 'serial' library. I can control an LED with Python and Arduino, but when I try it with blender it doesnt work.

Can you help me?

I have found my problem (windows):

I was using and installing 32bits python and 64 bits from blender.

My solution:

I'm using Windows 10 64 bits.
Download Blender 32 bits,v2.79.
Remove/uninstall all Python stuff that i have.
Reboot the system.
Reinstall Python 3.5.3 (64-bits) donwloaded from Python site.
Download the pyserial, version 3.4.
Copy from pyserial: the folder serial, paste the folder in blender sub-folder site-packages:
 /blender-2.79b-windows32/2.79/python/lib/site-packages
Open and run Blender 32 bits,v2.79.
Using Blender game engine, made a script and my LED in Arduino turned on.


Can multiple meshes and textures share one material? I am going to begin work on a game and was curious to know if I had 6 meshes (limbs) on one armature(think armors and equippables)? like each has an animation and own texture but the material shared by all of the other meshes(limbs). Thanks.

It is possible to give a bunch of objects the same material. If each is unwrapped that may complicate things. I think this may be what you are looking for

I hope this is what you were looking for


How do I get rid of the mesh or faces inside my cube? How do I get rid of the mesh or faces inside my cube?

It looks like you may have inadvertently added a 'Subdivision Surface' Modifier. Go to the properties page and open the 'Modifiers' tab (it will show a little blue wrench). With your cube selected, click the 'X' at the far right of the subdivision surface modifier.
Or, simply hit tab to get into Object mode, delete your cube with X and add a new one.


Preserve Shape of Texture, when Object gets edited? I have a custom texture applied in UV editor to the mesh. However, I need the  texture to save its shape when I move vertices of a mesh (right now, when I move some vertices in edit mode my texture also follows these vertices and changes shape.

How can I achieve this?

Short answer - you don't.

The UV layout is tied to the object in a way that each vertex in the UV layout represents a vertex in your 3D mesh.

Imagine a rubber skin that gets stretched around your model. You paint it to look good on your model and afterwards you stretch your model or add new parts to it. Now, the same rubber skin has to cover a different mesh, which results in stretches.

You can make the stretches visible in Blender, if you activate the stretch indicator in the Properties Region of the UV/Image Editor.

Moving vertices around creates stretching in the area and the angles of your UV layout.

If you manipulate the vertices in your 3D mesh, you also need to update your UV layout to avoid stretching.


How do I get the 'Fracture' panel to appear in the Toolshelf? What must I do to get the "fracture" panel to appear in the 3D View Toolshelf? I have download the "Blender fracture; version --> 2.79a".

I have made a picture of a Youtube video where I can see that they have the "fracture" panel (I have made a orange circle around the 'Fracture' panel):

No, this addon is bundled with the Fracture Modifier Build, it should be inside the "fracture_extra" folder within the zip file which contains the build. ("fracture_helper.py") Alternatively you can separately download it here:

http://blenderphysics.com/fracturemodifier/

(Helper Addon)

The addon might also be updated separately from the build from time to time.


How do I stretch my object from one point to the other? Just wondering how I could get my object (the truss) to stretch and become the same size and shape like the cube behind it.

Thanks.

I think you can solve this with snapping and transforms with cursor as pivot. I tried to rebuild a situation similar to what I see in your picture, so that the truss is of different size and rotation than the other shape:

First of all, switch to top view, and activate vertex snapping like below:

Then, translate the truss towards the other shape, and snap a corner vertex as below:

Then, go into edit mode (of the truss) and select one corner vertex, then snap the 3D cursor to it.

Now you can activate cursor pivoting, and rotate the truss

...until its upper vertex snaps to the other shape, perfectly:

Now the different angle is gone, and you can switch to front view, to stretch (scaling) the truss until it matches (snapping) the other shape perfectly:

Does this solve your issue?


POSER - Can Poser files be used in Blender and Blender in Poser? I only know Poser (now by Smith Micro) and use it for 3D stills.  Poser human characters/figures (with wireframes made by SmithMicro, DAZ3D or HiveWire) with photo-human textures can be extremely realistic, better than any other 3D programs I've seen.  I wish I could try my Poser figures in Blender to try its renderer, lighting, clothing creation, landscape creation, etc.
I don't yet know Blender; do any of you use Poser and Blender??
Thanks for your time!

Daz studio uses poser models and according to this answer exporting the model using collada (.dae) works, .fbx may also be a good option. You could export a posed character with .obj but that doesn't include the armature.

While each renderer can use the same image textures, expect some manual texture creating to use cycles, which is blender's newer and better render engine. You will probably find this much easier with the new principled shader in the new blender version about to be released. You can test it in the daily builds and see it in use in this tutorial

I would suggest asking/looking at poser specific sites like the daz3d forums which is where I first heard about blender years ago, people using it to make poser models.


How to snap 2D cursor to key in graph editor As the headline says: Is it possible to snap the 2D cursor in graph editor to a specific key? I can snap it in time from key to key using up and down arrow, but how can I exactly position the horizontal line to a key? I only found options to snap keys to the cursor, not the other way round.

Use Key>Jump to keframe (or press Ctrl+G) to place the cursor on the selected keyframe.


Python, is there a way to copy the orientation from a custom transform to an object? I'm trying to create a custom transform from selected vertices, then copy the orientation of this transform to an object.
I know it's doable from an object to another, so basically Blender copies the orientation of Active object, and rotates the Selected object to match that orientation, what I'm trying to do, using Blender API, is to copy from a custom orientation, rather than from an object.

The following script shows how to get to assign the custom transform orientation to the active object's orientation, after creating the custom transform orientation, and naming it (name):

import bpy
from bpy import context
import mathutils
#Get the matrix of the transform orientation called 'name'
custom_matrix = bpy.context.scene.orientations['name'].matrix
#Copy the matrix to resize it from 3x3 matrix to 4x4 matrix
custom_matrix_4 = custom_matrix.copy()
custom_matrix_4.resize_4x4()
#Set the matrix of the active object to match the resized matrix
bpy.context.active_object.matrix_world = custom_matrix_4


Why is my edited video not rendering all as one? I have had two different issues for rendering not as a playable whole video.
a) If I pick FFmpeg, The videos are titled WarriorHunters_0000001-61167, WarriorHunters_0010001-61167, WarriorHunters_0020001-61167 and it is three different videos, but for instance WH_002 has a "ghost" 00:00 - 25:00 and only has video there for 25:00 - 37:00.
b) If I pick AVI raw, it is a 430 GB (!!!) file that also launches and only plays the first 15 seconds before stopping.
It is worth noting, a lot of the seams in the FFmpeg version are near where I do long pan-and-zooms with keyframes.

I do not have much of an answer for the malfunction, except that your frame numbers are huge. The blender manual recommends rendering as frames if it is longer than 2,000 frames, but in this case I recommend rendering it in parts.
PS: The question does not have very clear information, and leaves alot of questions for the answerers to ask. What exactly do you mean by ghost? Does the video show 25 minutes of blank, or does the player just skip ahead? What codecs are you using with FFmpeg? There are several available. How do you do the pan and zooms?
That aside, what is your operating system and graphics card?


Faces with more than four vertices for 3D printing When I'm making planar faces with more than 4 vertices I can do this with F or AltF.

F will create a single face.

AltF will create multiple faces made up of triangles.

Which of these is the best? I'm planning on using the model for 3d printing. Will a face made of more than 4 vertices cause problems?

You shouldn't use ngons for printing. Not even quads. Send triangulated mesh to the printer.

Ngons (and quads) are very convenient to work with. You can use knife tool on them easily. Because of this I would recommend using F when making the model.

For export for printing, use the Triangulate modifier and the Wire and Use All Edges option for Object Display. This allows you to control how the model will exactly triangulate and how it will print. You have more control over the triangulation and you can set the same Beauty algorithm for triangulating ngons as the Alt F command does by default.

Most exporters will allow you to apply modifiers on export, so you don't have to triangulate you model in Blender which makes it easier to do changes on the model later.


Stuck on Texture Artifacts Important to note I had to bake five different pieces separately for my object because no matter how I made the bake cage I kept getting poor results with one cage for the whole object (Maybe someone has a better solution??) This does result in a beautiful result except for in certain areas. The issues appear where the different normal maps meet. I have tried combining normal maps onto one material, this doesn't work. I have used a combine normal map plugin which does an amazing job on what it is supposed to do (the produced normal map literally looks like I made them all at once) but I still get artifacts. I have tried the clone brush which does nothing. I also have already merged by distance with the mesh after I joined the objects. Does anyone have a possible solution? Thanks :( I have been stuck for a long time with this maybe a week. Thanks to whoever can help or try. Just looking for a solution doesn't matter how it is done.

Credit to Polytoots on youtube, learned the following from his tutorial.
I was able to solve the artifacts by editing the normal maps. I exported the normal maps and opened them in GIMP to use a clone brush to clean up sites of distortion. (any image editor can work, I encourage one with a clone brush :)
A normal map example that I did (same principle for all of them)


cycles bake script error: "Circular dependency .." I'm working on a simple bake script - if the materials are just colors the script works - but if any of the materials include a texture - then I get a "Circular dependency for image.."

when I manually replicate process of this script - baking works fine.

The script works like this:

for each object within a group named 'bake':

create a new image to hold baked texture
loop thru each object material + add extra image node
bake object
remove extra image node

test file:
http://www.pasteall.org/blend/39951

# list items in a group names 'bake'

import bpy

# bpy.ops.baketool.bibake() - quick test to use BAKETOOL addon for baking from CI - it works well

bake_size = 512
uv_channel_name = "B"

# function to create new image
def create_new_image(name):
    # create blank image
    bpy.ops.image.new(name=name, width=bake_size, height=bake_size) # new image

    return

# function to add nodes
def add_bake_nodes(mat, name):

    # make sure using nodes
    if mat.use_nodes == False:
        mat.use_nodes = True

    nodes = mat.node_tree.nodes

    node = nodes.new(type="ShaderNodeTexImage")
    bake_img_txt = "bake_img_" + name
    node.name = bake_img_txt
    nodes[bake_img_txt].location = 300, 160
    nodes[bake_img_txt].image = bpy.data.images[name]
    nodes[bake_img_txt].select = True

    node = nodes.new(type="ShaderNodeUVMap")
    bake_uv_map = "bake_uv_" + name
    node.name = bake_uv_map
    nodes[bake_uv_map].location = 100, 160
    nodes[bake_uv_map].uv_map = uv_channel_name
    # connect nodes
    outn = nodes[bake_uv_map].outputs[0]
    inn = nodes[bake_img_txt].inputs[0]
    mat.node_tree.links.new(outn, inn)

    return

def remove_bake_nodes (mat, name):

    nodes = mat.node_tree.nodes
    bake_img_txt = "bake_img_" + name
    nodes.remove(nodes[bake_img_txt])
    bake_uv_map = "bake_uv_" + name
    nodes.remove(nodes[bake_uv_map])

    return

def select_none():
    for obj in bpy.context.scene.objects:
        obj.select = False
    return

bakegroup = bpy.data.groups['bake']

print ("ITEMS TO BAKE: " + str(len(bakegroup.objects)))

# select none
select_none ()

for object in bakegroup.objects:
    objName = object.name
    print ("name: "+ objName)
    object.select = True
    bpy.context.scene.objects.active = object

    # num materials
    num_materials = len(object.data.materials)

    # create new image for bake
    create_new_image(objName)

    # add bake nodes
    for num in range(0,num_materials):
        print("  -material "+ str(num) + ": "+ object.data.materials[num].name)
        object.active_material_index = num
        material = object.active_material
        # add bake nodes to material
        add_bake_nodes(material, objName)

    # bake object to internal img data
    # assume bake settings are set
    # select UV channel B
    uv_textures = object.data.uv_textures
    uv_textures.active = object.data.uv_textures[uv_channel_name]
    bpy.ops.object.bake(type='COMBINED')

    # remove bake nodes
    for num in range(0,num_materials):
        object.active_material_index = num
        material = object.active_material
        remove_bake_nodes(material, objName)

    object.select = False

Cycles is baking on the texture ( not the new image ) itself because you haven't changed the active node through the script, just add nodes.active = node inside add_bake_nodes() like this :

# function to add nodes
def add_bake_nodes(mat, name):

    # make sure using nodes
    if mat.use_nodes == False:
        mat.use_nodes = True

    nodes = mat.node_tree.nodes

    node = nodes.new(type="ShaderNodeTexImage")
    bake_img_txt = "bake_img_" + name
    node.name = bake_img_txt
    nodes[bake_img_txt].location = 300, 160
    nodes[bake_img_txt].image = bpy.data.images[name]
    nodes[bake_img_txt].select = True
    nodes.active = node   # set it as active node

   ......

"Circular dependency for image" because the image that is used as a texture (read from) is the target of the baking (written to)


Restrict HDRI Lighting to affecting certain places I have a small question. I was trying to get the hdri lighting only through the windows. As you can see, my model has one side of its face open and I don't want the hdri lighting to affect the open side, I want the lighting only from the Windows. The only way I can stop the lighting from affecting the model is to create two opaque planes along it, but I need to be able to see the inside of it without having the hdri lighting affecting it. How can I do it ?

Found the answer, For Cycles this node setup using the geometry node is to be used for making the object transparent on one side and completely opaque/diffused on the other, flipping the normals will help switch the sides and determine which side has which shader


knife tool not working I am learning how to use the Knife tool and it's not working for me. I try to make a straight line by clicking on two points with Left mouse button, but the second time I click it, the line disappears.
I am trying to cut a diagonal line in the small box on right.

Please find attached blend file.

I tried to attach a Blender Screencast but it doesn't allow me to upload avi files, could you please tell me how to do it?

PS While you are at it, could you please check why my vertex snap (or any snap for that matter) is not working when holding down the Ctrl key? I am following a video tutorial and it's supposed to snap at all the corners, but it's only snapping in one or two places.
Thanks

The reason why your knife tool is not working is due to the fact that you have multiple polygons on top the same surface area. What I did was ... I made sure I "removed doubles" by hitting the W key and chose "remove doubles". After which the knife tool works.

As for your screencast, the site blender.stackexchange will only accept .gif files. You can use Screen 2 Gif software to capture the gif but it has to be below 2mb , if you want to upload via stackexchange's internal upload interface. Or else you would have to upload your gif to an external site and add the link to your post.


Issue with smooth shading What you'll see is flat shading then smooth shading. It is splitting the object down the middle in a disection for soem reason, in regards to shade and lighting.

This effect carries over into other programs when exported as well.

I made this object from a cube and used a boolean to make the cutouts.

A possible approach to do it with quads only :

Start with a square and subdivide it W then subdivide
Extrude E and scale down S
Make a copy and round it to sphere (Alt+Shift+S then move the mouse to the right)
Keep only the wanted vertices it each
Move back the angular part and align it : set the cursor as pivot point, select the vertices then scale S+Z0 and for the other part S+X0
Remove doubles

Concerning the shading, that may be dependent on your target system (sL ?)... so you may need to give it a try.

Possibilities :

Global smooth
Inner edge loop smooth
Global smooth + edgesplit modifier


Is it possible to resize faces/edges/vertices to a specific size? I have some previous experience from both Hexagon and 3DS Max. And you can easily resize a face, edge or a group of vertices to a precise number in both platforms. For example, you can create a 2x2x2 m box, then select one single side (face) and set the size to 2.189 m. For example.
Blender does have a size pane. But only for entire objects. I can set the width of an entire object to 2.189. But not a single face. Or an edge. In order to do the operation above in Blender I'd have to bring out a calculator and figure out the ratio of 2.000 to 2.189 and punch in that number in the resize tool. I can't for the life of me understand why there's no built in size panel for stuff like this.
What also bugs me is that for the very same reason you cannot easily read the size of an element, such as a face or an edge. Sure, there is a distance tool. But a lot of time I'd like to know the size in X, Y and Z. Not the actual distance from one end of an edge to the other.
Is there some plugin or setting in Blender for this? I basically want to be able to select a face or an edge, and see the size in all three directions. And also be able to change the size by punching in numbers. Resizing the width of an edge from, let's say 3.448 to 3.207 shouldn't require a calculator.

Yeah, unfortunately, I think the best you can do for now is to enable face and edge measurements under overlays. It's only a display - it doesn't let you input any numbers directly, but at least it lets you see dimensions as you scale, and transform and whatnot. If an add-on for this type of thing does exist, I would love if someone could point it out. Until then, I think this is what we're stuck with.


Blender 2.77a crashes on startup Receiving error when starting Blender:

C:\Program Files\Blender Foundation\Blender>blender
Warning! Legacy WGL is unable to select between OpenGL versions.found bundled py
thon: C:\Program Files\Blender Foundation\Blender\2.77\python
Fatal Python error: Py_Initialize: unable to load the file system codec
  File "C:\Python27\Lib\encodings\__init__.py", line 123
    raise CodecRegistryError,\
                        ^
SyntaxError: invalid syntax

Current thread 0x000008d4 #most recent call first

Note that I have a full version of Python 2.7.12 (32-bit) loaded at c:\python which is the default Python found when using my PC.

Found that I had PYTHONPATH set as an Environment Variable so I'm going to set up a batch file that resets that var before starting Blender.

This does resolve my issue, for anyone else with the same problem.


Parenting - Only the children moves when I move the parent and the parent stays still I have attached a few objects to a parent, but when I transform the parent, only the children are transformed while the parent stays the same. This is the case for positioning, rotation and scaling.

I recreated it in fresh scene with some boxes and it worked fine.

Thank you very much for your help!

This can happen when you transform only Origins.
Parented object (children) are bound to the object's origin, not geometry.

Example: Cube as parent, Suzanne as child.


Is there a way to bake a model's normal map in chunks? I'm very new to texturing in Blender. When baking the normal map of my model, it is unable to render correctly because my model has too many varied spacing lengths between geometry to have a "ray distance" setting that bakes cleanly. Is there a way for me to bake the model in chunks, so that I can avoid this problem? If I have to go as far as breaking my model into smaller objects, how should I go about piecing the resulting renders into a single normal map?

If you uncheck Clear Image checkbox in the Bake/Output you will be able to bake from different chunks sequently to the same image. You may want to lower the Margin distance so that the margin wont overwrite previous bakes.

Another way of dealing with this type of problems is to (copy and) move different parts together with their high-poly counterparts so they will be baked all at ones but without intersecting with each other.

Or, as previous suggested, create a cage mesh so you can control the ray length in detail.


How do you create a simple single vertex mesh with no actual faces whatsoever? In link How to edit Parameters for an Object after it is created?, it is suggested in one of the answers to begin a workaround by "Create(ing) a simple single vertex mesh with no actual faces whatsoever,...."
There's an animated GIF embedded within the answer that illustrates its making, but does not include the menus and commands involved.
All I see in my own 2.92 for Add is commands for meshes that are 3D objects, not anything like a simple vertex mesh.  Can anybody look at what's going on in the link and tell me how its author is building the first 8 seconds of the screen that is reproduced there?

Create a cube or a plane or anything really, go into edit mode and select all with "a".  Then press "m" at center to merge all the vertices into one.
Alternatively enable the "mesh: extra objects" module in preferences and then you get an option to add a single vert.1
Specifically what this demo has done though is create a single vert as mentioned above, then duplicated it and moved the second one a little way off, then with both vertices selected they made an edge between them with "f".  Now you can hop into object mode and follow the rest of that little tutorial to make your cylinder.


Controlling ColorRamp nodes with Group Inputs Is there a way to control parts of a node (that doesn't have inputs) with Group Input nodes?

So far as the method addressed in the question, I think the C-Code would have to be changed for that to work.  Maybe with Python but I'm not sure about that.

This field can be manipulated using Drivers and Scripted Expressions.

One way to do this would be to add an Empty.

Next keyframe the empty at t=0 then move the timeline to the end of the animation and the empty 1 unit to the right along the X-axis.

Now add a driver to the Step Field of the Color Ramp by hovering over the value and pressing 'd'.

Open the graph Editor and change the value in the expression field to be 'var' as seen in the image below.  Also, add the Empty as the Object to the default Variable field and change the Type to X Location so when the Empty moves to the right, it will change the driven value accordingly.
(I had to add a default modifier to get this to work for the Pos field which may be a bug since it now continues to work after I delete the modifier.

Here it is animated.  The reason I am moving the mouse cursor around in the Node Editor is because this updates the UI and the animated values can be seen to move.

With a bit of creativity, maybe you can find a way to use drivers to do what you were planning on doing with the socket input...  you didn't say what would be driving the socket so we can only guess at this part.

Some thoughts I'd like to add to this.  I believe, (at least according to my understanding which is very limited here) that this will be per-object since I don't know of a way to make drivers work on a per-vertex basis and especially not on a per-fragment basis which excludes a lot of the refinement which a shader-based control would offer.

It may be possible to duplicate an object and give it the same material but make it invisible and alter it's shape in order to affect shader input values like Geometry->Position and if I come up with anything like then I will append this method to the Answer.
If anyone else does think of something like this, feel free to piggy-back a second answer based on what I've shown here as a starting point so that this page can become a more comprehensive piece of documentation.  I'll vote up any answers that are useful even though this has been chosen as the solution.


Trying to reduce polygons (decimate) is not an option https://cdn.discordapp.com/attachments/191625599176015873/415621667432300545/unknown.png This is my current model for a health charger in Garry's Mod however the poly count for it is Verts:833,385| Faces: 831,002| Tris:1,662832 its too big to import into the source engine with all those polys (I get a crowbar error). The reason why I cant use decimate is because the mesh screws up before getting a reasonable poly count

You'll probabably have to do retopology and then bake the normal information into the low poly one, in case you don't know what I'm talking just google "Bake in blender high poly to low poly" or something of the sort and you'll find plenty of tutorials on how to do it
Also you could always do this too: Youtube link


(Animation) Nodes : how to map a rotation to a value between 0 & 1? The Parameter input of the Evaluate Spline, in Animation Nodes, needs to get a number between 0 & 1.
I would like to map it to the rotation of an empty (here, Effector-Spline-Loop).
No mather what the Y rotation is, I need to always have a value between 0 & 1.

0° -> 0
180° -> 0.5
360° -> 1
540° -> 0.5

How should I improve my nodes ?
Thanks !

the Map Range Node is what you are looking for. It takes the input values (min: 0, max: 360) and maps it to the target values (in your case 0 to 1).

Combine that with a Float Math Node set to modulo of 360. this way you'll only get values between 0 and 360 (540 returns 180 so the map range node will output .5).

separate Euler -> math node -> map range node.

Edit: final nodetree


Maths question regarding curved bay window I have been using Archimesh to create floor plans for a representation of my house. Generally, this is OK but it really is not very flexible with curved walls and cannot reflect my bay window at all.
All curved walls so far have not been smooth enough to add the 4 bay equal size window panels that I have.
I have finally decided that I will succumb to splitting the bay into 4 straight walls.
As it is not an exact representation, but I do want it to look right, I realise I have a maths problem to solve to identify the angles and lengths of these 4 walls.
The width of the bay on my plan is 240cm. At the centre of the bay, it should reflect a protrusion of 70cm and the curve of the bay is consistent with an arc on a perfect circle although I cannot be sure how many degrees of circumference this would be. It looks roughly 75 degrees to me. I expect with the width of the bay and the distance the window protrudes, this can all be calculated.
If anyone could provide me with wall lengths and angles to create this, I would be grateful.
Also, in case I have to change scale but with the same ratios, I would be grateful for the working to calculate this in the future.
Width of bay  240cm
Maximum protusion at centre of window 70cm
No of sections to split curve 4
Cheers

@batFINGER's or something like it, is clearly the most accurate way, but if eyeballing is enough, you can use the Spin tool to create an arc between 3 points.
If the 2 end vertices are not aligned to a convenient set of axes, you may have to make a Custom Orientation from them.
Select the 2 end vertices, and ShiftS Cursor to selected.
ShiftD duplicate one of the end vertices, and call up the Spin tool. Adjust the spin center in the perpendicular to the two ends to pass the arc of the spun vertex through the third point, and its angle to span the end points.


Face exists but no edge I've been learning Blender for a while now, and there's this problem I couldn't figure out the answer, even after searching for it.

There's this edge I want to move, on the same z axis :

And when I want to move this edge like this :

There's still this face existing even if I moved the vertices and the edge. How could I remove this overflow ? Why does it even exist ? I'm using Blender 2.79. Thanks in advance for your time.

It acts like this because it tries to create a face between your 4 vertices. To do what you want to do you will have to create a transverse edge like that:


Growing strands with particles Is something like this possible in Blender ?

I need random movement of particles, which leaves static strands behind.

You can use a Halo material and Trail Particles to do this.

Use a turbulence force field to create the random motion. (You can also use the Brownian value in Particles > Physics, but I liked the motion created by the turbulence force-field better)

Set the Trail count up. 700 may be a bit much if you have a lot of particles, and unnecessary if your particles don't move very fast.

Use a Halo material for the particles:


Trouble getting windowmanager properties to save it's contents with blend file I'd like the contents of this custom editor panel to persist with the file.

I can't seem to get my PropertyGroup or even a StringProperty to save with the blend file.

class PG_mypg(bpy.types.PropertyGroup):
    custString = bpy.props.StringProperty(name="custString")

bpy.utils.register_class(PG_mypg)

# this adds it but it doesn't persist in the file
bpy.types.WindowManager.myPanelSettings = bpy.props.PointerProperty(type=PG_mypg)

# even this one doesn't save either
bpy.types.WindowManager.myCustString = bpy.props.StringProperty(name="customString")

Note that I want this to be set for my window, not per object.

Custom properties to the bpy.types.WindowManager type don't serialize to .blend
(as if options={'SKIP_SAVE'} was set).

Your options are to use

bpy.types.Scene, but you will need to chose one scene instance to store the actual properties, and if that scene is deleted, they will be gone
Serialization: serialize your data to a string and make it the text body of a new text datablock. Give the datablock a name that starts with a dot, e.g. .my-data, to hide it in the interface. It is less likely to be removed like a scene this way.
AddonPreferences or saving to a custom configuration file - if the data is relevant to not just the current .blend, but the local Blender installation