Advice on how to approach scene involving zooming down to atomic scale? The animation I'm planning involves zooming in on a stainless steel ruler all the way down to the atomic structure in a single shot which would involve passing through the following levels of detail:

Shiny brushed stainless steel ruler with numbers and markings as additional texture (photo realistic).
Etched depressions that make up the markings.
Scratches / pitting that make up the brushed texture.
Grain boundaries* (see note below).
Packing of atoms within the crystal grain.
Individual atom within a crystal grain (fuzzy ball of questions & confusion).

*note: steel at the atomic level consists of grains of crystal clumped together where the atoms that make up each grain are arranged in an orderly matrix, the grain boundaries are where the axis of the different grains don't line up.
So my question is what plugins and techniques can people suggest to accomplish this as painlessly as possible.
I'm thinking I may be able to approach it by modelling a large enough patch at each detail level to just fill up the camera and then somehow stealthily transition between the texture at the larger level and the detailed model at each stage as the magnification increases.
Alternately via the python API generating a dynamic texture dependent on the current zoom level of the camera something like a fractal texture [just spit-balling here - haven't even looked at the API yet].

You will have to blend two shots together. Its most likely impossible to get the geometric level of detail at the atomic scale that will work for a macro shot. I would model the scene with the ruler, with some textures etc.

Then add some procedural textures for pits, scratches, etc. That way we can continue to zoom in without becoming pixellated.

Next model a completely different scene that is molecular in scale and have a zoom animation in both scenes that match up. Once your first scene gets close enough, start blending into the second screen. You could use the compositor, or maybe just a plane in scene 2 that has a texture of the rendered video from scene 1. As you get close in on scene 2, adjust the transparency of that image plane.

Good luck!


How to calculate mean twist of a curve? Similar to this, But i want a slider that adjusts the mean twist of the curve. As stated in that post the content I need is defined outside of Python API, I and would have to write an operator to do it. I can do that, but I need to know how to do the calculation for the mean twist.

I figured it out. I made a FloatProperty and put the function I was going to write as the update:

bpy.types.Curve.mean_twist = FloatProperty(name='Mean Twist', step=10.0, default=mean, unit='ROTATION', update=get_twist)

Then I wrote the function which got the average tilt of all the points, subtracted that from the floatproperty to get the difference after the change, and added that to all the tilts: tilt + (floatproperty-averagetilt)

def get_twist(self, context):
    cur = bpy.context.active_object.data
    points = cur.splines.active.bezier_points
    rot = cur.mean_twist
    tilts = [p.tilt for p in points]
    mean = sum(tilts)/len(points)
    new_twist = [t + rot - mean for t in tilts]
    points.foreach_set('tilt', new_twist)

Then I just added the float property to a panel as a slider. It changes the actual mean twist and works in Object mode.


Rigify is using all Layers I'm curious about a problem (?) that I'm having with the rigfy add-on.
First of all, I have this model with the meta-rig adjusted

Until this moment is everything normal.
But when I click in the generate buttom, all the layers are occuped:

The configuration that (I think) is responsible for the layers occuped is se as default:

I think this is a problem because in the videos I saw it didn't occurred.
Someone knows about this (little?) problem?

I'm using blender 2.74.

Sorry for my poor english and, since now, thanks.

Bone layers  are different from object layers.
As i can see from your screenshot, Rigfy has correctly put the bones in different bone layers, to help selection groups when animating, but the "problem" you point at is the fact that all object layers appear "occupied".
You can go to the outliner window (or create one), change the pop-up menu from "All scenes" to "visible layers", select one object layer at time and read in the outliner what's inside, to understand the thing, that - I don't think - is produced by Rigify.

Also, before pushing the "generate" button, apply the scale (Ctrl A) to both your model and the meta-rig.


Create and export bounding boxes for objects I am using Blensor v2.67. I have a camera and several objects in my scene. The camera follows a path and I would like to save what the camera sees for each frame. Among other things, I would like to save the (oriented) bounding boxes of my objects. I did some research, but I believe Display bounding box around objects only displays the bounding boxes and in Save the bounding box position of an object in a text file the requirements seem to be different (2D, moving object,...). Any answer on how to do this will be greatly appreciated! Is there inherent functionality to do this or do I need to include a custom script?

From my answer here, you can create a bounding cube around an object:

  Select the target object and press CtrlShiftAltC > Origin to goemetry, and then press F6 and select bounds center.
  With the target object selected, press ShiftS> Cursor to selected to move the cursor to the objects origin.
  Add a cube to be the bounding box. It will automatically be centered at the 3D cursor, which is snapped to the target object's
  origin point.
  Copy the Dimension and Rotation values from the target object to the bounding cube. These values are located on the Properties
  region (N in the 3D view):

  You can quickly copy and paste values by hovering over the number
  field and pressing
  CtrlC/CtrlV accordingly.

  Since this process of copying and pasting the values of each channel
  can be a bit tedious, you can use a quick bit of python to do this for
  you:

import bpy

active = bpy.context.active_object
selected = bpy.context.selected_objects

for obj in selected:
    obj.dimensions = active.dimensions

  Parent the bounding box to the target object so the relative location, rotation, and scale is kept the same. You can also set the
  bounding cube's Draw type to Wire in Properties > Object >
  Display > Maximum Draw Type.

This processes could be automated in python:

import bpy

selected = bpy.context.selected_objects

for obj in selected:
    #ensure origin is centered on bounding box center
    bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY', center='BOUNDS')
    #create a cube for the bounding box
    bpy.ops.mesh.primitive_cube_add()
    #our new cube is now the active object, so we can keep track of it in a variable:
    bound_box = bpy.context.active_object

    #copy transforms
    bound_box.dimensions = obj.dimensions
    bound_box.location = obj.location
    bound_box.rotation_euler = obj.rotation_euler

This adds a bounding box object for every selected object.


degrouping stl file objects on blender I have imported an stl file to blender and its separate objects I can`t figure  out how to deselect the objects.

I have tried all the selection and deselection option
s
The file was made on 123D
this is the STL file I imported to blender and I want to un-group the highlighted objects any suggestion thanks?

Use the Separate function.

Enter Edit Mode (Tab)

Highlight (select) the object you are breaking apart, press space, type "separate" (or use the keyboard shortcut P) then pick "Loose Parts" from the list of options.

To help you select the parts, you can select one vertex of or the specific item you want to separtate and press CtrlL to select all of the connected vertices. Then separate using P

A different way to select different parts is using Box select (CtrlB


Full UV wrapping on a mirrored Mesh I have an object with a mirror modifier in X and Y direction. Is it possible to unwrap all the 4 quadrants as a big single UV map and then have this UV map to apply to the object as it was a single non mirrored object (Same as apply in the mirror modifier), without using the Apply button first?

I wan't to be able to edit the mesh with the Mirror modifier later on, but have the UV map seeing it as one single object.

Yes, this is possible (out of the box).  The mirror modifier has a mirror UV option, so you can mirror either the U or V (or both) texture coordinates.  So for example, you can model the left hand side of a head with the mirror modifier enabled for X and U.  Then unwrap it to the left-hand side of your texture.  The mirrored right-hand side of the mesh will have its UV co-ordinates on the right-hand side of the texture, so you can have something different there, e.g. a scar drawn on the texture's right cheek which appears on the right cheek of the mirrored model.


HDR background rendering in view-port but not in final render? I've looked at other threads about this and they say to toggle transparency under film. It still doesn't do anything and I just have no idea why this won't work. My blend file.

View-port render

Final render

That big plane - Plane.011 was turned off in display but not from rendering. So it occluded the reflection. You can also hide its influence in a scene by altering the object's Cycles Properties. I often turn off Camera Rays for lights so they can be in the frame but not in the shot.


Handler Function doesn't update Text Object in 3d_View The script below uses a handler function to show the current frame on the Text_object (every 10 frames) in 3d_view.
Tried assigning current_frame to text object in 2 ways:
1.With context.object.data.body
2.Updating text from Edit mode with editmodetoggle()
Both , Frame and Scene are being updated with their respective handler functions.
However, in both cases the handler function is not entirely getting executed and the Text in 3d_view  doesn't update
How to resolve this?
# SCRIPT -->  SHOW CURRENT FRAME (EVERY 10 FRAME'S) IN 3D_VIEW

import bpy

scene = bpy.context.scene
obj_active = scene.objects.active
obj_ops = bpy.ops.object
font_ops = bpy.ops.font
handlers = bpy.app.handlers

frame_current = scene.frame_current
obj_active = bpy.data.objects["Text"]

from bpy.app.handlers import persistent
@persistent
def frame_change(scene):
    frame_end = 200
    print(frame_current ," = script start")

#ATTEMPT 1---------------   UPDATE TEXT.DATA.BODY   --------------
    if frame_current <= frame_end:
        if frame_current % 10 == 0 :
            obj_active.data.body = str(frame_current)
            print(frame_current ," = TEXT UPDATED")  #Function not getting executed
    print(frame_current ," = script end")

#ATTEMPT 2----------------     EDIT TEXT FROM EDIT MODE    ------------------
#    if frame_current <= frame_end:
#        if frame_current % 10 == 0 :
#            obj_ops.editmode_toggle()
#            font_ops.delete(type='ALL')

#            text_frame = str(frame_current)
#            font_ops.text_insert(text = text_frame)
#            obj_ops.editmode_toggle()
#            print(text_frame," = FRAME CHANGE")

def register():
handlers.frame_change_post.clear()
handlers.frame_change_post.append(frame_change)
bpy.app.handlers.scene_update_post.append(frame_change)
handlers.load_post.append(frame_change)

def unregister():
    handlers.frame_change_post.pop(frame_change)
    bpy.app.handlers.scene_update_post.pop(frame_change)

if __name__ == "__main__":
    register()

##########################---------- EDIT 1 -------##########################
Tried @batFinger's script but Text doesn't render in 3d_View (even if script runs in console )

import bpy
from bpy.app import handlers
from bpy.app.handlers import persistent

@persistent
def frame_change(scene):
    frame_current = scene.frame_current
    frame_end = 200
    obj_active = scene.objects.get("Text")
    print(frame_current ," = script start")
    if obj_active is None:
        return # no font object named "Text"
    if frame_current <= frame_end:
        if frame_current % 10 == 0 :
            obj_active.data.body = str(frame_current)
            print(frame_current ," = TEXT UPDATED")
    print(frame_current ," = script end")

def register():
    handlers.frame_change_post.append(frame_change)

#ALSO TRIED  THE BELOW COMMAND'S BUT NO RESULT
#    handlers.render_post.append(frame_change)
#    handlers.scene_update_post.append(frame_change)
#    handlers.load_post.append(frame_change)
#    handlers.frame_change_pre.append(frame_change)

def unregister():
    handlers.frame_change_post.remove(frame_change)
#    handlers.render_post.remove(frame_change)
#    handlers.scene_update_post.remove(frame_change)
#    handlers.load_post.remove(frame_change)
#    handlers.frame_change_pre.remove(frame_change)

if __name__ == "__main__":
    register()

An issue of scope.
As mentioned in a prior answer.  Defining frame current outside the handler sets it to what the current frame was when question script above is run and the handler is registered.
If you want current frame when the handler is run
def frame_change(scene):
    frame_end = 200
    frame_current = scene.frame_current
    print(frame_current ," = script start")

secondly recommend don't scope an object outside the handler, instead within the handler
ob = scene.objects.get("Text")
if ob:
    # it exists do something to it.

Also don't mix context with handlers. Every chance it will not work as expected, especially when rendering.
Related.
Handler-script updates in viewport but not in render
This should work in 2.7
Notice for 2.7x use frame change pre, for 2.9 use frame change post.
Notice the use of the div operator
int(frame_current) // 10

to set on each frame, otherwise will not set properly until a 10th frame using the modulus == 0 operator.
import bpy
from bpy.app  import handlers

from bpy.app.handlers import persistent
@persistent
def frame_change(scene):
    frame_current = scene.frame_current
    frame_end = 200
    obj_active = scene.objects.get("Text")
    print(frame_current ," = script start")
    if obj_active is None:
        return # no font object named "Text"
    if frame_current <= frame_end:
        obj_active.data.body = str(int(frame_current) // 10)
        print(frame_current , int(frame_current) // 10)
    print(frame_current ," = script end")

def register():
    handlers.frame_change_pre.clear()   # use when testing will burn others
    handlers.frame_change_pre.append(frame_change)

def unregister():
    handlers.frame_change_pre.remove(frame_change)

if __name__ == "__main__":
    register()


How to control user interface (panels) across Addons I have a Master Addon which adds its own vertical tabs and panels. Then i have a Child Addon which provides some additional tools which fit well into various panels created by master. But the Child Addon can also run standalone.

When both Addons are enabled the additional tools from the Child Addon shall be placed into the Panels provided by the Master Addon. But when the Child Addon is running "standalone", then it shall create its own panels instead. The master may know about the child. but the child must not depend in any way on the master addon.

So the goal is to avoid to duplicate Operator Buttons and Panels when both Addons are enabled. To achieve this i added a global Property to the child addon and defined a child Toolbox like this:

# In the Child Addon:
# ===================

global CHILD_ENABLED
CHILD_ENABLED = True
class PanelChildTool(bpy.types.Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_label = _("Child Tools")
    bl_idname = "child.tools"
    bl_category    = "Tools"

    @classmethod
    def poll(self, context):
        global CHILD_ENABLED
        return CHILD_ENABLED

    ....

def set_ui(is_enabled=True):
    global CHILD_ENABLED
    CHILD_ENABLED = is_enabled

So i can now enable/disable the drawing of Child panels.
And in the master Addon's init section i added:

# In the Master Addon
# ===================

loaded_default, loaded_state = addon_utils.check("child")
if loaded_default == False and loaded_state is None:
    print("Child seems to be not installed")
elif loaded_state != True :
    addon_utils.enable("child", default_set=True, persistent=False, handle_error=None)
    print("Enabled module 'child' On The Fly")
    loaded_state = True

if loaded_state == True:
    import child
    child.set_ui(is_enabled=False)
    print("Disabled Child's native UI")

Now the Child panels are disabled.
Finally, wherever i want to load an operator from the Child into one of the master Panels, i add something similar to this to the master's panel draw() function:

if  sys.modules.get("child"):
    import child
    child.draw_generic(context, layout) # Generic draw function provided by the child

So this appraoch is working.
But is there a better solution ?
thanks.

The common way in Blender is to append or prepend draw functions via the panel "class":

bpy.types.CATEGORY_PT_panel_name.append(draw_func)

Registered bpy classes are globally available, you can check for a certain one with hasattr(bpy.types, "CATEGORY_PT_panel_name"):

import bpy

# Change this to some type that doesn't exist and re-run
panel_type = "VIEW3D_PT_tools_transform"

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

    obj = context.object

    row = layout.row()
    row.label(text="Hello world!", icon='WORLD_DATA')

    row = layout.row()
    row.label(text="Active object is: " + obj.name)
    row = layout.row()
    row.prop(obj, "name")

    row = layout.row()
    row.operator("mesh.primitive_cube_add")

class HelloWorldPanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "Hello World Panel"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    #bl_context = "object"
    bl_category = "Tools"

    # re-use draw functions
    draw = draw_func

def register():
    if hasattr(bpy.types, panel_type):
        getattr(bpy.types, panel_type).append(draw_func)
    else:
        bpy.utils.register_class(HelloWorldPanel)

def unregister():
    if hasattr(bpy.types, panel_type):
        getattr(bpy.types, panel_type).remove(draw_func)
    else:
        bpy.utils.unregister_class(HelloWorldPanel)

if __name__ == "__main__":
    register()

The draw functions are internally stored in Panel.draw._draw_funcs

You can remove them like you add them, the method is just called remove.


How to change restpose of armature while still preserving animation data? I purchased BVH files containing Horse locomotion data. I want to retarget them to my custom Rigify Horse Rig.

the only thing thats stopping me is that the armature from BVH has restpose with all bones laying flat on the ground. instead of usual T pose. so the rotation translations for them are driven via this pose. is there way to convert animations for this restpose to that from a T pose?

I also got a seperate Tpose BVH file for the same armature above.. but that also has a restpose with bones laying flat on the ground.

Is there a way to use Tpose as restpose and convert/translate teh animations based on this pose?

was able to achieve the required result with Blender MoCap tools. I used the T-Pose BVH file and applied rotation scale and location to the TPOSE and set it as restpose.. then i imported gallop BVH file and using mocap tools i mapped the rotations to the first armature.. I was then able to retarget to my Custom RIgify rig with usual workflow.


I always get rendered and old version, I cannot save the new version neither Hello Blender Community,

I already checked for this question, and it seems it already has been asked and answered. Still, I none of the answers helped me to fix this problem in my case.

I opened my file (waste floating in the ocean) to add more waste to the scene. Then I want to save it and render it. But pushing the render button it jumps back to the old version and renders the old version.
To get back to my modified version (where I added more waste) I have to use the CMD-Z combination, because it seems I also cannot save the new version.

In the photo attached I described the problem.
I hope somebody can help me.
Thank you!

********************* EDIT 1 *************************
I edited the scene again. I put 2 new plastic cups in the scene.
And when I push the render button these 2 cups stay in the scene.
Only the 3 new bottles disappear?
I duplicated the other 2 bottles to create the 3 new bottles. But why do they disappear when rendering the scene while the new cups stay in the scene?

********************* EDIT 2 *************************
Has it something to do with these arrows?
Because the cups do not have these arrows while the bottles have them.

When you duplicated your bottles, you also duplicated their animation data. After you reposition your duplicates, you also need to overwrite the location and rotation keyframes, or they will jump back to the original position as soon as you hit render or change the frame.


Is there a better way to make complex cloth, than sculpting it? I want to make this exact white blanket.

How would you go about creating such a fluffy, extremly wrinkled blanket.

I went through some tutorials, but they only deal with very simple blankets.

I would like to get it to like 80% before starting to make the details with sculpting. The smaller blankets on top should fall into place much easier, once the big white one is done and can function as a collision object.

I also want to constrain myself to blender and dont want to do it in marvelous or etc.

Edit:

Rigg Riggs answer works perfectly as startingpoint.

You can rotate the imageplane used for the displacement-texture to control the direction of the patter without messing it up . Thats how i got it to go diagonally.
I also used two diffuse shaders (b/w) in a mix, controlled by the noise texture, instead of his node setup. Seems to work better. At least for me.
Had to play around with the settings a bit before getting a texture to my liking.
I added a decimate modifier set to un-subdivide and a triangulate modifier  once i applied the displacement, to reduce the face-count.

If you have a different approach please feel free to share it. Im trying to learn :)

Render out a texture on plane similar to the following & save the image:

Add a plane to the 3D view > subdivide it like crazy (W >> S)

Add a Displacement Modifier

Create a new texture from here.

Go into the textures tab on the properties panel and set the texture to your rendered out image location on disk.

Come back to the modifiers tab and play with your settings, start with mine here and adjust to your liking.

finally add a subsurf modifier

Last apply the subsurf modifier, then the displacement modifier.

Then go into sculpt mode and have your way with it.


How to put thorns on the surface of a plant? I  want to make a Spiny plant and I want make thorns on the surface of it with a specific angle .. I tried to use particle system (hair) but the thorns appear floating outside the mesh with random angles .. is there any way I can snap them on  the surface of the plant ? .

I had the same problem, when flower pedals were floating around the scene in random directions. I played around with particle settings and found the setting somewhere in the settings panel.

But solution to the floating particles I figured out much later. You have to make sure that your particle object is sitting right on top of its origin point. (orange dot) The particle system doesn't take the mesh and put it nicely o your object. Instead it takes the origin point and slaps it on top of the object. And when your particle object is far away from the origin, at just floats around somewhere else.

So yeah. Make sure your particle object is sitting on top of its origin (orange dot) and particle rotation settings you find somewher in the particle settings.  Hope this helped. Happy blending!


Specific fluid sim look I've spent the past couple months trying to figure out some fluid sim for a project. I'm trying to go for a specific (and slightly unrealistic) water flow look:

However, I don't seem to be able to get anything that looks like this. I've spent the last month(s) frustrated at this. The best I was able to get is:

and even then, there's still a bunch of splashes and other undesirable parts. I'm beginning to wonder if a fluid simulation is the best option, but I don't know what else would work. A bare-bones blend file of what I have so far is included below (not including the baked data, I don't think)
I've tried guides, wind, and messed around with a lot of other settings, to no avail.
(Note: my goal is to make the water look photo-realistic, and hopefully animated if possible)

Position the inflow as desired. In an Inflow section set X and Z to non-zero values(Z to -1) and see if it works.


How do I delete the faces on this SVG? So I uploaded an Illustrator SVG to Blender and opened it.
The problem is that the SVG now got some extra faces i didn't need. I need only the outline/curves and also I can't find anymore the face selection.
This is what i'm trying to do so you can understand more

Turn to "None" the Fill Mode in the Curve Properties.


Can't get SSS to work with Principled BSDF shader I can't seem to get the SSS to work with the new principled BSDF shader of Blender 2.79. The SSS effect is almost invisible.
Please see the image below:

Does anyone know how to use this shader for SSS?

Here is the Blender scene in case someone wants to examine it: http://pasteall.org/blend/index.php?id=47835

Not an expert, but I think increasing Subsurface Radius to 10 does the job?


Adding brushes for sculpting in 2.83, missing config folder So I was able to append the brushes and use them in the sculpt mode. However, some of them didnt work properly, so I looked up how to install them properly. From the zip file im supposed to put it in the folder, config. Which I just can't find:
I got my pathway:

I'm not sure finding this folder would help either way.
So the actual issue with the brushes is that they keep drawing squares where they are supposed to draw cracks.

The brushes worked fine as soon as I moved them to the Blender 2.83 Folder you see above.
I think it has to do with administrative authority required to move them there.


Force materials to render on top of others In Blender Internal there is Z Offset setting for Z-transparent materials, which put one object over another on shader level only. But what about Cycles, how to do it w/o compositor?

Blender Internal and Cycles use completely different methods of rendering the scene - BI draws each face in turn (after optionally eliminating any ‘backfaces’), using a Z-buffer to determine whether each face should appear infront of whatever has already been painted in that place. It is this Z-buffer that is overridden by the Z Offset.

Cycles, however, traces each ray from the camera to the surface. When it hits a surface, Blender determines what would be contributing to the illumination of that point on the surface. Unless the surface is transparent it will not even consider any faces behind that point - so it is not possible to have a material with a property where it will overlay any material infront.

The only way of achieving this in cycles would be via the compositor.


deformers are red and do not work? I've placed a sphere in my scene and want to apply a lattice. I have it selected and then select the modifier, but when I do that along with any modifier, the title of the deformer is red and no deformer shows up. What do I need to do to make that work? All the tutorials I'm seeing show it being as simple as what I'm doing.

Thanks
Dave

Dave

You have to add a 'Lattice' object as well as the object to deform (should be in the shift+a menu, 3D viewport), and point to this lattice from the lattice-modifier added to the object you want to deform...

Have a look at this- https://www.dropbox.com/s/4goj0kobrqmjbut/LatticeExample.blend?dl=0

Chose the sphere, and enable the 'lattice' modifier in the viewport (2nd in the top row of buttons in the modifier settings, in the 'spanner' modifiers tab), bingo!...


Object stretches when rotated for shaped keys I've this butterfly model and I want it to fly.

when I add shape keys and rotate the wing in edit mode, the wing stretches and get a weird shape, like this:

I see some areas aren't selected when I select the wing, maybe this is the cause?

I'm new to Blender. thanks for any tip in advance.

That could perhaps be the distortion you ran into. I looked at your model and you shouldn't need to use shape keys or rotate the wings in edit mode. It comes with an armature that you can use to move and animate it. It looks a little complex, so take some time to play around with it, and do some reading on armatures if you need to.

Edit: I think your idea about vertices not being selected is most likely the answer. Editing for shapekeys is basically the same as ordinary editing, so I don't think the shapekeys themselves would cause that problem. (Artist put lock on hind wings-see last paragraph below.)

In general, though, shapekeys are not used for large rotations because they don't work well for that. The individual vertices move to their new positions by the shortest route, and the mesh can become quite distorted in the middle positions. I know - I tried to shapekey fingers once.

If you need something to rotate in a specific way and don't want to use an armature (I still haven't made peace with armatures) you can set the origin to the spot where you want it to pivot and then use rotation to move it. You can even set rotation locks so it will only move in one or two axes (click the locks in the Transform/Rotation menu in 3D view - if you can't see it try pressing N).

Change pivot or local origin of an object

In trying to pivot the wings just now, it seems the artist has tethered the bottom of the hind wing to the body - not sure how he did that, it would be interesting to find out. That could be the distortion you ran into. Apparently this is how the butterfly actually works, but you have to rotate it on 2 axes to get it to look right. You can read about it in the comments here: http://blog.hawkbats.com/2011/03/07/3d-commission-models-and-art/


how to control pose of an armature real time in blender? I'm creating a devise to identify hand movements and display on 3d hand model in blender.For that I used flex sensors and accelarometer to measure finger/hand movements.By using pyserial the sensor values are imported to bender as many variables.

I'm new to blender and python.I have created a hand model and need to run it using python script.I have added always sensor and python controller. I need to change the pose of the bone(actually euler angles) in real time using those sensor values(In blender game engine).

There has been some work on using a kinect with blender, you might find some help in that work.

From python you can manipulate an armatures bones with -

myrigbones = bpy.data.objects['metarig'].pose.bones
myrigbones['chest'].rotation_euler = Euler((12.0, 0.0, 0.0), 'XYZ')

Don't think that will work in a game engine controller though - the BL_ArmatureObject available in the game engine has a channels property to access bones.


Why is Composite Blur square I'm attempting to use the compositor to blur a test render.  I'm hoping to make a scene where I fly through a space filled with stars of various sizes, colors and brightnesses.

To visually underscore the brightness of the stars, I'm using the Gaussian Blur node in the Compositor.  I was hoping that the brighter stars would have "glare" that changed in size and intensity depending on the brightness of the star and its emission strength.

But, before I do this, I'm running up against an issue that I can't resolve.  I'm getting a bizarre looking "square" blur when I crank up the size of the blur beyond a certain point.

Here's my test image before the composite blur is added:

And here is the image after the blur is added:

Here is what happens when I use the "glare" node:

I'd like the blur to be circular.

Exporting the files and adding the blur to individual images in After Effects or Photoshop would not work, because these programs cannot distinguish the between a rendered object that has an emission from a small or large object, or differentiate between an object that has an emission strength of 1 from one that has one of 100 (as Blender can):

Left icosphere: emission strength 2
Middle icosphere: emission strength 20
Right icosphere: emission strength 200

Any thoughts?

A "true" gaussian blur is not limited by distance - if the 'centre' point is strong enough it would have an effect on even the most distant pixels in the image (the gaussian distribution falls off towards zero as the distance increases but never actually reaches it). For efficiency, the Gaussian blur in Blender is limited by range in each of the X and Y directions - so the value falls off with distance but cuts off at the edge of the range. Since the range is determined only in the X and Y directions this forms a 'square of effect' of the blur from any pixel in your image.

This would not normally cause a problem since relatively low intensity pixels would naturally drop off to very close to zero at the edge of the range when the gaussian blur is taken into effect. However, in your case you have extremely large values for your bright points. This means that the gaussian has not dropped quite so close to zero at the edge of its range to be unnoticeable and so the edge of that 'square of effect' is noticeable.

The only solutions I can suggest are to either limit the brightest stars to lower values or to blur them in multiple stages to 'spread' their impact more evenly - eg, instead of a single Blur of 20x20 you could use one at 10x10 to soften them out followed by another at 17x17 (I picked these values 'by eye') to produce the following :

(The left-hand side is the 'single' blur (showing the square artifact edge) while the right-hand is the 'double' blur)


position and scale of the model randomly changes on different actions/animations i have downloaded a free zombie model and made some animations/actions for it in action editor like, walk, die, attack and so on.
but now, when i select and play different actions, my model's position and scale randomly changes, like every animation/action is playing on different position and scale.

I'm Pretty sure that when i was making different actions, the model was in middle of the screen.

here are a few pictures that shows the problem

i animated like 5 other models before and everything worked perfectly, and I'm pretty sure that i did everything like before.

i spent like 4 hours on this model, Please help me fix this problem.

Here are some points that will fix (or at least explain) a lot of your issues in my opinion. I've tried to be clear but I may come back to make it clearer:

Reorganize a bit your armature. Give it a root bone (a big bone that you create on the ground, at its feet level), then parent (Keep Offset option) the hips to the belly bone, and parent the belly to the root. Also parent all the IK targets/pole targets that you’ll create to this root. It will ease your work with all your armature animations as it gives it a static bone that you won't move in Pose mode most of the time.
In the Dopesheet/Action Editor mode, in the same action, don't mix keyframes of your armature (created in Object mode) with keyframes of the bones (created in Pose mode). Actually, most of the time you won't need to insert keyframes for your armature itself in Object mode, unless you want the whole object to move, along a road for example (example : bird flying, walk cycle, car...), or if you want to exceptionally scale it up or down for a reason or another, and anyway don't mix it with bones keyframes in the same action. If you want to scale your object up or down because you think it’s too small or big compared to the scene scale, just select the armature in Object mode and scale, don’t insert any keyframe, either in Object or in Pose Mode. In your case, if you check your actions in the Dopesheet, you’ll see the keyframe tracks for all your bones but sometimes you will also see the LocRotScale track for the whole armature. It means that in the same action you sometimes mixed keyframes of the whole armature in Object mode, and bones keyframes in Pose mode. Example: you’ll see a LocRotScale track for the action called Wake. Select and delete it with X. You’ll see that your character will become huge, perhaps because, to compensate the tiny size you’ve given to the whole armature with this keyframe you’ve created in Object mode, you had to scale up the bones, or something like that happened. To sum it up: If you need to move your whole armature in the scene, first make sure that it will be a new action in the Dopesheet, so that this whole armature animation won't be part and interfere with a bone animation, so close the action you were working on, or push it down in the NLA Editor if you want it to be played at the same time, then work on your object action.
In Pose mode, when you insert keyframe, do it for all the bones and with LocRotScale, this way you’ll be sure that when it plays another action, it won’t keep from the previous animation some values or some bone poses that you wouldn’t like to have for the new one. Not sure it is a problem here though.


Blender import ply file but only show orange color I'm trying to use Blender to open .ply file. But it only shows orange color. When I use Cloud Compare/MeshLab, rgb color of this point cloud model can be seen. Anyone can help me how to show the rgb color in Blender? I'm actually Blender beginner. Really appreciate.

I think the orange color is showing because you selected that thing. so deselect everything(press A in 2.79 and alt+A in 2.80).


Render suddently coming out black in Blender 2.91 I have been working with a blender file for a few hours with no issues. Then all of a sudden, I noticed the the lighting had changed in the Modelling view.   I went to check how it came out in a Render and the render is completely black, with some tiny white dots which seeem randomly placed like stars.
The scene looks like there is a load of ambient lighting still there when I disable the sun effect in the World tab.  Yet despite the extra ambient light (which I don't want) AND the sun clearly shining away in all of the edit views, the render is black and I can't work out why.
I will post a screenshot and my Blend file below:

Here is my .blend file:
http://files.staging.x-rm.com/nick/house6.zip

Check your Scene settings, you've chosen your house as Camera, select your camera instead. Selecting another object than a camera may be useful sometimes to see what an object is pointing towards (for example select a light and press Ctrl0):

As for the light, it's your world that lights up your object, open a Shader Editor, switch to World and see, you have a Sky Texture plugged into the Output.

If you don't want the world to light up the scene you can unplug its nodes or play with its Ray Visibility settings:

Edit: Additional edge loop in order to sharpen your roof (but Subdivision Surface modifier doesn't seem necessary here, it is supposed to round the shape with virtual subdivisions):

To get a proper displacement for the material called Pantiles you need to unable Material > Settings > Surface > Displacement > Displacement Only. But as your topology is not very good the Subdivision Surface modifier subdivision won't be very good either, you'd better rework the topology a bit so that it is made of regular square faces:


Creating Override Library via script I've been trying for days to create a script for my addon that does the following things:

Open an existing file A.
Link an existing B file using a Link link.
Create an Override Library on this file.

The problem is that when you open the A file the context disappears and does not allow the command to run

bpy.ops.object.make_override_library

The error message is that the context is incorrect.

finally i've found the solution...

  for w in bpy.context.window_manager.windows:
    if w.screen.name  == "Layout":
      for area in w.screen.areas:
        if area.type == 'VIEW_3D':
          for region in area.regions:
             if region.type == 'WINDOW':
                override = bpy.context.copy()
                override[ 'area'] = area
                override['region'] = region
                bpy.ops.object.make_override_library(override)
                break


Scale/Rescale using resize doesn't fit I want to create a set of "distorted" images using python. The images should show possible misplacements of objects. The part of my script for translation and rotation seems to work well, but the scaling part doesn't work as expected. I want to randomly choose scaling parameters (random.gauss(1, 0.33)) to scale in the different axes - so I put the following in a while loop:

# 3 random variables for scaling in x, y and z directions
num1 = math.fabs(random.gauss(1,0.33))
num2 = math.fabs(random.gauss(1,0.33))
num3 = math.fabs(random.gauss(1,0.33))
# scaling with random variables
bpy.ops.transform.resize(value=(num1, 1, 1), constraint_axis=(True, False, False))
bpy.ops.transform.resize(value=(1, num2, 1), constraint_axis=(False, True, False))
bpy.ops.transform.resize(value=(1, 1, num3), constraint_axis=(False, False, True))

Then I save the image and want to get back to the "undistorted" image. So I tried:

# scale back to original image
bpy.ops.transform.resize(value=(1/num1, 1, 1), constraint_axis=(True, False, False))
bpy.ops.transform.resize(value=(1, 1/num2, 1), constraint_axis=(False, True, False))
bpy.ops.transform.resize(value=(1, 1, 1/num3), constraint_axis=(False, False, True))

But this doesn't bring me back to the start. So I tried this in the console window of blenders UI. I have the simple startscreen featuring a camera, a cube and a lamp. For now resize and re-resize works. But if I turn the Cube by 45° round the z-axis it doesn't work any more. Scaling by (2,1,1) gives me a scale of (1.581,1.581,1) which suggests the scaling works in global coordinates. But why doesn't scaling with (0.5,1,1) give me the original cube. It gives me a scale of (1.25,1.25,1) instead.

So the question is, how do I get this to give me the original object back?

One way to do this is to get used to scaling using the obj.matrix_world and obj.matrix_local. Where obj is a reference to your Object. That way you can reset to the original scale using the identity matrix. You can even chain various kinds of matrix manipulations (Rotate, Scale, Location).

I hope to have time to give examples. The documentation shows how to do things, but it assumes you know Matrices and Vectors well enough to understand the terms:

docs: mathutils.Matrix

Ideasman points out that object.scale can be used. This is a convenient way if all you need is to rescale, it lets you scale directly using a vector (or tuple.. or list..as long as there's 3 elements).

obj = bpy.data.objects['Cube']
obj.scale = (0.5, 0.3, 1.2)

# will return all dimensions to their original value
obj.scale = (1, 1, 1)

You mention in your Question about rotation. Another convenient way to rotate an Object can be found in the set of attributes starting with .rotation_*:  see Docs for a description of:

obj.rotation_axis_angle
obj.rotation_euler
obj.rotation_mode
obj.rotation_quaternion

# ---- needed imports to use euler and math module
import math
from mathutils import Euler

obj.rotation_euler = Euler((0, 0, math.radians(45)), 'XYZ')


Execute something by clicking object This is probably a no-brainer, but somehow I can't find the solution with google. How do I execute a function once, if an object is clicked?

import bpy

def something(obj)
  print(obj.name)
  return

...
if anyObjClicked:
  something(context.scene.active_object)

Result should be:

Cube

and not

Cube
Cube
Cube
Cube
...

Blender's event system doesn't expose an event that triggers just once when an Object is selected (December 2015) - You aren't missing anything obvious.

You could make an event handler that listens for scene updates and only fires a custom function call once if the active_object changes between calls (these scene updates can be high frequency, 30 times per second).

read: bpy.app.handlers.html  see bpy.app.handlers.scene_update_pre (or ..._post)

The docs have sample code which you can extrapolate.

ps. this assumes your use case doesn't include clicking the same object a number of times in sequence.


Error message importing MHX2 in 2.8 I'm definitely an amateur so excuse me if this is an obvious thing, but I'm trying to import Make Human characters into blender to fix clothing layer issues before moving them into Unity. I'm more than open to alternative suggestions on this whole process but I'll describe what I'm doing and what's going on right now.

I made a character in Make Human and exported them as an MHX2 file. I then installed the MHX2 importer from this URL https://bitbucket.org/Diffeomorphic/mhx2-makehuman-exchange

This allowed me to see MHX2 files to import. But when I selected my imported NPC I get a redline of error messages and it fails to upload. After mashing my keyboard I managed to get this window pop up somehow, which I assume is the error log: https://cdn.discordapp.com/attachments/353422958984953857/627373902674395136/unknown.png

Does anyone have any suggestions on how to fix this? My one and only thing that I need to do is fix clothing layering on Make Human NPCs, if there's a simpler way of doing that with a different program or something obvious I'm missing with this one then I'd really appreciate a hand. Whether or not you've got a suggestion, thank you for reading this.

The add-on hasn't been properly updated for Blender 2.80. It tries to access color_space on an Image Texture node, which is no longer part of ShaderNodeTexImage in Blender 2.80. It used to be in Blender 2.79b and before.

The proper way of accessing the color space settings is to retrieve the Image object referenced by ShaderNodeTexImage which has the colorspace_settings.

The issue has already been reported to the developer.


Blender Basic Bevel is Flat - Not Curved Basic scene with mesh cube.  4 parallel outer edges are selected to round the cube.  A bevel is applied but here is no curve to the bevel.
Why? And what tiny settings do I need to correct?  And where are those settings in this massive UI?

You can add bevel segments with the mouse wheel or the segments in the options that pop up bottom left of the view port when you confirm your bevel.  This will make them curved.


How to link a variable of a material to another material? Let's say I have two materials "material1" and "material2".
How do I achieve that material1's roughness(or anything else) is the same as material2's and changing material2's roughness will change both?

I think the easiest way to do this - is using node-groups. This is instruction:

Add a node with your parameter for roughness it will be Value node:

Select your node than press Ctrl+G. It will create a node group with output from value node:

To exit from node-group press Tab and connect node group to
roughness socket.

In N-pannel you can change name to any that you like:

And finally, in outer material nodes you can add same node-group from Add(Shift+A)->Group menu.

New node will have number near node-group name. It indicates how many copies of this node-group you use.


Can't duplicate a proxy armature with mesh My problem:

I have a rigged character as an asset of a master-scene in its own .blend-file. The asset.blend contains the character and its animations. To make use of my character and its animations in the master-scene I link the Character and make its armature a proxy one.

This allows me to access different actions from the action editor and it will always be updated if I ever want to add some more animations to the character or some changes to the mesh.

Now, since I want multiple instances of my linked character, I tried to copy and paste my armature and the mesh.

I expected to have another character (a sheep to be exact) with an individual armature that can have different actions selected.

What happens is that both meshes are only controlled by the second instance of the armature

What am I doing wrong? Is there a work-arround or is it possible at all?

I created a demo project for you, so you can try it yourself.

Download .blend-files (ZIP)

I Believe this is a limitation from the current linking implementation. The workaround I currently use is to create a copy of the file (or a file link if the os supports that) with a different name and link the second character from that.


Bad Quality whilst exporting an animation I am dealing with a problem when exporting the animation I've tried to create on my own. I don't think I messed up something during the animation process, so it has to be something with the output settings. Just like with the donut tutorial (which I exported with the same settings and without any quality loss), I rendered all frames into a separate folder. Only then put them into Video Editing as "Image/Sequencer", chose all output settings, and clicked "Render Animation", as I should. In the Render environment, I see it played in high-quality, just as it should. But then, when I open the video in Windows Player, it seems like it stretches the video to default 1920x1080, whilst it's set to 500 x 500 in the output settings (same whilst animating). I checked all the output settings, but haven't found an issue regardless. I have attached some screenshots to give a clearer view of what I am talking about.

I also sometimes have videos smaller than full HD and when I open them in the player, the video player maximizes its window and makes the video display larger.
However, this is not a problem with Blender, but with the video player. Or maybe with the video format you choose. But if the file says it's 500 x 500 then it is all fine with the file. Maybe there is a setting in the player to play the video in original size.
What I meant by "it is not stretched to 1920 x 1080" is that the aspect ratio didn't change. It might be scaled to fit the height of 1080 and of course this might result in worse quality because not all software scales bitmap perfectly. But again: this is not a Blender problem. By the way, this is how it would look stretched to 1920 x 1080 and your object definitely isn't stretched like that:


2.8 Basic Unwrap Problem? https://www.youtube.com/watch?v=0trhFMBdVzI&feature=youtu.be
Video of the problem

Right, so I have a problem. I just downloaded 2.8beta and I can't unwrap anything it seems. Unless I am completely misunderstanding a new workflow.

Seems when I try to unwrap something, it doesn't appear inside the UV editor.
And whenever I try to open a side panel or do anything there I get a message that reads

Tool 'Select Box' not found for space 'IMAGE_EDITOR'.

In 2.8 where is new View mode in uv/image editor.
In this mode where is no UVs or mask or painting tools are display. To edit UV you need to switch to UV edit mode:

New View mode is good for viewing image for reference.

Note, that where is new UV editing workspace with uv/image editor with uv edit mode by default:

Tool 'Select Box' not found for space 'IMAGE_EDITOR' it is just a warning don't pay attention to it.


Character Rig: High deformation with bones I need help for my character rig please, when i rotate on move on certain pose the bones the character got ultra high deformation like this screenshot:

God bless the one who fix my problem~

Well, you have irregular scale of armature:

Fix by doing this:

Select armature
Select object mode (instead of pose mode)
Press Alt+S

See also: Why is it important to apply transformation to an objects data?


How to move 2 edges in different ways (symmetry)? Blender 2.79 How to move 2 edges to different ways (with symmetry)? I tried to use the scale tool, but it works only in Y-axis, not X-axis, what I need.

Found a solution:

Reset Mesh Scale, Rotation (Ctrl + A  in object mode)
Select Edges in Edit Mode, press on keyboard S, X  .
Scale edges by X-Axis.


How to draw a circle hole by bmesh on the plane? How to draw a circle hole or a square hole by bmesh on the plane object?
I tried with below but failed it only draws circle rather than a hole.
bm=bmesh.new()
ret=bmesh.ops.create_circle(
    bm,
    cap_ends=False,
    radius=1.8,
    segments=8)
#print('circleret:',ret)
bmesh.ops.translate(
    bm,
    verts=ret['verts'],
    vec=(5.0, 24.0, 0.0))
mycircleface = bm.faces.new(ret['verts'])
me1 = bpy.data.meshes.new("Circle")
bm.to_mesh(me1)

Round or square hole in round or square mesh.

Would be many ways to skin this cat.

Add a plane remove its one face. Size square_size
Subdivide the plane equally using cuts
Add a circle with 4 * (cuts + 1) segments, radius circle_radius
Bridge the loops from square to circle

Test script.
import bpy
import bmesh

cuts = 3
square_size = 1
circle_radius = 2

context = bpy.context
collection = context.collection
me = bpy.data.meshes.new("Hole")
bm = bmesh.new()

bmesh.ops.create_grid(
        bm,
        x_segments=2,
        y_segments=2,
        size=square_size,
        )

bm.faces.remove(bm.faces[:].pop())
bmesh.ops.subdivide_edges(
        bm,
        edges=bm.edges,
        cuts=cuts,
        )

bmesh.ops.create_circle(
        bm,
        segments=4 * (cuts + 1),
        radius=circle_radius,
        )

bmesh.ops.bridge_loops(
        bm,
        edges=bm.edges,
        )

bm.to_mesh(me)
ob = bpy.data.objects.new("Hole", me)
collection.objects.link(ob)

This makes one of each as mesh and hole. Circle in circle (Square in square) can be done as above, simply making one twice.
Could wire this up similarly to
Create Circle with Inner Radius
giving option of square / circle inner outer and ngon fill.
See also
How can I morph a flat plane to be a flat cirlce?  re morphing one to another.


Glowing lines via nodes How do I add glowing lines on a cube or anything that have vertices on Blender 2.8? I'm a beginner so I thought adding material should work. There is another thread where it explains that but I cannot make only the vertices glow. Also it would be great if I could make the lines a bit thicker. I'm trying to make a on/off button which has glowing lines around.

Thanks!

You can use Pointiness from the Input Geometry Node
But as you can see here from these wire-frames the geometry plays a big part.

Using a Mix Shader with a BSDF Shader and an Emission Shader and controlling the effect with a Color Ramp

Of course, you could remove all the extra geometry that does not affect the effect.


How to create a perfect depth hole? I want to create a perfect depth hole. I tried using boolean and bevel after, but doesn't work...

Here is my reference image:


Boolean Union making part disappear I know this question has been beaten to death, but I have tried all the solutions, and none of them work (manifold, normal's, triangulate, splitting it into simpler parts)

Im trying to add hoses to the side of my model, but the union boolean isnt working properly. It just makes the part disappear. Once I join them, I can mirror the part.

I did import these models from starcraft 2 using a m3 import tool, so there may be something a bit more complicated going on here that I just dont understand.(vertex groups? Materials?)

heres the file:  http://pasteall.org/blend/index.php?id=43732
(the entire model is there, just hide everything but the hips/hoses for now!)

Thanks for the look!

Download a copy of 2.78RC2 - the boolean modifier in 2.78 has a new BMesh solver that looks to give the results you are after.


Why can't I save my rendered animation as video? I just finished rendering my first animation and I can't find it in a video format. I tried saving it and all but its in a blender file. How do I get it into a video file. I rendered it as AVI raw at 1080p 60fps.

Make sure you have saved the file in a folder you can remember. You must do this before rendering the animation using the folder icon in the output settings or it will be saved in your tmp folder.


How can I find out the variable name in python? I know how I can find out the python command by clicking a button in the Blender interface, and then look in the info window:

For example, as can be seen, I added a cube, UV sphere, plane, camera, lamp, pressed A twice.

But how can I find out an object variable name, for example the y-rotation of an object. Because I can't find the y-rotation, when I point my mouse over it, I can only find the rotation:

This has been turned off by default in 2.80. Turn it back on in Edit > Preferences > Interface > Display > Python Tooltips


How to modeling an alphabet monument from image reference? I plan to make this letter monument in Blender, but I am confused how to make the exact same shape as that monument especially the curve shape on the alphabet. can anyone give me a little example

The elements of the art installation (which is at the intersection of Naripan and Braga Street, in Bandung, Indonesia; (Geographical co-ordinates: -6.920010, 107.610142)) might be inspired by, or copied from a font, but I tend to think it a bit more likely that the realization of the shapes is done from scratch, as they might be in a logo. I know there are a number of tutorials on Youtube, and in other sources on using Blender to create a 3D logo. Do a search for "Blender 3D logo tutorial", and you should come up with several.

If, as I suspect, the glyphs in the image posted in the original question are custom designed for the sculpture, it would be useful to have some idea as to the scale of the elements. Reviewing a few of images I found in on-line sources, I infer from the ratio of the size of the people I see pictured in some of the images to the size of the elements, that the height of the individual elements in the installation are about 3 meters from the plane upon which they are installed, and the thickness of the wider strokes of the element are about .3 meters. I would use image editing software to make the heights of the elements, and the width of the wider strokes as nearly the same in each image as possible. I would model the individual elements using. Unless this is an assignment the exact dimensions of the model are required to conform to the exact proportions of the orginal, this may be a case where "close is good enough". In either case, the standard modeling techniques—start with a mesh primitive, and scale, translate (move), extrude, rotate, and subdivide as needed to create the elements—should be adequate to model the elements of the installation.

On the other hand, if the shapes of the letters were different so that one could select a font and use a text object as the basis for the model, there are tutorials on Youtube covering that, too. On example of such is at https://youtu.be/48L9YU1FKPU.


Baking problem (selected to active- cycles) so I've modelled a high poly character and then i retopologized it using shrinkwrap. So then I followed Andrew Price tutorial on youtube how to bake normals from high poly mesh to low poly by selecting both of them and leaving the low poly mesh selected last (active). But from the whole character just one hand baked i dont understand why. Anyone have any sugestions?

I already figured it out. I left Mask modifier on my high poly mesh. I had to delete it in order to continue baking all highpoly meshes onto the lwopoly.


How can I use this Python module in Blender? I know this question has been asked before (for instance, here: Using 3rd party Python modules), but The answers aren't getting me where I need to be. I'm not an expert, so I might need a little more hand-holding (sorry).

I have a script that works outside of blender that uses "python-midi" (found here: https://github.com/vishnubob/python-midi), but I can't get it to run in Blender.

I tried moving the "python-midi-master" folder into Blender/Contents/MacOS/2.70/python/lib/python3.3 but it didn't seem to make a difference. I also tried deleting that folder (to make Blender fall back on the system's Blender?) but that didn't work either.

I'm running Mac OS 10.8 with Blender 2.7 and Python 3.4.1

The midi library seems to be only for Python 2.x. Whereas Blender runs off Python 3.3. But if you are adventurous enough, you can probably get it working.

1. Installation:

Download the source from Github. Copy the src folder from the package into blender.app/Contents/MacOS/2.70/python/lib/python3.3/site-packages/ and rename the src directory as midi

2. Auto Convert to Python 3 syntax

Run 2to3 * -w on the midi folder, to automatically convert as much of the code as possible to Py3k. The 2to3 command should come with a system installation of Python3.

3. Manual Fixin'

At this point, you should be able to at least get Blender to recognize the library. Fix errors as you encounter them.

Good luck!


Fractals in Blender? Is it possible to define a true mathematical fractal in Blender?

For example, would it be possible to use a script or a Blender addon to procedurally generate 3D fractal objects. This could be immensely useful for a number of natural objects that happen to be fractal in nature, such as snowflakes, broccoli, tree branches, ferns, coastlines, mountains, etc?

Fractal snowflake:

Fractal Romanesco broccoli:

My first thought was to use the Add 3D Function Surface addon, but that doesn't currently allow for recursive definitions. Using textures, combined with images of fractals could help with 2D objects (such as the snowflake), but this solution doesn't really allow for the generation of these fractals. So my question is, is it possible currently to recursively generate fractals in Blender, either with built in functionality or with an addon? If this functionality isn't yet available, would it be possible to write a script to do this?

This script will generate a 2D Mandelbrot set in Blender using OSL.

#include <stdosl.h>

shader node_fractal(
        float CenterX = 0.0,
        float CenterY = 0.0,
        point Vector = P,
        float Zoom = 1.0,
        int MaxIterations = 50,
        color Foreground = color(1.0),
        color Background = color(0.0),
        output float Fac = 0.0,
        output color Color = 0.0)
{
    point p = Vector / (2* Zoom);
    float auxiliar = 0.0;

    p[0] += CenterX;
    p[1] += CenterY;

    point pa = p;
    point pb = point(0.0);
    int i = 0;
    for(i=1; i<MaxIterations; i++)
    {
        pb[0] = pa[0]*pa[0] - pa[1]*pa[1];
        pb[1] = pa[0]*pa[1] + pa[1]*pa[0];
        pa = pb + p;
    }

    auxiliar = sqrt((pa[0]*pa[0]) + (pa[1]*pa[1]));

    Fac = clamp(auxiliar,0.0,1.0);

    if (Fac == 0.0)
        Color = Background;
    else
        Color = mix(Foreground, Background, Fac);
}

Result:

Source: http://elbrujodelatribu.blogspot.fr/2013/04/blender-cycles-osl-mandelbrot-fractal.html


More detailed weight painting? Hi i was weight painting for a finger and I couldn't help but notice it doesn't paint anything until i hit a certain spot and even then it paints all around it!

apparently brush size doesn't help. any ideas?

Weight paining is actually just assigning weights to vertices.  So you will need to add more geometry to your mesh.  I would recommend going into edit mode on your mesh, selecting all with A, and hitting W > subdivide or subdivide smooth.


Blendshape the armature I’m doing a blendshape that shrinks a character and I need to shrink the armature too.

Is it possible to do this in blender? How is it done?

Put the cursor on the center (Shift C), use the cursor as pivot point. Select the mesh in object mode, turn off the armature modifier, press S to scale around the cursor, move your mouse but don't click: in the left bottom corner you will read the amount of scaling according to the mouse movements, read the value when you're satisfied (let's say it's 0.563), press .563 and Enter. Then select the armature, go to edit mode, activate all the armature layers, press A to select all, then press S .563 Enter. Reactivate the armature modifier.


How to export texture into a file that unity can read I've just made this texture with a displacement map with the intention of using it as a terrain texture in unity, so how can i export it as a file that unity can recognize (.png)?

You can bake normal maps from geometry in Blender. Unity works very well with normal maps. Follow the instructions here, but instead of baking a displacement map, bake a normal map.
How to make a displacement map from existing 3d geometry

Displacement maps work great on models with high levels of geometry. They work by displacing the models vertices based on the texture value. dense geometry does not work great in video games, because that means more faces that the computer has to render 60 times per second (usually). Instead a normal map represents lighting information for each pixel within the texture. Without deforming the actual geometry, the texture itself can receive detailed lighting information, creating the illusion of depth.


How do I add to my scene a shader I downloaded? I'm referencing this CC-0 shader:
https://www.cyn-prod.com/projects/wood.php

How do I add this to my scene?

I've tried "appending" but Blender drills down into the Blend file's directory structure.

I want to add wood texture to a kid's stool project.

Blender 2.82a

What you are trying to download is a full blown shader that is designed for wood. Unless you are making wood of all types, it seems like overkill to download a shader for it, as the principal shader included with blender more than enough. What you need is a wood texture.

Here is a texture website that I would recommend: https://cc0textures.com/list?q=wood&method=&type=&sort=Popular

Select the one you need, and hit download. Unzipping the file will give you a folder.

New go back to blender, select the object you want to give a wood texture, and press the shading tab on the top. Create a new material for that object by pressing "new" on the top of shader editor.

But first you need to enable an add on called Node Wrangler which will help you a lot while editing nodes. Go to "Edit" near the top, -> Preferences -> Add-Ons -> Search "node wrangler", and check the box.

Go back to the shading editor and select the big green box. Press Ctrl-Shift-T. In the file picker it opened, find the folder you got from the texture website, open it, select all the files inside, and press Principle Texture Setup on the bottom right. Node wrangler will open up a lot of nodes automatically, and should look something like this.

Aaaand.. that's about it. Now you can view this new texture by switching to LookDev or Render mode on the top right (make sure to go to the layout tab first).


Export bezier curves I placed some bezier curves in a scene. This scene is getting exported as an .obj file later with a scaling factor of 11 and +X-axis as Forward and +Z-Axis as Up. as In a further project some insects shall move along these curves.
Now I need the handle and control points of these bezier curves in world coordinates so I can use these coordinates to calculate the bezier curves in my project. I wrote a script for that:

import bpy
import os

ob = bpy.context.object
currPath = os.path.splitext(bpy.data.filepath)[0]+".txt"
file = open(currPath, "w")

for curves in bpy.data.curves:
    for splines in curves.splines:
        for x in range(len(splines.bezier_points)):
            file.write("p ")
            handle_left = ob.matrix_world * splines.bezier_points[x].handle_left
            handle_left *= 11
            co = ob.matrix_world * splines.bezier_points[x].co
            co *= 11
            handle_right = ob.matrix_world * splines.bezier_points[x].handle_right
            handle_right *= 11
            file.write("%.3f " % (handle_left.x))
            file.write("%.3f " % (handle_left.y))
            file.write("%.3f " % (handle_left.z))
            file.write("%.3f " % (co.x))
            file.write("%.3f " % (co.y))
            file.write("%.3f " % (co.z))
            file.write("%.3f " % (handle_right.x))
            file.write("%.3f " % (handle_right.y))
            file.write("%.3f " % (handle_right.z))
            file.write("\n")
    file.write("n\n")

file.close()

The bezier curves are not at the position where they should be in my project. Is something wrong with the script?

Now I have found a way to export the bezier curves in world coordinates. To do so I name all my bezier curves "BezierCurve01", "BezierCurve02",...,"BezierCurve18" and so on. I also have to make sure that the curves are in exactly this order in the table bpy.data.curves. This is achieved by simply renaming every curve. Then I can run the following script to get the desired output:

import bpy
import os

currPath = os.path.splitext(bpy.data.filepath)[0]+".txt"
file = open(currPath, "w")
i = 1

for curves in bpy.data.curves:
    idx = str(i)
    if i < 10:
      bezier = "BezierCurve0"+idx
    else:
      bezier = "BezierCurve"+idx
    ob = bpy.data.objects.get(bezier, None)
    for splines in curves.splines:
        for x in range(len(splines.bezier_points)):
            file.write("p ")
            handle_left = ob.matrix_world * splines.bezier_points[x].handle_left
            handle_left *= 11
            co = ob.matrix_world * splines.bezier_points[x].co
            co *= 11
            handle_right = ob.matrix_world * splines.bezier_points[x].handle_right
            handle_right *= 11
            file.write("%.3f " % (handle_left.y))
            file.write("%.3f " % (-handle_left.x))
            file.write("%.3f " % (handle_left.z))
            file.write("%.3f " % (co.y))
            file.write("%.3f " % (-co.x))
            file.write("%.3f " % (co.z))
            file.write("%.3f " % (handle_right.y))
            file.write("%.3f " % (-handle_right.x))
            file.write("%.3f " % (handle_right.z))
            file.write("\n")
    file.write("n\n")
    i = i + 1

file.close()

This only works for 20 curves and has to be adjusted properly for more.


Help forming an aircraft cockpit Hello,

I am trying to extend the lines on the body of the aircraft I am working on, see photo below.

I have used a combo of both scale and moving by the z axis so far, but I am unsure how to apply the lines of the model so they overlap the top line of the cockpit, having tried so far, it causes the bottom lines to bulge out over the bottom of the plane which I have already set, as seen in the pic.

Thanks for any help.

I'd probably go about it like this:

And I'd likely keep the cockpit cover itself separate:


Randomize Transform is not available I wanted to use the "Randomize Transform" tool as described here

Or in the first half of that video.

Following the video, after seperation of each individual cube into single objects, when I want to use the tool, everything is greyed out, like in the attached screenshot.

What am I doing wrong here?

Make sure Global Undo is enabled.
For 2.8x and 2.9.
Edit > User preferences > System > Memory & Limits: Global Undo

For 2.79 use
CtrlAltU > User preferences > Editing > Undo:

That panel is called the redo panel, because when you change a setting on it, blender actually redoes the previous operator with the new settings.
If blender can't undo the previous operator first, running it again will add it's effect on top of the result of the previous operator (which is not the desired effect at all).
So this panel is disabled when undo is not available.


How to make vertices more uniform I used the 'solidify' modifier to make a contact-lens shape. However, it results in this ripply pattern that is visible in the shape's surface. Is there any way to make the vertices more uniform, to match the ones closer to the edge?

The rippling pattern shows up in the final render. The ripples appeared after applying Blender's 'Solidify' modifier.

Relax (Loop Tools)

Loop tools add-on brings in a nice operator called Relax that is capable of "relaxing" the selection that should works well in your particular situation.

In alternative, without adding any external add-on to your Blender's copy, you can select each circumference and run the To sphere operator (Shift+Alt+S) and type 1 (max value).

You can give a try even to the Smooth Vertex operator, but it give best results if the loop to fix is between two loops that have the right shape.


Weight painted movement mesh is jagged when moving bones. How will I usually fix this? This arm is becoming jagged and folded when folding, I tried taking off some weight from the shoulder and adding some, and even blurring it a lot, any help?

I start with noticing that your images do not have severe deformation errors, even real arms get jagged and folded someway.
Anyway, here are some tecniques for improving the joints:
Create a geometry in which regular edge loops are present in every joint, just before them and just after them, as in photo:

Then you can go in edit mode, select the edge loop (Alt Right Click on an edge) on the joint, in vertex group tab assign 0.5 to the first bone's vertex group, and the same to the second bone's vertex group.

Then select the near edge loop, and weight it 0.75-0.25.
You can add more edge loops, I.E. 0.1-0.9, 0.2-0.8, 0.3-0.7, etc...:
more loops degrading, better the result.

All vertex should have a total weight of 1.
Some riggers add a third bone on the joint, with a copy rotation constraint with half influence: if the second bone rotates 90 degrees, the third bone rotates 45 Deg.
The edge loop on the joint can be weighted 0.33-0.33-0.33, you can guess the others.

Don't forget to put the subdivision surface modifier UNDER the armature modifier in your modifiers stack!

Anyway good weighting is an art that can be improved with practice.

Happy blending


What is the difference between 'Save as' and 'Save copy'? When I want to save a copy of my blend file, I know two options:

File > Save as
File > Save copy

What is the difference of the two?

And after I press them I see the same result, except difference of 'Save Copy' being checked:

When I point my mouse on it it says for both:

Save As will save the current file as a new file, and you will continue working in that new file.

Save A Copy will save an exact copy of the file with the entered name, and you will continue working in the file you had open before the operation, leaving the copy exactly the same.


Blender is only adding about half of a video? The weirdest thing seems to be happening, I am trying to add 3 videos to blender VSE, for this sake we'll call them 1.mp4 2.mp4 and 3.mp4.

Each of these videos is exactly 14 seconds long and within 150 kB of each other in size. They are all the same frame rate.

No matter what I do 1.mp4 is only about half of the video when I add it to the video-sequence editor, the rest work fine.

I've tried messing with the start and end frames and the frame rate but changing these doesn't appear to affect anything with 1.mp4's length.

I have also simply tried extending 1.mp4's length in blender but obviously there's no video on the second half.

I have played all 3 videos in VLC and they play just fine so I know it's not a corrupted file.

Either there is something different in 1.mp4 or there something wrong in the Blender import of them.

Try to compare the metadata of the clips in MediaInfo if they are similar, if they're not, then that might be the reason.

If they are similar, try to make four copies of one of the good clips, and import them in Blender, if the problem is visible, then do a bug report: Menus > Help > Report a bug.


Apply Transforms on object copies not working I have two objects which I want to make copies of them and apply transforms for these copies. I'm using the below script but it doesn't work and I don't know why?

obj1c=bpy.data.objects['Obj1']
obj2c=bpy.data.objects['Obj2']

obj1c = obj1c.copy()
obj2c = obj2c.copy()
obj1c.data = obj1c.data.copy()
obj2c.data = obj2c.data.copy()

bpy.ops.object.select_all(action='DESELECT')

obj1c.select = True
bpy.context.scene.objects.active = obj1c
bpy.ops.object.transform_apply(location = True, scale = True, rotation = True)
obj1c.select = False
bpy.ops.object.select_all(action='DESELECT')

obj2c.select = True
bpy.context.scene.objects.active = obj2c
bpy.ops.object.transform_apply(location = True, scale = True, rotation = True)
obj2c.select = False

It's because the copies are not on the scene so you can't make them active. To do so the command is bpy.context.scene.objects.link(ob)

import bpy

obj1c=bpy.data.objects['Obj1']
obj2c=bpy.data.objects['Obj2']

obj1c = obj1c.copy()
obj2c = obj2c.copy()

obj1c.data = obj1c.data.copy()
obj2c.data = obj2c.data.copy()

bpy.context.scene.objects.link(obj1c)
bpy.context.scene.objects.link(obj2c)

bpy.ops.object.select_all(action='DESELECT')

obj1c.select = True
bpy.context.scene.objects.active = obj1c
bpy.ops.object.transform_apply(location = True, scale = True, rotation = True)
obj1c.select = False
bpy.ops.object.select_all(action='DESELECT')

obj2c.select = True
bpy.context.scene.objects.active = obj2c
bpy.ops.object.transform_apply(location = True, scale = True, rotation = True)
obj2c.select = False


Can an emitter receive shadows from another emitter in Blender Render? Scenario:

Can I get blue shadows on the red plane?
And red shadows on the blue plane?
But, without using any external lamps...

Yes.  Go to World > Indirect Lighting, and check that.  Then go down a little to Gather, and click Approximate


Denoise Node is"Disabled" but is working The Denoise Node is working but it is giving this warning. Should I change something? Note I have enabled denoise in render layers.

The denoise is not working because your blender build has no openImageDenoise.What removes the noise is the legacy denoiser in the renderlayer which is not based on machine learning.


Is it possible to get rigid body objects to move randomly in space? I'd really like to simulate a environment with multiple objects flowing around in a confined space, randomly, almost like they are under the influence of zero gravity. How would I go about doing this? They must be rigid body type objects.

This is possible. The solution contains multiple steps though (long answer).

Requirements:

random starting location and rotation
rigid bodies
no gravity
random initial velocity

In my example this resembles and asteroid field.

Setting up objects

Create a large domain. Add a particle system to it, emit randomly from volume. Check the Rotation option and set them to random values. In the Render section use a dupli object. I randomized the scale as well for more variety.

Convert the particle modifier, then hide or remove it. The objects have been created, each with their own location, rotation, scale. Apply the scale if you wish. Ctrl+A

Create the rigid body world in the Scene properties panel. I deleted the dupli object. Select the large domain object and make it a passive rigid body with mesh boundaries. Hide it temporarily.

Select all the particle duplicates, with one as the active object. Make it an active rigid body. In my case the objects are cubes.

Copy the settings to all selected.
This will take some time. Use few objects or be patient. After the operation all objects are rigid bodies confined to the walls of the domain object. Running the simulation with Alt+A will result in the objects tumbling onto the domain floor.Solve this, by disabling Gravity in the Scene Properties Panel.The object will now (mostly) stay as they are. They're rigid bodies which will collide physically.Unfortunately, we can not give rigid bodies a starting velocity.

Setting up an initial velocity

Rigid bodies don't have a starting velocity. But since their  can be keyframed and because rigid bodies calculate their movement on previous frames, we can achieve this with keyframes.

In this example, the cube has two location keyframes on frame 1 and 3. Its animated rigid body property is keyed to ON on frame 2 and to OFF on frame 3. Hence the speed of frame 2 is the input for frame 3 and following.

To animate all particle object over the span of two frames, I will use a python script.

The script will do the following:

get all selected objects (our particles)
get the start frame
for each object:

  key the first frame of the scene (location and rotation)
  translate and rotate the object randomly
  key the location and rotation to the third frame of the scene
  key the animated property to ON on frame 2
  key the animated property to OFF on frame 3

I will use the following modules.

import bpy
from random import random
from random import uniform
from math import pow
from math import pi

We will need a function to generate a random vector. Let's setup a threedimensional array with random values, the normalize it and multiply it with a given length (pLen).

def genRandVec(pLen):
    #setup random translation vector
    t = [random() - 0.5 for x in range(3)]
    # normalize the translation vector
    t_len = pow(pow(t[0], 2) + pow(t[1], 2) + pow(t[2], 2), 0.5)
    t = [x / t_len for x in t]
    # multiply it with the length
    t = [x * pLen for x in t]
    return t

Next up is a function which will move and rotate an object with a certain randomization. We will get the parameters:

obj          the input object
t_amount     the maximum amount of translation
t_var        the amount of variance in the translation [0 ... 1]
r_amount     the maximum amount of rotation
r_var        the amount of variance in the rotation[0 ... 1]

A random value of the variance is input into the genRandVec function. Then location and rotation_euler of the object are altered.

def randLocRot(obj, t_amount, t_var, r_amount, r_var):
    t_rand = uniform(1-t_var, 1)
    t = genRandVec(t_amount * t_rand)
    obj.location = (t[0] + obj.location.x, t[1] + obj.location.y, t[2] + obj.location.z)

    r_rand = uniform(1-r_var, 1)
    r = genRandVec(r_amount * r_rand)
    # because radians are confusing
    r = [x*pi/180 for x in r]

    obj.rotation_euler = [obj.rotation_euler[0] + r[0], obj.rotation_euler[1] + r[1], obj.rotation_euler[2] + r[2]]

With these functions we can easily assemble the required steps.

def randomTwoFrameMovement():
    # get scene variables
    sel = bpy.context.selected_objects
    scn = bpy.context.scene
    startFrame = scn.frame_start
    keyInterp = bpy.context.user_preferences.edit.keyframe_new_interpolation_type
    # set interpolation type
    bpy.context.user_preferences.edit.keyframe_new_interpolation_type ='LINEAR'
    # counter
    i = 0
    for obj in sel:
        i = i + 1
        print(str(i) + " / " + str(len(sel)))
        obj.keyframe_insert(data_path='location', frame=startFrame)
        obj.keyframe_insert(data_path='rotation_euler', frame=startFrame)
        randLocRot(obj, 0.2, 1, 2, 1)
        obj.keyframe_insert(data_path='location', frame=startFrame+2)
        obj.keyframe_insert(data_path='rotation_euler', frame=startFrame+2)

        obj.rigid_body.kinematic = True
        obj.keyframe_insert(data_path='rigid_body.kinematic', frame=startFrame+1)
        obj.rigid_body.kinematic = False
        obj.keyframe_insert(data_path='rigid_body.kinematic', frame=startFrame+2)

    # set interpolation type back
    bpy.context.user_preferences.edit.keyframe_new_interpolation_type = keyInterp

Select all particle object and call randomTwoFrameMovement(). Then, simulate the Rigid Body World.

The Calculate Mass tool is very useful. Setting the rigid body dynamics to 0 Damping results in a more space-like feeling.

 Higher Resolution


Design of Pen holder with musical score I’m again here to ask your support. I’d like to draw a 3d-print someting similar to “tower of pi” but instead of using numbers, I’d like to use a musical score, let’s say beethoven fifth symphony.

I have a picture (B/W image) of what I need:

I would “extrude” black portion of musical score, wrapped around a cilindrical shape.

Is there some way to use a displace modifier in order to use mi musical score to be wrapper around a spiral?

Thank you very much as usual!
Francesco

I had a quick go.

Took the source image into GIMP and made it one long line.

Imported that image into Inkscape and used Path/Trace Bitmap to create the vector data, then saved as SVG. See notes at the end.

Used import from the File menu in Blender

Then extruded the curve. I also converted the curve to a Mesh and used the ReMesh Modifier to stop some bad geometry where vertices where connected from great distance.

From the User Preferences view I searched for Extra and selected the Curve: Extra Objects

Now I could add a new Curve and select the type Spiral and Logarithmic. Set the height and the number of turns to create the spring shape.

In the Curve panel ensure the Twisting is set to Tangent. This ensures the results do not twist as they are modified by the spiral. Without this you get an unpeeled orange effect.

Now you can add a Curve modifier and select the Spiral.

The final result.

Notes:
The image was not particularly high resolution and made the initial vector data quite messy.

I needed to remesh the curve to get the vertices density required to allow the curve to take place.

There are lots of disconnected pieces, not ideal for 3D printing.

My basic result has obvious sharp ends that would need additional work to create a clean cylinder.

Suggest you take a lot of time to create nice neat/clean vectors before trying to extrude/curve.


Fighting split col and aligning row content I am really struggling with horizontal alignments.

Look at lower right image example.

Layer + Parent are in one column and a split function defines the width of the next column that contains the layer and parent UI elements.

The problem is that this way the row like horizontal alignment is off.
Parent text is higher than the parent UI element.

I tried different row ideas but nothing worked.
To my frustration in the upper right corner the parent UI is drawn on the left side while the layer element is on the right side. What causes this?

So this is what I try to do.
Lets say 30/70 column spacing
and the content aligned along their top edge

The % value should be global so I have to adjust it once and the layer + parent UI will be stretched along the length.

Two approaches.

not pixel accurate, but less code.

c = layout.column()
row = c.row()
split = row.split(percentage=0.3)
c = split.column()
c.label("Layers")
split = split.split()
c = split.column()
c.prop(obj, "layers", text="")

c = layout.column(align=True)
c.prop(obj, "parent", text="Parent")

Pixel perfect but a little convoluted!

c = layout.column()
row = c.row()
split = row.split(percentage=0.3)
c = split.column()
c.label("Layers")
split = split.split()
c = split.column()
c.prop(obj, "layers", text="")

c = layout.column()
row = c.row()
split = row.split(percentage=0.3)
c = split.column()
c.label("Parent")
split = split.split()
c = split.column()
c.prop(obj, "parent", text="")

The second version can be restated using a function, there's a lot of repetition, and you might want to do the same for more properties..

    def draw_props(labelname, propname):
        c = layout.column()
        row = c.row()
        split = row.split(percentage=0.3)
        c = split.column()
        c.label(labelname)
        split = split.split()
        c = split.column()
        c.prop(obj, propname, text="")

    draw_props("Layers", "layers")
    draw_props("Parent", "parent")


Can anyone explain to me what the advantage is of the current Child Parent location is? Almost in every other apllication that uses a coordinate system with a world origin, the basic principle of a child parent relationship is: the parent becomes the child world origin. In blender when you parent an object, the transform(position,rotation,scale) stays the same, even more against every basic logic, when you move the parent, the transform of the child object stays the same, I know there are workarounds, but for me and many others that come from other 3d packages this makes even the most simple rigs very backward and a pain to work with. So can anyone give an answer other then : "this is how blender works"
First of all, blender is awesome, but if this isn't fixed in the future then I fear blender will never become an industry standard beyond basic asset creation.

there are 2 types of assigning a parent you might be interested in:

regular one:

and keep transform one:

as you can see both have a 0.1 vector transform but they are not positioned the same from the parent.
read more about it here:
https://docs.blender.org/manual/en/2.79/editors/3dview/object/properties/relations/parents.html


Why are my Cycles settings missing? so I'm working on a little bathroom scene and wanted to make a clay render. I started looking for the material override which I kinda knew where it was and on the way I switched my render engine accidently to workbench instead of cycles. Switched to cycles all my seetings on the render tab are missing except color management and free style. Hows that? I restarted blender multiple times and tried some other stuff but nothing changed a thing, and I'd rather avoid a new installation

Oh, that's weird.
This typically happens, when you check ✓ Filter Add-ons in the Tool tab.


Using RNA Property in Drivers? I'm currently trying to modify some drivers so that they are disabled when they're not on a proxied armature.  Right now, I'm using the following script to set a custom property, which is used by the drivers:

import bpy
from bpy import context

class UseHeight(bpy.types.PropertyGroup):
    @classmethod
    def register(cls):
        ob = context.object
        if("UseHeight" in ob.keys()):
            ob["UseHeight"] = (ob.proxy != None)

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

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

if __name__ == "__main__":
    register()

However, I have to put this into every script I use, and with how my memory has been impacted by my health problems, I don't want to add yet another thing for me to keep track of.  I've attempted to use it as an addon, but it fails to work due to this error:

Exception in module register(): '/home/zauber/.config/blender/2.69/scripts/addons/MaelstromUseHeight.py'
Traceback (most recent call last):
  File "/home/zauber/Desktop/blender-2.69-linux-glibc211-x86_64/2.69/scripts/modules/addon_utils.py", line 311, in enable
    mod.register()
  File "/home/zauber/.config/blender/2.69/scripts/addons/MaelstromUseHeight.py", line 12, in register
    bpy.utils.register_class(UseHeight)
  File "/home/zauber/.config/blender/2.69/scripts/addons/MaelstromUseHeight.py", line 7, in register
    ob = context.object
AttributeError: '_RestrictContext' object has no attribute 'object'

So, what do I need to do to get this working?  Or is there a way I can directly check if the object's proxy value is equal to "None" inside the drivers?

From the advice of CoDEmanX and reading documentation, I figured out what to do last night.  I changed it all to use a pair of handler functions.  Here is the altered script:

import bpy
from bpy.app.handlers import persistent

bl_info = {
    "name": "Maelstrom Height Handler",
    "category": "Object",
}

'''
Called when the scene is updated, and calls height_general_update if
any objects in the scene have been updated.
'''
@persistent
def height_scene_update(scene):
    if(bpy.data.objects.is_updated):
        height_general_update(scene)

'''
Iterates through each scene object to see if the "height" property
is present, then adds and/or adjusts the "useHeight" property.  Does
nothing if the height is unchanged, to prevent other potential code
from running.  Runs when a scene is loaded or when called by the
above function.
'''
@persistent
def height_general_update(scene):
    didChange = False
    for obj in bpy.data.objects:
        rigChanged = False
        if("height" in obj.keys()):
            val = int(obj.proxy != None)
            if("useHeight" not in obj.keys()):
                obj["useHeight"] = val
                rigChanged = True
            else:
                if(obj["useHeight"] != val):
                    obj["useHeight"] = val
                    rigChanged = True
        if(rigChanged):
            print("Adjusting useHeight flag of", obj.name)
            didChange = True

def register():
    bpy.app.handlers.scene_update_pre.append(height_scene_update)
    bpy.app.handlers.load_post.append(height_general_update)

def unregister():
    for idx, val in enumerate(bpy.app.handlers.scene_update_pre):
        if(val == height_scene_update):
            del bpy.app.handlers.scene_update_pre[idx]
    for idx, val in enumerate(bpy.app.handlers.load_post):
        if(val == height_general_update):
            del bpy.app.handlers.load_post[idx]

if __name__ == "__main__":
    register()


A polygon uses the same vertex twice error in animation nodes I am trying to recreate the animation nodes example from the online documentation that is here.
https://animation-nodes-manual.readthedocs.io/en/latest/user_guide/nodes/mesh/operators/create_polygon_indices.html
I get an error at the combine mesh node (Which used to be the Combine Mesh Data Node) "A polygon uses the same Vertex twice"
I have tried fix it but couldn't. I would like to know why. Thanks. I am using animation nodes 2.1.7
and Blender 2.83.1
I have attached the Blend file.

I fixed it by connecting the math add node to index instead of iterations and added the edges of polygons node.


How to change texture of all objects at the same time? I have an object that has been divided into 3 parts and joined by a 'Plain Axes'.
How do I change the texture of the 3 parts of the object at the same time?

Thanks!

Try applying the same materials on those parts if they are just using the same texture. have them UV unwrapped uniformly so they will have the same amount and look of the texture as you adjust the material.


Blinking noise on animation I created Christmas tree using this tutorial (http://www.blenderguru.com/tutorials/how-to-make-a-christmas-tree/). In a words it uses Sapling Add-on(3-level tree) and Hair particle system using 900k emission number, and shaded with this node scheme:

Then I created simple "Rotation" keyframes, which rotates camera around the tree, but from frame to frame the noise looks like its blinking, here is the  first 10 frames animated in gif:

What is wrong?

Thanks for all comments, the reason was in rendering noise. By default it was only 10 Samples for render (Properties -> Render -> Sampling -> Samples -> Render), Now I use 200 samples and Hair particular System looks perfect! But after changing this option each frame  rendering time increased in several times, so you should not increase Samples count too much.


Rotate a particular bone in edit mode without offsetting animation? I have an armature of animated bones and I want to rotate the main bone by 90 degrees in edit mode so that that particular bone has the right orientation when exporting the animation for the source engine (I accidentally animated it with the wrong rotation).

My animations are already finished, so when I rotate the bone in edit mode now it messes up the animation. (The bone is moved away from its original position and moves in the wrong direction during the animation.)

How do I fix this?

This is what the problem looks like:

Here's one of the .blend files (not rotated): idle.blend

Here's a function I wrote that lets you rotate a bone in edit mode and automatically corrects all animations so they maintain the same orientation:

def reorient_bone(operator, context, fixed_items, layers=(), bone_name="Bip0", location=mathutils.Vector((0,0,1)), rotation=mathutils.Euler((0,0,1)) ):
    qrn = rotation.to_quaternion().conjugated()
    qe = rotation.to_quaternion()
    #when no object exists, or when we are in edit mode when script is run
    for ob in bpy.context.scene.objects:
        if type(ob.data) ==  bpy.types.Armature:
            bpy.context.scene.objects.active = ob
            bpy.ops.object.mode_set(mode='EDIT')
            for bone in ob.data.edit_bones:
                if bone.name == bone_name:
                    l =  mathutils.Vector(bone.head)
                    m =  rotation.to_matrix() * bone.matrix.to_3x3()
                    bone.head = mathutils.Vector((0,0,0))
                    bone.tail = mathutils.Vector((0,1,0))
                    bone.roll = 0
                    bone.transform(m)
                    bone.translate(l)
            bpy.ops.object.mode_set(mode='POSE')

    for action in bpy.data.actions:
        for group in action.groups:
            if group.name == bone_name:
                #rotate the translation so the movement of the bone remains identical
                for t in ("location", "quaternion"):
                    curves = [fcurve for fcurve in group.channels if fcurve.data_path.endswith(t)]
                    if curves:
                        num_keys = len(curves[0].keyframe_points)
                        for i in range(0, num_keys):
                            frame = curves[0].keyframe_points[i].co[0]
                            key = [fcurve.keyframe_points[i].co[1] for fcurve in curves]
                            if len(curves) == 3:
                                key =  qrn * mathutils.Vector(key)
                            else:
                                #arbitrary rotations keeping the worldspace character of the rotation
                                if fixed_items == "0":
                                    q = mathutils.Quaternion(key)
                                    v, a = q.to_axis_angle()
                                    v =  qrn * mathutils.Vector(v)
                                    key = mathutils.Quaternion(v, a)

                                #for the other case - restore rotation around rest bone change
                                if fixed_items == "1":
                                    key = mathutils.Quaternion(key) * qe
                            for a in range(0,len(curves)):
                                curves[a].keyframe_points[i].co[1] = key[a]
                        for fcurve in curves:
                            fcurve.update()
    #call the tangent function
    loop_fcurve_tangents()
    return {'FINISHED'}