text:
Is there a workaround for missing snapping in shrink/fatten? (curve bevel/taper? But I do not get it)
I have a (at the moment extruded) profile and a "rail" (selected edges in the first image). I want the extruded profile to follow the curvature of the rail (a bit like in the second image).
In the second image I used scale+vertex snapping to give an idea of the desired end result (but here the result is of course not regular (as it only scales from a single reference point in the middle of the profile, so the further away vertices will be scaled too much)).
The obvious solutions to me would have been to either using the shrink/fatten tool (Alt + S) for each profile loop, but sadly it seems there isn't any support for snapping with it.
The other solution I thought of (and thought it would be easy) was to convert these two into curves and use bevel and taper ... but man, that is very unintuitive and even after watching quite some tutorials I did not get it to work).
How can I best achieve this?

As you said, converting it to curves and using one as the profile works a little counter-intuitive. Here's how you do it (sorry, my model has a slightly different shape):
Just take the bottom edge of your object and convert it to a curve: Object > Convert > Curve, do the same with the vertical  profile.
Select the bottom edge and go to the Curve Properties. Under Geometry > Bevel switch to Object and there you choose the vertical profile.
Now, to understand how this works: the bevel profile will be following the curve with its origin point. This means, you have to set the origin of the bevel profile on the vertex at the bottom. The orientation of the bevel profile (when the rotation is applied and all set to 0°) is like this: vertices in positive X direction point to the right of the base curve's forward direction. Vertices in positive Y direction are pointing in upward direction of the base curve. So the curves should be setup like this:

The result looks like this:

@Gordon Brinkmann This is a very good explanation (the clue with the origin is especially helpful) and it should work... but somehow i get this as a result: https://de.catbox.moe/p3tol0.png ... at the base it has the right size but at the top it is much much much to wide and overall it is much much much too high. (All transforms were applied before)

@GordonBrinkmann I need to scale the profile down by 0.001 to get the right result ... not sure why. (Does it have to do with unit scale beeing 0.001 and mm? But why do i not need to scale down the curve also then ... i am confused). Well, at least now i know how to do it, thx.

Pardon, I missed that!

@Nathan Nevermind :)

@CoD This sounds a little strange when all transforms were applied... The problem is, my solution is built with my own models, whatever there might be in yours going wrong is not recreated this way. Maybe you could upload your file so I can investigate it further? Maybe there is a certain reason it's not working as expected. What I don't understand in your picture with the result, why is the bottom such a pinpoint, where is the original rounded rectangular shape? For the scaling issues: very often this is caused by the different scaling and number formats in different softwares.

@GordonBrinkmann must have been some hickup or i forget something. I now reimported the stuff (to have a more refined mesh as basis) and am now not able to recreate this issue. Maybe i just forgot to apply some transform (am quite sure i did not tho). If i will run into this again i will upload an example here and tag you.

In my opinion it would be easier to redo it properly from scratch, plus it's better to use less vertices and then subdivide with a Subdivision Surface modifier:

Create this shape:

Bevel these edges:

At last bevel these ones:

Another way would be to extrude your profile a bit and give it an Array modifier to repeat it and a Curve modifier so that it rotate around your square:

The shapes are done in a CAD software using exact measurements and constraints etc. and imported to Blender (as 3D capability of the CAD software ... is not very nice for several reasons). It is also only one of much more shapes with different dimensions. So redoing it in Blender is more or less out of questions.

oh ok but for the second solution I cite you don't need to redo it, you just need to convert the vertical curve into mesh

That almost works. Problem is, that the width of the segments is wrong (same width for everything, while in the end result they are supposed to be the same width as the segments of the profile).


text:
How do you connect a vertex to a mirrored version of itself?
I've probably butchered the title, but I think its a simple answer I can't find.
Here's a picture of my issue, it seems easy to solve but I've been stumped for a couple minutes now.
Basically I want to fill in the void left with a simple straight edge, but I'm not sure how, anybody know?

The vertices generated by a modifier don't really exist in edit mode. (You edit only the original mesh, not modified)
So, you can't interact with the mirrored vertice.

Solution 1:

Turn on clipping in the mirror modifier
Keep the merge option on in the mirror modifier
Extrude the original vertice towards the mirror plane

The point will stop at the mirror limit (clipping option) and it will merge with the mirrored point (merge option)

Solution 2:
(not recommended unless you know you want to change objects in a non-mirrored way)

Leave edit mode
"Apply" the mirror modifier
Select both vertices and fill.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
How to animate a destroyed object?
I have a wall and a ball flies into the wall, as well as the Cell Fracture addon BUT upon collision the ball should fly apart (not the wall), but I can’t animate 100-odd pieces of the ball so that they fly into the wall and break. Rigidbody won't let me animate it

hello do you mean that the ball hit the wall and breaks?

@moonboots, Yes!

Create your wall, give it Rigid Body > Type > Passive, create your ball, give it Rigid Body > Type > Active, create your animation of a ball hitting a wall, let say it is supposd to hit at frame 11, at frame 10 keyframe the Animated option on:

At frame 11 keyframe it off:

Back to frame 1, fracture cell your ball, once done, put the 3D cursor at the center of the sphere with ShiftS > Cursor to Selected, select all the pieces and right click > Set Origin > Origin to 3D Cursor:

Now in the Outliner, select all the pieces and Ctrl select the original ball:

Copy the animation of the original ball with CtrlL > Link Aniation Data:

Also copy the rigid body settings with Object > Rigid Body > Copy from Active:

Here is the animation:

Now you just need to keyframe the sphere and pieces visibility so that the sphere is visible from frame 1 to 10 and invisible afterwards, and vice-versa for the pieces. Select the sphere, create a brand new action from the existing one:

Keyframe its visibility in the Outliner, at frame 10 make it visible and keyframe, at frame 11 make it invisible and keyframe:

Do the opposite for the pieces...

I do not know why, but after this destroyed ball looks like: https://ibb.co/60J8rgW

Oh yes I get it, when you've done the cell fracture, put the 3D cursor at the center of the sphere, select all the pieces and right click > Set Origin > Origin to 3D Cursor

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How to hide object but remain shadows in Blender 4?
As I understand the interface of visibility has been changed, and now I just do not know how to hide the object but remain shadows from another items on it.

Hello, if you are using Cycles, it is still possible in the Object panel > Visibility > Ray VIsibility and disable Camera

As @moonboots said, what you are looking for are the Ray Visibility settings, they are not removed but are a Cycles feature (just like they were in older versions as well, that did not come with version 4), because Cycles is a raytracing engine ("ray" visibility settings).

@moonboots, I have checked: the switching off the camera in ray visibility does not remain the shadows

@GordonBrinkmann, I have checked: the switching off the camera in ray visibility does not remain the shadows

You may look for the Shadow Catcher option in Cycles in the Object panel > Visibility (there are some ways to do it in Eevee but I'm not sure that it's working well):


text:
How to Properly Connect Crossing Railway Tracks without Overlaps?
I'm working on a 3D model of French railway switches in Blender, and I've run into a problem. My model includes the following components:
The Frog (green), which is already complete.
Standard rails (blue) that end where they meet the frog.
Wing rails (red) that overlap with the standard rails and need to transition smoothly into them without any excess parts.
In the attachments, you can see an image of my current Blender setup and a reference image of a real railway switch.
Current 3D Model:

Reference Image:

My goal is to make the blue and red rails "merge" seamlessly at the transition, so there are no overlapping parts and the wing rails (red) meet the standard rails (blue) smoothly. So far, I've tried the following:
Merging: I merged the rail parts.
Intersect (Knife): I used the "Self-Intersection" option with the tool.
Merging Vertices by Distance: I merged vertices by distance and then tried to manually delete the overlapping vertices at the ends of each rail section.
However, this doesn’t seem to work, as vertices aren’t being created where some edges intersect. This leaves overlapping rail sections and creates messy transitions.
How can I correctly cut these overlapping parts and connect the rails so they look like the reference image? Is there a more efficient method or a specific setting with the knife tool that I may have missed?
Any help would be greatly appreciated!
Thank you in advance.

Can you share your Blender project file? Instructions for sharing.


text:
importing WRL files with bad sliced surfaces fix
total beginner here. I need to put artwork (textures) on flat surface 3D units for my work and need to import WRL files that have been exported from the CAD team, when I import the files in edit mode they are all sliced up instead of a flat surface like this:
Is there a way to fix this quickly without having to pick out each slice to UV map it?
Thanks

It looks like you’ve got Z fighting problems with the shelf model in the background, which indicates doubled mesh. I can’t tell from your description if you just need to do Limited Dissolve, or Merge Vertices By Distance and learn about how UV mapping works. If you can, share your blend file with blend-exchange.com

Instructions for sharing your Blender project file.


text:
Most efficient way to round edges
In this simple model I first rounded the corner edges of the shape using bevel, with 16 segments (1st pic). Then I selected everything and applied a second very small bevel of 1 segment, to give the hard edges a softer look (2nd pic).
I am happy with how it looks, but is there a better way to do it? By better I mean more efficient, and looks as good or better.
I know I could use the subsurface modifier for rounded edges as well, but read that bevel is more efficient and gives more control. I guess the efficiency will be lost if I use too many segments. But I don't know at which point this becomes true; is it something I need to worry about, or is bevelling so much more efficient that it is not realistic that it ever becomes more costly than sub-surfacing?
Is there an even better way to handle the two types of rounding in this model?

maybe my eyes are deceiving me but it appears that the internal edges are not consistently smaller than the outer edges by some factor. there seems to be some movement..

I think that is because I bevelled every edge for the edge softening, including the segments of the corner bevelling. When I redid it bevelling only the outer edges the effect went away.

There is no most efficient way to effectively round edges, this is highly dependent on what type of object you are modeling, how much detail you want, how close you plan to render, the environment your model will be in etc.
There are several ways to go about this, all highly effective depending on the situation they are use in. I would recommend to continue beveling your edges.
Why? Beveling is much more efficient and cheaper than subsurf, you also have better control of your geometry and topology. What you are doing above is using it inefficiently, that shape could be just as rounded with fewer segments, You don't need more than a few or so segments on any edge at a time. It is also worth noting that since it is a modifier, any mistakes you make can be easily undone.
Here are is an object duplicated twice and bevelled with different amount of segments, one has 12 segments and the other has 6, can you immediately tell which one is rounder?

Here are the wires..

As you can see it is highly efficient, it's all in how you use it. As you have it above is overkill for such a simple object, you don't need more than a few segments to round out your edges depending on the complexity of your mesh.
Note: Also using Shade Smooth on your hard surface models can help to make them appear more smooth/round and less faceted as I have done on the objects in the images above. You can also just smooth certain parts of your mesh by selecting the vertices/faces and using the same method.
Also, feel free to use a mixture of modifiers to achieve your final shape or effect, for some objects it is better to use subsurf with edgeloops and for others, subsurf with creases etc. There is no one good or most efficient way to go about it, It all depends on what you need, the model being used and how well you as the artist can determine what the best way to go about it is.
Additionally, you can get more tips here:

How can I make sharp geometric 3d models look more realistic?
How to smooth shade an object while retaining hard edges?

Hmm, in your example I agree there is no real difference, but in rendering my model with 16 segments I still see clear faceting. Are you doing anything else to smooth that? Point taken though, I will experiment with less segments.

@Sean all I did was use shade smooth. Use the W menu in edit mode. I will add it to the answer.

Thanks! I just figured out I can smooth shade more selectively than the whole object, so this presents more options.

@Sean also check out the modifier "edge split" which can help you fine-tune precisely how the smooth shading should work. It allows eve more control than just selecting what faces are smooth. You can set, over what edges they should be smooth. - However, it should always be after all mesh-deforming modifiers, else you might get disconnected meshes.

@kram1032 I mention it at the end, it is the last link in the answer or here http://blender.stackexchange.com/questions/734/how-to-smooth-shade-an-object-with-hard-edges/

I get the impression that you are capable enough to reason about which approach benefits you in the long run.
Using the sub-surf modifier has the drawback that it creates extra geometry for every face in the mesh, it also requires that you make extra control geometry or set the crease value of edges that need to be sharp. So there is some hidden work in this method.
Using the mesh bevel tool (not the modifier) is a bit more hands-on but you end up with geometry where you want it. Unfortunately it's destructive so changes in the long run can mean redoing some work.

I know I could use the subsurface modifier for rounded edges as well,
  but read that bevel is more efficient and gives more control. I guess
  the efficiency will be lost if I use too many segments. But I don't
  know at which point this becomes true; is it something I need to worry
  about, or is bevelling so much more efficient that it is not realistic
  that it ever becomes more costly than sub-surfacing?

Plan, do some tests. Ultimately if you are happy with the results, it doesn't really matter what method you use, as long as you don't have piles of excess geometry that don't contribute in a meaningful way to the geometry or the end render.
If you have close-ups and side-views where the edges will be noticeably faceted, you will need extra geometry along those curves to make it believably round. Setting the surface shade method to smooth won't always mask these things at certain angles. The amount of bevel segments will therefore depend on things like that.

Thanks. I forgot the bevel tool is also a modifier, I had been using the mesh tool. Being able to undo the modifier later would be really useful, I'll give that a go. You are right on the sub-surf modifier, it's very impressive, but I have been frustrated by the lack of control (because I don't yet understand exactly how the geometry I add controls it). Bevelling otoh is much easier to understand immediately.

At times the involvement of a sub-surf modifier can present tricky issues, even for people who are familiar with it.

You can also use the Spin tool to create rounded edges with AltR.

Use the Spin tool to create the sort of objects that you would produce
on a lathe (this tool is often called a “lathe”-tool or a “sweep”-tool
in the literature, for this reason). In fact, it does a sort of
circular extrusion of your selected elements, centered on the 3D
cursor, and around the axis perpendicular to the working view…

The point of view will determine around which axis the extrusion spins…
The position of the 3D cursor will be the center of the rotation.

The spin tool will spin the selected vertices around the cursor (on the view axis). If you set your cursor to the center of the spin and spin 90 degrees, you'll get a rounded corner.

Aside from beveling.You can also fake the look of a smooth surface using the smooth tool. If you have some good beveling, with few segments, then you can add some smooth shading and get a better smoother look.

Thanks, I didn't actually realise until just now that I can apply smooth shading in edit mode to some edges only. Till now I only changed smooth/flat at the object level.

Yeah I only resantly figured that out

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
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?

There is a quite easy way to do it via the user preferences. You have to add the toggle in the input tab, 3d view, Object Non-modal section. Practically it's set up the same way the switches to weight paint and pose mode that are already there are.

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.

There is probably a better or more efficient way of doing this but this is one way to go about it..
The command for entering sculpt mode is bpy.ops.sculpt.sculptmode_toggle()
. You can put this into a small script and register the desired shortcut…
import bpy

class EnterSculptMode(bpy.types.Operator):
    bl_idname = "object.enter_sculpt_mode"
    bl_label = "Toggle Sculpt Mode"

    def execute(self, context):
        bpy.ops.sculpt.sculptmode_toggle()
        return {'FINISHED'}

def menu_func(self, context):
    self.layout.operator(EnterSculptMode.bl_idname)

addon_kmaps = []

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

    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')
    # change the shortcut here..
    kmi = km.keymap_items.new(EnterSculptMode.bl_idname, 'TAB', 'PRESS', ctrl=True, shift=True)
    addon_kmaps.append(km)

def unregister():
    bpy.utils.unregister_class(EnterSculptMode)
    bpy.types.VIEW3D_MT_object.remove(menu_func)

    wm = bpy.context.window_manager
    for km in addon_kmaps:
        wm.keyconfigs.addon.kmaps.remove(km)
    del addon_kmaps[:]

if __name__ == "__main__":
    register()

After running this, you should get a new Space menu item with keyboard shortcuts attached..

…you should now be able to enter sculpt mode using CtrlShift+Tab. It is easy enough to modify the shortcuts (as I think this conflicts with another), see the commented line in the script.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
What exactly does edge loop selection do?
AltRMB — What exactly does it do? After subdivisions or loop cuts, AltRMB does not seem to select some loops.
What should one do to define a loop? How can I use select edge loops efficiently?

An Edge Loop is a chain of connected edges where each edges shares a vertex with the previous edge, and that vertex has exactly 4 edges attached to it (except on the borders of a non-manifold (not "water-tight") mesh, where there will be only 3 edges, 2 of which have just one face connected).
An edge loop is terminated where the vertex has more than 4 edges (poles) or meets a non-manifold edge (an edge with only one face) or an Ngon (face with more than 4 verts). The latitudinal loops (rings) of a UV sphere are perfect non-terminating loops, but the longitudinal loops (segments) all end at two points (the North and South poles)
Here are some examples of edge loops (see where they change direction or terminate and why)

Details on the algorithm from the wiki:

First check to see if the selected element connects to only 3 other edges.
If the edge in question has already been added to the list, the selection ends.
Of the 3 edges that connect to the current edge, the ones that share a face with the current edge are eliminated and the remaining edge is added to the list and is made the current edge.

There is no option to tell Blender, that something is an edge loop. An edge loop is defined by the topology of your mesh. It is a loop consisting of edges.
From Wikipedia:

An edge loop, in computer graphics, can loosely be defined as a set of connected edges across a surface. Usually the last edge meets again with the first edge, thus forming a loop. The set or string of edges can for example be the outer edges of a flat surface or the edges surrounding a 'hole' in a surface.

See Blender Wiki for more details: http://wiki.blender.org/index.php/Doc:2.6/Manual/Modeling/Meshes/Selecting/Edges

That link is useful, but this is currently an essentially link-only answer...

You're right. I put more info into the answer.


text:
What is the difference between the trackball and turntable style view modes?
Blender has two methods for model navigation using the viewport, namely turntable and trackball, with the default being turntable.  When I use trackball instead, I can feel that something is changed, but I can't seem to be able to explain the difference to someone who has never tried it before.  How can I explain, in a technical or non-technical manner, the difference between the two rotation modes?

I'm surprised at the analogy used in the wiki concerning Turntable. This is a turntable for scultping with clay. This lets you rotate around the vertical axis so you can see all sides and judge their proportions accordingly. This is why the mode is called turntable.

(reference, Denise Ferragamo)
Trackball lets you rotate freely around a point in 3D space, this is like picking up the object with your hands and rotating it around until the point of interest is visible.

As per the wiki

TrackBall/Turntable
By default, when you rotate the view, you are using
  the turntable method. For some users this is intuitive and for others
  it is not. If you feel you are having difficulties with this style of
  3D window rotation you can switch to the "trackball" style.
With the Trackball style you are rotating the scene as though you are rolling
  your hand across a "trackball".
The Turntable style is fashioned more like a record player where you
  have two axes of rotation available, and the world seems to have a
  better definition of what is up and down in it. The downside to
  using the Turntable style is that you lose some flexibility when
  working with your objects. However, you gain the sense of up and
  down which can help if you are feeling disoriented. Of course you
  can always switch between the styles depending on what you are working
  on.

Or, succinctly: turntable is Z-up.

The only difference, as far as I can tell, is that Turntable rotation mode locks the viewport's Z axis orientation. Trackball doesn't lock Z orientation, and can be a bit confusing if we're not used to it.


text:
How do I use the compositor to output colour based on the depth of objects?
This setup seems like it should work, but it doesn't.

and another, more tunable.

the Z-buffer isn't really an image but a grid of distance values mapped from camera clipping start, and end (these settings are found in the Camera Object properties tab).
Use the limits tickbox to visualize the clipping start and clipping end range, (also called near and far clipping planes). Generally keep all your geometry in that range and you will be using the Z-Buffer like a boss.
PS: instead of the Map Range node, you can use the Normalize node and you won't have to set the range values, it will find the lowest/highest values in the Z-buffer and map them to 0...1 range

The value outputted by the z pass is in absolute units, going from zero to however far the objects in the scene are. Thus it goes over the color ramp's range of values, and gives out the value that maps to full 1 in the ramp.
You can fix this by adding a normalize node before the color ramp, or by multiplying it by some small value with a math node. The normalize scales the range from the smallest value to the largest to map into the 0-1 range, so the results of all objects change if you animate the furthest or closest object. A math node does not have that limitation and thus works better with animated scenes.

Oh, I forgot the map range node, it would be the best solution for this situation. Basically it's the same as normalize but it has settings to work around that problem I mentioned


text:
Why can't I punch a hole through a mesh?
Why can't I punch a hole through a mesh? When I use a boolean modifier with the difference operation it's not punching a hole, and it is giving the below result.

Check normals, doubles, scake... the usual. But, dont't use booleans, select square faces and delete/extrude/inset them. Enough subdivisions will make it smooth with subsurf.

Booleans are not always reliable when modelling. Even when your Boolean and booleaned mesh both have almost the same mesh densities, problems always show up.
I applied the solidify modifier on your mesh and then changed the Boolean method to carve rather than bmesh. Although it could've worked if you put the Boolean modifier before the solidify, but in your case it doesn't work.
To make this work you have apply the solidify modifier and then change the boolean method to carve. If you don't want the internal faces to have the red material, change the material of the cutter mesh to the material of the mesh being booleaned.

The Blend file:

No problem. Be sure to check doubles and normal consistency in the future, while using booleans. Majority of the problems come from there.


text:
How can I apply some kind of pattern on a mesh?
How can I prepare this type of mesh? With these kind of curved strips. How should I proceed?

The bottle is whole like this:

I've trying some stuff like this:

I created some separate strips to shrinkwrap on the bottle, and join it. After that, I create a label to shrinkwrap all of these two objects. Or maybe use a lattice to fix it on the bottle. But it doesn’t look good. And I know there is a best way (correct one), but I don't know exactly how.

It's not clear if the shape itself is made of this repetitive pattern or if it's a round shape with an added line on its surface.
In the second case you can use the method I describe, except keep only the lines and create another object, a subdivided cylinder that will be deformed with the same Mesh Deform modifier, so that both the 2 objects, lines and cylinder, have the exact same shape.
In the first case, you could begin with a 16 vertex circle, keep only 7 of its vertices, duplicate, flip:

Extrude, flip, bevel:

Array along the X and the Z:

Use the Simple Deform modifier (Bend mode) to bend along the Z axis:

Use the Mesh Deform modifier to shape it:

I think like this should be great, I gonna try.

Oh cool, I never tried to do something like this, but this is really helpful for any kind of similar modeling.

@Gordon Brinkmann, what do you mean by "something like this"? How would have you done that? I'm curious about all alternative solutions  ;)

I'd be surprised if someone found something much neater than this. :)

thanks, it's not perfect because if you squeeze the object it will also squeeze the pattern, but in that case use a Curve modifier with an ellipse instead of the Simple Deform

@moonboots Sorry that was misunderstandable :) I meant that I never tried to create such thing and never needed to, but seeing your solution and thinking that you could use it for a lot of other patterns makes me think I will do something with it one day :)

oh ok I was just wondering if you had another solution  ;)


text:
What is "OptiX" and "OpenCL" in 2.81?
I have seen two modes in 2.81 other than CUDA in the system settings - OptiX and OpenCL. What are they and how do I use them?
When I click on it, it's giving a message:

No compatible GPU found for path tracing. Cycles will render on the CPU.

For both (OptiX and OpenCL), I have a graphic which is enabled in CUDA. How do I enable and use it?
Any suggestion, video tutorial, or help.

OptiX™ is for RTX series graphic cards that include a ray trace (RT) core. For example, RTX 2080Ti.
Nvidia provides some API to let a program best use this GPU hardware for best results and also benefit from the original paper published in 2010. If your GPU is not Nvidia or it is not RTX (for example,  GTX series), OptiX won't work. There is a Blender development blog post to explain it more.
And for OpenCL, it is for an AMD GPU to utilize the hardware since AMD doesn't support CUDA at all.
It is all listed in the user manual:

CUDA
If the system has a compatible NVIDIA CUDA device, it will show up an option for rendering with Cycles.
OpenCL
If the system has a compatible AMD OpenCL device, it will show up an option for rendering with Cycles.

If you have a Nvidia GPU you can use either CUDA or OptiX. OptiX is specifically built for ray tracing and is probably faster than CUDA, which is built for general compute. Blender OptiX option uses Nvidia RT tech, which is only available on the newer Nvidia cards (NVIDIA GeForce, Quadro and Tesla products with Maxwell and newer generation GPUs.)
Here are the compatible cards for Nvidia ray tracing:
https://www.nvidia.com/en-us/geforce/news/geforce-gtx-dxr-ray-tracing-available-now/ GTX 1660 seems to be the absolute minimum.
If you didn't have a Nvidia GPU you could only choose between CPU and OpenCL. OpenCL is a Khronos standard for open computing for multiple different platforms.


text:
Is there a way to snap geometry?
I am trying to model a protection fence, but there might be an easier way. I want to snap to the other geometry instead of adding vertices and doing it by hand. Is it possible?

Create two objects, top (the rail you want to snap to), and bar (highlighted on the screenshot), in which assign the top 4 vertices to a vertex group SNAP, add an *Array *modifier to the bar object, and a Shrinkwrap modifier in Project mode, Z axis, with the target top and vertex group SNAP:


text:
Apply rotation to camera?
So as a follow up to the gimbal lock question, I've learned that for a camera it's best to use YXZ euler model (as explained in this video).
Here's the problem. When I add a camera in blender, it for some reason points downward, so when you change the euler to YXZ, rotate the camera 90° along X axis(gimbal), you immediately hit the gimbal lock. That wouldn't be a problem, if you could apply rotation to the camera - which seems to not be possible.

One convenient thing about the unrotated camera pointing down is that it's super-convenient to make orthographic animations in the XY plane.  (use the Z for layering)

The suggested YXZ order from the video does not work in Blender because it uses the Z up axis convention, whereas Maya uses Y as up axis.
If you want to get a setup like the video, where the gimbal lock occurs when looking up or down, you need to parent the camera to an empty and rotate the empty 90° on the X axis, then set the rotation order on the camera to YXZ.
Only changing the rotation order on the camera can't work, the gimbal lock always happens at 90° on some axis and the camera is at (0°, 0°, 0°) when looking down, so this extra parenting is needed.
That being said, I think the standard XYZ rotation order in Blender may actually be better for cameras. It will give you gimbal lock when tilting the camera 90° sideways, which is perhaps even less common than looking down or up.

Good point about the Z axis convention. The set up with the empty works great and you're probably right about the XYZ model. Btw, do you have any idea why it's not possible to apply rotation to either the camera or the empty?

There is nothing to apply the rotation to, cameras or empties do not have a rotation stored somewhere besides the object. For meshes there are the vertex coordinates that can be changed but there is no equivalent here.

Since you are asking this question you may want to consider setting up a camera rig.
There are some example videos online link, link, of different camera rigs however I'm not sure which are good to use with the latest blender release. (Nice addon project for beginner/intermediate developer).

+1. Great idea. The book "Film Directing Shot by Shot" has some nice examples of standard camera rigs. Will be nice if there is an add-on with such rigs.


text:
How to pass variables in the game engine to a newly loaded .blend?
I have two blend files, a.blend and b.blend.
I open a.blend, and run the game engine P. A script is then run that uses the function bge.logic.startGame("b.blend"), which starts running the game setup in b.blend.
In b.blend, another script runs. This one needs a value that is in a script in a.blend. How can I pass a var from a script in a.blend to the script in b.blend?

You could dump it to a file.
a.blend
with open('/tmp/mydata', 'w') as f:
    f.write(a_setting)

b.blend
with open('/tmp/mydata', 'r') as f:
    b_setting = f.read()

Eh.... that is really inefficient, I did think of doing that already. I wonder it it could be passed more efficiently via an external source though.

As you start your game session just once, it "just" increases loading time a bit when starting. A typical game has a save(load option already, so you might use it for such a purpose as well.

You can't.
As the name implies, you start a brand new game session. The sessions have no relationship to each other (except the starting operation). Each session starts from scratch.

So what exactly should I do in this scenario?


text:
Giving planes thickness in real-time display
I've got a bunch of planes that are perfectly lined up with the coordinate space, so I can't see them when I go to either front, side, or top view. Is it possible to give planes some thickness for the real-time display, just so I don't lose track of them when I'm editing other meshes?
I can imagine giving them all a thickness modifier that is disabled for rendering, but that seems like a big pain in the neck.

You could disable the axis lines with 3D view > Properties region (N)> Display > Only Render, but this will disable a lot of other stuff too.

I only see your problem when you are in orthographic view and your plane overlaps with one axis line. You could go into Properties -> Object -> Display panel and enable Axis or Wire.

Is there a way to apply this globally, rather than having to select the option for each and every plane?

@ajwood Select planes > Enable wire > Right click > Copy to selected. Or change the viewport shading to wire.

authors: Иван Сахаров


text:
Houdini's "explode node" in Animation Nodes
Not sure how to explain the question clearly, but I will give it a try.
I wanted to simulate "Explode Node" in Houdini, which basically rather simple and I think in Sverchok I manage to do that, but kind of overcomplicated somewhat.
It's actually super simple. And the answer is probably lie in using Vector and Matrix.
Supposed I have bunch of objects in the scene. From those objects each in position in the scene, user provides a custom Empty position, or some kind of Math formula to find the center of mass of the group. Then from that point, I wanted to just push the position of each object away from that point reference empty.
I tried just now, but I make all the objects fly away. This is because I probably doing it inside the loop?
I can't do "Apply Matrix" inside AN ala Sverchok to have the "default position" of each object.
Currently my logic is simply using Vector Add while referencing each object pivot. But I seem to just push all the objects away.
Should I... perhaps create a reference pivot using instance and that reference should not be looped?
---- MORE INFO
I need a way to keep the Matrix transform of object in "current original position", and then push each of the object apart from X point position. I don't want to make each object fly away.
It's kind of when dealing with TEXT object, and I want to have control over each of character letter position, and then adding to that current position.
---- REPHRASING THE QUESTION
Just like what we can do with Text Object (separating into letter), I would really like to do the same to Group Objects or Joined objects.
Manually by hand:
1) Multiple objects in the scene. Joined or Group them
2) Separate them again, control the pivot, usually centered.
3) Now, I would like to control each and every object from here, this position. Probably wiggle, but in this particular question, I just want them to drift and pushed away based on 1 single point position.
4) That way, we have explode in or out effect.

Does this have to work with sverchok? Could they be rigidbodies flying away from a force field?

Yes, well, I like to know both method.Actually prefer the Animation-Nodes or Sverchok procedural effect, in which the user/artist have more control over the result, without the need of simulation.

If I understand you correct, what you essentially need is a way to store the initial transformation of objects.
Fortunally Animation Nodes (AN) has an in-build system for that. It is called the ID-Key system (the name comes from the fact that it can theoretically work with all types of ID-Objects in Blender)
Using it is relatively simple - if you know about it:

Select all objects whose transformation you want to save in an ID Key.
Go to the AN tab in the toolshelf of the 3D View and open the ID Keys panel. There you have to click the "From Current Transforms" button. This will store the location, rotation and scale of each selected object in custom properties. You can also see them in the object settings.

Open the node editor, insert a Object ID Key node, click Choose Key and select Initial Transformation. Now you can get the initial location, rotation, etc of the object you have as input. The Initial Transformation of an object does not change unless you press that button again.

The ID-Key system is a generic solution to the underlying problem of storing values per object that are not changed by your nodes.
The same system is used by the Separate Text Object node. If you look at the template, it also uses the Object ID Key node. Also it does not only store the initial transformation of a letter but also the inital text-value.

That's exactly the answer I was looking for! Thanks Jacques. Great, then my next video can explain that mysterious Object ID thing.

By the way, can Object ID store all kind of arbitrary values per points or per object? For example, I want to store special value like "Initial Transoforms" (Vector), but I want to custom name it like "Level". So that each point carry this special ID and then I can change and use this data at any point in time? If yes, how would one create such special ID value?

You can only store data per object, not per vertex in an object. For that you should just use a separate copy of the mesh which you don't modify. Unfortunally the UI in the ID Key system panel is not ready yet. So you can't add more ID Keys there... This will hopefully change soon! Fortunally most of the time the initial transforms value is all you need..

Ok good to know about that limitation. Yes, I guess with what we have now it's pretty robust already.

 Cheers Jacques for the help. The explode modifier is a success. BVH can also works with this. Only 2 more wishlist:

Separate Loose node
A way to get to the center of object (when grouped) Cheers again! --- CASE CLOSED ---

Thanks a lot, @jacques-lucke !
But further: isn't there a way to set this "From Current Transforms" by default? Maybe implement a checkbox on the "Initial Transforms" node?

I don't want that this operation is implicit. Sure, in some cases it can be faster but I want that the user definitly knows where to change the Initial Transforms when he uses this node. Also "Initial Transforms" is part of the larger "ID Key" system in Animation Nodes. I don't really like having special rules for some types.


text:
Messed up Blender models when exporting to Unity3D
I have modeled a simple pocket watch in Blender. Every time I import it into Unity3D, regardless of whether I export it from Blender as an FBX or 3ds file, it always comes out missing faces! Why is this happening? I have never had problems importing models into Unity3D like this before.
Blender Screenshot

Unity Screenshots

It seems to me that different faces appear when I rotate it differently. How can I prevent this? Thanks!

If you're using ngons, convert them to quads or tris first.

what direction are your face normals pointing at in blender?

This looks like you have flipped normals.
Blender draws double-sided by default, but you can enable Backface Culling in the Display panel (one of the panels right hand side of the view-port).
You can also enable drawing normals which draws a line in the direction each face points.
So you can use either of these draw options to check which way your normals are flipped.
This could be...

Normals flipped the wrong way in Blender, you can select all in editmode and run 'Mesh -> Faces -> Recalculate Normals' (CTRLN). OR if they are all the wrong way around: you can simply flip the normals. 'Mesh -> Faces -> Flip Normals')
Negative scale on the object. Blender detects negative scaled objects and shows the faces pointing the right way, but many game engines will show normals flipped if you have a negative scaled object.

Flipping the normals worked great!

Thank you my scales were negative causing issues, wondering why just one object was going wrong in the scene!


text:
How to unlink material from a mesh, with python script?
Blender 2.68a, Python 3.3
I would like to unlink material from a mesh, and even after googling a hour I don't know how to do it. I only saw scripts that work in Blender 2.5x only for this.
So could someone tell me (or link info), how to do this:

with python script?

Unlink a Material
Remove the first material from the mesh.
import bpy
obj = bpy.context.object
obj.data.materials.pop(0, update_data=True)

Remove all materials.
import bpy
obj = bpy.context.object
obj.data.materials.clear()

Unlink Texface
This clears images for each face (active uv layer only)
import bpy
obj = bpy.context.object
for tf in obj.data.uv_textures.active.data:
    tf.image = None

This clears images for all UV layers
import bpy
obj = bpy.context.object
for texlay in obj.data.uv_textures:
    for tf in texlay.data:
        tf.image = None

Update: TexFace has been removed in Blender2.8

Trying to avoid comments, like "thanks"... LOL but thanks, I would never thought it is the "pop" I was looking for. Will accept in 2 mins, and vote up when I get 15 repu.

Ideally we would be able to do: del obdata.materials[0], Which would be the most obvious way to do this, but this way doesn't accept arguments for how to handle linked data.

Is there something similar for textures?

@McLawrence best ask a new question, link to this one.

You can also do the following to properly remove materials. This will both unlink the materials and also remove the unlinked materials from memory. ideasman42's original solution does not remove the left-over data blocks and can cause memory leakage issues unless you close/re-open Blender or exit the current Python environment (themultiprocessing package can help with the latter). Here's a modified version of the solution that ideasman42 proposed that properly removes materials:
import bpy
obj = bpy.context.scene.objects.active
mats = obj.data.materials

for mat in mats:
    mat.user_clear()

matLength = len(mats)
for i in range(matLength):
    obj.data.materials.pop(0, update_data=True)

leftOverMatBlocks = [block for block in bpy.data.materials if block.users == 0]
for block in leftOverMatBlocks:
    bpy.data.materials.remove(block)
bpy.context.scene.update()

mats.clear() # I'd recommend not executing this line. It might sometimes cause the object not be shown in final rendering


text:
search for unknown operator (bpy warning in custom script)
I'm calling one of my operators within another operator. The code worked fine until I tried it on a new file.
search for unknown operator 'MYPLUG_OT_update_list'

I'll try to simplify the code here
class login(bpy.types.Operator):
    bl_idname = "myplug.login"
    bl_label = "Login"

    def execute(self,context):
        ....

        bpy.ops.myplugin.update_list()

        return {'FINISHED'}

class updateList(bpy.types.Operator):
    bl_idname = "myplug.update_list"
    bl_label = "UpdateList"

    def execute(self,context):
        ....
        return {'FINISHED'}

def register():
    bpy.utils.register_module(__name__)

def unregister():
    bpy.utils.unregister_module(__name__)

if __name__ == '__main__':
    register()

Any ideas? I'm debating whether I need to preregister the dependent Operator or call it with some other convention.

Are there any errors printed to the system console at registration time? A bad line of code in the operator class can let the registration of that class fail.

No. No other errors.

Well, it works fine for me. There must be something wrong, or the example code is different from your actual setup.

This is impossible to repo. Maybe I did have some other error.

@BenL still having problem with this ?

No. I've moved on. The issue may remain for someone else.

The message:
search for unknown operator "NAME_TYPE_shortname", "NAME_TYPE_shortname"

could come from the user preferences keyboard shortcuts manager.

Registering an incorrectly spelled operator path will give that message.
Adding the shortcut in your script before the operator is registered will give that error too.

Maybe this is a typo but your
class updateList(bpy.types.Operator):
    bl_idname = "myplug.update_list"

Would mean that the operator is located at bpy.ops.myplug.update_list(), not bpy.ops.myplugin.*
There is no inherent reason that operators can't be called within other operators, but you will have to wait for the called operator to complete before the calling operator can end, it doesn't fork off into its own thread.
for instance
import bpy

class login(bpy.types.Operator):
    bl_idname = "myplug.login"
    bl_label = "Login"

    def execute(self,context):
        ...

        # bpy.ops.myplug.update_list()  # should be.
        bpy.ops.myplugin.update_list()

        return {'FINISHED'}

class updateList(bpy.types.Operator):
    bl_idname = "myplug.update_list"
    bl_label = "UpdateList"

    def execute(self,context):
        print('caramba!')
        return {'FINISHED'}

def register():
    bpy.utils.register_module(__name__)

def unregister():
    bpy.utils.unregister_module(__name__)

if __name__ == '__main__':
    register()
    bpy.ops.myplug.login()

# AttributeError: Calling operator "bpy.ops.myplugin.update_list" error, could not be found

If you are calling a set of operators in sequence, then of course you must  ensure that the operators are registered globally. If i'm not mistaken the bpy.utils.register_module(__name__) will register classes in order of appearance in the file, use that order to your advantage.


text:
Import camera information from Sketchup
Is there a way to import Sketchup scenes into Blender as cameras?
I can get the geometry into Blender without any problems; my issue is that I'd also like to bring along the scene viewpoint as a camera.
The data obtained from SketchUP API is like this:
mod = Sketchup.active_model
vue = mod.active_view
cam = vue.camera

cam.eye
> Point3d(240.719, -236.069, 102.276)

cam.target
> Point3d(-285.372, 553.004, -82.0446)

cam.fov
> 35.0

What is a convenient way to convert this into a new camera?

Related. Import SketchUp “.skp” files

seems like more of a question about how to get the camera/viewport data out of SketchUp in the first place, the ruby API is quite nice.

@zeffii I actually know how to do that (see here; What I'd like to know is if there is a way to do this without manually getting the coordinates and entering them somehow in Blender.

You would want the Up vector or Roll from sketchup too, otherwise you can't create the exact same camera.

If that's all sketchup gives, then it's a little awkward -- but I think still doable. Maybe something like this. You will have to 'tame' the dimensions yourself.
import bpy

# Data from Sketchup.
cam = {
    "eye": (240.719, -236.069, 102.276),
    "target": (-285.372, 553.004, -82.0446),
    "fov": 35.0,
}

# Create empty to target.
bpy.ops.object.empty_add(location=cam["target"])
target = bpy.context.object

# Create camera.
bpy.ops.object.camera_add(location=cam["eye"])
bpy.context.object.data.lens = cam["fov"]

# Configure camera to track the empty.
constraint = bpy.context.object.constraints.new("TRACK_TO")
constraint.target = target
constraint.track_axis = "TRACK_NEGATIVE_Z"
constraint.up_axis = "UP_Y"

Then you can apply the constraint (Apply Visual Transforms) and delete both it and the empty to avoid clutter.


text:
How can I make a camera the active one?
I have multiple cameras in a scene. What I want to do is to change which one is active. This way I can view the scene from different angles. How would I do this?

Related: http://blender.stackexchange.com/q/139/599

There are a few ways to set the active camera.

Key Binding: select it and press Ctrl+ Numpad 0.

From the menu:3D Viewport Header -> View -> Cameras -> Set active object as camera.

Scene property:
Scene tab in the Properties Editor and pick a camera object from the list:

Outliner (V2.90+):

You can click the green camera icon beside the camera's name in the outliner to toggle it as active for the scene.

Animation:
To change the active camera during an animation you can use Markers.

Add a marker where you want to change the active camera (M in the Timeline, or Timeline header > Add marker will add a marker to the current frame):

Select the object which you want to set as the new active camera and the marker which you want to bind it to, then press CtrlB in the Timeline (or Timeline header > View > Bind camera to markers):

Note that markers behave like keyframes, so you will need at least two markers with cameras bound to them to have any camera switching.
To illustrate this, here is an example with Camera.001 bound to the marker on frame 1, and Camera bound to the marker on frame 5:

Note: If setting the active camera is only effecting a single view, you may have Scene-lock disabled. In the 3D View header (Right hand side of layers buttons), there is a lock icon. This should normally be pushed in, unless you explicitly want to set a camera & layers only to a single view.

I just wanted to say that I had problems binding the active camera to a marker then I realized that I had restricted the rendering (the camera symbol on the right next to the camera in the Outliner). Cameras are not visible in the rendered product even if they are right in front of each other. Don't restrict the rendering or the viewport visibility of your cameras. This is a comment to help those noobs who like me were wondering why switching cameras was not working.

Note that clicking the camera icons to switch active camera will stop working if you are using an edit camera (e.g. you held down the mouse wheel button and rotated the camera). You have to choose an active camera first, e.g. View -> Camera -> Active Camera before the icon switching works (Blender v3.3).

Oh yes, thank you! Add Marker was the solution for me! I downloaded an Earth model, and it had animation included. Apparently, it was rendering the first frame... which I didn't think was the first frame... Anyway. I scrubbed until I got to the globe location that I needed, then used ADD MARKER (M). Then it rendered the correct view. Whew!

Another way to achieve camera switching in Blender is through the VSE or Video Sequence Editor.

Establish multiple cameras in the scene.

Add a scene strip to the VSE for each camera and set the active camera of the strip to each camera in the scene.

Note: If you cannot add a scene strip (because the menu is empty), just add a new scene and then you can add your original scene into the timeline.

Add a Multicam effect strip above these scene strips and use the buttons to switch between cameras. With a VSE preview window open you will see the switching occur (but not in the 3D view)

This can be used to feed the compositor with time offset scene renders as well. For example you may want to have a repeated action from alternate angles, simply set up the switching in the VSE then drag the scene strip along the timeline.

In order to change the currently active camera, select the one you want to be active and press Ctrl0. This will also change your view to the new camera.
To change cameras mid-animation, you need to use markers. A marker can be added by hovering with your mouse over the timeline and pressing M. Next you need to bind the second camera change with that marker. You can do it by selecting the camera  and pressing CtrlB.
NB: It is important to know that markers behave a bit like keyframes, so it is important to add one at the beginning of your animation and bind it to your first camera.

run the following script:
import bpy
import os

scene = bpy.context.scene

currentcam = bpy.context.scene.camera

setcam = False

for ob in scene.objects:
    if ob.type == 'CAMERA':
        if ob == currentcam:
            setcam = True
        elif setcam:
            bpy.context.scene.camera = ob
            break

if currentcam == bpy.context.scene.camera:
    for ob in scene.objects:
        if ob.type == 'CAMERA':
            bpy.context.scene.camera = ob
            break

To someone who has no idea how to run a script, how do I run this script and what does it do exactly? Try to add a bit more detail when answering, if the API changes (probably will) then your script will probably become obsolete, a few comments here and there will help.

@iKlsR Of course some more context information would be nice. But I think your requirements would prevent people from posting useful scripts, as it just becomes to tedious.

@tobltobs I agree, however I don't see the harm in appending a line of text to say open the text editor and do this or that or linking to a post that already answers that, it's not time consuming. Could be just me but when I answer I use layman terms and assume you know nothing about Blender.

@iKlsR - I know it's quite old but in blender 2.8x goto the scripting workspace --> new text --> past the above script --> click run script --> that's it.

I needed this, you saved my life. Thanks!!


text:
Installing an addon
There is this addon that was built called Window Generator 2. It can be found at this BA thread. However, when I go to the download link it shows up in a new tab as a bunch of code.
How can I download and use this addon in Blender?

related when this doesn't work, and why: install-from-file-not-working-to-install-addon and addons-only-some-zips-will-install

Download the script (Right click on on the link or on the page it is on and choose Save As...) and save it with a .py extension for example.. window_gen2.py.
Open User Preferences (Ctrl+Alt+U) and under Add-ons, click Install from File. Then navigate to the file you downloaded and select it.

It should now appear in the window and you can tick the checkbox in the upper right to enable it.

If you would like to have the add-on enabled every time you start Blender, click Save User Settings at the bottom.

Alternatively, you can just save it and open it in the text editor and press Run Script.

Will the script be copied to a blender-specific location, or will deleting it from, say, one's download folder cause Blender to fail to load it?

@hexafraction Blender will copy it into its scripts folder, next to where your config is. You can safely delete the file from the download folder.

this works for zips nowadays too btw

@ikIsR I have created a small script its running fine in text editor when i saved in .py and install and want to activate the check box i cant find it i search in community, testing and official. This is my small script :      import bpy
bpy.ops.object.delete(use_global=True)

@iKlsR I have an addon that requires restarting Blender to start working. I have compiled Blender as a Python module. How can I restart the bpy module? Is that even possible?

@Amir See https://blender.stackexchange.com/questions/2691/is-there-a-way-to-restart-a-modified-addon

@iKlsR I have compiled Blender as a Python3 module so I don't have access to the GUI. I install an addon and enable it using the function you pointed. I then save the user preferences using bpy.ops.wm.save_userpref() and exit Python.Next time that I do import bpy I don't see the addon API being added to the bpy module.Do you know how I can fix that?If I run the same exact script in Blender terminal (when using the GUI) everything works.(You may answer here)

Where is the path so that I can install it manually by copying a folder?

This is an alternative method that works well with multiple file addons as well:
Move or create an addon directory into the addons folder of your blender settings:
Example for Linux and Blender 2.69:
/home/$user/.blender/2.69/scripts/addons/m3addon

Example for Windows 7 and Blender 2.69:
C:\Users\%username%\AppData\Roaming\Blender Foundation\Blender\2.69\scripts\addons

Example for Windows XP and Blender 2.69:
C:\Documents and Settings\%username%\Application Data\Blender Foundation\Blender\2.69\scripts\addons

Example for Mac OSX and Blender 2.69:
/Users/$USER/Library/Application\ Support/Blender/2.69/scripts/addons

Activate the addon in blender

iirc, you can install a zip file as an add-on too (multi-file add-ons are usually downloaded as a zip file), which blender then extracts into its own folder in the right place.


text:
Disable object automatic dragging after duplication
After duplication, objects automaticaly follow the mouse pointer, is there a way to disable this behavior?

As per the wiki when you duplicate an object in Blender..

..this will create a visually identical copy of the selected object(s).
  The copy is created at the same position as the original object and
  you are automatically placed in Grab mode..

I don't think this is possible out of the box with Blender the way you are asking. At most, you can hit Esc after you duplicate an object or right click to cancel the grab.

If you insist however, it is possible to write a small script and add this to the 3D View's header and register shortcuts etc.
Looking at the API reference, I found a function bpy.ops.object.duplicate() that says Duplicate selected objects. You can put this into a small script and register some shortcuts for ease of use. (it's not perfect code but it works)
import bpy

class Duplicate(bpy.types.Operator):
    bl_idname = "object.duplicate_no_drag"
    bl_label = "Duplicate"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        scene = context.scene
        obj = scene.objects.active
        bpy.ops.object.duplicate()
        return {'FINISHED'}

def menu_func(self, context):
    self.layout.operator(Duplicate.bl_idname)

addon_kmaps = []

def register():
    bpy.utils.register_class(Duplicate)
    bpy.types.VIEW3D_MT_object.append(menu_func)

    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')
    kmi = km.keymap_items.new(Duplicate.bl_idname, 'D', 'PRESS', ctrl=True, shift=True)
    addon_kmaps.append(km)

def unregister():
    bpy.utils.unregister_class(Duplicate)
    bpy.types.VIEW3D_MT_object.remove(menu_func)

    wm = bpy.context.window_manager
    for km in addon_kmaps:
        wm.keyconfigs.addon.kmaps.remove(km)
    del addon_kmaps[:]

if __name__ == "__main__":
    register()

If you run this, you should get a new menu item.

Additionally, you can call it with ShiftCtrl + D and you should now be able to duplicate objects and not enter grab mode.

Also, while writing this script, it's worth noting that if you use the console or the text editor and run the command that is behind the default 'duplicate objects' command..
bpy.ops.object.duplicate_move()

it duplicates the selected object and doesn't enter grab mode. This is because of the context that's given to the operator to run in. In the 3D View it is run in the context 'INVOKE_DEFAULT' if you run it from a script or from the console it gets run in the context 'EXEC_DEFAULT'. Look at the API reference for more info about this. Thanks to jasperge for the explanation.

Nice! that objects duplication feels more natural to me.

Go into your Edit > Preferences
Search for the command Duplicate,
Open tab Duplicate Objects under Object Mode,
Erase the _move part in the command text.
Press Enter


text:
How to add keyframes for multiple objects at once
I've got about 200 objects for which I want to insert location/rotation keyframes.
Is there a way to add a keyframe for all of the selected objects?

Assuming you're talking about actual objects (not a mix of objects and armature bones), the easiest thing would be to select all of the objects and, from within the 3D View, press I and choose LocRot. That will insert a key for location and rotation on all selected objects.
If your needs are more nuanced, you may want to consider building a custom keying set. In that, you can specify any number of different properties from any number of objects (and non-objects... like World properties) and key them all at the same time. If you're interested in taking that route, then Getting to Grips with Keying Sets is a good start.

Nice! I've always been adding keyframes by right clicking on properties in the object menu :)

why does this not work all the time and just sometimes!?

Keying Sets
As Fweeb said, the standard way of handling this is using Keying Sets. Accessible in the 3D View under Object > Animation > Insert Keyframe… (I). There's a limited set by default but custom ones can be added. For more info see: Can I personalize the insert keyframe menu?
Scripting
Any time a task would be repetitive to do by hand, scripting is a good choice. Here's a quick example of how to insert a keyframe to all the objects in a selection:
import bpy

for obj in bpy.context.selected_objects:
    obj.scale[2] = 0.5 # Set Z scale.
    obj.keyframe_insert(data_path="scale", index=2) # Keyframe it.

obj.keyframe_insert doesnt work in recent version of blender, this does obj.data.keyframe_insert
Linked Animation datablocks
If creating the same animation on all object, you can animate just the active object and then link the action to the rest of the selection: Object > Make links… (Ctrl+L) > Animation Data). If you wish to later mix in some unique animation, turn the action into a NLA strip before linking.

There is this commercial add-on, Key Selected Objects, if you want to add/delete keys for multiple objects from the user interface.:


text:
Have two lamps blend together to give another color on a face
I am working through Blender 3d Basics by Gordon C Fisher. I'm on page 72. I have a green light and a red light but no yellow as pictured. Can anyone explain what I am doing wrong? Or better, What to do to get the yellow color on the cube? It is black where the yellow should be (on top of cube), and was also black in the previous two with the one red light and two red lights.
How could I have two lamps shining on adjacent sides of a cube (1) and (2) blend together and create a different color on the top face (3).

You more than likely have the default point lamps at the exact middle of these faces, therefore they won't reach the top. Raise it above the top of the cube so they can illumiate the top face. The lamps will blend naturally and give you the third color.


text:
Isolate or hide specific parts of an object in edit mode
I am just modeling an Audi R8 in Blender. I've already modeled more than half of the car.
I've also modeled the front and now I want to model the back. But this is a bit difficult because when I am in the "Back" View I see all the stuff I modeled on the front.
So is there a way to blend out separate parts of an object in edit mode?

You can isolate a specific part of a model to work on by going into Edit mode and using AltB (this toggles the isolated selection on/off) and drawing a square outline to focus on a specific area .
One advantage/disadvantage of this (depending on what you need) over just hiding other parts of your mesh with H is that the entire model can still be affected by other tools such as ring cuts or proportional editing.

You can hide parts of a mesh in edit mode and you can hide whole objects in object mode:

press H to hide the selection
press SHIFTH to hide the elements which are not selected
press ALTH to unhide everything

You can also access these functions in the viewport in the menu via Mesh->Show/Hide.

I really wouldn't recommend this to a beginner as it can lead to a plethora of problems further on. Note that if you use these, and you use a tool such as proportional edit or add edge loops, it will not update or affect the hidden parts of the mesh. So if OP say adds a few edgeloops at the back and works on this for a few minutes, after showing everything again, you might be left with a large ngon or a very untidy mesh.

Thanks for this hint but this didn't worked if I am in orthographic view and back.

Tested and it works for me in orthographic view too. However note that parts of a mesh are only hidden when its being edited. If the object switches back to object mode the full mesh is being shown. It's an easy way to show/hide several elements blocking the view on the fly. Regarding invisible geometry i read that the devs do not want the user to make changes to it because the user does not notice and may be doing something unintended. Anyway other options have been pointed out.

it's working for me on Blender 2.75 but when i unhide, everything become selected :(

Besides using Show/Hide feature, you can also use Mask modifier and toggle the last two buttons as shown in the image below, which is more flexable by using vertex group:

Go into local view (numpad /) https://en.blender.org/index.php/Doc:2.4/Manual/3D_interaction/Navigating/Global_or_Local_View

Works in Blender 2.8 too


text:
Can unofficial Blender addons be included in a project as a text block and automatically register on load?
I am a keen user of Bassam's typewriter.py addon. It's not part of the official distribution, so I thought I could make my .blend projects more portable by including it as a text block.
I always need to run the block even though I checked the register checkbox.
Are there any more requirements to having the .py extension that I need to do before the script will run on load?

http://www.blendernation.com/2013/01/25/typewriter-blender-addon/

Yes, if the addon is a single file (rather then a python package containing an __init__.py file).
At the end of the script, remove these two lines:
if __name__ == "__main__":
    register()

And add this line:
register()

In Python __name__ refers to the module name, which in this case is the name of the textblock (without .py, however if you run the script directly __name__ will be "__main__").
Removing this check before calling the register() function will run no matter how its executed.

Note, if you do this - The script won't be listed in the preferences as an addon, this wont cause problems, but a user has no way to disable besides restarting blender.


text:
Setting keyframes with default linear interpolation
Is there a way to add keyframes (I key) with LINEAR interpolation as default instead of BEZIER?
I often animate cyclic motion (e.g. planets orbiting around the sun or textures spinning about Z on a sphere) and the created f-curves have BEZIER as default interpolation. This requires me to immediately change the interpolation to LINEAR.
I was wondering if there is a magic key that I can use to have the keyframes added as LINEAR interpolated, or at least have a global setting that I can set to have LINEAR interpolation used by default.

Please search around the site before asking a question. There's a good possibility it has been asked and answered already.

I also prefer Linear interpolation for my initial keyframes, and set is as the default for new keyframe points through User Preferences > New F-Curve Defaults > Interpolation:

In case somebody finds this reply now many years later, like I did: It is in a slightly different place now (but not hard to find): Preferences > Animation > F-Curves .


text:
Make a hole in the ground of a video which is camera-tracked?
With my trial and error learning, I managed to track a video in Blender 2.67 and make a cube (the one which is there by default) appear on the "ground" (which is a table).
But how can I make a hole in the ground?

Edit:
I used the two buttons shown below:

The two functions seems to do a bunch of things to the scene, which seems to include setting the background and foreground layers, and adding a Ground object to the scene.
The problem is, what do I need to do to create a hole that appears to sink into the table?

Have you seen this tutorial?

seems to me like you could skip all the way to 39 minutes in that video: https://www.youtube.com/watch?v=CVPcT0dJmoY#t=2391s

@grc Just watched it and I think I get it. Still need someone to place a good answer for me to accept.

@AlvinWong you are also free to make an answer to your own question if you feel you can explain it.

In concluding, this question is extremely broad and is not an ideal question for the scope of this site, not to mention incorrectly titled.

@AlvinWong the question is in danger of being closed, perhaps you might modify the question to how to mask / prevent specified geometry from being rendered.

Firstly, you need to create the shape of the inside of the hole and make sure the object is on the foreground layer.
After that, you need to crop the generated Ground object to remove an area which matches the opening of the hole.
Here is the result (not realistic, just to show that it works):

This is the way I did it. I guess this might not be the best way to do it, but it works.
I am not familiar with Blender terminology. If someone is willing to post a more detailed or better answer, I would be glad to accept it.

presumably this method creates the necessary holdout material or renderlayers for you

There are several options, depending on which  render engine you use.
for Blender Internal:
For a quick and dirty solution you could use a large plane for the floor, with your sink-hole chopped out of it, and enable transparency on the material associated with the plane, Then enable Mask and set the Alpha to 0.0. The ground plane won't be visible any more in the render, but it will still occlude the geometry that you don't want to see.
for Cycles using Holdout:
Enable Transparent in Properties > Render > Film and give the occluding geometry a Holdout material.

Why use a Color Key node? If you set the Cycles render to Transparent it will give you the right alpha already.

@brecht, Oh! thanks, I'll fix that immediately.

What I do the most for this, is to simply model the shape of the hole and put that geometry in a specific layer (alone). Then, composite the alpha channel of that render layer and the video with the "set alpha" node and you get a hole in your video. Then you can composite, the cube you modeled for the hole, and the video with an "alpha over" node.


text:
How is the normal direction determined when I use "Make Edge/Face"?
Very often I'll delete faces, simplify things a bit (dissolving unnecessary vertices) and make faces again by selecting vertices and using the "Make Edge/Face" tool F. Sometimes the generated faces are in the wrong direction, i.e. normals pointing inward, so I need to check and flip them manually.
My question is, how is the normal direction determined when making a face? It doesn't seem to depend on the direction/order of selecting vertices and the result is quite random.
Are there any tips to make face normals point at the desired direction so that I don't need to flip them manually later?

If you create faces connecting to existing faces, they will be used to calculate the direction. Otherwise the direction is undefined at the moment.
If you have a file that you think is making faces pointing the wrong way, I'd be interested to know, however this is more of a bug report.
The possibility of making faces that point towards the view for example, or as you suggest, using the selection order is interesting and may be added but currently isn't supported.

The reason I think it might relate to the selection order is because, at least in OpenGL, face culling is determined by the vertices order. Perhaps not the case in Blender then. Perhaps the  times this happens to me is when there are no adjacent faces.

In blender as with opengl the vertex order is used to define the face flipping, its just that the face creation function ignores the order you select vertices. If you think you find a case where blender could do better feel free to upload blend or report a bug.


text:
Subdivide and separate face into different meshes
Is there a quick way to subdivide a face and then separate the resulting faces into separated meshes?
Here's what I am doing now:

Select the face
Subdivide the face (e.g. into 16 square pieces)
Select one of the face
Separate by selection
Repeat steps 3 and 4 until there is one face left

This works, but this is really time consuming and I can't even imagine splitting into more pieces (e.g. 256 pieces).
Is there a function (hopefully built-in) to perform the above steps more efficiently?

Here's the result:

Here's the original state:

In Edit mode -> Select the face
W -> Subdivde -> tool shelf T or F6 -> Number of Cuts (in your case 3)
With the subdivided faces selected -> Ctrl + E -> mark sharp
Add edge split modifier -> uncheck edge angle
In Object mode apply the edge split modifier
(optional) in Edit mode -> select the faces if not selected -> Ctrl + E -> clear sharp
In Edit mode -> P -> separate by loose parts

This is a really nice way to do that!

Try this:

Select the face
Subdivide
Switch to Edge Select mode
Loop select all horizontal (or vertical) edges
Rip with V and hit Esc so the edges stay in their original places
Box select the edges in the other direction (e.g. vertical if you started with horizontal)
Rip with V and hit Esc
Use P and Separate by loose parts.

On paper, this is more steps, but the workflow is faster.

Thanks, your method is nice too, but I think @forest-house's answer is simpler (don't need box select). Anyway, +1'ed :)

Heres a script (commands copied from executing them - macro style), you can run this in the python console or text editor.
# select the face in edit-mode and run
import bpy
bpy.ops.mesh.subdivide(number_cuts=3)
bpy.ops.mesh.inset(thickness=0, use_individual=True)
bpy.ops.mesh.delete(type='FACE')
bpy.ops.mesh.select_all(action='TOGGLE')
bpy.ops.mesh.separate(type='LOOSE')
bpy.ops.object.editmode_toggle()
bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY', center='MEDIAN')

if you wanted to you could make this into an operator and assign a keystroke or a menu item to is.

Extrude individuallly

In Edit mode > Face selecion mode > Select the face
W > Subdivde > tool shelf T or F6 -> Number of Cuts (in your case 3)
Extrude them with Alt+E and choose "Indvidual faces" (extrude them by a zero factor so they'll stay in place)
Invert selection with Ctrl+i
Delete faces
Select all, press than P > Separate by loose parts

Seperate faces by selection iterations

import bpy
for obj in bpy.context.selected_objects:
    obj.name = "OTEMPO"

obj1 = bpy.context.active_object
objName = str(obj1).replace('<bpy_struct, Object("','').replace('")>','')
print(objName)
for I in range(5):
    objname_namerange = objName
    print('doing',objname_namerange)
    bpy.data.objects[objname_namerange].select = True
    obj = bpy.context.active_object
    for I in range(0,1000):
        obj.data.polygons[I].select = True
        bpy.ops.object.mode_set(mode='EDIT')
        bpy.ops.mesh.separate(type="SELECTED")
        bpy.ops.object.mode_set(mode='OBJECT')
        objname_namerange = objName + '.' + str(I)
    for I in range(0,1000):
        objname_namerange = "OTEMPO"
        obj.data.polygons[I].select = True
        bpy.ops.object.mode_set(mode='EDIT')
        bpy.ops.mesh.separate(type="SELECTED")
        bpy.ops.object.mode_set(mode='OBJECT')

---------------------------------------------------------------------------
what this does is selects a polygon, triangle, or face goes into edit mode and then rips the face off of the mesh. It iterates over this same process for about 1,000 times with a check at the end. Unfortunately it quits half way through for some reason, but that shouldn't be to much of a problem. To use, post this source code into the txt editor, select your object and run it from there. It should fail the first time, select your object and run it again, continue doing this until every face has been separated, while it's not perfect it is a lot easier than manually ripping every face off.
as for subdivisions,
enter edit mode
press A >> selects all
press W >> opens panel
select subdivide >> will subdivide your mesh once, do so until you're satisfied.
also in your case you'll want to subdivide first then run my script.


text:
Setting the DPI value in rendered images
I'm in trouble with finding a way to set DPI value of files within Blender. I have set up an automated workflow to generate image files for printing, but the volume is too high to open and change the DPI value of each image separately. (PNG for example)

May be this addon is the one you need.

Wiki page about this addon.

Thanks for input, but looking at the code I understand that this is basically a calculator that outputs values to render dimension fields and has nothing to do with file formats. Very useful tool for many cases, thanks for bringing that up.

Btw, there is a nice discussion here may be informative http://blenderartists.org/forum/showthread.php?138614-render-at-300-dpi

Thanks again. This is also about calculations. My customers just want to print the file with single click without any preview and then they just get part of image printed on the sheet. I'm now trying to dig in the PNG format itself to change the values after rendering without recompression.

Note, that this is a feature intentionally left out of Blender, preparing images for print is out of scope for most 3D applications.
Suggest to automate setting the DPI with a command-line tool, eg:
https://superuser.com/a/479199/240907
This way you dont have to manually open and resave each time.


text:
How to get the entire list of operators?
I want to create a list with everything the spacebar operator search can produce. Is that possible?

Yes,
See: Help -> Operator Cheat Sheet
This operator is written in Python, See : startup/bl_operators/wm.py for the source is you like to get this data for your own use in Python.
The result can be viewed in the text editor:

Only 1469? Cool, now I can keep track of new operators.

The number is not so important it depends on compile options and which addons you have enabled.

As of Blender version 2.83.5 the menu Help -> Operator Cheat Sheet does not appear to be available.  But, the Operator Cheat Sheet can be found at the following URL for any Blender version: https://docs.blender.org/manual/en/dev/advanced/operators.html#bpy-ops-wm-operator-cheat-sheet


text:
Is there a way to unfold a mesh?
Is there a way to take a mesh, cut it with seams or sharp edges and flatten it, so that the faces stay the same shape and size?
Making paper models is one aspect, where you could use that technique.
No, I'm afraid SZ0Return is not going to do it properly.
And misusing the UV-unwrap is only a last option.

Note, while it's an option to revert to Blender 2.49 which had a script to do this, I'd like a solution that I can use inside the current workspace.

Would be great if someone could update the 2.49 script, it was quite advanced.

There is an exporter for paper models, it even has a Blender Wiki Page with in depth usage guidelines.
For more information and plenty of examples of successful use cases you can read the BlenderArtists thread by the developer of the script.
Add seams like you would for any regular texturing job, experiment with simple geometry first. Here is an icosphere.

That's an awesome addon. Nice find.

Agreed, the developer seems very eager to attack any bugs that lurk within.

I really want to use this addon as well, but the download button takes me to a wall of text... how am I supposed to download that?

Espen, search for how to install add-ons

For Blender 2.8+ the paper model addon is available at GitHub
Quoting the manual at http://addam.github.io/Export-Paper-Model-from-Blender/

Install
The script is included in Blender 2.80. Just enable Import-Export:
Export Paper Model in Blender Preferences → Addons.
If you need something special and know what you’re doing, you may
download and install a recent version. There is also another version
for Blender 2.79.
How to Use
An optional step before start is to mark edges where the model will be
cut. From the Properties editor, call the Unfold operator on the
selected model. The edges will get marked as Edit mode Seams, you can
edit them in any way you like. The script will use the seams you mark
and mark some more as necessary.
All the show happens when you choose File → Export → Paper Model. A
File Browser appears, which also allows you to change the export
settings in its bottom-left corner.
Then (if everything goes well), the script saves the file without
talking. In the settings, if you switch No Texture to something else,
Cycles' Bake functionality will be exploited to render the images.
That may take some time.
The file format is PDF and should be ready to print. If you want to
edit the net by hand, you may prefer exporting to SVG and using a
vector editor such as Inkscape.
Advanced Usage
A humble panel is in the Properties panel in Object Data section.
Currently it gives you an overview of how the net will be split into
parts (aka. islands). It can show one of them directly in the 3D view,
highlighted in orange. You can edit the name of each island and give
it a three-letter abbreviation that will be used on the sticking tabs.


text:
Why does operators bl_idname have to contain 1 dot?
Since anything before and after the dot is arbitrary, why bother?
Related error:
RuntimeError: Error: Registering operator class: 'abcdefg', invalid bl_idname 'abcdefg', must contain 1 '.' character

This rule may seem arbitrary, but looks like there's already some structure in existing operator's names. All registered operators will end up within bpy.ops module, and we can see that identifiers directly under it is reserved for modules/namespaces further categorizing the operators:

bpy.ops.action for animation data,
bpy.ops.object for object, regardless of data type,
bpy.ops.ui for user interface,
etc.

When we need an operator to quit Blender, it's available, grouped with other window management operators.
At first I, too, didn't bother with naming, putting everything under bpy.ops.object. But namespace distinction really helps to document, browse and search all the operators. Predictable identifier + Python console's Autocomplete feature made it easier to discover and build upon existing operators, including those from other addons.
I don't know if it has any other significance, but self-documentation alone made the naming rule worthwhile to enforce.

Developer note: in C code blenders operators are formatted SOME_OT_operator, which gets converted to some.operator in Python. To ensure the conversion can be done the "." needs to be added.
Then we can expose all operators as bpy.ops.some.operator() too, which is neat/logical.
This is arbitrary and we could have chosen not to do it, but I think having each tool in a named category is a good thing.


text:
Declare a global variable in a Blender session
I have a list declared like this -
m_list = own.get("m_list")

Now the problem is I can't access this list from another object. How do I declare the list so that I can access it from another object. I have to check whether or not an element exists.

If you want data to be global in Python, (within a Blender session).
Typically its best to create a module with a unique name specific to your project, import it - and access variables in that module.
Every script which imports the module will be viewing the same data.
In this exact case it sounds like you should add the object it self to a module.
import my_module
my_module.my_obj = obj

Some other script
import my_module
obj = my_module.my_obj

I don't think this works anymore in blender 2.8+ since other textblocks are now loaded with "bpy.data.texts['textblock.py'].as_module()" instead of import and variables don't seem to be global anymore.

While text blocks can no longer be imported. The answer doesn't mention them, you can use files for this.


text:
How to stretch a mesh object over another?
Let's say that I want to make, say, a tarp stretched over some objects (like some tools covered down on a military jeep) or a snake stretched around it's prey (I'm a horrible person, I know :P)  or even camouflage netting:
I've had a go at this using soft bodies physics:
Like This Animation
But if you've watched the animation, well... the results are not so great.  Does anyone know of any methods to do this?
Any and all methods are welcome, whether animate-able or not!

What about cloth simulation or the shrinkwrap modifier?

You could also try Cloth simulation or the Shrink wrap modifier.
Soft body simulation could be useful if you need the cloth to stretch (see What is the technical difference between softbody and cloth simulation?), but other than that you are probably better off with cloth. Note that if you do use soft body, remember to set the Cache step in Physics > Soft Body Cache to 1 to cache soft body deformations on every frame.
Cloth simulation:

Cloth simulation is one of the hardest aspects of CG, because it is a deceptively simple real-world item that is taken for granted, yet actually has very complex internal and environmental interactions. After years of development, Blender has a very robust cloth simulator that is used to make clothing, flags, banners, and so on. Cloth interacts with and is affected by other moving objects, the wind and other forces, as well as a general aerodynamic model, all of which is under your control.

Note that a new feature for "sewing" cloth has been added on February 6th 2014. This could be very useful for pulling cloth together (like in your first image). If you want to try it out, get a recent development version and have fun :)
Shrinkwrap modifier:

The Shrinkwrap modifier allows an object to “shrink” to the surface of another object. It moves each vertex of the object being modified to the closest position on the surface of the given mesh (using one of the three methods available). It can be applied to meshes, lattices, curves, surfaces and texts.

As mentioned by ideasman42, you can also try using the Convex Hull tool.
Run it by pressing Space> Search > Convex Hull:

Maybe worth mentioning the convex hull editmesh tool - its a good basis for shrink-wrap too.

Could you share your settings for the cloth simulation? I was going to ask a similar question to this one, how many subdivs? How do you make it look so good? How do objects not go through each other? Thanks!


text:
Can Blender Render on Systems without a GUI?
Is there any way to get blender to render on systems without a GUI?  Over the network on systems with a GUI?
I know of a service that will let you buy virtual servers that are charged by the hour, not the month, allowing to purchase extra performance on demand very cheaply!
The question itself is OS-agnostic, but in this case you can essentially respond in a any OS you would like.

Amazon web services? you can run blender headless, see the docs: http://www.blender.org/manual/render/workflows/command_line.html

Yes, this Blender supports this feature, which is frequently used on render-farms.
For reference, in Blender this is known as background mode.

I've had success rendering on a Linux cluster using SGE. Here, I render the first 1500 frames of an animation:
$ for n in `seq 1 1500`; do qbatch blender --background myblend.blend -x 1 -f $n; done

(note qbatch is just a script that submits a regular command line invocation to SGE for distribution to a compute node, so it's the stuff between "qbatch" and "done" that you're probably interested in)
Depending on the dynamics of your system, you may want to batch your renders differently, but you can adapt what I used.
Here is a page that describes some useful command line options: https://docs.blender.org/manual/en/dev/advanced/command_line/render.html

The command blender -b myBlenderFile.blend -a will render an animation of the file myBlenderFile.blend with the settings with which the file was saved.


text:
Python script to edit addon settings
I am trying to use python to script to change the settings of the Network Render addon. I am attempting to change the tags in the slave that way I don't have to change my blend every time. I am using a python script to enable CUDA but I can't figure out how to properly reference the settings for addons. Any help would be appreciated.
Here is my slave.bat
blender -P script.py -b slave.blend --addons netrender -a -noaudio -nojoystick

Here is the script.py
import bpy
bpy.context.user_preferences.system.compute_device_type = 'CUDA'

After digging deeper into the Api I found the render settings were in the 'type'. I edited the plugin to include a button that adds the tag in the settings panel and then enable the button with
bpy.types.NetRenderSettings.slave_pm = True

Hopefully that will help someone.

While this happens to work, its incorrect - You're editing the type so all instances will be True, but what you attempted the first time was the correct method.

What exactly did you edit? And what exactly did you mean the first time? The first time I wasn't even talking about the Netrender settings, just the cuda.
What would be the correct way to assign the bool then?


text:
How can I isolate one object in the viewport and still have all the lighting and models around it still affecting it?
I want to isolate one object in the viewport (I know I can do that with "/"), but I want the rest of the lighting and models to still affect it.
I mainly want to use this for texturing certain elements in a big scene. Is there a way to do this or is it a bit of a reach?

I could write a Python script that assigns a temporary material to all other objects, with Blend Mode set to Alpha Blend, and Alpha set to 0.0: https://i.imgur.com/zu36q8C.png as well as make those objects unselectable. It could also hide cameras. You would still see light objects as on the screenshot.

Well...That would be simply INCREDIBLE ! Also an alternative (not sure if easier/less taxing on system ? or not ? )
I wonder if instead of assigning a temp material maybe doing this : 1-Select object 2-Invert selection 3-Object properties 4-deselect camera in Ray visibility 5-Copy to selected. AND then doing the reverse to bring them back to normal again

I'm not sure what are the upsides of disabling Ray Visibility -> Camera, but the downside is it only works in Cycles...

@markusvonbroady oopps You’re actually right hah totally forgot!

Python script
As promised. After running the script, press Alt + Numpad / to hide/unhide. Everything except the active object, lights and meshes is hidden. Meshes other than the active object have their materials replaced with a temporary material using Alpha Blend and Alpha=0. If there's no material slot, it is created. All data is saved to a textblock, so you can hide other objects, save the file, return to it later, and unhide the objects. However, messing with material slots of "hidden" meshes, or renaming them, will hurt you.

import bpy, json

shortcut_key = "NUMPAD_SLASH"
shortcut_modifiers = {"alt": True}
save_name = "hidden"

C = bpy.context
D = bpy.data
addon_keymaps = []  # store keymaps here to access after registration

class CUSTOM_LOCAL_OT_With_Light(bpy.types.Operator):
    """Make other objects invisible, but still affect light paths
    https://blender.stackexchange.com/q/226679/60486 """
    bl_idname = "custom_local.with_light"
    bl_label = "Local view with light still affected by hidden objects"

    def make_invisible_material(self):
        name = "Temp.Invisible.Material"
        m = D.materials.get(name)
        if not m:
            m = D.materials.new(name)
            m.use_nodes = True
            m.blend_method = 'BLEND'
            m.node_tree.nodes['Principled BSDF'].inputs['Alpha'].default_value = 0.0
        return m

    def hide(self):
        engine = bpy.context.scene.render.engine
        invisible_mat = self.make_invisible_material()
        objs = []
        mats_with_fake_user = set()

        to_hide = (o for o in C.scene.objects
                   if o.type != 'LIGHT' and not o.hide_get() and o is not C.active_object)
        for o in to_hide:
            entry = {"name": o.name}
            objs.append(entry)
            if o.type != 'MESH':
                o.hide_set(True)
                continue
            if o.hide_select:
                entry["was_unselectable"] = True
            else:
                o.hide_select = True
            if engine == 'CYCLES':
                if o.cycles_visibility.camera:
                    entry["camera_ray"] = True
                    o.cycles_visibility.camera = False
                continue
            entry["materials"] = []
            if not o.material_slots:  # no slot
                entry["slot_added"] = True
                bpy.ops.object.material_slot_add({'object': o})
                o.material_slots[0].material = invisible_mat
                continue
            for slot in o.material_slots:
                mat = slot.material
                slot.material = invisible_mat
                if not mat:  # empty slot
                    entry["materials"].append("")
                    continue
                if mat.use_fake_user:
                    mats_with_fake_user.add(mat.name)
                mat.use_fake_user = True
                entry["materials"].append(mat.name)
        return {"materials_with_fake_user": list(mats_with_fake_user), "objects": objs}

    def unhide(self, data):
        for entry in data["objects"]:
            o = D.objects[entry["name"]]
            o.hide_set(False)  # hidden objects were ignored, so all objects saved
                               # are objects hidden by this script
            if "was_unselectable" not in entry:
                o.hide_select = False
            if "camera_ray" in entry:
                o.cycles_visibility.camera = True
            mats = entry.get("materials")
            if mats is None:
                continue
            if "slot_added" in entry:  # remove the added slot
                bpy.ops.object.material_slot_remove({'object': o})
            for i, name in enumerate(entry["materials"]):
                mat = D.materials[name] if name else None
                o.material_slots[i].material = mat
                if mat and mat not in data["materials_with_fake_user"]:
                    mat.use_fake_user = False

    def execute(self, context):
        txt = D.texts.get(save_name)
        if txt:
            self.unhide(json.loads(txt.as_string()))
            D.texts.remove(txt)
        else:
            txt = D.texts.new(save_name)
            txt.from_string(json.dumps(self.hide()))
        return {"FINISHED"}

def register():
    bpy.utils.register_class(CUSTOM_LOCAL_OT_With_Light)
    # handle the keymap
    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name='3D View Generic', space_type='VIEW_3D')
    kmi = km.keymap_items.new(CUSTOM_LOCAL_OT_With_Light.bl_idname, shortcut_key, 'PRESS', **shortcut_modifiers)
    addon_keymaps.append(km)

def unregister():
    bpy.utils.unregister_class(CUSTOM_LOCAL_OT_With_Light)
    # handle the keymap
    wm = bpy.context.window_manager
    for km in addon_keymaps:
        wm.keyconfigs.addon.keymaps.remove(km)
    # clear the list
    del addon_keymaps[:]

if __name__ == "__main__":
    register()

Thanks a lot ! This is Incredible !!! PS:It only works in EEVEE though, is something like this possible with cycles too or not really ? Thank you again!!

@kay777 oh, so you were right with camera visibility after all. I updated the script, though I were unable to make the floor behind hidden meshes visible in Cycles :(.

Create a new Collection.
With an object selected, press M -it moves the specific object into the collection.

Use the Isolate icon to turn OFF/ON the main Collection.

Notes:

Shift clicking on the Isolate icon will set all nested collections
I moved lights into a solo collection just to make it organised, but you can keep it in a main collection. Lights are not affected.
Cycles only (so it is useless for texturing)