give a variable to an operator For a workflow tool I made a panel in which it displays each separate library that is linked in my file. For each library I want to add some buttons that does stuff to the library in question.

So in this example I have my panel which shows for example 2 libraries and for each one it creates a "reload" button.

Now my question is.. How do I make it so the reload button only reloads the library I want to reload? I would probably have to give the button an id or something so it knows for which library it was created...

my code so far:

import bpy

libs = bpy.data.libraries

class Reloadlib(bpy.types.Operator):
    """Reloads the current Library"""
    bl_idname = "my.reload_lib"
    bl_label = "Reload"

    def execute(self, context):
        libs[?????].reload()
        self.report({'INFO'}, 'Reloading ' + libs[?????].name)
        return {'FINISHED'}

class LibPanel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "Scene Libraries"
    bl_idname = "SCENE_PT_layout"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"

    def draw(self, context):
        layout = self.layout
        scene = context.scene
        layout.label(text="Libraries:")

        for i in libs:
            layout.label(text= i.name.replace(".blend",""))
            row = layout.row()
            sub = row.row()
            sub.operator("my.reload_xref", icon = "FILE_REFRESH")

def register():
    bpy.utils.register_class(Reloadlib)
    bpy.utils.register_class(LibPanel)

def unregister():
    bpy.utils.unregister_class(Reloadlib)
    bpy.utils.unregister_class(LibPanel)

if __name__ == "__main__":
    register()

Where the question marks are is where I should be able to make the difference between the first [0] or second [1] library in the libs[] array.

In future I would also like to ad an 'open' and an 'unlink' button for each library so I can make changes to the other file. But this works by the same principle as the reload button.

I'm presuming that reload_xref is meant to be reload_lib.

In your Reloadlib class you can create a StringProperty to pass the name of the library into:

class Reloadlib(bpy.types.Operator):
    """Reloads the current Library"""
    bl_idname = "my.reload_lib"
    bl_label = "Reload"

    #2.8
    library_name : bpy.props.StringProperty()
    #2.79
    #library_name = bpy.props.StringProperty()

Then in execute you can access this local property with self.library_name:

    def execute(self, context):
        libs[self.library_name].reload()
        self.report({'INFO'}, 'Reloading ' + libs[self.library_name].name)
        return {'FINISHED'}

Then, when you display the operator you can pass in the name:

for i in libs:
    layout.label(text= i.name.replace(".blend",""))
    row = layout.row()
    sub = row.row()
    operator = sub.operator("my.reload_xref", icon = "FILE_REFRESH")
    operator.library_name = i.name

(To be clear, I haven't tested the specific functionality of reloading libraries, but  this is how you pass data generally.)

Full code:

import bpy

libs = bpy.data.libraries

class Reloadlib(bpy.types.Operator):
    """Reloads the current Library"""
    bl_idname = "my.reload_lib"
    bl_label = "Reload"

    #2.8
    library_name : bpy.props.StringProperty()
    #2.79
    #library_name = bpy.props.StringProperty()

    def execute(self, context):
        libs[self.library_name].reload()
        self.report({'INFO'}, 'Reloading ' + libs[self.library_name].name)
        return {'FINISHED'}

class LibPanel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "Scene Libraries"
    bl_idname = "SCENE_PT_layout"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"

    def draw(self, context):
        layout = self.layout
        scene = context.scene
        layout.label(text="Libraries:")

        for i in libs:
            layout.label(text= i.name.replace(".blend",""))
            row = layout.row()
            sub = row.row()
            operator = sub.operator("my.reload_lib", icon = "FILE_REFRESH")
            operator.library_name = i.name

def register():
    bpy.utils.register_class(Reloadlib)
    bpy.utils.register_class(LibPanel)

def unregister():
    bpy.utils.unregister_class(Reloadlib)
    bpy.utils.unregister_class(LibPanel)

if __name__ == "__main__":
    register()


How can I efficiently duplicate a large amount of objects? I wrote a blender script that duplicates an object, rotates it, and eventually creates a mosaic, data looks like this: [x,x,x, o,o,o, x,x,x,], where x is 90 degrees and o is 180, for example. Creating a "board" of the rotated objects.
The problem is that my mosaic consists of 17,000 objects and blender crashes when ever I run the script. It worked great when I was only creating 30/40 objects in my first tests but 17k is just too much to handle that. Routine:

Duplicate the active object and move it to the right (or down and to the left if the row ends
Rotates that active object
Repeat both steps

I'm fairly new to blender, is there a better way to achieve that? I tried to run the script on the default cube and that crashed too. Also, I tried adding time.sleep(0.1) to slow it down or something but that also crashes:
import bpy.ops
from math import radians
from mathutils import Matrix
import time

def move_obj(x, y, z):
   bpy.ops.object.duplicate_move(OBJECT_OT_duplicate={"linked":True, "mode":'TRANSLATION'}, TRANSFORM_OT_translate={"value":(x, y, z), "orient_type":'GLOBAL', "orient_matrix":((1, 0, 0), (0, 1, 0), (0, 0, 1)), "orient_matrix_type":'GLOBAL', "constraint_axis":(True, False, False), "mirror":True, "use_proportional_edit":False, "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "use_proportional_connected":False, "use_proportional_projected":False, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "gpencil_strokes":False, "cursor_transform":False, "texture_space":False, "remove_on_cancel":False, "release_confirm":False, "use_accurate":False})

def rotate_object(rot_mat):
    obj = bpy.context.active_object
    orig_loc, orig_rot, orig_scale = obj.matrix_world.decompose()

    orig_loc_mat = Matrix.Translation(orig_loc)
    orig_rot_mat = orig_rot.to_matrix().to_4x4()
    orig_scale_mat = (Matrix.Scale(orig_scale[0],4,(1,0,0)) @
                      Matrix.Scale(orig_scale[1],4,(0,1,0)) @
                      Matrix.Scale(orig_scale[2],4,(0,0,1)))

    obj.matrix_world = orig_loc_mat @ rot_mat @ orig_rot_mat @ orig_scale_mat

def rotate_dice(num):
    if num == 2: rotate_object( Matrix.Rotation(radians(90), 4, 'X')) #2
    if num == 3: rotate_object( Matrix.Rotation(radians(270), 4, 'Z')) #3
    if num == 4: rotate_object( Matrix.Rotation(radians(270), 4, 'X')) #4
    if num == 5: rotate_object( Matrix.Rotation(radians(90), 4, 'Z')) #5
    if num == 6: rotate_object( Matrix.Rotation(radians(180), 4, 'X')) #6

def rotate_to_one(num):
    if num == 2: rotate_object( Matrix.Rotation(radians(-90), 4, 'X')) #2
    if num == 3: rotate_object( Matrix.Rotation(radians(-270), 4, 'Z')) #3
    if num == 4: rotate_object( Matrix.Rotation(radians(-270), 4, 'X')) #4
    if num == 5: rotate_object( Matrix.Rotation(radians(-90), 4, 'Z')) #5
    if num == 6: rotate_object( Matrix.Rotation(radians(-180), 4, 'X')) #6

def dup(to, fro, x, z):
    move_obj(x, 0, z)
    rotate_to_one(fro)
    rotate_dice(to)

dice_arr = [1,2,3,4,5,1,2,3,4,5] // actually 17,000 entries long (removed for post)
break_on = 119

def run_arr():
    counter = 0
    last_index = 1
    movement_amount = 2.075
    count = 0

    for i in dice_arr:
        if count == break_on:
            dup(i, last_index, -movement_amount * break_on, -movement_amount)
            count = 0
        else:
            count = count + 1
            dup(i, last_index, movement_amount, 0)

        last_index = i
        time.sleep(0.1)

run_arr()

Edit: Blender doesn't seem to "Crash", it just hangs and is not responsive. How do I speed this up or let it run and so I can see the incremental changes?

Remove repeated operator calls
Most likely this is a veiled duplicate of
Python performance with Blender operators
Removing 17,000 operator calls will help... ie removing bpy.ops.object.duplicate_move using low level API calls
# copy the object
copy = ob.copy()
# copy and link data, prob not needed here
mesh_copy = copy.data.copy()
copy.data = mesh_copy
# set the local location
copy.location = (0, 0, 0)
# and / or set the global translation
copy.matrix_world.translation = (0, 0, 0) # scene origin

Link to scene in <= 2.7x
scene.objects.link(ob)

Link to collection in >= 2.80
context.collection.objects.link(ob)

In 2.8 for example move_obj can become, (Note there is no need to link them to collection here, could do it later)
def dupe_move_ob(coll, ob, vec):
    copy = ob.copy()
    copy.matrix_world = Matrix.Translation(vec) @ copy.matrix_world
    coll.objects.link(copy)
    return copy

Returns  a reference to the newly created and moved object.
Similarly would change other methods to pass objects
def rotate_object(ob, rot_mat):

Dupli
For 17, 000 objects will still be slowish. As commented consider using some form of dupli for this, eg dupliverts, make one mesh, add verts at all the locations calculated, set their normals (via the rotation) and one object will be duplicated for each vertex aligned to the vertex normal.
Make the new mesh object the parent of dupli object and under   Properties > Object > Instancing choose Verts.
To illustrate a script to duplivert a cone to a subsurfed suzanne.

The vertex normals of suzanne are determined by the faces. If we construct a vert only mesh, then set v.normal = (x, y, z) for each vertex
import bpy
from math import radians
from mathutils import Matrix

context = bpy.context

bpy.ops.mesh.primitive_monkey_add()
monkey = context.object
monkey.modifiers.new(name="Foo", type='SUBSURF')

bpy.ops.mesh.primitive_cone_add()
cone = context.object
cone.scale *= 0.1
cone.parent = monkey
cone.data.transform(Matrix.Translation((0, 0, 1)))
cone.data.transform(Matrix.Rotation(radians(-90), 4, 'X'))

monkey.instance_type = 'VERTS'
monkey.use_instance_vertices_rotation = True


Remove Console visualization on Blender Game Closing I create an application .exe of a blender game engine. Everything works fine except when I close the .exe window the console appear.
I would like to avoid this behavior and just close the executable.
Is it possible?

Thanks

I'm fairly certain that it has to deal with the fact that the console has to open up the extension files (eg. the .dll files) that actually make the game run. Reason being is that "most" systems will not have the accurate extension files. So, BGE adds the necessary files along with the executable to ensure proper functioning. As far as I know there is no way to "turn them off" because it is a necessary OS function. Hope this helps with your question.


Get Bone to track another armature I have 2 armatures, the first has a static root bone that does not move, the others can only rotate on the Z axis, I am trying to get the last child bone to track the second armature, the second armature only moves up and down.

I want the last bone in the link to track the second armature and to cause all the parent bones connected to it, apart from the root bone rotate to keep all the bones connected.

This is for a "Digger" like object where the Root would be the base of the vehicle that does not move, and by graving and moving the bucket the rest compensates appropriately.

I Managed to accomplish this through trial and error. First going from the second bone (first child after Node) I added two Constraint's.

First add a "Damped track" and target the same armature as the bone, and target the next bone in the armature, Bone_2 targets Bone_3, 2->3, 3->4.

Second add a "Limit rotation" constraint keep everything default and Limit X, Y, and Z.

On the last, Tail Node add only 1 Constraint: A "Inverse Kinimatics" Target is Armature 2, Bone x.

After all this the first armature will fallow the second one, keeping its constraints.

EDIT: I made a small mistake the last Bone (Tail) constraint is not a Spline IK, but an Inverse Kinimatics constraint.


How to edit video with a third audio channel I've just started using blender to edit videos (a site recommended it out of a list of free video editors), and for the recordings, I've been using a third audio channel to help separate my speech from the rest of the audio. However I'm not sure how to edit it in blender and i haven't found any tutorials on how to do this. Is there a way in blender or would I have to use another program to edit the audio?

EDIT: to clarify, when recording, my voice is recorded into a third audio channel along with the usual left and right channels in the video file. this was so I could edit out background noises (or me coughing in some cases) without having to mute all sound.
For now i'm using a "push to talk" button to reduce background noise

You added information to your original question. It's not so important how many audio channels the video has in your scenario, you want to drop the volume of one of the audio tracks for a cough/sneeze/burp you can keyframe the volume of a track.

view the audio track as an audio waveform
set keyframes at the appropriate places. A sane volume range is between 0.0 and 1.0


Is there any way to remove edges causing a loop? How do I remove/dissolve the selected edges while keeping the geometry?
Every other modeling software I've worked with can do this without any problem but Blender refuses to dissolve/remove them or adds faces if I merge them.

From what I can glean from here, Blender's representation of a polygonal mesh does not currently permit faces to have holes.
The rule appears to be that a face must be bounded by a single loop of vertices, with no vertex visited more than once, so..

.. a hole can be bounded by two faces, as on the left, but not by one, as on the right. That would mean doubling-back on the radial edge.
The topology of your top surface seems to be as shown in the examples below, a figure-of-eight region with two holes:

In the state you show, the region is divided into 3 faces, as at the top.
It would be possible to divide it into 2 faces, with one edge connecting the holes, as in the middle.
But not by connecting the holes twice, leaving the outer, green, face-with-a-hole.


Jagged Edges in Mesh Looking at my mesh in render view, I get these results. I've turned off my Subdivision Surface modifier as well as my Solidify modifier, but the jagged zigzags in the curves remain. Wondering if it has something to do with the geometry of the mesh - I converted a curve into a mesh - or my graphics card. Would much appreciate the help for a Blender beginner.

This seems like part of the mesh has inverted normals. In blender 2.8, run shift+N(Recalculate Normals) to make normals consistent.


Is there a way to hide the masking lines when using Texture Paint with masking enabled? I'm getting into painting textures onto my models using Blender's texture paint.  I like that Blender provides the 'face selection masking' button that lets me mask out faces that I don't want to accidentally paint.  However, when enabled this feature outlines all the selected faces with bold white lines - making it really difficult to see the results of my painting.  Is there a way to hide this overlay?

As far as I know there is no such option, which disables the white lines.
In Weight Paint Mode you have an option to display vertices instead of edges, but in Texture Paint Mode there is no option like this.

I think that using the Clipping Border Tool may be a good solution for you. Press ALT+B and drag a mouse to select the portion of the model which you want to be visible.

You can rotate selected portion, and paint on it precisely. And the most important is, there are no lines that may disturb you :).


Blender does not render OBJ and MTL import I am trying to render a set of lines through an OBJ file and the matching MTL file. The import does not give an error and the MTL seem to be correctly imported. But the render image is empty. I am a noob to blender and any help is highly appreciated. I have attached the links to the files below.
Thanks.

MTL: https://drive.google.com/open?id=0B-TWCTRv7UM1VTl4SWo2Zy1ZYmM

OBJ: https://drive.google.com/open?id=0B-TWCTRv7UM1TWdJREQzWnE2NFU

Your object only consists of connected vertices, it does not have any faces.

Blender needs faces to render an image.


How to align vertex to circle After several tries I can't solve this problem: the vertices are not aligned correctly.
What I tried, which is supposed to be the closest answer for me now, is using the loop tool addon and "space" them equally, then ShiftAltS to make a circle, but it messed up my topology (of course!) Anyone has a tip for that ?

Thank you

I think you were along exactly the right track in using the 'space' command of the loop tools add-on; even spacing really is the best way to get the smoothest curve.

The reason that the 'space' command is distorting some of the edges is that there are more edges on one side of the arch than the other, so some edges have to be moved a long way before the arch is evenly spaced. Having a similar number of edges going into each side of the arch will help with this.

I would try to either add a few extra loops into one side of the arch (marked in green in the screenshot below) or remove some loops, if possible, from the right side (marked in red):

Ideally, you would do a mixture of the two to even up the arch. Once this is done the 'space' command will not have such an extreme effect on the surrounding edges. I understand that adding more loops in will not seem ideal as you are probably (and rightly) keeping the topology as simple as possible, but in my experience, this is the right way to go.


How to get XYZ euler rotation of 3DView? I'd like to extract the user view orientation of the current 3DView. Since I didn't find a direct command to get it, my approach would be to take its matrix using bpy.context.region_data.view_matrix.transposed() and somehow convert it to a Euler rotation (ignoring its location), but I don't know how to do it.

Note that I'm not talking about a camera object but the user view.

bpy.context.region_data.view_matrix.transposed().to_euler()

Tanks HENDRIX, that was pretty simple


How to animate Constraints with Python? I have a cube

cube = bpy.data.objects['Cube']

The cube has a constraint, follow path. I would like to animate the offset in this constraint. I do know how to edit the value of it, but i need to put in a keyframe. Is there something like:

cube.keyframe_insert(data_path='offset_constraint', frame=10)

Right click on the property and select copy data path and use it :

in this case it's constraints["Follow Path"].offset

and the adding a keyframe would be like :

cube.keyframe_insert(data_path='constraints["Follow Path"].offset', frame=10)


Multi-line Text in blf (with multi colour option) Further my previuos question, i'd like to know how i cant draw multi line with an array fonction on the Y axis always there concervant the different colors.

for exemple, i'd like draw:

"Ngons: 5"

"Tris: 60"

Ngons and Tris are the label and have to be in red

5 and 60 are the value and have to be in blue.

How can i do that please ?

Building on the previous answer, now you have to think about line-height. A reasonable line-height for typesetting is the height of capital M x 1.45. But the coefficient can range between 1.2 and 1.45 (See the wikipedia article on Leading. These values are suggestions, and for HUD text or UI information use the value that seems most pleasing and doesn't cause the text to be too close or too separated vertically.
Take for instance the default line-height of Blender fonts.

1 / 0.682 = 1.46    # it's only a suggestion anyway.

A multi-line version of the script from the previous question, might look something like this:
def draw_string(x, y, packed_strings):
    font_id = 0
    blf.size(font_id, 18, 72)
    x_offset = 0
    y_offset = 0
    line_height = (blf.dimensions(font_id, "M")[1] * 1.45)
    for command in packed_strings:
        if len(command) == 2:
            pstr, pcol = command
            #bgl.glColor4f(*pcol) -> Blender 2.7x
            blf.color(font_id, pcol[0], pcol[1], pcol[2], pcol[3]) # Blender 2.8x
            text_width, text_height = blf.dimensions(font_id, pstr)
            blf.position(font_id, (x + x_offset), (y + y_offset), 0)
            blf.draw(font_id, pstr)
            x_offset += text_width
        else:
            x_offset = 0
            y_offset -= line_height

x = 60
y = 100
RED = (1, 0, 0, 1)
GREEN = (0, 1, 0, 1)
BLUE = (0, 0, 1, 1)
CR = "Carriage Return"
ps = [("Blue ", RED),("Yellow ", BLUE), CR, ("White ", GREEN)]
draw_string(x, y, ps)

You aren't limited to single words either:
ps = [("Blue Steel", RED),("Yellow Monk Fruit", BLUE), CR, ("White as an otter", GREEN)]
draw_string(x, y, ps)

produces this. (and note I forgot on purpose to add a space after "Fruit" to show how words are separated).

caveat: Don't change the "Carriage Return" string to something with 2 characters, it's a place-holder to keep the code simple and its length must be anything other than 2.


Combining 100+ Materials So I have a mesh model obtained from google maps data and we are using it for large-scale site representation. We typically combine architectural models with this google maps data and put up on sketchfab. However, Sketchfab only takes max 100 materials and my current model is sitting around 300. Is there a way to combine these materials? I dont have to combine all of them into one massive texture as long as i can get the materials number below 100. I saw that people bake these combined materials onto a single map but i tried and have crashed out my computer numerous times. My rig is i9 GTX 3090TI with 128gb ram so i don't think getting a beefier computer is a solution.
Any help or advice is welcome :) See below some images of the project.

My only suggestion is you could bake some of these maps to a single texture and apply the same texture to multiple objects. Only issue here is that you would have to UV Unwrap everything, which is a killer task with a scene as dense as this one. If you are interested in the baking process, Grant Abbitt has a pretty straight-forward tutorial for this.


How do I get rid of the pixelation that occurs when I render on Cycles? The pixelation gets worse if I rotate my view around the object in question.
I've tried increasing the viewport frames, changing the resolution, and playing around with the quality.

This generally happens when you have SSS on.
Try adding a denoiser node and rendering it:

End result:

Viewport:

Hope this helps!


I would like to know how to use dyntopo with multi-density I think it is a big advantage of dyntopo to be able to sharply sculpting a part without subdividing the entire mesh.

However, when rubbed with a smooth brush, there is a tendency to leave traces near the boundaries of the different density topologies.

I have marked it with a red grease pencil on the attached photo.

How can I make this place a natural gradient?

Also, I would be grateful if you could give me the correct order or tips for multi-density work.

1. Avoid going too hi-poly if you don't have to. If you're planning to sculpt at this level of detail on your whole mesh, make sure your computer can keep up. And ask yourself if you really need that much geometry. In my opinion if your wireframe turns black in some spots, that's too many polygons.

You can change these settings to control how fine your sculpt will be. Personally, I find that Constant Detail is easier to manage than Relative Detail.

2. The Smooth operation can help.

Back to basics, just press W in Edit mode and choose Smooth from the Specials Menu. If you Grow Selection (Ctrl+) and repeat, you can smooth over more area in steps.

3. You can always retopo (and usually should retopo after Dyntopo).

Personally, I like to do a Multires retopo to preserve the high level of detail but also be able to still manage the mesh.


How to see the actual commands blender runs I'm writing some scripts for applying textures and got into troubles.

The commands showed in the info window seems to be only a part of the commands actually runs. I copied the demonstrated commands into a script to do the same things as what I do manually, but the script just fails. I guess it missed some commands setting the context.

So how can I see all the commands actually runs?

In addition, how to see the content of '...' like this

Consult the docs

What you are seeing in this instance is an object property. Blender uses operators as "command" clearly recognizable from bpy.ops. namespace.

For the case shown::

It has ID object of type screen (bpy.types.Screen) an instance bpy.data.screens["Default"] akacontext.screen  and a property name of texture_context

This means we can find it from the screen object following chain of collections or pointers screen.foo.bar[0].blah.texture_context where none of foo, bar, blah will be an ID object. It is this chain that can be abbreviated to "...". Without can produce ridiculously wide tooltips.

(Reminder to self) Before pecking about aimlessly in the python console why not consult the docs.. Using the right click and view docs outlined here will take you directly to the help page.

Searching the old** API manual using just the property name.

we find that texture_context is a member of bpy.types.SpaceProperties as shown in tooltip.  A space belongs to an area, an area belongs to a screen.

You set the space of an area when selecting the editor type, in this case we want the area of type  'PROPERTIES', aka the Properties editor which has an  active space of type SpaceProperties  (tip can toggle an using area.type = 'PROPERTIES')

Scripting

Here is an example using the py console (bpy.types.SpaceConsole).

>>> for i, a in enumerate(C.screen.areas):
...     if a.type == 'PROPERTIES':
...         i, a
...         break
...
(1, bpy.data.screens['Scripting']...Area)
# bpy.data.screens['Scripting'].areas[1]

>>> a.spaces.active.texture_context
'MATERIAL'

>>> space = a.spaces.active
>>> space.texture_context = 'WORLD'

If your script is going to be invoked from a button or menu in the properties area, can use.

space = context.space_data
# or
space = context.area.spaces.active

albeit this may seem convoluted, you'll find blender follows a pretty consistent data structure.

** Note

I believe this property has been removed from 2.80 and searching the new manual will direct you to the API changes page.


UV Mapping reset error I have this swimming pool mapped with just one texture.
When I try to reset the UV Map I get a strange triangles (image 1). If I unwrap it again I got only the swimming pool stairs (image 2).

The object was exported from MAX into 3DS in order I could open it in Blender. Might be a export bug?

Is there a way to fully reset the mesh or check if there some error?

Watertight surfaces can't be unwrapped in one time without seams

The issue comes from the absence of any seam in the portion of mesh that not belong to the pool's stairs. As there is no edge marked as seam, you are asking the software to unwrap a shape that is "solid", that cannot be profitably unwrapped, an operation that leads to the "default" result (the same you get when choosing the reset function).

That is true even for simple object like the shown pyramid. You simply cannot unwrap watertight mesh (unless the are bi-dimensional): you need at least to make an hole somewhere or, preferrably, mark some seams:

Here's a possible result using the provided mesh:

Seams has been made all around the floor of the pool (on both sides) and the resulting ring has been cut in half at some point.


What does the mouse-binding "in-between move" do? Soo, changed my settings around a bit so that Shift-C is cursor-to-selected and Ctrl-S is "view all without moving cursor". After doing this I had some intermittant trouble with the view resetting with the original Shift-C action when I alt-tabbed or used my screenshot program.

I finally tracked it down today; somehow this got set instead of disabling the original command:

I can't find "In-between Move" anywhere else in the key list; though that might be because search dosen't seem to work on it:

Note that the box dosen't become red like you typed something invalid in it.

Sooo ... what is this mouse action supposed to represent, anyway? I can't consistantly do it, so I'm not positive what it is, but I guess it has something to do with dragging between windows?

This is an event used internally for painting and sculpting tools, it is not useful in a keymap. It can be used when writing certain tools in Python (typically modal operators).

What this event does is give you higher resolution mouse positions in between the regular mouse move events. For most tools only the latest mouse position matters, and processing the positions in between would just be wasting time. But for some tools like painting and sculpting it's useful to known the full path that the mouse traveled to get more accurate paint strokes.


Export model and textures from CityGML to UE4 through Blender In Blender Render I'm facing a problem with imported CityGML building models. I used the Rotterdam dataset available online and used this very good script from batFINGER to import XML files in Blender. The models are already textured.

This just works very well, the thing is that the way it use textures is quite messed up, and I can't figure out how to export that properly with textures to a game engine such as UE4.

The model use a bunch of texture images (around 300) that are all listed here:

When I select only one building and check its UV's, it is all over the place and the UV's are overlapping each other. For some reasons this seems wrong to me, but in view mode the model looks fine. I feel like each building from the model is using textures from different pictures.

I used ctrl+J to join everything, but when I look at the UV's it's even worse:

If I zoom I can see every single UV crossing each other:

Baking the textures seems very promising, but after few try outs my model turns white and the final picture stay black:

*note that I've tried that without unwrapping because I think the model is already "unwrapped" and anytime I try to unwrap it again it crashes.

I've tried many options, without any success:

Unwrapping model causes crash
Packing islands causes crash
Baking the textures makes the final image black, or the model turns white
Auto unwrap from texture atlas causes crash
Exporting glTF doesn't export the textures embedded

Even if the UVs and textures looks messy the model is fine in the 3D view but there is no way I can export this properly with one single texture that I can use in my game engine.

The best would be to find a way to combine all theses different texture images into one single image witout losing the texture application, that I can easily import to UE4 (proper baking?).
Or find a way to export the model as it is in the view mode, with embedded textures, without modifying anything in the UV editor. I guess there must be a way...

Any help would be much appreciated!

Ok I finally figured out this issue. The problem was that I didn't had any material in the material tabs, so there was nothing to bake. I had to go through other programs to convert properly the cityGML files before to bake them in blender. I had to use Autodesk Infraworks and FME cityGML importer to get there. It works at least for me with the models I got from Rotterdam.

Here is my workflow:

Download the model from the website in cityGML format, thematic classes: buildings, textures: RhinoCity texturing.
FME quick translator: run CityGML to IMX workspace and convert it to a .imx file.
Open Infraworks and import the .imx file, then export it to FBX (uncheck merge textures toggle and do not export the ground).

Then in Blender I can open the FBX that contains the materials and textures ready for baking. Clear parents and keep transformations with alt+P, group meshes with ctrl+J. Create a new UV map, a new texture image, unwrap (smart UV project) and finally bake the textures.
Use the baked image as a new material, and the texture is mapped on the UV map created. I exported the file in FBX and the import in UE4 is very smooth. It looks great!

It works very well this way, hope that it can help someone else!


How can I give a wet effect to my character mouth and eyelids I'm making a maned wolf and I'm trying to make a material for the eye lids and gum with this wet effect:

but the effect I'm getting looks too rubbery

I'd like to know what I could do to replicate that wet effect

EDIT: I'm using eevee, and I want to know something that could work for both cycles and eevee

I also tried to use clearcoat, normals with noise texture, but it still looks bad

If you're using the default Blender Renderer try making the surface smoothly bumpy so there are plenty of angles to catch the light, and turn up Hardness to make the specular highlights sharper.  You could use extra lights at angles to the camera, placed here and there, with Diffuse unticked so it only gives Specular light, and if those extra lights interfere with your general lighting, you can put the lights on their own layer and tick This Layer Only, then put the gum on that layer too.  You can have more than one layer open by pressing Shift while clicking on the layers.  (You move an object to another layer with the M key, with object selected.)


Any tools to capture movements from a mobile phone to Blender? I am not sure what is this called, but maybe similar to motion capture. For example I want to animate a hand in Blender. Instead of motion capturing by pointing a camera at my hand and it tracks in 2D, I hold my phone and set the forward direction then I can move a point in blender as if my phone is that point.

Another case I would like to use something like this is camera animation. If I can hold my phone, set a starting position, and Blender's camera can move along with my phone I could record an animation to make panning or just holding a camera still looks more human. (with little noises and all)

If it does not exist in Blender but exist in other programs I would like to know a name of it. Or if this is not a common idea I might learn to contribute to Blender one day. (but first I don't want to reinvent the wheel if there is any) Newest iOS 11 has ARKit, it might have some interesting pre-made phone localizing function without using markers and I might try it.

I'm searching for the same.

As far is I went, I have some experience using AndroSensorGTK.
https://github.com/geooot/AndroSensorGTK

accelblend looks nice.
https://talk.maemo.org/showthread.php?t=76991

Does what we want, but no source.
https://rbteam.wordpress.com/2014/07/29/android-blender-connector/

Interesting project, no source found.
https://ensiwiki.ensimag.fr/index.php?title=Use_of_smartphones_as_3D_controller

Uses android as virtual camera (no sensors).
https://www.blendernation.com/2012/08/27/using-an-android-phone-as-a-virtual-camera/

I think this is just a website for controlling (didn't look into).
https://github.com/joewashear007/BlenderWebController


freezing bkender when using soft body iam making a small scene using soft body on a sphere and its freezing my blender and moving 1 frame every 1 minute very strange even my pc is strong even when i use fire simulator also very slow and struggling to move 1 frame ! what
ryzen 7 3700X
RTX 2070 Super
32 GB Ram
What is the issue please ?

The thing you are doing wrong is that you are not baking the animation first, no matter how powerful your computer is it will take time to bake and currently you are baking it while playback that's why you are not able to get high fps, bake the animation first and you'll be able to have a smooth playback.


Node for setting render colour, regardless of lighting I'm trying to make a material node setup to set final render colors, regardless of lighting conditions. Is such a setup possible?

I assume you mean a "shadeless" shader:

To create this you can use the Light Path node to make an emission shader which is visible only to the camera, letting other rays straight through with a transparent shader:

Casting shadows:
With a diffuse shader (or a holdout shader, black transparent shader, etc. anything that will cast a shadow and render fast) used instead of the white transparent shader:

You'll notice that there is some indirect lighting (in this case it's a slight orange tint to the shadow, because I made the diffuse shader orange)

If you don't want that orange tint, you can either:

Disable it per object by disabling Diffuse in Properties > Object > Ray visibility:

Disable it per material with the light path node:

Result:


Make an old TV screen material How could I make an old TV material? I've tried some nodes, but I don't get the dessired result

Base material:

In Node Editor add Subsurface Scattering shader set Radius to 1.5 to have nice darkened corners, select desired color (for example #CCE7D7) then add Glossy shader and set Roughness to 0. Add Mix shader, connect them and as a factor add Input > Fresnel to fake PBR reflections.

Now you will have something like this:

White spot:

To add this white spot in the center of the screen we will need Gradient Texture as color for Subsurface Scattering. We will also need some simple UV unwrap for the screen, mine is simple Project from view (bounds) from Front Ortho view.

Add Input > Texture Coordinates then Vector > Mapping, now in Mapping node choose Texture tab and set Scale to 0.7 (X, Y, Z) and Location to 0.5 (X, Y). Those values may vary based on your mesh/unwrap!

Now add Texture > Gradient, set it to Spherical, add Converter > Color Ramp, change black color to the one from base material steps and move white color to the left (more to the left, bigger white spot).

Connect it to the Subsurface Scaterring color slot and we are done here.

Note that I'm using Environment Texture for lightning and reflections. You will have it packed in .blend file.

Blend file:

Edit:

I tought that I can crank it up a little bit by adding this white spot in the center of the screen. More details above, I think that extending previous steps would be much better then creating it belowe edit.


Python script for adding Child Of bone constraint with 'Set Inverse' to multiple bones? Completely new to scripting and was hoping someone would help me out here.

I've imported a rig twice and want to add a "Child Of" bone constraint to each bone in the first rig using the matching bone in the second rig as the target. I also want to use "Set Inverse" function of this constraint.

The rigs are the same, so all the bones are named the same.

Rigs are called "root" and "root.001".

I figure I need to do something with:

import bpy

context = bpy.context
scene = context.scene

rig1 = scene.objects.get("root")
rig2 = scene.objects.get("root.001")

for bone in rig1.pose.bones:
    cbone = bone
    cbname = bone.name
    setchild = bone.constraints.new(type='CHILD_OF')
    setchild.target = rig2
    setchild.subtarget = cbname

But beyond that I have no clue. I'm not sure how to set the inverse option.

I'm looking to edit a number of animation files, so would need to do this process for each fbx file, and therefore would love to automate the process.

Hoping someone can help me out.
Cheers.

import bpy

ob = bpy.context.active_object

# Take a copy of current layers
org_layers = ob.data.layers[:]

# Show all layers
for i in range(len(org_layers)):
    ob.data.layers[i] = True

for b in ob.pose.bones:
    for c in b.constraints:
        if c.type == "CHILD_OF":
            context_py = bpy.context.copy()
            context_py["constraint"] = c
            ob.data.bones.active = b.bone
            bpy.ops.constraint.childof_set_inverse(context_py, constraint="Child Of", owner='BONE')

# Reset back to orginal layer state
for i in range(len(org_layers)):
    ob.data.layers[i] = org_layers[i]

Found by Ratt, cheers guys! (let me know if this is what you meant)!


During a Cycles render an object behind glass looks striped Using Cycles I rendered a object inside a tube (it's glass material). The problem is the object edges are striped as shown here:

The same thing happened for another project too:

In the first render I tried different options but the issue is still there. Is there any way to fix this?

Make sure the object with the glass material has smooth shading.
You can change the shading of the object from the default flat shading by pressing  Space  and search for "Shade Smooth"


How to change the inherited F-curve independently from the original one ? what I did:

I created a hammer, inserted two keyframes to rotate it a bit, set the curve to linear and extrapolated it linearly. Than I duplicated the hammer, the result was two hammers that spins synchronous.

What I want to achieve:

I would like the second hammer to spin with only half the speed or I would like to create a few hammers and each one spins some degrees ahead of the other. But I only have one curve in the graph editor for both.

You could also try to use F-Curve-Modifiers. To do so:

Go to frame 0 and add a keyframe on the rotation Axes you want
In the Graph Editor bring up that sidebar by pressing N. Add a Modifier > Generator. This will give you the polinominal tools to create a Graph as in y=mx+b as you might remember from school.

This value controls the ascent of the curve. By default it's 1, so we have y=0+1x, so y=x meaning that for each 1 frame (one unit on the x axis), the curve ascends 1 unit on the y axis as well (it actually goes up to 57,296 because 1 rad= 57,296°).

So if you want to have a second object that rotates half of that speed, you just enter half of the value you entered at (3), 0.5 in my example.


Unsubdivide doesn't work Blender 2.80

A number of steps (days) ago I accidentially subdived my low poly model. When I now try to undo or at least reduce the number of vertices with Un-Subdivide simply nothing happens. Un-Subdivide has absolutely no effect.

Verifying the issue with a new cube in the same file Un-Subdivide works.

The documentation says nothing about any limitations.

So is there a way to force unsubdivide the mesh.
The model is a partial adapted model from a larger one, made with triangles, already with vertex-groups and weight paint. The tris seems to be gone after the subdivision.

For the moment I'll rebuild the low poly model from scratch but I'm curious how I should proceed if a rebuild is not acceptable.

According to Campbell Barton Un-subdivide currently requires grid topology, which means it likely won't work on a triangulated mesh. The discussion on the issue tracker can be found in T65748.


Can't change horizon color: "can't edit driven number value, see graph editor for the drive setup" I am trying to change my background color for rendering. I tried changing horizon color in World (circled), but received an error message that I don't understand.

  can't edit driven number value, see graph editor for the drive setup

Why is this? How may I solve this?

The purple border indicates that there is a Driver present for that value. A Driver is a way of programatically controlling a value - similar to keyframing. When a value is being Driven you cannot manually change it. Move the mouse to over the field and press Alt-D to remove it (or right-click for the menu which also lets you add/remove drivers). You probably pressed D at some point without realising whilst hovering over the field and this would have added the driver.


How to export an animation to my sprite engine I have a blender animation for use in a multi platform app. The sprite engine is Urhosharp.
In urho, an animation has a defined animated object with the meshes of several bones, and a texture direct draw surface.
How should I convert my animation to try to make it useable in urho?

There is a blender plugin that can export *.ani animations to Urho 3d.
View the Github repository of reattiva.


Splitting pieces of a mesh into a new object I've just made a set of armor by using a male body mesh model I downloaded and selecting certain faces from the model and duplicating them to create viable armor pieces.

Since the pieces are just duplicated from the same mesh male model, then it's still part of the same object.

How do I separate the armor piece from the model to make the pieces separate?

Select the object.
Enter edit mode (press ↹ Tab)
Press P> Selection to separate the selection into a new object:

From the manual:

Options

Selected
This option separates the selection to a new object.

By Loose Parts
Separates the mesh in its unconnected parts.
By Material
Creates separate mesh objects for each material.

Note that if there are no disconnected parts of the mesh besides the armor, using the By Loose Parts option might be faster.
Also note that you can select linked geometry by:

Pressing L with your mouse over geometry will select all geometry connected to the element below your cursor.

Pressing CtrlL will select all geometry connected to any selected element(s).

To access the option from a menu use Mesh > Separate


Why does my model become partially transparent when using the alpha channel to control transparency? Здравствуйте  не могу разобраться с прозрачностью
есть волк и текстуры.
почему то все становится полупрозрачным

Hi I can not understand with transparency
is a wolf and texture.
why everything becomes translucent
Download Blender File For Mega

https://mega.co.nz/#!EJ5miDrR!PFgflDbXDROdb0nBfxKqcdT79v0ucEcYGgKugwDYRLU

This is because the alpha channel is not completely opaque on the other parts:

The mix shader uses the top slot where the Factor input is 0, and the bottom slot where the Factor is 1. When the Factor is between 0 and 1, it will mix the two accordingly. See How does fac differ with manual control versus node control?

A quick fix you could do in this case is use a Math node with the operation set to Greater than to make the factor only have an input of 0 or 1, never a value in between:


nVidia driver causes flickering viewport background I noticed a flickering background whenever I click a button or orbit in blender 2.8 or 2.79

It only happens when I use my NVIDIA 940mx but not when I switch to the integrated Intel 620.

I can't record the effect with a screen recorder, so it might be related to the NVIDIA driver interacting with the display brightness/gamma/contrast.

Maybe someone has experienced this problem and knows how to fix it? Also, is there any disadvantage of using the integrated graphics? Especially on 2.8 and eevee?

After about a year with the same issue, I found a solution: use Blender in REAL fullscreen mode. By that, I mean, do not use it with maximized window, go to Window > Toggle Window Fullscreen. This solved the problem both in Blender 2.79b and in 2.80.

I dunno if we have the same machine, I'm using an Acer Aspire-E5, but it uses the same graphics card, 940MX.

I feel like this is some sort of conflict between it and the integrated graphics card, where when idle, it uses the Intel card. This would explain this bug, and another one I was getting recently in 2.79b, were the interface would not show what was really happenning currently and show still images of stuff that happenned.

`Putting the software in fullscreen may tell the NVIDIA card that it can take full control of it, so those bugs don't happen.


How to add an edge ring around a hole What is the easiest way to add/extrude an edge loop around the hole in the first image to make it like the second image?

In addition to using bevel (@RobinBetts answer), you can also use Inset.

In face selection select all your geometry minus the ring of faces inside the hole, then inset I. This gives you loops on both sides of the hole.


How to make this sharp circle edge rounded? How to make this sharp circle edge in the middle (highlighted on pic2) - rounded like all the other edges of the cube? I tried "Bevel" but probably I don't master it well enough, or maybe it is the wrong tool to use...

The bevel tool is what you need but won't work properly on your model because the top of the tube lacks edges to join the vertical edges on the outside and inside of the tube. See the picture below.
To get them there, delete the polygon at the top of the tube, then select the inside circle (click on an edge with alt held down) then hold shift down while selecting the outside circle. Then bridge the edge loops. (You can press W and choose Bridge Edge Loops from the menu.)
Edit - have tried to help with the wrong edge - didn't read your question properly.
Using the Bevel tool - press Control B, then, without pressing a mouse button, move the mouse around until it starts to do something to the edge - you might need to move back and forth a bit - when you get something that looks like what you want, Left Click. If you want to use numbers or fine tune - left click then go into a Bevel menu - see bottom of workspace and click on down arrow to open menu.


How to get an event when an object is selected? I've tried to find a way to do this using handlers and events, etc. Essentially I need to know when an object is selected. This isn't a click event, or another action based on user input, but instead based on user selection.

I guess I could capture all clicks through a modal and use that to check selected objects, but that seems like overkill. Blender knows when something has been selected. I just don't know how to piggy back off of that.

EDIT

This is the modified script from the examples I could find. While I want selection eventually, for now just wanted to get something that would work. Anyone know why this script won't work?

import bpy

ob = bpy.data.objects['Cube']
def cube_location_callback(ob):
    # Do something here
    print("Cube has moved to ", ob.location)

def subscribe_to_cube_loc_change(ob):
    if ob.type != 'MESH':
        return

    subscribe_to = bpy.context.object.location

    bpy.msgbus.subscribe_rna(
        key=subscribe_to,
        # owner of msgbus subcribe (for clearing later)
        owner=ob,
        # Args passed to callback function (tuple)
        args=(ob,),
        # Callback function for property update
        notify=cube_location_callback,
    )

subscribe_to_cube_loc_change(ob)

FOLLOW UP

Since my original goal was to fire an even upon object selection, I wanted to update with a solution.

subscribe_to = bpy.types.LayerObjects, "active"
bpy.msgbus.subscribe_rna(
    key = subscribe_to,
    owner = self,
    args = (self,),
    notify = wall_selected_callback,
    )

This taps into the active object selector and will callback whenever the active object changes. This is pretty handy.

It's not what I wanted originally, which was the ability to tie back into the object itself and only fire when that object is selected. If that were available then the object would automatically know what to do when selected. With this solution the script still needs to figure out what has been selected and what the next actions is. There may still be a way to register with the object itself, but I haven't got that far yet.

A lot of people recommend using handlers for this type of usage, but the only option for this is the bpy.app.handlers.depsgraph_update_pre/post command. This can fire off a lot of extra events if all you want is to know when an object has been selected. Plus handlers seem to revolve much more around file and animation operations. Using the above is a more targeted solution.

You have to pass "location" (string) to path_resolve():

import bpy

# Callback function for location changes
def obj_location_callback(ob):
    # Do something here
    print('Object "{}" changed its location to: {}: '.format(
        ob.name, ob.location)
        )

# Subscribe to the context object (mesh)
def subscribe_to_obj_loc(ob):
    if ob.type != 'MESH':
        return

    subscribe_to = ob.path_resolve("location", False)

    bpy.msgbus.subscribe_rna(
        key=subscribe_to,
        # owner of msgbus subcribe (for clearing later)
        owner=ob,
        # Args passed to callback function (tuple)
        args=(ob,),
        # Callback function for property update
        notify=obj_location_callback,
    )

# Ensure only meshes are passed to this function
subscribe_to_obj_loc(bpy.context.object)


Round the coordinates of a model that outputs to a text file? Alright I have this:

import bpy
import decimal

blenderCipher=open('C:\\Users\\Nathan\\Desktop\\t.txt','w')

selected_objects = sorted(bpy.context.selected_objects, key=lambda obj:
obj.name) #Sort objects

for obj in selected_objects:

    xloc= obj.location.x #X coordinates of object

    round(xloc,2) #Round X coordinate to 2

    blenderCipher.write(str(xloc)) #write coordinates to text
blenderCipher.close

Although it still doesn't output rounded.

Round just returns a rounded version of your variable, it doesn't change the variable. Your code should read something like:

xloc = round(obj.location.x, 2)


How to copy Modifiers I must be doing something wrong, I select my object which has two modifiers, press space, search for "Copy Modifier", and select it. I get the error message

"The object the data pointer refers to is not a valid modifier"

I have also had no luck with copying stuff like Materials.

Searching the error message in the source code shows 3 occurances, it appears that the "Copy Modifiers" operator is only available for some freestyle settings.

blender-2.69\source\blender\editors\render\render_shading.c
            BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
            BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
            BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");

As described here Add the Same Modifier to Multiple Objects at Once? you could link the modifiers using Ctrl-L (Make Links) and select Modifiers.

Python:

bpy.ops.object.make_links_data(type='MODIFIERS')


metarig is invisible, can't see it (scale, move pose it) I'm a super newbie here. Currently using V 2.91
I started with some tutorials and stuff in youtube and it was all going well until I messed up with some configuration in the process of editing my character and now I can't see my Rig anymore. I tried searching for answers online but nothing worked. Everything seems to be fine and working but I can't manage to see the rig.
I'm going to upload the file and take a screenshot:
Blender File: https://drive.google.com/file/d/1klVfvf6Vt__D6HR9IAO5_OmDXZZaXRSh/view?usp=sharing
Thanks in advance.

A friend of mine got what I did to mess up. Really simple, for anyone that might make the same rookie mistake, on the upper right side there's viewport options and "bones" weren't selected. I just clicked and It was back to normal.


Can python scripts be used to make a simple real time game in Blender 2.8? I would like to use Blender for a python class project.  Many students are writing simple games using pygame etc.   Instead would like to write a simple game using blender+python.  But - this is a python class!  so using previous blender + game engine is not python.

So what I'm really asking is this: is it possible to write python scripts that move simple objects around and implement a simple game (eg, say, a pong game, or very simple 2D mario-like game, but within Blender so it can utilize Blender's many features and be very nice looking.

Means the script runs in real time and accepts keyboard input (no sounds needed though)

Hope that was clear enough.

thanks for any info.

Matt

Yes.
A game is an activity that one engages to have fun. By this definition a game can be made using pretty much anything.
Python is a powerful programming language and it can run in Blender 2.80. You do not need any of Blender's functions to script even a very sophisticated game in Python alone and run it from inside Blender. Blender 2.80, even though it is not designed to make games in, has a lot of functionality in general and that functionality can be manipulated using Python and Blender's Python API so there are even more tools there that can be used to create environments or situation suitable for activities one could engage to have fun. Blender is not designed for this purpose, however there is nothing stopping you from coming up with ways to have fun.
There are other questions that might be relevant to your context that might be useful to consider. For example - time needed to learn functionality of Blender and time that you will need for learning to use its Python API. Because of the amount of information we are talking about time in terms of weeks and months, possibly even years here. Learning to use Blender and its Python API can be very useful as well as a lot of fun and can bring you a lot of satisfaction and pleasure, however it might not be an amazing idea in the context of a class project, unless you enjoy unrealistic goals and failure. Another thing to consider - are there maybe better tools for the task that could be easier to learn and use for the specific purpose? There must be some reasons people use game engines to create games. Is it possible it might make more sense to look into open source game engines in your situation?


Rigid Bodies copied from one file to another don't work I'm having some issue with Rigid Bodies now. I created Rigid Body objects in a *.blend file, and when I select it and copy it with Ctrl+C, Ctrl+V into another *.blend file, it gets copied, but it doesn't quite become a Rigid Body there. I mean in the Physics panel it shows up as a Rigid Body, however, when you select it, it's not highlighted with green - as all Rigid Bodies should be - but with orange. Also, when I play the animation, it doesn't fall etc. like normal Rigid Bodies should behave.

Do you know how this can be fixed?

There are a couple of topics in this question actually, so I'm going to cover them separately.

Copying Rigid Bodies objects between files

As you did, copying is simple as Ctrl C and Ctrl V.

In my case (running 2.77 RC1) when you paste the objects they keep the highlighted green.

What this green means is that the object is assigned to a Group. When working with Rigid Bodies, Blender add them to a group named RigidBodyWorld automatically. This is the way Blender knows what objects are into the simulation.

If you don't have your objects in the group, add them manually.

In case that you don't have Rigid Bodies working simulations into your scene:

Select all the objects you pasted
Press Ctrl G
Go to the operator panel (at the bottom of the Tool Shelf) or press F6 and change the name to RigidBodyWorld.

If you have other working Rigid Bodies into your scene, add them to the existing RigidBodyWorld group:

Select all the objects you pasted
Also select one of the existing Rigid Bodies in your scene, having this last object as the Active Object.
Press Shift Ctrl G
Select RigidBodyWorld on the pop-up menu.

Making your Rigid Body World work

Now, you have all the objects into the RigidBodyWorld group and they have all they Rigid Body properties as they had in the file where you copied them. But, if you are into a scene with no simulations, they'll don't work.

When you add a Rigid Body, Blender creates a Rigid Body World automatically, but if you are copy/pasting objects between scenes, you have to active the Rigid Body World manually.

Into the Properties window, go to the Scene tab and look for the Rigid Body World panel. Activate it.

Click the Group Field and select RigidBodyWorld

Now, if you play animation, you'll see that your Rigids Bodies are working just like in their original file.

Simulation VS Animation

Just a clarification: when you paste Rigid Bodies, you are not copying their animation because there's no animation linked to them.

Animation stores within an object as keyframes, and simulation does by caching. The simulation cache is a group of files that stores the transformation of the objects in every frame. Contrary, the keyframes just store this information in some frames and Blender interpolates the movement between them.

So there's no way to copy the simulation itself into a new file by pasting the Rigid Body objects until you convert the simulation into keyframes by Baking the simulation. Here there's a question which covers that: Baking rigid body transformations


Metaball Active Element Panel is missing I've been getting to know meta balls in Blender 2.82 and often find that at some point in Edit Mode, the Active Element panel goes missing for all but one element in a family. I'm trying to understand why. Retracing my steps I started again with an empty file and added just two meta balls with drivers on the X and Y locations for each. (I don't think the driver is relevant, it's just what I've messing with when this problem arose.) Somewhere along the way the Active Element panel stopped appearing for one of the balls. I began again with a second file and have now recreated everything in the first, but the Active Element panel is still working for both metaballs. Is there anything I can do to analyse the content of each file and find out what's different?

The two blend files are here on Dropbox if anyone wants to take a look:
https://www.dropbox.com/s/waaw2ez4wjhbts5/AE%20Panel%20missing.blend?dl=0
https://www.dropbox.com/s/tewv7rxtka2gdxl/AE%20Panel%20present.blend?dl=0

Thanks

I think it's working, but admittedly in a weird and unintuitive way (and there's no visual indication of what is happening), which might be considered a bug. I've submitted a fix here.
Steps to reproduce:

Add a metaball
Deselect all (the transform panel remains present)
Switch out and back into edit mode (the transform panel is gone)
Select the metaball again (the transform panel returns)

If you are aware of how the "active" selection works with other selectable things in Blender, this behavior makes sense:

Only one object/element may be active at a time. In rare cases (e.g. there are no objects), there may not be an active object.
The active object is the "last individually select object"; that is the last one clicked on.
Deselection doesn't affect the active object.

If you try this same exercise with a mesh object, you get roughly the same behavior, but a rather less confusing "Nothing selected" message in the transform panel when nothing is selected.


Keep strips height when pressing home I am still trying to get familiar with Blender's interface, to use it for video editing.

Now, when you press the home button, it shrinks the strips in order to see the whole timeline. I would like to know if there is any way to use this option but keeping the height of the strips that i set.

There is no way to change this behaviour.

  View all Sequences Home
  Zooms the display to show all strips.

But there is a similiar command.

  View Selected NumpadPeriod
  Zooms in the display to fit only the selected strips.

This will zoom to the selection. An alternative would be to quickly select all then view selected.

A, (A,) NumpadPeriod

This will preserve the height scale.


Is it possible to have windows which are independent of the workspace? What I am looking for is the ability of having independent windows that retain their type and shading/viewport settings when I change workspace. What seems to happen is that each workspace changes each of these independent windows to the last used state (or how you defined the startup file if you are just starting Blender). Is it possible to have windows not linked to workspaces? Thanks.

The "view/area" menus have a "duplicate area into new window" which gives an independant window that is not related to the workspace.


Running a script for each frame If there is an object which has a property that which varies with each frame, would it be possible to to build a script that can access that property before each frame is rendered and thus change another property?

One way is by using drivers. Drivers allow you to calculate a value to use, this may be from other values in the same object, or from other objects. This answer provides examples. Also consider that drivers may be disabled by the user.

Another way is to setup a handler function. You could choose between using frame_change_post or a render_pre. You simply define your function and then append it to the handler list, then remove it when it is no longer needed.

def my_handler(scene):
    val = scene.objects['Cube'].location.x
    scene.objects['Sphere'].location.y = val + 1.6

def register():
    bpy.app.handlers.frame_change_post.append(my_handler)

def unregister():
    bpy.app.handlers.frame_change_post.remove(my_handler)


Manipulator widget appearing where the 3d cursor is Something weird is happening where the manipulator arrows moves where ever the 3D cursor is. I don't want this.

You have set the Pivot Point to the 3D Cursor:

Simply go to the menu and select whichever you want to use (most likely Median Point).


Python SCript - 'NoneType' object has no attribute 'vertices' I have several pieces of geometry, seemingly imported from some parametric modelling tool. They all have an ".ipt" in their object name.
My original goal was to write a script that goes through all the objects in the scene, gets the object's dimensions, counts the number of vertices in a an object, compares it to the same parameters in the active object, and replaces object data if it finds a match. To that end I wrote the following:

from bpy import context

scene = bpy.context.scene

actob = bpy.context.selected_objects[0]
actobdat = bpy.context.selected_objects[0].data
ob = bpy.context.object
dimact = actob.dimensions
conapp = 0.007
actobvert = len(actobdat.vertices)

for ob in scene.objects:

    dimob = ob.dimensions
    obvert = len(ob.data.vertices)

    if abs(dimact[1] - dimob[1]) < conapp and abs(dimact[2] - dimob[2]) < conapp and abs(dimact[0] - dimob[0]) < conapp and actobvert == obvert:

        ob.select = True
        ob.data = actobdat

In response to this I received the following error message:
AttributeError: 'NoneType' object has no attribute 'vertices'

I did some searching online, but still failed to solve the issue.
Any help would be greatly appreciated! Thank you!

It says 'NoneType' object has no attribute 'vertices', so it can be an empty that is being selected. You must check that the objects are meshes:

actob = bpy.context.active_object
if actob.type == 'MESH':
    actobdat = actob.data
    dimact = actob.dimensions
    [...]
    for ob in scene.objects:
        if ob.type == 'MESH':
            dimob = ob.dimensions
            etc...

You use bpy.context.active_object to get the active object, the index 0 of selected_objects will give you the last object added to the scene within the selection.


How to make the strings of a guitar connect with the pegs? I need to make the strings of my guitar and I have a problem with the part where the strings connect with the pegs. I need to make the string go around the pegs. Should I make them step by step the classic way without modifiers or is there an easier way?

Well you could use curves with a curve modifier and an Array modifier

Add Your curve:

Adapt your curve:

Add a new cylinder and assing it a curve modifier and an array modfier:


Image texture is not applied on the hairs when I reopen Blender (2.8) I'm trying to texturize the hairs of the 3D character using the projection painting tecnique. At the beginning the hairs are separated objects from the body. Then I spread the texture taken from a picture over their surface and finally I attach them to the rest of the body and I save the file.

But,when I reopen Blender (2.8),the base color is applied,but not the image that I want. I tried to join the objects in two ways. Before I have selected the hairs and then the body and I have joined them,but it didn't work. Then I tried to select before the body and then the hairs and I have joined them,but also in this case the image texture is not applied when I reopen the file. What's the solution here ? You can see what I did going here.

If you make sure your UV map is clean enough to paint, then you can paint and then save the image to disk so it will keep the changed pixels. Using the image texture through an image texture node, you can specify the uv map to use so that it stays put in case you have multiple uv maps for other materials in your object.


BGE: Adding an object linked from another file I'm adding an object to my scene using bge.logic.getCurrentScene().addObject("Object Name"). But the object I want to add is linked from another file and the scene it's being added to is linked to a .blend controlling everything. Due to that I'm getting an ValueError saying that the requested name "ObjectName" did not match any KX_GameObject in this scene.

So how can I add the object from the other file or is there another way around it? I also uploaded a .zip containing 3 .blends: a library containing the group, a level (the group from the library is linked to it) and the main control .blend controlling everything. The level scene is linked to it. Here's the link.

I just reproduced a working example with two files, see the sceenshot below:

The left file is the library, containing an object "Suzi" which is part of the group "grpSuzi". I set up some simple rigid body physics here.

The right file is the "game", containing an empty named "spawn" which has the logic attached as seen in the screenshot. I added the "grpSuzi" on Layer two in this file. It made no difference whether I wrote "Suzi" or "grpSuzi" in the addObject() call. Once I pressed "P" in the game file (right) and the spacebar, the mesh appeared (twice).

But once I misspelled the name like "Suz", I ended up with the error you described. Are you sure there is no typo?!


Keyframe between frames How do I set a key frame between 2 frames? The reason I want to do this is because I want to render in different frame rates without needing to change every time and some objects start and stop between frames. Do I have to scale everything up by increasing the frame distance between key frames, change the output framerate scaling and finding the lowest common denominator?

I don't think that's possible.

What you can do, however, is scale your entire animation to create more frames in between the existing ones.

Enter the graph view and move the time cursor to 0. Then select everything and press . (to scale relative to the cursor) followed by S X 2 to scale by a factor of 2 in the X direction (i.e., along the time axis).

You can then adjust the project's frame rate, modify the frame steps (in this case double it) and etc. to get it playing at the right speed.


how to create a pine cone Mathematically Ideal Non-Transitive 3D Printed Pine Cone(s) is the idea for the new year gift, problem: abysmal maths and python knowledge. There are a lot of 'that script can do (a lot of complex maths things) and by this you can do (a lot of another strange words)', but it doesn't look too helpful. Create it manually petal by petal isn't so efficient way i assume. Please, step-by-step instructions of the process (if it include math - please explain how it works) if possible, thanks.

You can model a pine cone-like shape using icospheres and vertex bevelling.

Add an icosphere (Add > Mesh > Icosphere). In Edit Mode, select the topmost vertex, turn on Proportional Editing (O), and translate up (G > Z). Use the Mouse wheel to increase the size of the proportional editing influence area as needed, until you get an egg-like shape.

Select all vertices (A), then bevel the vertices into hexagonal faces using the shortcut CtrlShiftB. Try to scale the faces until they are as large as possible without overlapping each other.

Select all faces except the few on the bottom, then extrude the faces individually (Tools Shelf > Mesh Tools > Add > Extrude Individual).

With the extruded faces still selected, change the pivot to Individual Origins (through the menu at the bottom of the 3D viewport screen).

Scale the selected faces down in the Z axis to flatten them a bit (S > Z).

Change the pivot point back to Median Point.

Turn off proportional editing (O) and move the selected faces up a bit (S > Z).

Add a Subsurf modifier with at least 2 subdivision levels (Properties Window > Modifiers > Add Modifier > Subdivision Surface), and change the shading to smooth (Tools Shelf > Edit > Shading > Smooth).

If you want a slightly more twisted version, experiment with adding a Simple Deform Modifier in one of the steps along the way:


Share Object Data Without Copying Transformation Let's say I have two objects and I want them to share the same editing data. Usually you would go the Data tab and connect them by selecting one from the drop down list. The problem is that it also copies the original object's transformations, which I don't want.

Here is an example of what it should NOT be doing. I don't want it to turn the bottle back upright. Any idea it is possible to share data without sharing transformations?

I know duplicating the bottle with Alt+D and then rotating it will work. The problem is I've already duplicated a lot of bottles with Shift+D and moved them into place. Wouldn't want to redo all this moving work.

Afaik, linked duplicates do not inherit "object mode" transformations, only "edit mode" (ie: "editing data") ones.  So, if you wish to use the same "editing data" for another object, just select thew same "mesh data", and transform your duplicates only in object mode....

or maybe I didn't get what you mean...


How to rig a switch to swap a bone's parents? I'm trying to figure out how to use Child of constraints to swap a bone's parents when pulling a bone switch. This is a simple enough task when done manually, as shown below:

But I run into problems when trying to set up the drivers to have the switch swap them. Setting up the constraint for Parent 1 is easy:

This makes it so that the when pulled, the Switch bone controls the influence of the Child of_1 constraint from 0-1 when moved in the positive Y direction. But to pull off what I want done, I need the Child of_2 constraint to start at 1 influence, and move to 0 when the switch is moved. How can this be done?

Use Python expression to do that :

Let's say the switch bone change the influence when its Y location is more or less than zero.

Add a variable to the driver which is based on this location, then use its value in a scripted expression, here "var > 0" which returns the value "True" (equal to 1) if var is positive and returns "False" (equal to 0) if var is negative.

For the second driver, do the same, but with an expression "var <= 0" to have the opposite values in return.
You can also choose to say "var < 0" if you want that none of the parent influences the child when exactly 0.

In result :

Note : when you validate something in the second driver, Blender switch back the selection to the first driver... a little bug maybe. So beware at which one is selected in the drivers panel, all the time.


ATI Radeon HD 7770 no GPU rendering? So I don't have an option to turn on GPU rendering in settings. I only have the option for CPU rendering.
Here's my specs:

ATI Radeon HD 7770 1GB  GDDR5 1GH
AMD Phenom II 4x 960T 3GHz
4Gb DDR3 1600MHz RAM

My GPU driver is version 13.9.
I see people running fine with this GPU, but for some reason I don't have an option to turn it on.

I need to deliver my design tomorrow so I need this fast and CPU just can't render it that fast.

I'm running Blender 2.69 on Windows 8.1.

OpenCL isn't fully supported yet (which is what AMD/ATI cards use to render):

  Cycles has two GPU rendering modes: through CUDA, which is the
  preferred method for NVidia graphics cards; and OpenCL, which is
  intended to support rendering on AMD/ATI graphics cards. The
  implementation of OpenCL is only in an experimental stage and disabled
  in official builds. (source)

You could try to find a build on GraphicAll, but there is no guarantee it'll work.

I would recommend just rendering it on CPU. If you are really pressed for time, there are a few things you can do to speed things up:

Set the size of the tiles lower (Render Tab > Performance). The CPU renders faster if the tiles are smaller (GPU renders faster on bigger tiles).
Set the threads to fixed and set them as high as possible (Render Tab > Performance). This will make Blender use more threads which will speed up the render.
Turn the samples down. It's fairly easy to remove a few fireflies later on in compositing, and will speed up your render time a lot.


Simulate the effect of light over time I would like to simulate the effect, that has light, over a periode of time on an object. For example on the begining of my animation my wooden object looks bright and new and on the end of the animation it is darker. For that I only changed the texture color during the animation. Now my problem is, that my Model ist quite complex and ther are parts, that are kompleatly hidden and shhould not be efekted. I would like Blender to automaticly detect, whitch parts of my object are being more exposed to the light and just darken that. Is it possible? I thought of maybe somehow using the ambiente oclussion?
It will be a Film. It does not have to be in the material, but I just do not know how to do it. I have this image, where the edges are dark, becouse of an another object, that was covering it and only the edges were exposed to light. now in the beginig of the animation the whole face shold by the same color and during the animation the edges should get darker

Thanks

You can simply bake the light/shadows and then use them as a mask.

Bake a Combined Pass (default settings work fine)
Use the resulting BW texture as a mask for a MixRGB node
Done

Have some tan Suzanne...


How to create faces connecting a curved area I want to fill this area, and I'm selecting all of the edges and press the key f, it's not as expected. It looks horrible and not filling.

I tried to see which vertices are connected and it shows that 3 vertices at the other end of the model is somehow connected and I really cant figure out how that happened! In the picture below, you can see the result of choosing one of the vertices down at the bottom -> shift + G -> Amount of connecting edges.

The thing is, when I show numbers on the vertices, it doesn't make sense either as the numbers skip at some places which might be the problem of my mesh. But now it's happened 3 times, starting from scratch each time.

What am I missing? and is there a way to save this?

I hope I've made myself clear, but it's kind of a hard problem to describe. Feel free to ask if you need more information!

You can connect the vertices manually.
This will also create proper topology, which is nice.

Select two vertices and go Vertex > New Face from vertices, F
Repeat, repeat repeat until it's filled
Done :).


How do I stop Blender from automatically creating floating windows? Is there any way to stop Blender from showing the file explorer, Preferences and Render results in new floating windows and just show those editors as part of the inerface?

I assume you're looking for fullscreen by default.

Open a new blank file. Go to Window > Toggle Fullscreen Window. Then, go to File > Defaults > Save Startup File

Edit:

To stop renders and file browsers from popping up in new windows, go to Edit > Preferences.

Then select Interface > Editors > Temporary Windows.

Keep User Interface will not make any changes to the user UI when you press render. If there is an Image Editor set to Render Preview open, it'll display in there.

Fullscreen will replace your current window with a fullscreen render preview/file explorer.

Image Editor will replace the current editing window to an Image Editor set to render preview (for ex. your default 3D viewport will be switched to Image Editor it that was open)

EDIT 2

If you want to keep the current interface without any floating windows all you need to do is change the editor type or Toggle the active window, by selecting it on the top left, or selecting the shortcut of the editor you want. The file browser is Shift+F1. To go back to the 3D viewport press Shift+F5. Rendered images will be in the Image Editor or Shift+F10

To toggle the current active window into the preferences window you need create a new shortcut (version 2.8 has no pre-assigned default).

To edit the preferences and add a new shortcut:
Open the preferences window>keymap open the window section. Press on Add New to a new shortcut :

Type screen_space_type_set_or_cycle and select a combination of keys of your choice (in previous versions of blender it was Ctrl+Alt+U) and select the preferences window as "type" on the bottom left.

Then Click on the top right of the screen to show the option to save the preferences to make the change permanent.


How do I permanently add materials to Blender using Cycles? I open Blender and set Render to Cycles. I have downloaded many materials to my computer. To use them in a project I Append and choose a file with materials and append 9 or 10 materials. They show up and I apply chosen ones to my models. I save my project and close. I start a new project and go to choose a material and there are no materials in the file. Why don't the materials that I appended before stay there? Do I have to do this process every time I start a new project or is there a way to keep the materials I appended? The projects are not related but I would like to have all materials available without having to Append in every new project.

Keep in mind that I am new. Is it possible that Append isn't what I'm looking for? whatever way I need, my point is to get materials into Blender so that they are always available. Thank you.

Append imports the materials into you current scene, so it is project related. Yes, you will have to append them every time this way.

The solution I'd use in this situation is to append them to the default scene and save the edited default scene as the new default startup file (google how to do this, its easy). When you start Blender, the scene will be loaded with the added materials.

Make sure that you make the materials persistent by hitting the "F" button. Blender deletes unused materials on close if they are not persistent. The button will add a "fake user" and the material won't get deleted.

Here some post that could help you out:

Changing startup file

About the "F" and the "2" button in material panel


Can't find materials in .blend file I downloaded a material from http://matrep.parastudios.de/index.php. By my understandings you just need to download the .blend file, open your project, go to append and find in the .blend file the material. But when I open the file, it's empty.

Maybe anyone had this problem and can help me out? Maybe I'm missing something.

I tested downloading a material there myself, and had similiar problems like you. Neither appending nor linking were possible. On opening the file itself, blender complains about File format is not supported. So I guess you just have to look for another material. Maybe this site is outdated.

Try this link: Resources for blender.


Black reflections at extreme angles with glossy shader on smooth surfaces How do I remove them?

They don't appear when using flat shading.

Nothing in the scene can cause this.

The problem occurs in smooth shading because it changes the way the shading is calculated across the surfaces, giving the illusion of a smooth surface even if the angle between the faces is sharp.

To correct that, add edge split modifier while all faces are set to smooth shading.


How to get dynamic updating of quad views on multi-monitor screen? I'm using blender 2.79 on Ubuntu 18.04 with a dual monitor setup. I currently have my left monitor set as the main 3D view and the right one set to quad-view.

When working on a model I normally glance at the quad-view to check that everything is where they need to be. The view on the quad-view is static however... If I were to work on a different section on my main 3D view, I would have to manually set the views on the quad-view to center on the section I'm currently working on.

I noticed there is an option to lock views to the 3D cursor. This works somewhat, but not as pleasing as I need it to be.

Ideally I would like to know if there's some way I can make the quad-view to always lock on to the active object, kinda like a perma-numpad . on all quad-views.

Thank you all in advance.

You could link the location and distance of your main 3d view to the quad views with Python using scene_update_post handler. The good news is that it updates the quad views every time you navigate, the bad news is that it updates the quad views every time you navigate. :) This does what you need, but also requires some processing power pretty much constantly:

import bpy
from bpy.app.handlers import persistent

for w in bpy.data.window_managers[0].windows: # let's find what's what
    for a in w.screen.areas:
        if a.type == 'VIEW_3D':
            if len(a.spaces[0].region_quadviews) > 0: #if quadviews are active
                quad_views = a.spaces[0].region_quadviews
            else:
                main_view = a.spaces[0].region_3d

@persistent # This makes it stay if another file is opened
def update_handler(dummy):
    for every_view in quad_views:
        every_view.view_location = main_view.view_location
        every_view.view_distance = main_view.view_distance

bpy.app.handlers.scene_update_post.append(update_handler)
#bpy.app.handlers.scene_update_post.remove(update_handler)

You could just use it as an operator assigned to some shortcut so it only does it's thing once when you press a button:

bl_info = {
    "name": "Quad View Updater",
    "author": "Martynas Žiemys",
    "version": (1, 0),
    "blender": (2, 79, 0),
    "location": "shift + num .",
    "description": "...",
    "warning": "",
    "wiki_url": "",
    "category": "3d View",
    }

import bpy

class ViewSelectedPlusQuadViews(bpy.types.Operator):
    """View Selected Plus Quad Views"""
    bl_idname = "3d_view.view_selected_plus"
    bl_label = "View Selected Plus Quad Views"

    @classmethod
    def poll(cls, context):
        return True

    def execute(self, context):
        #bpy.ops.view3d.view_selected() #Maybe center selected before?
        for w in bpy.data.window_managers[0].windows: # let's find what's what
            for a in w.screen.areas:
                if a.type == 'VIEW_3D':
                    if len(a.spaces[0].region_quadviews) > 0: #if quadviews are active
                        quad_views = a.spaces[0].region_quadviews
                    else:
                        main_view = a.spaces[0].region_3d

        for every_view in quad_views:
            every_view.view_location = main_view.view_location
            every_view.view_distance = main_view.view_distance
        return {'FINISHED'}

addon_keymaps = []
def registerKeymaps():
    wm = bpy.context.window_manager
    if wm.keyconfigs.addon:
        km = wm.keyconfigs.addon.keymaps.new(name='3D View Generic', space_type='VIEW_3D')
        kmi = km.keymap_items.new('3d_view.view_selected_plus', 'NUMPAD_PERIOD', 'PRESS', shift=True, alt=False,ctrl=False)
        addon_keymaps.append((km, kmi))

def unregisterKeymaps():
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
addon_keymaps.clear()

def register():
    registerKeymaps()
    bpy.utils.register_class(ViewSelectedPlusQuadViews)

def unregister():
    unregisterKeymaps()
    bpy.utils.unregister_class(ViewSelectedPlusQuadViews)

if __name__ == "__main__":
    register()

You could save this to a file with .py extension and install it as an add-on.

I tried to detect changes of the active object with scene_update_post handler and then view selected in the quad views, but it seems there is some bug in Blender and working with bpy.context inside the handler crashes Blender. So if you wanted to center the quad views I can only offer a method using a keyboard shortcut. There should be a way to do it automatically, but the bug prevents it. If someone is interested in this, here is the code that crashes.

You can copy this into a .py file and install it as an addon to be able to view selected in all quad vies with Shift+Numpad .:

bl_info = {
    "name": "View Selected in Quad Views",
    "author": "Martynas Žiemys",
    "version": (1, 0),
    "blender": (2, 79, 0),
    "location": "shift + num .",
    "description": "...",
    "warning": "",
    "wiki_url": "",
    "category": "3d View",
    }

import bpy

class ViewSelectedInQuadViews(bpy.types.Operator):
    """View Selected In Quad Views"""
    bl_idname = "view3d.view_selected_quad"
    bl_label = "View Selected In Quad Views"

    @classmethod
    def poll(cls, context):
        return True

    def execute(self, context):
        context = bpy.context.copy()
        for w in bpy.data.window_managers[0].windows: # let's find what's what
            for a in w.screen.areas:
                if a.type == 'VIEW_3D':
                    if len(a.spaces[0].region_quadviews) > 0: #if quadviews are active
                        for every_region in a.regions[4:]:
                            override = context
                            override['window'] = w
                            override['area'] = a
                            override['region'] = every_region
                            bpy.ops.view3d.view_selected(override)
        return {'FINISHED'}

addon_keymaps = []
def registerKeymaps():
    wm = bpy.context.window_manager
    if wm.keyconfigs.addon:
        km = wm.keyconfigs.addon.keymaps.new(name='3D View Generic', space_type='VIEW_3D')
        kmi = km.keymap_items.new('view3d.view_selected_quad', 'NUMPAD_PERIOD', 'PRESS', shift=True, alt=False,ctrl=False)
        addon_keymaps.append((km, kmi))

def unregisterKeymaps():
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
addon_keymaps.clear()

def register():
    bpy.utils.register_class(ViewSelectedInQuadViews)
    registerKeymaps()

def unregister():
    unregisterKeymaps()
    bpy.utils.unregister_class(ViewSelectedInQuadViews)

if __name__ == "__main__":
    register()


Mesh disappears in BGE I´m creating a FPS game, but an error is occurring when I start the game. My person is disappearing.

In the 3D View, everything appears normal.

But in BGE, it disappears.

Note: I´m using 2 .blend files, with textures. I don´t know if it is related, but I need help.

I tried to Flip Direction, Recalculate UV, etc. but it doesn't work. Why?

In my case, my character does not appear because it was restricted for rendering (or invisible for rendering)

Bad configuration:

Bad result:

Good configuration:

Result:

The solution is "Restrict rendering"

Good Luck!


How can I add a second texture apart from the one I'm using with displacement modifier? I'm trying to work my way through the desert tutorial by Andrew Price. I have a landscape with a displacement modifier with clouds texture (Type:Clouds). So my landscape has already one texture assigned to it. Now I added some grass with particles and I'm trying to add a material to that grass (particle system is assigned to the same landscape). In the tutorial the grass material is based on a another texture (Type:Blend). The problem is that I can't add a second texture - I can only modify the texture which is used by displacement modifier.
The main reason for this problem is that Andrew is using Blender internal renderer and I'm using cycles.

So the question is: is there a way in cycles to add second texture (Type:Blend) without deleting/modifying the one assigned to displace modifier (Type:Clouds)?

Yes of course you can still have different textures when using cycles. However that way you add them, and access them is a little different.

When you are using cycles you no longer start your texture in the texture tab of the properties window (like how you had to do it for particles), now much like the displace modifier there is a button to jump right to your texture.

Now for the particle system, you do much the same thing as for the displace modifier.

Go to the particle tab and add a new texture.

Click on the "Show texture in texture tab" button. (You could also go to the texture tab your self, more on that in a bit.)
You are now editing the texture for the particles, set what ever influences you want.

The texture tab works a little differently then when you are using the blender internal.
In cycles all the textures are nicely broken up by category, and you can edit any of them at any time.

While you can make new textures and assign them to different uses (say I make a new texture for the displace modifier, I can switch right in the texture tab.)
However you can not add new texture uses from the texture tab. So if you do not already have the displace modifier using a texture you can not assign a texture to it in the texture tab.


Issue with Renderman and Blender 2.75 Earlier today, I was able to enable Pixar's Renderman add-on for Blender 2.71. I then decided to update to Blender 2.75, but when I tried re-enabling Renderman, I got this message:

Anyone know why?

I had the same problem, but when I updated renderman 19 to 20, my problem was solved.


Is there a good workflow for creating 'swappable' linked characters? We're creating an animated scene that features lots of simple characters based off the same model. We'll vary them a bit (some male, some female and with different colours and clothes etc), but they all have similar proportions and are linked to the same armature in the master file.

They look a bit like the above.

What we want to be able to do is to embed these characters into a different blend file where we'll pose and animate them. They'll be placed in the scene and animated individually as opposed to say a crowd simulation, we'll do this using linking and making the armature a proxy so that we can continue working on the characters once we've added them.

Our hope was to be able to easily 'swap' a character for a different looking one once we've added them to the main scene and started animating etc.

Originally we hoped to be able to bring in all of the characters as linked collections, all parented to the same linked armature (made proxy), and we could simply show and hide each character if we wanted to change the appearance of a particular one. However when we tried this, only one of the characters we'd brought in was parented to the armature, the rest were unaffected.

I was hoping someone could offer a workaround for this so that the linked characters behaved as they do in the original blend file (i.e all parented to a single armature), or perhaps suggest a different solution altogether.

The aim again is to make it as painless as possible to switch one character for another once they're already animated.

We're using blender-2.80.0-git20190605.e80cbdac331a-x86_64

Note: we need the characters to be linked in from a separate blend file since we'll have multiple people working on the project simultaneously.

Thanks

We managed to solve our own problem. It turns out that all we needed to do was turn the mesh object into a proxy, as well as the armature (which we were previously leaving as linked). Doing so allowed us to specify (for example) that Instance A should be parented to Armature A, and so on.

From there we duplicated the characters and their armatures ‘as linked’ within the main scene, to make multiple versions of each character, this gives lots of different characters that we can pose individually, all of which are instances of a single original character so that when we make changes it propagates to them all.

Swapping a character out once we’ve started animating is easy too, all we have to do is create a new instance of the character we want to switch to and set it to use the desired armature in the armature modifier.


How to scale all key frames in a layer of grease pencil? While animating in grease pencil Blender,
I need to scale all key frames in a layer at a time.

I cant find any option to do so.
Is it possible in grease pencil to enlarge all key frames with same percentage?

If you parent your grease pencil to an object - in this example an empty - the children will follow the scale that mum or dad tells them to do...


Converting GUI operations to Python code? If I start building my scene from scratch using GUI (read: clicking buttons), will I be able to automatically obtain the equivalent Python code that achieves the same end results?

This is a really cool feature that sounds definitely doable, but not sure how to do it.

Most actions you perform will have the operator used listed in the info view, just expand the top most editor in the default screen, you can then select and copy any of these steps and paste them into a text file that you can run like a macro.

While this is an easy way to get started and works fine for simple tasks, it is often recommended to avoid operators in scripts, search here for operator performance to see discussions on the best way to do things. You will also find some steps will have better alternatives than listed in the info window, for example bpy.ops.object.editmode_toggle() is shown in the above list, you will find it better to use bpy.ops.object.mode_set(mode='EDIT') as you clearly change to the mode you need rather than toggling from a random mode when you run the script.

As you learn using python in blender you can start making your own operators, add them to your own addon which can be setup to bind them to shortcuts or custom menus.


Bending a chain without deforming the links? So, I've done the anchors on my ship, but the chains needs to be bent around the winch at the bow. How would I accomplish this without actually bending the links?

Kind Regards

Skull Kid

Solved! I used DupliFrames. By selecting the chain links, I used parenting (selecting by Right click on the chain links, then selecting the curve and parenting it to the chain links with Ctrl+P and choosing Follow path). Then you can go to the Object tab. under Object, find the Duplication tab, open it and choose "Frames". Then play with the settings to get the best result. To get it to follow for example, a Bezier curve. Select the object you want to follow the curve and go to Object in the 3D view panel. Then in that menu, choose Clear > Origin (or simply select the object you want to follow the curve, and choose Alt+O).