Using object.convert function after creating object I'm creating an object from code

obj = bpy.data.objects.new("ObjectName", SomeMeshData)
bpy.context.scene.collection.objects.link(obj)

Now, i want to convert this object into a Curve, using blender console i can see it's quite simple: bpy.ops.object.convert(target='CURVE') from code this doesn't work causing: RuntimeError: Operator bpy.ops.object.convert.poll()

Using obj.convert(target='CURVE') causes different error:

AttributeError: 'Object' object has no attribute 'convert'

Should i 'select' the object and then use this function? This doesn't sound like proper approach cause i want to do this for thousands of objects and i also tried selecting and couldn't make it working.

New Blender 2.8 API is so confusing, after hours of searching all forums i can not find any way to make it work. This should be fairly easy task but seems to be impossible for some reason. I'm a newbie, please help.

Ok, so i found the answer:
Since bpy.ops.object.convert() needs a context the only way i managed it to work is:
obj.select_set(True)
bpy.context.view_layer.objects.active = obj
bpy.ops.object.convert(target='CURVE')

Though, it's quite weird that i have to 'manually' select an object to be able to use it, why not just obj.convert()? I'm not sure if method i used is the only one possible but i tried A LOT of stuff.
If there is a better, more elegant and robust method, please let me know!
Blender API changes so fast that it took me couple of hours to find the answer, even Blender 2.81 Docs were saying

bpy.context.object = obj will raise an error.
But
bpy.context.scene.objects.active = obj will work as expected.

While bpy.context.scene.objects.active is already deprecated!


The render result is correct but when in the viewer node the render is going off screen I'm trying to put my render with a background image which worked the first time, but when I enlarged the resolution of the background image in photoshop to twice its size (from 4368 × 2084 to 8736 × 4168) and put it back in blender (and after doubling the size of the render resolution to match) the render is going off screen as shown in the pictures. How do I fix this?

Here's a link to screenshots: https://www.flickr.com/photos/163507419@N03/?

first one shows how I want it to look (this was when it worked at the 4368 × 2084 resolution), the others show what it looks like now

thanks in advance

Without having your .blend and image files at hand, I can't tell for sure what is happening.

However, usually a "Scale" node (found under "Distort"), set to "Render Size" and applied just after the Image input, should guarantee that RenderLayers and external images have matching sizes. (Note: if the image is smaller than the render layers, it will be stretched, losing sharpness in the process)

I don't know, however, why they don't match already if – as you say – you already changed the resolutions in both the image and Blender. I can just suggest to check again.


I have this weird effect after I apply shade smooth I am creating a glasses by following this tutorial
https://www.youtube.com/watch?v=9rGp_-zgjxQ
At 12:09, after I apply shade smooth on the frame and the lens. It has this weird effect.

I've been following closely to the tutorial. Is there any other way to solve the problem or I should just accept the flaw?

Did you select autosmooth check box?
It is right here, it should most probably solve your problem:

If it doesn't fix it here's is another possible solution:

Click on the arrow next to viewport overlay
Select 2nd option from the bottom called face orientation.
If all the faces are blue, you are good to go, if any face is red you might have to recalculate the normals.
to recalculate normals, go too edit mode, select all the face by pressing A, press Alt + N, From the list that opens select recalculate outside.


Is there a generic way to lookup what a hotkey/shortcut does under current user prefs? Example: today I worked through a tutorial where the person running the tutorial casually said "And now we'll double tap R..."

This is easy enough to follow, behaved as expected, and I can see that the behavior is different from just hitting R once and rotating normally. I am not sure what the nature of this difference is, though, and would like to be able to look up in my Blender interface: what action/behavior is currently mapped to the key combination "double-tap R"?

Is there a generic way of doing so?

Yes, there is.

You can go to Setting > Keymap, here is all the input event user does.

And up there is a search bar. With Key-Binding search method selected, you can search your short cut by key.

If you are using 2.79b for an old favor. The same panel is in user preference > Input.

And the sequence of what you tap when operator is running (the second R) is inside the modal group keymap, you need to expand the action group to see it.


Snap an empty to a bone's coordinate, quickest way? I'm doing a ragdoll system with lots of rigidbody constraints. I use empties as constraints, which will be snapped to the location of a bone.

The problem is that my armature has too many bones and I have a lot of empties to snap to. So is there a quick way to snap a empty to a bone's location?

The possible way I find is to transform snap an empty to a bone's vertex, but somehow the bone's vertex won't be recognized by the snap tool?

I use the procedure described here to parent an Empty to a bone.  For example set the cursor to a location between a characters eyes; I then add an empty between the eyes (Empty.eyes.rig-dz1), parent that to a face bone to track (might also be able to add Copy Location constraint instead?).  I then have another character whose Eyes have an animated Copy Location (target==empty).  So that when it is enabled, eyes will look the other as the other moves.


Copy and Paste creates random null objects from existing geometry i have a really annoying and strange copy & paste bug.

Sometimes when i want to copy & paste an object, blender creates random null objects from my existing geometry, sometimes everything is deleted exept the copied object.
I couldn't reproduce this bug in a new file.

Maybe changed some settings accidentally with a shortcut?

Iam using Blender 2.9 A

Best, Joseph

If you want to duplicate objects in your scene, instead of using Ctrl-C to copy them, consider using Shift-D instead. Admitedly. It's a bit confusing that there are both methods available when they don't seem to completely work the same way. I don't use Ctrl-C for anything except copying poses in Pose Mode. And I have no issues. Interestingly, when I just tried to use Ctrl-C on an object in a scene, as you have done, I got a weird result also: It made an extra copy of my armature object. However, it's an armature that wasn't even part of the object I tried to copy. Very odd.


How to offset the start of rigid body physics to a specific frame How can I tell Blender not to start applying physics until a certain frame? Is it possible? I have a very complicated shot, where a massive object is crashing though various different cell fractured elements, but despite having tried the Enable Deactivation/Start Deactivated and trying somehow to set up keyframes for the Dynamic check box, all of my objects that are supposed to activate when my large object interacts with them end up just breaking apart on their own free will at the beginning of the animation. Is there a solution I am missing?

To offset when a rigid body simulation starts, I would suggest that you use keyframing to your advantage. You can keyframe any option in blender, including the "Animate" and "Dynamic" check boxes in the rigid body options. Mouse over the "Animate" or "Dynamic" checkbox and press "i" like any other add keyframe.

You can then make it so that only when the object is hit, or at a certain time, will the object begin to fall. Likewise, you can also use this so that your fractured objects do not fall apart until they are hit or about to be hit. Hope this helps!

P.S.You can find a full tutorial detailing this sort of animation/simulation here. This is a three part tutorial (with a prequel teaching how to model the mug) made by Blender Cookie.


Why is part of a mesh a different color on the viewport? I would like to know if the color of a mesh means something special. Is it because these two triangles are deep grey that something is wrong with them?
Thanks everyone.

Normally, I believe it's just plain shadows that blender generates for you to be able to identify the object as 3D. However in this case, the unusual colouring of these faces are most likely because their normals are the wrong way around. If your model is well designed (in which you made sure all the edges connect each other with no holes or gaps, which can be re-ensured using remove doubles in edit mode, but don't do this if you actually need different vertices in the same place), go to edit mode, click the UV tab on the left and recalculate normals.

Or to avoid any confusion, click Reverse normals on the faces that look unusually dark. If they become brighter and more grey rather than blue, it means their UV's were the wrong way around and are now the right way around. This is essential when importing models into game engines like Unity 3D, where you wouldn't want to have a partially invisible asset.

Here:


Does Blender have the equivalent of Photoshop Smart Guides? I'm doing my first blender tutorial. I want to extrude a face to create an upper lip but I don't want it to be larger than the lower lip as I extrude. In photoshop this is easy because the smart guides automatically create a pink line when and object you're dragging or extruding aligns with another edge/object.

Example:

I tried the solution found here: Object alignment/Pattern Object/Smart Guides in Blender but that did not actually apply to my use case at all.

I tried the different snap options but none of them seem to do it. If not, what's a simple way to guarantee that an extrusion does not go beyond a certain point?

"Snap" is what you're looking for, but the way to use it isn't really intuitive if you come from Photoshop. Please let me detail the procedure step by step.

Starting with the default config :

Set the "Snap element" to Vertex
Start to extrude with E. If needed, specify an axis (X in your case)
Keep Ctrl pressed, and move your mouse cursor to either A or B. When the face snaps, press left mouse button to validate.


Joining additional objects breaks armature I'm very new to Blender and am working with a simple collection of cylinders and a three-bone armature.

Suppose I go into Pose Mode to check rotation and find that a cylinder's accidentally been left behind in a Join. I'd like to simply Join the unattached piece but when I do it appears to break the parent connection with the bone. I anticipate making additions as my object requires more detail and am sure I'm not alone in this so I wonder what's the correct way to do this.

I had several problems.

There were multiple stray & empty Containers, which I examined and deleted.

The object hierarchy was incorrectly nested.

I may have been selecting objects to join in the incorrect order.

While none of the other Stack Exchange-suggested questions were exact duplicates they did help me to think about this correctly and solve my problem.


How to retrieve dupli data in 2.8? In 2.79 there is dupli_list_create and bunch of attributes to get from it:

https://docs.blender.org/api/2.79/bpy.types.DupliObject.html#bpy.types.DupliObject

According to the change log it was removed in recent version:

https://docs.blender.org/api/current/change_log.html?highlight=dupli_list

What is analog for 2.8?

From batFINGERS' answer:

  Instances can be obtained from the depsgraph.
  https://docs.blender.org/api/master/bpy.types.DepsgraphObjectInstance.html#module-bpy.types

  There is a section in

  https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Scene_and_Object_API

So, bpy.context.evaluated_depsgraph_get().object_instances is a replacement for bpy.context.object.dupli_list


How can I make both sides of this mesh bright in material mode? I have recently been started to model a fairy in blender but when I got to the wings I realized I have a problem... you see I don't want to give any width to the wing, so wanted to solve it with a two sided polygon like this:

But the problem is, the back side of the poly is always dark, and it makes the teyture darker too in material view. I want this model to be a game character, and I don't know how Unreal Engine will handle the backside culling.

Any alternative ideas how I should  solve this?

Every face has a normal- a direction that shows where "outside" is. By this I mean that when multiple faces are joined into an object, it tells blender that the rest of the space is outside and inside the object is inside. Blender shows the inside portion darker so you know  where your normals are facing. Unreal engine will make backside normals invisible, so I would suggest a solidify modifier with a very thin thickness. The wing will remain very thin, but not have any normal issues.


Is it possible to split a .blend file? Is it possible to split a .blend file, e.g when a scene has grown and exceeded a manageable number of objects?

I would like to save some groups into a new .blend, texture the objects in the newly created file and link to the original scene. Probably I could export object to Collada and re-import them to a new .blend. Is there a native way that I've overlooked?

First, a workflow question about your scene: might it work just as well to set up a different scene in the same blend file, dividing the groups between the two scenes?

If not, I think the fastest way within blender would be to save your blender file under a new name (or twice, each under it's own new name) and delete the objects in the group you want to split out in one copy, and delete all of the other objects in the other copy. (Keeping the original unchanged is just part of my standard workflow. I'm too afraid of deleting an object from both copies and losing it. Your mileage may vary.)


Why are there black frames in my project? again, as a prologue, I have close to no experience with Blender. Just getting into it driven by the fact that my Son wants to be a Minecraft Youtuber, and thus needs an Intro. So I found a free Blender template and just started jiggling.

Here's the current state. It's actually being synched to this place whenever I save locally.

https://drive.google.com/open?id=0B9par3l2T-UJQ1paY0tZRXlpN0E

From frame 42 to 52, the rendered output just shows a black screen. This is because the original music had a break there, but the music I will use doesn't. I'm unable to find where this is defined. Any ideas?

I've tried to delete all things from the scene, then add new cube, camera and lamp. Even this doesn't help, hmm... curious setup.

But you can try create new scene via Link object and data.

1. Switch top tab to Info

2. Hit Plus to add new scene and choose Link Object Data

3. Go to Compositor and make sure you are working in a new scene

4. Now your image should render fine. (I switched plugs for Alpha Over node to show final render)


How to "flatten" the faces of a solid to level with its vertices? I have the following decahedron:

But as you can see below, its faces are not "flat" but rather curve towards the inside:

How can I make it so that all the faces become flat kites, without adding edges or vertices?
EDIT: To be clear, I want to end up with a shape similar to this:

A very unscientific way to do it would be to first create this shape:

Use the Array modifier in Object Offset mode, rotate the offset object 72° on the Z axis:

Rotate your mesh in Edit mode so that if fits perfectly with its instances:

Apply the modifier, duplicate, rotate the copy 180° on the Y axis, rotate 36° on the Z axis, merge the 2 meshes:

Bevel if you want more geometry:


How to make a (mesh) light only cast a shadow? How to turn a (mesh) light into a shadow caster only? I want to use a (mesh) light to cast a shadow only, not actually light anything. It's easily done in the blender internal and other software. Question is how to do it in cycles?

1: Negative lighting

Add a lamp and an idetical one but with negative strength and shadow casting disabled:

Positive Lamp

Negative Lamp

Without the Lamps

With the Lamps

Additional Notes

Because mesh light shadow casting can not be disabled, this works only for other light sources. Requires more samples than without the shadows. These are subtractive shadows, meaning the value of the shadow is subtracted from the color. Multiplicative shadows would look better, but those require spearate render layers and compositing.

2: Compositing

On the render layers tab there is an option for quickly replacing all materials with a single one, which can help with creating a shadow map render for the light by using a simple white material. You could exposure and gamma adjust the result of the render layer and multiply it ower the original render.

Additional Notes

This is a little longer setup, but with material overriding and putting the main lights and the shadow light to separate layers it can be easier. It might be good to disable bounces for the shadow render. This method however, instead of casting only shadows also darkens faces facing away from the light.


Object created by joining several objects doesn't rotate uniformly consistently Aloha.

I'm experiencing a similar problem I had with a prior posting Joined spin dupli objects don't rotate together with another object I created by joining 3 objects that doesn't rotate uniformly consistently.

I tried clearing and applying rotation of individual objects and joined objects to no avail.

I have screen cast of defective object as well as object by itself in blend file if you need to see them

Any ideas?  Thanks.

Your problem is with the precision of your model, you should improve your modeling skills and take care of your mesh.

You model needs some serious clean up, there are quite a few misplaced vertex, inverted normals, non manifold faces, overlapping geometry, etc.

There is also one unused Copy Rotation constraint, probably a leftover from when there were several objects

Now to the problem at hand, what you are seeing is probably an optical illusion, your model seems to be rotating at different speeds because the center is not accurately placed relative to the geometry, making the center part "wobble" in relation to the rotation center.

Now your geometry is really uneven and you should probably model it cleanly from scratch, but if you don't want to, just enter edit mode, select the central vertex, move the cursor to selected, exit edit mode and align objects center to the cursor position.

Do this for all objects, although they are all slightly skewed and wont easily be totally perfectly aligned


Bone rig doesn't work? I'm trying to rig a model I have, but when I add the skeleton, I pose and it glitches.
An arm also pulls the stomach, 1 leg bone will pull both legs, and the head will pull the body too. I don't know what to do!
(BTW I used Automatic Weights, with Envlope Weights it's a whole different problem.)

Use weight paint mode in order to fix the geometry effected by the bones.

Select the mesh and you can change to weight paint mode by pressing CTRL + TAB.

Use CTRL + Right Click to select bones. You will see colors ranging from Red (a weight of 1) to Blue (a weight of 0). A weight of 1 means the geometry moves with the bone and a weight of 0 means the geometry is not affected by the bone. You can use the subtract brush to remove weight from geometry you do not want the bone to affect.

You can learn more about weight paint mode here: http://blender-manual-i18n.readthedocs.io/ja/latest/modeling/meshes/vertex_groups/weight_paint.html


How to make an object move on a Mobius strip? I have Mobius strip and a sphere. I want the sphere to move on the strips surface, like on a path. How can I do this?

I've tried drawing curves, but I can't create the whole path at once and I've tried joining drawed pieces but the sphere moves just on the first drawed curve. I've tried joining two circles but also the sphere goes just on one of them. There is a way to create a mobius nod directly but it doesn't match the shape and I can't make it match. Can I somehow draw the path by code?
I'm very new to this so if there's an easier way I would appreciate it.

Tryed making edges the path, didn't work.

Create a Bezier Curve. Open it (it shouldn't be closed). Tilt one end 180°. ⎈ CtrlT
The Curve should resemble the twist of the moebius strip.

Add a Follow Path Constraint to the object. Check Fixed Position and set a key with the offset at 0 and 1.

Select the created keyframes and make them linear. T > L
Then make the graph cyclic. ⇧ ShiftE > Make Cyclic
Set a key on the first frame of the rotation. I
Set a key after the second keyframe of the offset on the rotation with the object rotated 180°, making it ready for the second circulation.
Set the new keys to constant interpolation. T > C

Wheeee!


Overriding Node Wrangler Keyboard Shortcuts I use Linux Mint, and unfortunately, I can't use a lot of the Node Wrangler shortcuts because they conflict with the Operating System shortcuts.  For example, I can't use Lazy Mix because it moves the window instead.  I went inside the Node Wrangler source code and tried to change it to a differnt short cut (which kind of works...) but I still have to release the right mouse button and such.  Can anybody explain how to get around this OR what each of these parameters represent in the Node Wrangler addon?:

# Lazy Mix
(NWLazyMix.bl_idname, 'RIGHTMOUSE', 'PRESS', False, False, True, None, "Lazy Mix"),

Edit: If I can do what gandalf3 suggested in the comments, that would work too.

What I ended up doing was going into the Windows settings and changing the "Special key to move and resize windows" to Super (the windows button) instead of Alt.


How to " no-flood-fill " a texture? By No-Flood-Fill I mean filling like in paint. A fill brush in blender fills the entire object. This is not the result I am looking for. However, I want to fill only instead of a certain color?

Any help would be really appreciated, thanks. :D

Use the Fill Tool in the 2d Image Editor and you can then use the Thresh hold setting to dial in your desired tolerance. This threshold feature is not possible as of yet in the 3D view in Texture Paint mode, as it is a different process for painting under the hood. I believe that google search should have brought you to a thread here if I am not mistaken(I made that picture).


Turning off deform for all bones How do you turn off deform for all bones in a rig? I've tried selecting all the bones in Edit Mode and unchecking Deform, but going through each bone, I've noticed some are still checked.

Select all your bones in Edit mode, put your mouse cursor over the Deform checkbox, and click altenter, it will deactivate the Deform option for all the selected bones.


Rope Physics Causing Issues I've read through a few questions, watched at least 5 videos and I'm getting stuck on this. Hoping more experienced users can help me out.
In the attached Blend file, I've got a mortar board I've created and I'm in the process of trying to get the first strand ready. I'm talking about the cord that connects from the pin at the top of the hat to the brass or metal piece before all the strands.
I finally seem to have some of the settings right because the string is pinned where I want it. However, it's like the hat doesn't exist. I have collision turned on. Can someone give me an idea of what I'm doing wrong? Or if you have one, an easier way to go about these next steps?
I'm trying to get this project finished by tomorrow (or the weekend). Any tips would be greatly appreciated!

First, you need to fix the normals on the hat.  They're pointing the wrong direction.  This can often cause issues with physics, which can use normals to decide inside/outside-- what's solid and what's not.
But that's not the only issue.  The other issue is that you're colliding simple, low-vert-density strings of verts-- remember, your skin modifier isn't even being evaluated until after the physics-- and so there are only a few places on the mesh that are even being checked for collision with the hat.
By default, soft body physics like you're using uses virtual balls centered on each vertex of the mesh to test for collision.  And if you play that animation, after fixing normals, you'll notice that none of your vertices ever go through your hat.  The collision is working!  It's just that it looks wrong, because even though the verts collide properly, the edges still go through the hat.
One thing you can do is, just make more verts.  This will create more places along your string for Blender to test for collision with the hat.  Subdivide your strings to create 3 or 4 times as many verts.  Do this in edit mode: modifiers won't be evaluated until after your soft body physics have run.  You'll probably have to tweak your physics settings afterwards: more verts means more freedom of motion, which usually needs to be compensated for by strengthening soft body edge forces.
Another option is to use edge collision instead of vertex collision.  In properties/physics/soft body/edges, you'll see a checkmark for "collision edge".  If you enable this, Blender will try to use the edges of the mesh for collision.  I think you'll see that you'll still want more vertices than you have right now though.


How to import recorded iPhone gyro data into blender? I recorded iPhone's rotation and now I want to import these data as x,y,z for object rotation in blender.

How can I convert OSC or CSV formats into F-Curves?

Thank you for help.

Download SensorLog app for your mobile device (free) and record some motion. Data can be send from device via mail or you can connect to local network. Output format is CSV.
Download add-on csv_fcurve_importer to import csv data.
Addon appear in Scene properties window.
(Works for blender 2.74)

Thanks to zeffii's comment about OSC vs. CSV formats.


Can i open the linked object to another blender session from current scene? I imported (link) another .blend files into my scene. To view those link paths, in outliner , i change the display mode to 'blender file'. There's a path list there, but :

how do i know which one is which? If i select any object (the linked object), there's no indication in the outliner to show which blend path it is.

How can i select the linked object and open it in other blender session ? so i can modify/edit the master file. I don't want to append. I want to edit the source without manually find it in explorer.

Thanks

Found it. There's cool builtin addon : edit linked library.
https://docs.blender.org/manual/en/2.83/addons/object/edit_linked_library.html
I simply click the button on the side bar and it will take me to the linked .blend file , edit it and use the sidebar again to go back to previous blend file.


Looping isometric animation I’m looking at making a music video with blender. I’m fine with modelling but I’ve never really done much in the way of animation,

I want the video to consist of a camera following a road From an  isometric perspective.

How should I approach this?

i don’t want to model 3 minutes worth of road with all the buildings so I’ll need some sort of looping.

Any tutorials I should look at? Any keywords?

Thanks from one of those annoying newbs

You can create a path (Shift + A  > Curve > Path) that you want the camera to follow. After that, move the camera to the starting position of the path.

Then set the path as a parent of the camera (Ctrl + P  on a PC) and select Follow Path.

In the path settings, you can now set the duration of the animation. Using a constraint you can even make the camera track another object or always look forward or whatever.


Beginner's help with topology? (Extruding and beveling letters) I know I'm terrible at topology, but that's because I don't know how to properly approach it. All I read is quads = good, ngons & tris = bad. But I'm terrible at looking at a shape and being able to break it down into something I can make. For example, I'm toying around with letters, and trying to figure out how to make them better.
Can anyone advise me on how to approach these letters? (Or just letters/shapes with holes in them, etc). I know it's not that efficient, but as I said, I don't know how to do this. Any help is appreciated (or any good materials to learn this).
Also, the 'T' is stylized like that, just fyi.

You have 2 ways:
Converting your letters to mesh and working the topology so that it works fine when you bevel, but in your case it's more a matter of how your topology is than a problem of tris and ngons. Here I've made a X > Limited Dissolve and tried a bevel, then create new edges where I saw that the bevel failed:

Or keeping your letter vectorial and giving it extusion and bevel in the Properties panel > Object Data > Geometry, then converting it to mesh (then, same thing, you can simplify the topology with a X > Limited Dissolve):


Increase Lines Width in Viewport I know there is an option available in preferences to increase "Width Outline". However this only applies to active object.

Is there anyway, through code manipulation possibly, to increase Line Width for all empties, latices, and objects in viewport? I believe the default value is 1px.

The 'width outline' option found in themes adjusts the width of the outline drawn around selected objects. There is no option to adjust the width of lines when drawing objects in the 3dview. There is a pixel mode setting that will allow lines in the 3dview (and all other interface items) to be drawn at double width, this is intended for the Apple's retina displays. You may also want to adjust the DPI setting to control the interface outside the 3dview.

The other option involves altering blenders source code. I don't think there is one location to adjust the line size, you may have to adjust the drawing of each object type, you could setup a preference that is then used in each place. The code you would need to change should be contained within editors/space_view3d/.


How can I have an armature deforming 2 separate meshes? I have organized my model so that the skin is the parent of clothings, hair, etc. Currently all of them move together according to the parent hierarchy.

I select the skin and Ctrl+P to the armatures and selected automatic weight. In the pose mode it deforms only the skin because weight paint could not go to different object

If I Ctrl+J all of them the armatures would probably work, but can I keep the mesh organized and have the armature deform everything? I have different auto smooth settings for each groups for example, that I don't want to merge them.

Ok I got it. I have to select all of the meshes before selecting the armature the last. Blender will give all the vertex groups to every mesh with different weights and then I can paint them separately.


Delete frames from a video I'm new to editing videos with blender. How can i delete selected frames from a video?

For this you only need select the strip with the Right Mouse Button and press K to make cut where the cursor is positioned.


Is there a "Volume Select" equivalent in Blender? 3D Studio has a modifier called "Volume Select" that allows using an element's geometry as a sort of selection force field that influences elements in its path. It can be used to transform many at once, as illustrated below.

Is there a way to do this in Blender? If not a modifier, maybe a script? I'm trying to animate a block of cubes that shrink and grow in a pattern and something like volume selecting would help a lot.

Thanks!

Animation Nodes can be used here. The Find Nearest Surface Point node is used to compute the distance between every element and its closest surface point, the distance is then used as the scale of the elements as following:

Evaluating the distance at an interpolation gives you fine control over its rate of change:


The box with the settings is not showing up when i add a new object When i add a box, plane, cylinder etc., the box on the bottom left (screenshot) is not showing up. What shoud i turn on to get that box when i create a new object?

It's called the Adjust Last Operation menu.
just enable it in View > Adjust Last Operation

Also if you press F9 it will pop up wherever your cursor is.


Fluid - Baked Mesh is Shifted When I bake my fluid data it comes out perfect but soon as I bake my mesh it gives me a wireframe of simulation and the actual fluid simulation right under it.

And here is the one with the mesh data baked.

How do I get it to where it only shows the finished baked mesh. I did this with a different fluid animation and when I check all the settings to this one they are the same.

Set origin to Geometry for Domain object.
Flow geometry you can hide from render in Outliner (Camera icon) and for viewport you can change Object Properties > Viewport Display > Display as Bound or Wire type, like that it is not hidden but is represented by different type.


Is there a way to make dynamic paint affect the reaction diffusion from tissue? I've been experimenting with the tissues reaction-diffusion, but I can't find a way to render the animation so I'm trying to control it with the dynamic paint, using some spheres to paint, but the reaction-diffusion doesn't seem to recognize it. Is there a way to make this work or is it not the best way to render an animation with reaction-diffusion?

Here is a way to visualize reaction diffusion, it takes a few steps but it seems to work I guess. Unfortunately, it does not seem that dynamic paint will directly work to control reaction diffusion, but we can use other ways to visualize it.
Starting with a densely subdivided quad-sphere, I have set up reaction diffusion and painted some random pattern on vertex group B with animation running. One thing I am also doing here is adding a few keyframes in the scale parameter throughout the timeline to add a bit of variation in the animation.
Here are my settings:

Bake the reaction diffusion before moving on.

In object mode, make a copy of the object, and do not move it.
Shift + D then Enter.
The copy and original must be in the same place for the next step to work properly.

In Weight Paint again, first select the original object, then select the copy and go to Weights>transfer weights to copy the weights from the original to copy. This will copy the reaction diffusion from the original mesh to the copy, also allowing the animated weights to be used in modifiers in object mode.
Now you will be able to use the vertex groups with any combination of modifiers, such as displace, mask, etc.
For example, here is the quadsphere with just a displace modifier using the B vertex group.

Here is the .blend if you would like to inspect it


Need help with subdivision surface I was trying to add the subdivision surface to this object so I can later add a displacement modifier, but when I add it, even on Simple it creates some weird geometry bugs, can someone help?

https://imgur.com/a/tNFQRTG

Its because how the mesh is shaped as it contains ngons so if you would add subsurf modifier it would create weird geometry

try creating a good mesh without tris and ngons just with quads.

Here I've converted ngons to tris and quads by selecting all the ngons and Hit Ctrl+T in Edit Mode. Then ngons will be converted to tris and quads.

Then by bevel edges you can see that some of the shape remains same..

So, the solution is to create a new mesh with good geometry just with quads if possible. and bevel all the edges that curve when subsurf modifier is used.

If you can create the mesh its great. If not try using Booltool addon it would save lot of time in creating these kind of meshes.


Editing the normal direction to be parallel with the face. So I am looking to change the normal direction from being 90° on the face to just kind of lay flat on the face. Is that possible to achieve in Blender? Or are there any addons that will help with this?

If you want to modify specific normals of specific faces of a mesh, the only way I know of is the "Normal Edit" modifier.

Basically you create a vertex group, containing all the faces you want the normals changed of. Then add the Normal Edit modifier, choose Directional, select the vertex group and pick a target object. After that all normals of all faces of the selected vertex group will point in the direction of the center of the target object. If you want the normals be parallel, select Parallel Normals in the modifier.


How can I get the new Templates to work in Blender 2.79? The Blender manual states in this article that 2.79 introduces a new Template System. This empowers the user to dynamically change aspects of Blender, like the startup splash screen, keyboard layouts, certain scripts, etc. The beauty of this is that users can create their own application on top of Blender when exploiting this.

I was following the manual as best as I could, but my templates never actually show up. This is the content of the folder I'm currently using:

The folder location is set via environment variables BLENDER_USER_CONFIG and BLENDER_USER_SCRIPTS. So they are not at their Default, but this has always been working nicely for me.

I would now expect to either be able to switch to that template either using the Splash Screen or the File Menu. But my custom template isn't listed anywhere. What am I missing? Even if I manually generate a ZIP file and use Install Template from File, Blender puts the files in that location just fine, but never actually shows or loads the template.

It looks like it doesn't work with Environment Variables at this moment because of this bug:
https://developer.blender.org/T52442

I hoped it should be solved by this fix:
https://developer.blender.org/rB2aa2bec43a7f1fa214833c73d033ae1785c600f3
... but it still does not work even in the most recent builds.

But regardless of Environment Variables, you should still be able to test your template by moving the bl_app_templates_user folder with your template to Blender's user directory c:\Users\yourusername\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\startup

So it will look like this

Make sure you no longer have a duplicate of your theme in the previous path (Blender program directory).


Why is blender rendering entire tile? As you'll see, my blender is strangely (i think) rendering the image as an entire tile and not a "one by one tile".
I'm using GPU (if using both GPU and CPU it shows the tiles). I'm also using Auto Tile Size plugin, but even when i check the 64px box it renders the entire tile.
My assumption is that render is not properly using my GPU, as i had to format my pc and install windows, then got a blue screen error and had to re-install windows using repair option (so i think the drivers doubled (?)).
Does anyone have an answer or assumption?

it can be the progressive refine setting "on": Progressive rendering will make a tile as big as your image -> render time will be long


Weak/No shadows? ( EEVEE ) Ive created a shadow catcher to suit an HDRI image. The shadow catcher is only basically doing ambient occlusion and there is no signs of shadows. There should be an entire shadow under the car.

Try this setup:

I only changed the diffuse color and the white handle on the color ramp. I also had a downwards facing sun lamp. Which, mind you, will ruin the shadow catcher if you rotate it beyond a certain point, you can play around with that and try to compensate those two values I changed to your own scene.


Tricky Curved Hardsurface, suggestions? (mandalorian helmet) I'm stuck trying to figure out how to model this part of the mandolorian hemlet without sculpting.

any help, tips, references is greatly appreciated!

In my opinion it would help if you had a side view, and use both images as background.

Begin with the right side, build a very simple topology that follows the lines. Switch to front view, move the vertices one by one to make them fit to this new view.

Fill the faces, add edge loops to sharp the angles.


How can I make a Bézier curve have sharp and curved points? How can I make a Bézier curve have sharp and curved points? Like a zig-zag. And also being able to make more 'circular' parts too.

(I want to make fig 2, but I can only get to 1 by creating curves added with the E button.)

Being in Edit Mode you can select the desired curve point, press V and change the Handle Type to Vector

To have even more control you can set the Handle Type to Free


Python scripting Blender with Luxrender Do you know how could I render a scene with luxrender using the python API of blender and luxrender ?

I found their Python API, but I don't find a way to render the scene thanks to luxrender with a python script.

My algortihm for the script would be :
- Load a scene with only one object
- Change the texture of the scene with a texture given in parameters
- Render the scene during 30s to 1min
- Save the image

I know it doesn't seem complicated, but I don't know how to start

While not specific to luxrender, some steps you can do to help with scripting.

Find an interface item that performs the task you want to perform or displays the value you wish to change in your script.

Look at the tooltips for the item, the data path or operator path is shown for most items.

Right clicking on an item allows you to "Copy Data Path". Another option is "Edit Source" which will open the script responsible for drawing the item and will even place the cursor on the relevant line for you. Remember that some names used in the scripts will be variables that have been defined earlier in the script.

For example the Render button tooltip will show you bpy.ops.render.render() that is the python line you put in your script to start rendering.

The render menu at the top will show you bpy.data.scenes["Scene"].render.engine which is a way to access the render engine for a scene named "Scene". Another way to access the same data is bpy.context.scene.render.engine While bpy.data.scenes[] allows you to access a specific scene, bpy.context.scene gives you access to the current scene.

So if bpy.context.scene.render.engine equals 'LUXRENDER_RENDER' and you call bpy.ops.render.render() then Luxrender will perform the rendering (as long as you have the luxblend25 addon installed and enabled)


How to achieve this shape (Twisted bottle) How can i achieve this bottle shape. I tried with the twist modifier and screw modifier both did not work for me any option or how can it work. Thanks

Create the untwisted shape, it looks a bit curved on its sides:

Give the object a Lattice modifier, create the lattice object, scale it in Object mode (not in Edit mode!) so that it contains the bottle, give it some additional horizontal edge loops, create 2 shapekeys, select the second shapekey, go in Edit mode, twist each of its horizontal edges:


model pulling apart when skinning I am working on skinning a character using automatic weights, and weight paint. As I work, I am finding it difficult to keep seams together, and stitching stuck to the model while keeping things smooth. Does anyone have some techniques or words of wisdom to help with this?
Default pose

Posed

I'm not sure though why that happened. But  you can join the sleeve and stitches with ctrl+J in object mode if they are sperate object. Or select every thing,  go to edit mode and search for (merge by distace) option (F3). And apply it.  It will join the vertices which almost share the same place.
Remember  after doing this you have re assign the weight.
Hope that helps.


How Do You Select Only Part Of a Timeline To Be Rendered? Let's say I only want a section of the timeline to be rendered, and I want the final output to be in RAW AVI format.  How would you do that? Thanks guys!

Specifying Render Output Settings

You can specify a specific start frame and end frame for your render in the Dimensions section of the Render tab:

Render tab -> Dimensions section -> set Start Frame and End Frame

If your animation is 250 frames long, but you only want to render frames 50 - 75, then set the Start Frame to 50 and the End Frame to 75.

You can also specify your render format to be AVI RAW in the same window:

Render tab -> Output section -> AVI RAW


Uses for the Location vector of the Particle Info node? What can the Location values of the Particle Info node be used for? It seems to provide control of something like color or texture of particle instances, but I can't seem to implement that idea.

Can it be used in conjunction with the Point Density texture node?

Particle Distance to Some Particular Point

The particles are colored differently within a certain distance to a given point P0.  Emission Shader. In the user ortho view is the cylinder with a particle system. The white torus has that same point P0 as center.  Image above.

Cycles Material Nodes calculating distance and employing color ramp.  Image above.

Click image above to see larger image.

The OP has asked about Textures Controlling Particles Systems.

This is a quick piece of information for further research.  The two columns are of the Particle Texture Settings which are visible only in Blender Internal Render Mode. Cycles will [not] show the same info, yet will be influenced by the textures as well. You can switch back and forth as [interesting] as this might seem.  The three yellow arrows emphasize Texture Panel Purpose, Mapping, and Influence areas.  This is not a tutorial on the topic.  I use two columns for the same settings out of edit convenience and readability convenience.

With a more complicated frame change handler and Python anything is possible. Same comment for BAN - Blender Animation Nodes.


How to make a popup Menu in the BGE? I want to make a button that when clicked opens up a popup menu, say like an options menu or something. After the button is clicked to open the popup menu I want to be able to click something in the popup menu.

How can this be done?

Have your first button in the game trigger a new object (lets call it menu2) to be added to the game, or play a animation to move menu2 on screen. Then on menu2 have several other objects parented to the menu, each with logic set up like in this question.

In the blend file you will find the object menu2 has a animation to move it in to view. That animation is triggered by the first button (a cube). The trick to playing the animation is to have the Action Actuator on the menu. The logic bricks look like this.

So every time there is a click on the cube it triggers the animation to play on the menu. You can have logic bricks go between objects, just select both objects and they will show up on the logic brick editor.

BGE menu demo blend file.


Adding a custom shortcut for sculpt mode I read in the blender 2.6 wiki that there is no shortcut for sculpt mode. I would like to make Ctrl+Alt+Tab the shortcut to switch to sculpt mode, but based on the instructions for making new shortcuts I read here and here, it doesn't seem to work for me (because I'm doing it wrong).

How can I add this new shortcut?

Starting with Blender 2.68 (earlier versions have a bug):

In the 3D view header click Object Mode to open the menu
Right click on Sculpt Mode and choose Add Shortcut.


Can the scale tool show me the real size of the object instead of a 1 - 0 scale? when I resize I want to see the real width\length\dept of the object instead of the x=1 y=1 z=1.

Is there a way to do this?

Are you looking for the Dimensions in 3D view > Tool shelf (N)?

You can also change the units these values are represented in. By default they are displayed in "blender units" (BU), which are equal to meters. To do this, adjust the settings in Properties > Scene > Units:

I should also point out that the Scale of an object is not limited to 0-1. For example:

A scale of 1 = no distortion
A scale of 2 = twice as large
A scale of -1 = inverted

The Scale object property is really factor by which you can non-destructively shrink or stretch the object in any given axis without modifying the mesh.

It's useful to know this, as it can result in some unexpected results if you are unaware of what scale is actually doing. See my answer here for more detail.


a simple script not working in blender 2.8 This simple script below does work for blender 2.79 but simply won't show the properties in blender 2.8 (it does draw the panel but it is empty inside)

import bpy

class SomeOtherClass:
    someMember = 100

class MyNewPanel(bpy.types.Panel):
    bl_label = "myNewPanel"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

    def draw(self, context):
        cubee = bpy.data.objects['Cube']
        somethingElse = SomeOtherClass()
        self.layout.label("Hey there")
        self.layout.prop(cubee, "location")
        self.layout.prop(cubee, "name")
        self.layout.prop(somethingElse, "someMember")

bpy.utils.register_class(MyNewPanel)

Did something change in blender 2.8 which causes it not to work or is it a bug that will be fixed in future? Hence, the second question: if I learn blender api in for 2.79, to what extent can I then use it for 2.8? Also, would it be difficult to bring my add-ons from blender 2.79 to blender 2.8?

The problem was not with the naming conventions (or at least, that wasn't the only problem, I don't know if Blender does enforce this). I also had 'TABERROR' object has no attribute 'msg' and I didn't have any classes in my script.

I finally found out what the problem was. The file failed to parse (hence no line number information) because there was an invisible error in the indentation. In particular, some lines were indented with tabs, others with spaces. In my case this was caused by me using tabs for indentation in my own editor, then editing the script in Blender's text editor, which automatically inserts spaces instead.

Opening it back up in my text editor and making all indentation consistent fixed the problem.


How to make image transparency of clouds brighter I am trying to make a pillar cloud using an image transparency. I have a basic node set up for making the image show with transparent background. But I would like to make the cloud pillar glow. I am not sure how to set up the nodes to make this happen. I am using Blender 2.79

Given that you are using an image to determine transparency, you can change the brightness by using any of the following nodes: gamma, color ramp, Bright Cont or even a Converter>Math node to affect the values.

To make things glow there are already endless posts on the subject in this site.

Start with this one:

Glow with depth in Blender?


How to render a background image in 2.8? I'm trying to "add" an 3D object onto a photo. I have added the photo to the scene in three ways so far, but none of them render (eevee):

Camera > Background Images
Empty
a. Add > Empty > Image (Empty gets added to current Collection)
b. Add > Image > Backround (Empty gets added to Scene Collection)

These all show up in the 3D View and I was able to align the camera and the object so its perspective matches the scene in the photograph. But when I Render the scene, I only see the object, not the background image.

For the latter, it's simple: Empties are not rendered at all.
There are few questions about this, since 2.8 has changed how it handles background images. The most popular seems this one (it includes references to others):

How do I set a background image while I am editing?

But I seem not to be able to find a method to have the background image render.

Another method might be to use the Compositor (Nodes) to Mix or Alpha Over an Image with the Render Layers. But this does not give the same alignment as achieved with the background image (also this requires that the World background does not get rendered (Alpha channel); for Eevee, this can be achieved by checking Film>Transparent).

What other options are there?

Docs:

https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/More_Features#Image_Objects
https://docs.blender.org/manual/en/latest/modeling/empties.html
https://docs.blender.org/manual/en/latest/render/cameras.html#background-images

To do this without making it the background of your whole scene like handle does, I reccomend the images as planes addon.

This makes your image displayed on a mesh plane, meaning it will show up as desired in the render.

First enable it in the preferences:

Then just add an image as a plane from the add menu:

And then it should show up in your scene as you want.


Blender 2.8 - how do I make a texture reflect light? I have a marble texture that I would like to make shiny.  Roughness is currently set to zero, but there is no light reflection.

Any suggestions would be much appreciated.  Thanks in advance!

Diffuse shader is just what the name suggests, diffuse. Try using a principled shader or combining a diffuse with a glossy shader through a mix shader node.:)


How to make a lamp light only one object in the scene I'm new to blender, and I'm a hard time understanding layers and collections.
I started using Blender on 2.8, and most of the topics I read about the matter compare how it works now with how it used to work. I know I can do this by using layers and collections but I would really appreciate a step by step guide.
This is my scene:
There is a background, a shirt, and a backlight between them, to light the shirt. I want this area light to affect only the shirt, and not the background. But I do want the background to be affected by everything else (shadows, other lamps and such). How should I proceed?
Thank you very much!

You will have to create separate layers for each render,
elements that you want to be effected separately put them in different collection.

Basically you can create the whole scene and then duplicate the render layer, in one of them disable the view layer (right-click on the collection --> View Layer --> Disable from View Layer.)
Do the opposite on the other render layer.

Use the compositor to stitch the images together using Alpha Over node.

attaching a .blend file for you to review.


how to set the camera follow path using python script (suppose camera is in the right location already)

I understand if doing this manually I need to select the camera and hold shift and select the curve that I want to follow, then ctrl+p and select "follow path".
But how do I make this with python script?

My guess is I can use python script to implement these tow steps in order. It seems that "Follow path" can be achieved by

bpy.ops.object.parent_set(type='FOLLOW')

But this alone won't work.

sorry I'm a newbie to blender.

Thanks for @poor 's comment. It can be done in the way of

make object A a parent of object B via Python

specifically, it needs to be coded like:

camera = bpy.data.objects['Camera']
path = bpy.data.objects['NurbsPath']
lamp = bpy.data.objects['Lamp']

camera.select = True
lamp.select = True
path.select = True

bpy.context.scene.objects.active = path #parent

bpy.ops.object.parent_set(type='FOLLOW') #follow path

you can find the objects name in python console with

list(bpy.data.objects)


How to snap the center of a face to another face? I have a sword handle and I want it centered below a completely differently object that has a face on the bottom with a vertex in the middle. I could also snap a central vertex to the other one but I don't know how. How can i do this?

You can use Vertex Snapping.

You can enable it by clicking on the magnet icon or If you wan't to use it temporarily, hold down Ctrl.

I would recommend setting the second option to active:

You use it by moving your object in edit mode Tab:


How to make freestyle lines stay the same size? Is it possible to make freestyle lines stay the same width relative to the distance from the camera?

The way free style lines behave by default, they stay the same width in pixels, but vary relative to the size of rendered objects.

How can I make freestyle lines appear small when rendered on objects far away (as the object appears small) and large on objects close to the camera? (as nearby objects appear large)

Yes, it is possible. Here is how:

First change the Line Thickness parameter under Properties tab > Freestyle to Relative (1)

Next go to the Render layers properties, or just click the icon in the Freestyle panel (2). Then go to the thickness tab (3), and then Add a Distance from Camera modifier (4) .
You then have to check the invert box (5) to that the lines decrease in width over the distance. You will see a parameter slider box called Range Max (6) , this value should be the distance of the farthest object away visible in the shot.You can use the Fill Range by selection, or do it manually. In my case the object is about 100BU away. Value Min (7) and Value Max (8)  control the ending width and starting width, respectively.

Note:

For animations you might have to set keyframes for these values
You can ignore the Base Thickness parameter
The Distance from Object modifier can achieve similar results and may be more suitable for animations.
Lines are drawn based on edges. One long cube is only going to have the same width through, regardless of the modifier.

Final Result:


Is it possible to programmaticaly render video from a blender pattern animated scene with images and mp3 as parameters? I would like to build an automatic generated video engine on a server.
The process would look like this :
renderblendfile (images on server disk ,Mp3 file on server disk) ----» video

The blend file would be a pattern animated scene where only the images and soundtrack would change.

I would like to know if it would be possible to build such an engine by using blender programmatically using python api?

Thanks.

Yes.

You can load a blender instance from command line and pass it arguments, and execute a script inside blender to change images / audio files, and then render.

Your scenario describes it adequately:

make a template blend file with placeholder audio file (a click track, whatever..)
add placeholder images (test screens for example, with numbers to allow you to debug
write the script that takes arguments (location of images, location of mp3)
execute from command line

I'm sure if you provide such a representative template .blend file one of us would probably give you a hand writing the script to change out the audio and image files.

Alternatively you can script the entire animation, while starting blender from console with an empty .blend file (but with the script preloaded to accept a directory of images / audio ), this is also easy enough if you know Python.

See this answer for an introduction to commandline blender (no gui needed)


Is there a quick way to space out timeline frames by X amount of spacing? In the timeline say I have frames 1, 2, 3 and I want to pad 10 empty spaces in between them, so it would look like frame 1, 10 empty spaces, frame 2, 10 empty spaces, frame 3. Is there a shortcut to achieve this? Right now I have to manually drag my frames using "G" to space them and it is slow.

Scaling should work, put the cursor (blue line) where you want the pivot point to be (here, at frame 1):


Rendering interval by frames I am new here and i hope i am not making anything wrong.
So, my problem is : I want to render my animation, i have 5+ computers to do that and the scene has 2730 frames.
Its possible for example : on computer 1, render from frame 1 to 500; on computer 2 from frame 500 to 1000;on computer 3 from frame 1000 to 1500 and so on ?
If yes, how can i attach each rendered animation to the other ?

Another option that is available if the machine are on the same network, is to enable placeholders and disable overwrite in the render output settings, then have each machine render to the same network folder. Each machine can then render the same frame range but each will render different frames.

While getting a little more complex, there is also a network render addon included with blender.


How to save and load an object position? I want to know if it is possible and how to save and load the object position using the same script that i used to save and load properties.
Here is the script: http://pastebin.com/aNZATwxX

My reputation is too low to comment. But your link to the script is not working.

If the script is writing and reading from an external file, it should definitely be possible to modify it to also save the object position.

Try re-uploading the script.


Why my monkey is rendered with only a mesh? I'm totally noob to the blender world, and I accidentally made my monkey like above.
the monkey was originally a solid not mesh. I managed to find the way for restoring my monkey to solid again in the dropdown list at the Object > Viewport Display > Display As. However, I wonder if there are some shortcuts to do this.

If you right-click that dropdown you can assign a shortcut key, but personally I don't use this feature very often, so I've never set one.

The usual way is to use the Z key to change the viewport rendering mode (note this is for all objects in the viewport).  You can also use the buttons in the top right of the viewport.


Toggle UI from python I am trying to toggle fullscreen and 3dview sidebar panels from python (shortcut 'shift+alt+space' and 'n' respectively). I found these commands, but I can't get them to work:
bpy.ops.screen.screen_full_area(True) # toggle full screen?
bpy.ops.wm.context_toggle(data_path="", module="") # toggle 3dview sidebar panels?

Any ideas on how I can do this?
EDIT:
This post asks my exact question: https://blenderartists.org/t/show-sidebar-3d-print-toolbox-with-python-api/1241410/2 . The answer is an operator with this line in the execute method:
context.space_data.show_region_ui ^= True

But this doesn't work for me :-(

I managed to get it working by overriding the context. So if anyone is interested, here it is:
for area in bpy.context.window.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
                    override['scene'] = bpy.context.scene
                    bpy.ops.screen.screen_full_area(override, use_hide_panels=True)

for area in bpy.context.window.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
                    override['scene'] = bpy.context.scene
                    bpy.ops.wm.setup_ui(override)

class MYOPERATOR_OT_setup_ui(bpy.types.Operator):
    bl_idname = "wm.setup_ui"
    bl_label = "Setup UI"

    def execute(self, context):
        context.space_data.show_region_ui = True # Opens sidebar in 3d viewport
        context.space_data.region_3d.view_perspective = 'ORTHO' # 'PERSP', 'CAMERA'. Set 3d viewport to othorgonal

        return {'FINISHED'}

The operator needs to be registred of cause.


Is it possible to change the far clip distance more than max value? The problem is, that my object disappears, when its far away. That happens because the clipping doesn't allow greater values that 100m unless I change the unit presets and therefore scale the whole object. That would be not so good, because I would have to rescale it than after exporting to get it right in unity. If I could just adjust the clipping distance a bit more that would be cool. Is there maybe a way to move the clipping spectrum from 10um-100m to something like 10cm-1km without changeing the whole scaling.

PS: I wanted to add the tag 'clipping'; can someone create that?

In 3D view, Object mode. Press N then change the Start and End of clip to whatever you want.


Custom file output name format using incremental letters instead of numbers? Lately I've been experimenting with importing rendered animation frames into a game engine which expects a very specific filename format consisting of four letters, followed by a fifth incremental letter, followed by a static numerical value.

NAMEA0.png
NAMEB0.png
NAMEC0.png

Is there a way to make it so blender automatically saves my rendered frames following this format? With frame 1 = A, frame 2 = B and so forth?

Thanks in advance.

Well, this is awkward, I just figured it out. I had looked at an answer to a similar question here, but having no experience with scripting, I thought I wouldn't know how to adapt it to my needs. Turns out that after looking at some basic python tutorials, I managed to write a script that, while not very elegant, definitely works. Here's the script in question:

import bpy
letter = 'A'
def handler_set_filepath_based_on_frame(scene):
    if scene.frame_current == 1:
        letter = 'A'
    if scene.frame_current == 2:
        letter = 'B'
    if scene.frame_current == 3:
        letter = 'C'
    if scene.frame_current == 4:
        letter = 'D'
    if scene.frame_current == 5:
        letter = 'E'
    if scene.frame_current == 6:
        letter = 'F'
    if scene.frame_current == 7:
        letter = 'G'
    if scene.frame_current == 8:
        letter = 'H'
    if scene.frame_current == 9:
        letter = 'I'
    if scene.frame_current == 10:
        letter = 'J'
    scene.render.filepath = ("/tmp/NAME%s0#" % letter)

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

I'll likely will never need to render more than 10 frames or so. So manually defining a variable for each isn't that much of a hassle.

Here's the answer from which I based my script off of.
Changing filename format based on current animation frame?


Curved mesh topology 2 I am trying to model a violin belly and I am intrigued, how is it possible to make faces with soft / rounded edges?

The edges I do are totally straight (see the blue amoeba).

Also, do you have some idea on how to avoid the edge loops getting too "compressed" in the middle of the model (see the red amoeba) ?

I know the Subdivision surface modifier, but I want curved edges after applying the modifier... like in this picture :

Any help will be very appreciated.
Thank you in advance!

Marcos

2nd part

In fact, I've tryied to model using nurbs and bezier curves, but I wasn't able to find any tool similar to loft that works with curves, then I was forced to convert it in meshes, the results were not terrific and I've started to move the vertices manually, a real pain...
Unlike a guitar, each edge loop is on a diferente elevation on z axis and I have to keep the original dimensions,
So I have to be extremely careful when using the subdivision suface modifier.
I've already modeled this think on three different CAD softwares, but the meshes are far from good...
I want to improve the edge loops, but it will be a long path...
Thank you again.

"but I want curved edges after applying the modifier"
There is no such thing as curved edges, edges are by definition strictly straight.

If you zoom in on one those apparently "curved" edges you will find that they are still in fact straight, just like before, just subdivided more finely into smaller straight segments.

And that is the basis of Subdivision Modelling you use a Subdivision Surface modifier to give the impression of curvature adjusted to a desired level of detail, but there never really is any true absolute curvature. There is always a fine balance between desired level detail and capable performance.

Anyway if you mean to say that you want to see the result of the Subdivision Surface modifier while modifying your mesh in Edit Mode you can activate the option Adjust Edit Cage to Modifier Results in the modifier header. You should for the most part never apply your modifier, and work on a low poly, good topology base mesh, while letting Blender do the hard work of subdividing it dynamically and non destructively.

If you want "true curvature" you should be using a different type of modelling software with a geometry engine based on NURBS surfaces, where curvature is mathematically described, and surfaces controlled with control points.

And even then you would find that a computer is only really capable of displaying straight segments, and those apparently curved surfaces are still actually composed of straight segments, only they are dynamically generated and usually harder to spot to the naked eye.


How can I improve the realism of my pencil texture lines in freestyle? I'm using a charcoal image texture to make my cycles freestyle lines look as though they were drawn by hand with a pencil. My inspiration (and the source of the charcoal image texture) was the teapot file linked on this page https://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.71/Freestyle

This is the charcoal image texture:

The concept works okay when you use multiple rounds to go over the same area a few times, but when I try to draw a single line it looks a bit crappy, with the repetitive nature of the texture very apparent.

Multiple rounds:

Single round (which is what I'm after, ideally):

I'm wondering if there's a secret to getting more realistic single stroke pencil texture lines in freestyle? Do I need a better texture? A more random way of having it repeat? Or something else? Hopefully things have moved on in the three years since that texture was created and used in the teapot model.

I've attached simple test file here:

If for some reason the charcoal texture doesn't appear in the file, you can grab it from my post.

Thanks!

p.s. I'm aware of this question How can I use pencil style strokes in frestyle? but those answers simply point me towards the files I've already referenced.

Update May 29th 2017: Spurred on by Mr Zak's answer below I made another version with multiple rounds of lines and a little randomness. While I realize I can get close to what I want with this method (as the layering of the textures creates more randomness), I'm still interested to know if there's a way to improve the realism of the texture on a single stroke. But in the meantime here's what I achieved with multiple rounds and the settings I used. Perhaps it will prove useful to someone else.

Finished image:

Close up of one line:

Settings:

Update 2 May 29th 2017: Since someone asked, the project I'm working on is a series of line-based maps that I'm hoping to render as though they were drawn either in pencil or in pen. I'm still fiddling around trying to work out the final look and feel of them, but knowing if I can achieve the pencil or pen look is a part of that.

Here's an example of where I am so far:

As you can see the lines representing the terrain already have a good deal of randomness and wiggle in them, so that's why I was concentrating mostly on the texture of the stroke. It might be that the lines end up being too small to even register a texture, but as this is an ongoing discovery I wanted to understand the full extent of my options.

According to the wiki article Textured Strokes the Use Tips option is available when Along Strokes mapping is used:

  Along Strokes Means that the texture will be drawn along the stroke length, making it possible to mimick pencil or brush marks.

However by default it won't really make any much difference:

The option depends on spacing between strokes mapped to the geometry:

  Along Stroke mapping depends by the LineStyle spacing parameter that can be found in the linestyle settings. It sets how much the texture will be stretched along the stroke length. Higher spacing means less tiling.

It can be found in the same place where strokes are set up to use texture, Render Layers tab > Freestyle Linestyle rollout > Texture panel:

With that texture rendered strokes become more smeared:

Spacing was set to 5

The effect however is still a bit off as its thickness is not varying and the stamp still is present.

From here on settings from the teapot file were used as reference as well

To correct that don't use thickness of 20; in fact less than 10 will be enough. For convincing and effective results better to let it draw with thin line and repeat it 2 or more times; that will simulate effect of graphite or a pencil strokes more nicely.
This is the result wil Stroke effect decreaed to 6:

Now some repeating pencil strokes would add a bit of "realism" to the image. With Repeat set to 3 it will be already more or less good. But to add even more to that in the Geometry panel add Spatial Noise modifier.

What the modifier does is it varies strokes created by the Repeat option. Amplitude option will increase or decrease how far away the repeated lines are from original; Scale adjusts the scale of repeated detail (if it was at 15 you'd get step-like corners around the line).

Smeared chalk like effect can be created with Along Stroke modifier added to the Thickness panel. According to the manual it applies gradient along each stroke while substituting original values of the line. To make lines more fat and smeared Use Tips option can also be unchecked (in this case):

The partially transparent effect from the teapot scene is created with adding Along Stroke modifier in the Alpha panel, but for some reason in Cycles it isn't visible (teapot scene is in Internal). Even setting Thickness to 0 doesn't really change anything, which is quite unexpected. It looks like in Cycles the freestyle won't calculate and hence use alpha of the charcoal texture. If making that in Internal effect shows up immediately:

It's hard to say if this means for you that Freestyle went ahead since that time but anyway the resulting effect of the freestyle strokes can be changed quite drastically by editing options and adding modifiers.

If going with only one round of the stroke (and hence only one stroke drawn on the objects) you will need to alter it as much as possible in order to get varying style. You can use several line styles as already mentioned by @TK or you can go with more modifiers for one line style.
I will use modifiers for Thickness panel mostly but possibilities are nearly endless as many of them have also additional modes of stroke overlaying which changes end result quite noticeable.

Note:

there aren't any modifiers on the line style for this one; none of the results used from the several rounds above.
in all the results here Face Smoothness in the Render Layers tab > Freestyle rollout is used for using smooth shading of the mesh.
It also means that shading of the meshes should be set to smooth as well.
in all the results here Alpha Fac in the Line Style Output node in the line style setup is set to 0.5. This allows Cycles to overlay alpha of the texture and use it along with the base color. For some reason it also fixes usage of the modifiers in the Alpha panel. None of these is needed in Blender Internal.

Using stroke thickness (Freestyle Line Style > Thickness) at 3 and Spacing at 1 the result is thin drawing:

To increase the variation add Along Stroke modifier to the thickness of the stroke. It will apply new values for thickness based on the progression type and blending mode choosed; from the manual:

  The Along Stroke modifier alters the base thickness with a new one from either a linear progression or a custom curve, mapped along each stroke’s length. In other words, it applies the selected progression along each stroke.

To mimic caligraphic changing of the line thickness which depends on the stroke angle add Caligraphy modifier. Its  Orientation property will simullate orientaition of the virtual pen drawing on the paper - the more it's aligned with the vertical axis the more horizontal strokes will be fat and vertical - thin. Default values of 60 are quite good as well.

Also it's possible to add some noise to the stroke in general; Noise modifier will be the last in the Thickness panel.

To simulate transparency of the strokes modifiers in the Alpha panel are added. In this example Along Stroke modifier is used.

Note also that most of the modifiers can be set to another blending modes thus altering their final result which allows even more different things to try.


Having trouble smoothing out elevation I'm fairly new to Blender, and I am attempting to follow the guide here. I found an example of a heightmap that I liked, so I have been trying to replicate it. However, I can't seem to get rid of the terracing from the contour lines in my render. Per step six of the guide, I have exported my tiff as a 16 bit unsigned integer. I also attempted to do the map algebra function in QGIS. I'm wondering if this is the step that's giving me trouble. It seems no matter what I do, though, I can't manage to smooth out the terrain. I've tried to increase my adaptive subdivision scale from 1.0 to 3.0, but it makes my render look blurry and not detailed. I also tried raising and lowering the displacement scale to varying degrees, but the contour lines remain.
This is what I am trying to mimic

And here is my image. Notice the "steps" on the hills on the right.

Perhaps it has something to do with my heightmap?

It may have to do with the height image format. Here is what a jpg height image map gives:

here is what an OpenEXR height image map gives:


weird smoothing issues So new to Blender but semi-versed in MAX so sorry if my wordings a little off. I have a weird shading issue, I have this smoothing issue visible in the screen capture, I've tried using the smooth function in the edit>shading menu, I've also tried flipping normal and neither change anything. My modifiers are, subdivision surface and mirror modifiers. Any tips would be greatly appreciated.

There might be few point that you want to know:

You don't get enough subdivision times, usually not going further then 2~3 times. Ctrl1~0 within object mode can set sub-modifier.
Your mask (I guest?) topologies are not suitable for subdivide, it has some holes with special case that blender nowadays can not resolve well. See the reference: Subdivide
The smooth shading AFAICT use Gouraud Shading in the view-port fast rendering. There is fake normal in the calculating pipeline, you might confused that by another common shading: Phong Shading.

No need to worried about it since in Cycles render, it use try tracing with other method to calculate the color and normal.


Vertex weight Edit modifier not working as expected I wanted to have the vertex weight edit modifier driving through texture, but I have no idea why it's not working as expected I'm watching a tutorial and following the steps exactly but not getting the same results.
So I have a plane that I subdivided and created a new vertex group in it that's empty:

And then I added the modifier and I allowed group adding and chose my vertex group.
When I press invert falloff it works as expected (goes red)

You can see I added the texture, but here's what my screen looks like:

As you can see there's no change and I don't understand why.... Any ideas?

Had the same issue. Change the falloff type to custom and set the first point from 0 to 1 (so the all falloff becomes a straight line on the top). Make sure that your vertex group is empty and the weight set to 0. Here are the settings of the modifier:


Replace Object During Animation I am looking to replace an object with another object during an animation. I want the original object to be in the animation up until I 'replace' it. I do not want to replace the original object throughout the entire animation.

What I am doing is essentially sliding letters onto a cylinder, and they are being spun around the cylinder. (Like at a playground, cylinder goes through the middle of the letter and you can spin it). By the way, each letter has been converted to a mesh (so I could animate them)

Example:
--WOW--
--YES--

I want wow to be visible (staying still), and then animate the letters to be spinning. During the spin animation I would like to replace the first W with Y, O with E, 2nd W with S. Still spinning. Letters stop spinning to say YES.

I have found multiple explanations for how to replace an object throughout the entire animation, but not on how to do the above. I'm not sure what the best way is to go about it, is there a way to "replace" the letter so it stays in the same spot, and continues the animation (almost) seamlessly - using a keyframe to set when the letter gets replaced, or make the 1st set of letters somehow go instantly invisible, with the new set becoming visible during the same frame?

One way to do this is by using the Mask modifier :

select the two meshes and click  Ctrl+j to join them
in edit mode assign each word to vertex group
add Mask modifier and add the vertex group
in animation Right click on the icon next to the vertex group in the modifier and select add Keyframe
clicking  the icon will switch the visible words

result :


UV unwrapping turns the uvmap model inside out When I unwrap this the legs point outwards:
https://i.imgur.com/lu8tjNm.png

I added some white and red colors to the pic to indicate where the verts ended up.

Here is a blend example:
https://www114.zippyshare.com/v/NxgNqXtR/file.html

How to get it to unwrap correctly?

You have the option Fill Holes turned on in the Unwrap settings which gives the undesired result in this case.

Turning it off will unwrap your model correctly.


Making a spherical gradient that becomes transparent towards the outside I want to know if there's a way to create the following material: A spherical gradient that is red in the center and gets transparent farther away from the center.
I want to apply such a material to a plane object.

As Rob suggests you can use a Gradient node in Quadratic Sphere mode:


Modifier added from Python operator not being applied My operator duplicates the active object, adds a solidify modifier to it, then applies it.
When run from my panel it works EXCEPT it does not apply the modifier and I can see it still under the duped object in the Outliner (I can then manual apply it, apparently correctly).
When I run the operator directly from the Python Console it DOES apply.
I've verified that after the duplicate, the new object is active and the sole selected object.
I must being doing something wrong that only manifests in a panel context, but I'm stumped.  Below is the complete test script.
# Blender 2.82a
import bpy

class TestSolidifyOp(bpy.types.Operator):
    bl_idname = "object.test_solidify"
    bl_label = "Test solidify"

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        orig=context.active_object

        bpy.ops.object.duplicate()
        ob = context.active_object

        if orig is ob:   # Just to show orig obj is NOT still active
             return{'CANCELLED'}

        mod = ob.modifiers.new("Solidify", 'SOLIDIFY')
        mod.thickness = -1
        bpy.ops.object.modifier_apply(modifier="Solidify")

        return {'FINISHED'}

class TestSolidifyPanel(bpy.types.Panel):
    bl_label = "Test solidify Panel"
    bl_idname = "PANEL_PT_tsolid"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

    @classmethod
    def poll(cls, context):
        return (context.mode == 'OBJECT')

    def draw(self, context):
        layout = self.layout
        row = layout.row()
        row.operator("object.test_solidify")

if __name__ == "__main__":
    bpy.utils.register_class(TestSolidifyOp)
    bpy.utils.register_class(TestSolidifyPanel)

Override the context.
TBH can't see why this is not working, the properties panel can be fickle, for example with context.object
Suggest two changes, make an override dictionary to be sure to be sure the object known as ob is the one having its modifier applied. Secondly using mod.name to identify the modifier ensures it is the last one added, in case the object has another already.
bpy.ops.object.modifier_apply({"object" : ob}, modifier=mod.name)


Blender 2.81, Why are my Light and other settings GONE? I have literally no light settings available.  I have the same problem with material settings.  Almost all of my material settings are gone also. It works fine on an older saved file.  Also works fine if I create a new file.  All light sources in this scene display ZERO settings such as color, power, radius. :(

What did I do to make them disappear? I have tried everything and searched to no avail.  Unfortunately, none of the suggestions has fixed it so far.

I have also downloaded and reinstalled 2.81 with no difference.

That happens when you have hidden "layers" in an old version of Blender and open it with 2.8x. To show the items click the tv and camera-icons to make everything visible again.

See the second image, click the tv-screen and everything is visible again.


How to apply (make real) a curve generated by modifier in Graph Editor? I need to apply (or make real) modifier used on IPO curve for next adjustment.

In my case I have curve with three keyframes plus Modifier (type Cycles) that repeats eight times this step.
I have many similar animated objects with modifier. And I need to edit each curve individually later (after applying modifier).

Does exist function in blender that make this modifier real?
Thank you for help

Select object, hit SPACE BAR, write Bake Action and Enter.
In pop-up properties window you can keep default setup for this purpose.
Confirm, that's it.


Multiple textures on a surface - transparency problems I'm trying to mix two textures for a large environment scene. The base texture is a JPEG (opaque), seamless and tiled. The second texture is a PNG with transparency (using it to give variety to the background hills). I've mixed the PNG over the tiled JPEG texture using the PNG alpha as the factor.. but the rendered result has problems (when I add a black background layer in photoshop it appears correctly)

This is the node setup.

EDIT: This node setup is actually correct... problem arose from having a second incorrect material on the same surface.

Ah silly me, this node setup actually gives the correct results. The problem was that I had another material slot on the same surface which had an older incorrect transparency node setup (which was causing these problems)...

Here's a render with the above node setup showing no transparency issues!


How to animate an object rotating on its own axis? I want to animate a planet spinning on a slight tilt, like the earth does. I want to use a generator (in the graph editor) to have consistent, procedural motion, but animating any single axis of rotation uses global coordinates. How can I achieve this effect?

if you animate the earth on the Z axis, then parent it to an empty, and tilt a bit this empty, is it not what you want?


Cryptomatte from Blender to Fusion Studio 16 I am new to Blender and I am trying to export individual multi layer exr files into Fusion Studio 16 for the purpose of utilizing cryptomatte editing. I enabled the cryptomatte in the render pass properties for object, material, and asset. I then setup up a compositor node as seen in the image attached. I am using the Reactor plugin's cryptomatte. I know others have been able to do this. I just do not know what it is that they did that I am not doing. If anyone could help me out with this I would greatly appreciate it. I also attached a screen shot of my Fusion Studio node build. It is what you would imagine. There is no cryptomatte file embedded anywhere in the openexr. On top of all of that, I cannot find anything on Cryptomatte for animation in Blender. I only see people using through the compositor which renders single images. I prefer single images, but it would be nice to be able to compile them and cryptomatte in Fusion through the compiled finish.

Blender

enable Properties editor > Layers Properties > Passes > Cryptomatte Object
export animation as image sequence in Multilayed OpenEXR format (Float Full)

Fusion

go to File > Import > Footage and select your image sequence in your directory (so it is imported as one node)
search Cryptomatte (from screen i see you have it instaled, so i'm not going trhough installtation process)
now you have to specify what object to use as mask, for that select cryptomatte node and place source cursor on desired object in image (Torus in my case) and click Add in properties editor, or you can type name of your blender's object directly into field (see image).

I had some issue with edge, but was solved with additional node (macro/group?) here (you will have to Login first). I was also asking for the same kind of node tree fix on BA Thread, but without help for now.


2.8 Timeline frame jump hotkey In blender 2.79b you could jump forward 10 frames. Is there an equivalent in 2.8 that anyone is aware of? Not sure how to go about setting up a similar hotkey.

From 2.79b manual...
The Time Cursor can be moved in steps by pressing Left or Right, or in steps of 10 frames by pressing Shift-Up or Shift-Down.

You can add the missing hotkeys in the Preferences Panel.

Open Edit > Preferences, then click Keymap.
Click Add New.
Expand the panel and replace none with screen.frame_offset.
Set the Delta value (keyframes): 10 or -10
Click the default hotkey A and type your hotkey Up Arrow
Select the Modifier (Shift)

Save your preferences (if Auto Save Preferences is not selected)

Thanks to Zino.G, who answered this question on BlenderArtist:
https://blenderartists.org/t/frame-jumping-in-2-8/1156440


"Add driver" not on menu I'm trying to add a driver to a shape key but when I right click on the value line, the menu skips "Add Driver" and goes from "Insert Keyframe", "Clear Keyframe", to "Add to Keying Set".  I have Blender 2.74. Thanks.

Thats because you are already controlling the value with keyframes. Drivers and keyframes do not mix.

Select Clear Keyframes from the menu and then add driver.


Change Blender 2.8 theme? I installed Blender 2.80 Beta on my PC and the UI looks different from what it should (as I find online, and having tested it on a friend's computer). The boxes have a weird gradient-like active status which I don't like:

How can I get the default theme with flat input boxes?

(+screenshot of my entire screen)

Edit > Preferences > Themes > Reset to Default theme > Save Preferences

(after entering the "Themes" tab you might need to load "Dark Blender" from the Presets)


Glossy materials not rendering correctly I'm new to blender (and 3D modelling) so please use dummy terms if you answer!

I have applied 3 materials one each to 3 different objects and only 1 renders the same as the material preview. I've attached a screenshot to show you what I mean. The silver material should be on the top ball and the brass material should be on the cylinder holding the ball up. I've no idea why it's not working when the copper material on the spiral wire worked. I'm using cycles render if that helps?

You need something to reflect.
Currently you have white plane on the ground and grey sky. That is exactly what your material reflects.

You need to add enviroment map or sky texture.


I can't seem to paint while using weight paint for character rigging Title says it all. I can't paint no matter what I press and whatever settings I change, despite being in the right mode and having selected the corresponding bone.

turn face selection masking off. (the blue one means it's on)


Python: assign custom tag to vertices Is it possible to associate a custom tag with each vertex?

I would like to be able to number them...

I have an export script that dumps 6000 vertices to file, I then run a simulation that generates an array for each vertex.

But I would like to be able to give each vertex a unique ID as it is written to file, so that I can select a dozen vertices in blender, and export a list of IDs (and then process the array for each)

How can I do this?

LINK: http://blenderartists.org/forum/showthread.php?318031-Property-for-each-individual-face

It is possible to tag vertices with the bmesh module:

bm = bmesh.from_edit_mesh(obj.data)
#or
bm = bmesh.new()
bm.from_mesh(obj.data)

#create custom data layers
my_id = bm.verts.layers.int.new('id')

#get the custom data layer by its name
my_id = bm.verts.layers.int['id']

#access
bm.verts[0][my_id] = 42

#apply the changes
bmesh.update_edit_mesh(obj.data)
#or
bm.to_mesh(obj.data)


How to combine the bump maps of two texture maps? I give a clay texture map (downloaded online) to the 3d model, it gives the colour of the model, then the roughness input and finally the normal input (non color data for the last two inputs).

I also want to imprint the grayscale template with cuneiform signs placed on the 3d model, I do this by giving the template as a normal input(for the last image texture I give the b/w template image). But as you can see, the rendered image with the signs dont have the small texture/bump variations of the clay texture map (looks flat).

How do I go about combining the height input for bump node of the clay texture and b/w template for the given node configuration?

I am using cycles render, also if possible want to do it using blender node editor rather than manually combining the normal maps of the two images using some other software.

I have tried the answers given in the following link How to Combine two Normal Maps? but it hasn't worked out.

Nvm I think I solved my issue by using a Mix RGB node to combine the heights of both the images as shown below.


Blender report error during loading: DNA block missing During a rendering I had a voltage drop, my UPS didn't work properly (damn, but the battery is new!) so PC shut down.
I was more or less quiet because I saved a minute before start rendering, but when try to load my saved file blender report an error never seen before:

Loading: "E:\path where is the file" failed: failed to read blend file "E:\again path where is located file": Missing DNA block

It is the same, if I try to upload file from my saved folder or I try to recover from autosave tmp folder, or if I try to recover last session or quit session.

The file is not empty, is 66mb

I can load any other blender file without problems.

Any idea? Did I lose the file?

I found a solution if this happens. go to recovery and save the files again . Need some luck too :)


Extruded rectangle boolean operator acting strange I have a rectangle from an SVG that is extruded into a cube. The missing faces are added. All this from a small script:

bpy.ops.object.select_all(action='SELECT')
bpy.ops.import_curve.svg(filepath = file_outline)
newcurves = [c for c in bpy.context.scene.objects if not c.select]
bpy.ops.object.select_all(action='DESELECT')
for c in newcurves:
    c.select = True

bpy.context.scene.objects.active = newcurves[0]
bpy.ops.object.join()
curve = bpy.context.object
curve.scale = [28.888, 28.888, 1]
bpy.ops.object.convert(target='MESH')
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.remove_doubles()

bpy.ops.mesh.extrude_edges_move(
    TRANSFORM_OT_translate={
        "value": (0, 0, 1.6)
    }
)

bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.edge_face_add()
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

Now when I create (manually in the GUI) a cylinder and place it within the cube, then add a boolean DIFFEERENCE modifier to the cube (to make a hole in the cube) the strangest thing happens:

The top face has a hole in it. The bottom face has an outline of the cylinder added to it.

Now, if I stop my script just before the extrude and then do the extrude manually, then continue the script (copy and paste in the console) I can then do the boolean operation fine.

So I figure there is something wrong with my extrude command. So I grab the command from the info panel that worked when doing it manually and pasted that into my script instead. The results are identical - the boolean fails miserably.

bpy.ops.mesh.extrude_region_move(MESH_OT_extrude_region={"mirror":False}, TRANSFORM_OT_translate={"value":(0, 0, 1.6), "constraint_axis":(False, False, True), "constraint_orientation":'GLOBAL', "mirror":False, "proportional":'DISABLED', "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "gpencil_strokes":False, "texture_space":False, "remove_on_cancel":False, "release_confirm":False})

This same script I have been using on a more complex path quite happily with no issues. But as soon as I use this much simpler SVG it croaks rather nastilly.

Is this a bug in the boolean modifier (I am on 2.77 on Ubuntu) or something in my script that is breaking the boolean's ability to do its job?

The generated cube can be downloaded here.

It turns out this is a bug in 2.77. Upgrading to 2.78a seems to fix the problem.

However that now has introduced a new bug whereby my mouse keeps jumping to the wrong monitor when I release the middle button after moving around in the 3D view. Very annoying.


How to set cursor location, pivot_point in script? I am trying to set a cursor location and pivot point with

bpy.types.SpaceView3D.pivot_point='CURSOR'
bpy.types.SpaceView3D.cursor_location = (0.0, 0.0, 0.0)

and I see I am not doing it right. How to do it correctly?

See Adhi's answer here as to why this won't work the way you are doing it.

Using Context
It's easier to read 3D View space's settings through bpy.context,
e.g.:

Use bpy.context.space_data, if the 3D View area is active (i.e. accessed through an operator executed from the 3D View itself).
Use bpy.context.area.spaces[1], if accessed through a Console whose display type is directly switched from a 3D View.
Use bpy.context.screen.areas[X].spaces[0] if accessed through a Console in another area, index X must be searched beforehand.

What you want to use is
bpy.context.area.spaces[1].pivot_point='CURSOR'
bpy.context.area.spaces[1].cursor_location = (0.0, 0.0, 0.0)

For the cursor location, there is a shorter alternative. All 3D View's cursor location is linked to the scene's, so it can also be accessed from bpy.context.scene:
bpy.context.scene.cursor_location = (0.0, 0.0, 0.0)

V2.8+ :
bpy.context.scene.cursor.location = (0.0, 0.0, 0.0)


Blender - Set blending mode(Porter-Duff) for a material I am using Blender as the 3d asset creation suite for my projects.
I have an exporter that is able to export mesh, materials, animations and skeletons.

In my home-grown engine, I want to render some materials with alpha blending.
Specifically, I with to be able to set one of the Porter/Duff operators to the materials.

Is there a way I can set this from within Blender?
All I can see is a tranlucency adjustment under material properties.

Is there a settings for alpha Blending mode?
Or should I use custom property?

Thanks in Advance,
-Valyannan.

The Blend Mode in the material settings is only available when Render is set the to Blender Game:

For textures there are Blend types which are also available in the internal renderer.

I'm not sure whether you can map these properties to the required operators defined by Porter-Duff, thus custom properties could be a good alternative.