text:
projecting onto a mirror and back?
Here's an illustration of what needs to be done:

A texture has to be projected from a point in space to a mirror (1 in the image) which will bounce the projection to a surface (2).
Here is the texture that is going to be projected although a real video file is going to be used.

The tricky thing is the mirror (the surface marked as 1 in the illustration) is not flat but curved as illustrated below:

The point is to see how the projected image or video will appear on the final surface (2) given a projection angle (fov) and a curved bounce mirror.
This is for a video for a project where I need to illustrate how a curved mirror deforms a projection from a video projector, laser projector and such and in the animation the shape of the mirror gradually changes (via shapekeys) which in turn changes the size and deformation of the projected image/video.
If Blender can do this somewhat accurately I can use it for simulations as well which is a plus because of the superior render quality compared to specialized CAD programs.
Also if this is possible with Blender and we have an answer then it makes Blender a powerful tool for people working with video projectors.

See my answer here for the projection part https://blender.stackexchange.com/questions/57013/correct-vector-input-to-map-texture-light-in-cycles Not sure how you can achieve the reflections though, Cycles is not very good at caustics. Also curious to see if anybody can come up with a solution

I don't mind using a different renderer. Feel free to post an answer with using on.e

Might be able to hack a solution using OSL on the surface (2) to trace paths towards the mirror and reflect them to the projector, summing over all valid paths. I don’t know how efficient (or not) it will be as it would need to trace many hundreds of rays off each surface point to resolve the whole projection but it should be quicker than relying on caustics.

I know nothing about OSL but if you're thinking of render times, then its not an issue, go ahead and post an answer with that method if you like.

Is the source ligth just a spot? Not a area light or multiple point illumination?
If yes, there's a way!

I'll elaborate this answer later, but here's a solution I found while needing caustics, it's for refractions, but it works as well with reflections as soon you change the 'caustic' object material to glossy. https://blenderartists.org/forum/showthread.php?386776-Caustics-in-Cycles&p=2972818&viewfull=1#post2972818

Light travels in straight lines. In addition, the angle of reflectance equals the angle of incidence. So your original illustration cannot be reproduced in the real world.

As has been said, Cycles isn't capable of this.  Luxrender, however, is.  You can read about it on this forum and elsewhere.  However, I'll say here that it integrates into Blender (previewing is even possible with the experimental API enabled as demonstrated below), and it handles refractive and reflective caustics very well.  It is a bit slower but the versatility is worth it for much more accurate physics than Cycles.
I have reproduced your scene by creating a Projector Spot Lamp (using your image) and a Mirror material on the reflector.  The reflector mesh has Subsurf and has Smooth Shading enabled.  The "screen" has the default Matte material:

Here I am morphing the plane from flat, to convex, to concave:

You must install Luxrender before opening the .blend:

For anyone curious the error with the bove blend is caused by the texture file path not having been set to relative. Fix it and it works (provided you downloaded the texture image file).

I assume it must be unpacked because of Luxrenderer?

All answers are pretty clever and good, but yous to me is the most straightforward in my opinion so Im going to give you the bounty. But before I do. if there is a way could add in your answer how to add vertical lens shift to the virtual 'projector'. it might also be possible be adding black border on the top and bottom of the image and switching to UV mode but there's probably a simpler way. Lens shift in video vprojectors allows the projection to not shoot straight to the middle but say from ceiling to a blackboard but still keep both the top and bottom of the projection in focus.

I think we misunderstood each other. Im talking about emulating "lens shift" found in real world video projectors. Lens shift is when the projection doesn't come out of the final lens and shoot straight to the middle but at an angle. Thats useful when the projector is not installed straight in the middle (vertically) to the projection screen but above or below it. In fact most home use video projectors shoot the projection at an angle vertically for this reason, some expensiver ones allow to adjust the lens responsible for the lens shift. Can we emulate this? https://i.imgur.com/nlRI4kZ.png

Some video projectors dont allow to adjust the lens shift and have a feature called "keystone correction" which just crops and deofrms the projecton so it will look proportionally correct. This cropping obviously causes loss of resolution and is a digital edit to the video rather than an optical effect like the "lens shift" is.

I was just explaining how lens shift works in real life, nothing to do with Blender and your solution. I just want to know if we can simulate lens shift in Blender. Basically this: https://i.imgur.com/nlRI4kZ.png     In the above illustration both projectors project the same thing on the same screen, one just projects it a bit lower in space. On the other hand, if you just rotated the below projector instead of lowering the lens shift the projection on the screen would look distorted. That's why we have lens shift feature on some video projectors. Does this makes sense?

Already accepted the answer but not sure the len shift looks right. The projection/texture doesnt seem the same just moving up or down but rather the visible portion of the texture going from top side to bottom side.

@bertmoog very nice solution, incredibly versatile. To put the cherry on the cake, you could take the distorted grid, "counter-distort" your footage based on the grid and later project (in real life) onto a sphere and see it undistort itself on the wall.

@yann - Ha!  That would be something to see :)

Particle Simulation
You could use a particle simulation, to simulate the light rays. In this setup, the particles get emitted from the faces of the hemisphere, with initial velocity (along the face normals). The particles duplicate a simple icoshpere. On the left wall, set up a DynamicPaint canvas, the icospheres serve as Brushes. Bake your simulation and bake the DynamicPaint sequence.

The Camera
The cameras folcal lenght serves as a reference for the "Ray casting". A boolean cuts out the other parts of the emitter. The spheres collide with the curved wall and create a different hit pattern.
Rendering
Use a long shutter (I used 48) to make the rays visible. Change the Motion Blur to a more pleasing curve (I used a very soft falloff).
Sorry for the low amount of samples, it just renders too slow for fast testing.

Very interesting way to do this, but it doesn't seem like it would work with a video texture.

Ignoring the original purpose of this, it just looks really cool. Love the glowing particles.

A script could be written to render this for each frame of a video file I guess. Still pretty clever to use particles for simulating light beam paths.

I could watch the slow-mo all day.  Thinking outside the box, very nice

Ingenious use of particles - very nice solution!

Scripting a reverse UV projection.
From the camera bounds shoot (raycast) an n x m resolution (simple grid uv) of rays onto the mirror object.
Estimate the normal from the hit face and the reflect vector is ray.reflect(normal).  Project that vector onto the plane.

Debug result of shooting 16 x 9 UV onto sphere as mirror.  The black arrows (empties) represent the reflection vector.  The faces used to calculate the normal are selected.  Notice the pole of the UVSphere is projected onto.

The resultant mesh and UV.  Missing faces where a reflected ray misses plane.  The pole effects the mesh on RHS.

Result of reflecting onto middle of sphere. All reflections captured UV resolution 160 x 90
Instructions
Grab the full script from below and edit to suit. Default uses a mirror object named Grid, reflects a (160, 90) UV map onto a plane with global location (0, -10, 0) facing (0, 1, 0)
debug = True
# projecting from scene.camera, change for different cam
mirror_obj_name = "Grid"
# reflection plane global cordinates
plane_co = Vector((0, -10, 0))
plane_no = Vector((0, 1, 0))
# stripes  The uv resolution to project from cam
XRES, YRES = (160, 90)
if debug:
    # adds an empty at hit point pointing in reflect
    XRES, YRES = (16, 9)

Make sure you are not in edit mode and run script.  A new mesh object named "reflection"  with result will be created.  With debug = True a set of empties representing location and reflect angle will be placed on mirror.
Some notes:
Make the mirror object as high resolution as possible and make sure it has vertex normals. The raycast hit normal is calculated using barycentric to map the normal of the raycast hit, from a triangle of the normals of face centre and the edge in the tessellation triangle hit.
Code:
import bpy
import bmesh
from mathutils import Vector, Matrix
from mathutils.geometry import intersect_line_plane, barycentric_transform
from math import degrees, pi, radians

debug = True
# projecting from scene.camera, change for different cam
mirror_obj_name = "Grid"
# reflection plane global cordinates
plane_co = Vector((0, -10, 0))
plane_no = Vector((0, 1, 0))
# stripes  The uv resolution to project from cam
XRES, YRES = (160, 90)
if debug:
    # adds an empty at hit point pointing in reflect
    XRES, YRES = (16, 9)

def draw_empty_arrow(scene, name, loc, r_global, draw_size=1):
    R = r_global.to_track_quat('Z', 'X').to_matrix().to_4x4()
    mt = bpy.data.objects.new(name, None)
    R.translation = loc
    #mt.show_name = True
    mt.matrix_world = R
    mt.empty_draw_type = 'SINGLE_ARROW'
    mt.empty_draw_size = draw_size
    scene.objects.link(mt)

def calc_normal(mesh, face_index, point):
    face = mesh.polygons[face_index]
    # debug TODO take out
    if debug:
        face.select = True
    o = face.center
    p = point - o
    # find the edge

    for ek in face.edge_keys:
        v0, v1 = (mesh.vertices[i] for i in ek)
        if (v0.co - o).angle(p) <= (v0.co - o).angle(v1.co - o):
            break

    return barycentric_transform(point, o, v0.co, v1.co,
                                face.normal, v0.normal, v1.normal)

def obj_raycast(obj, ray_origin, ray_target, matrix=None):
    # returns global coords
    if matrix is None:
        matrix = obj.matrix_world

    # get the ray relative to the object
    matrix_inv = matrix.inverted()
    ray_origin_obj = matrix_inv * ray_origin
    ray_target_obj = matrix_inv * ray_target
    ray_direction_obj = ray_target_obj - ray_origin_obj

    # cast the ray
    success, location, normal, face_index = obj.ray_cast(ray_origin_obj, ray_direction_obj)

    if success:
        n = calc_normal(obj.data, face_index, location)
        return matrix * location, (matrix * (location + n) - matrix * location).normalized(), face_index
    else:
        return None, None, None

context = bpy.context
scene = context.scene
render = scene.render
camera = scene.camera
# rays in global space
ray_origin = camera.location
cmw = camera.matrix_world
ar = render.resolution_y / render.resolution_x
s = Matrix.Scale(ar, 4, (0.0,1.0,0.0))
# find link to this pink, vertex code.
# get the camera frame
tr, br, bl, tl = (cmw * s * p for p in camera.data.view_frame())
# x direction stripe
origin = bl
x = br - bl
dx =  x.normalized()
# y direction stripes
y = tl - bl
dy = y.normalized()

obj = scene.objects.get(mirror_obj_name) # context.obj?
matrix = obj.matrix_world
mwi = matrix.inverted()

# reflection plane
plane_co = Vector((0, -10, 0))
plane_no = Vector((0, 1, 0))
strips = []
bm = bmesh.new()
uvs = {} # uv vert lookup
#make a mesh
me = bpy.data.meshes.new("reflection")

uv_layer = bm.loops.layers.uv.verify()
bm.faces.layers.tex.verify()

for s in range(YRES  + 1):
    py = bl + s * y.length / float(YRES) * dy
    strip = []
    for b in range(XRES  + 1):
        p = py + b * x.length / float(XRES) * dx
        ray_target = p
        hit, n, f = obj_raycast(obj, ray_origin, ray_target)

        if hit is not None:
            # check face normal vs returned normal
            face_normal = obj.data.polygons[f].normal

            v = (hit - ray_origin).normalized() # incoming vector in global space
            reflect =  v.reflect(n) # reflect vector
            v = ray_target - ray_origin
            r_global = reflect
            if debug:
                draw_empty_arrow(scene, "UV_%d_%d" % (b, s), hit, r_global)
            g = intersect_line_plane(hit,
                     hit + reflect,
                     plane_co, plane_no, False)
            if reflect.angle(-plane_no) < radians(90):
                vert = bm.verts.new(g)
                strip.append(vert)
                uvs[vert] = (b / XRES, s / YRES)
            else:
                strip.append(None) # miss reflect
        else:
            strip.append(None) # miss on hit
    strips.append(strip)

# skin it
bm.verts.ensure_lookup_table()
for j in range(len(strips) - 1):
    s0 = strips[j]
    s1 = strips[j+1]
    for i in range(len(s0) - 1):
        verts = [s1[i+1], s0[i+1], s0[i], s1[i]]
        if None in verts:
            continue
        f = bm.faces.new(verts)
        # add uv
        for l in f.loops:
            luv = l[uv_layer]
            luv.uv = uvs[l.vert]

bm.to_mesh(me)

obj = bpy.data.objects.new("reflection", me)
#obj.matrix_world = matrix
scene.objects.link(obj)
if debug:
    bpy.ops.object.select_by_type(type='EMPTY')

Pretty cool but the result doesn't seem right ( some faces on the edges seem to be missing)

If the reflection vector is 90 degrees or more from the plane normal it wont be reflected back onto the plane, same as if the mirror doesn't fill the view... rays will miss.  Would need to reflect onto a cylinder, or better still a sphere, to reflect all faces.

@LeoErvin added image of reflection off sphere where all reflected rays are caught. (No missing faces)

OK, perfect. Any way to simulate vertical lens shift found in video projector lenses?

@LeoErvin The rays are projected from the camera.  Adjiust the vertical shift on lens panel of camera data.

Cycles is capable of this by using an OSL shader. The trick is to use the 'trace' function to trace multiple rays from the surface receiving the projection to the reflective surface and calculating the reflected ray using the surface normal at that point. Most of the rays will not find their way back to the projection source but some will. The shader sums the results of all those rays that reflect back to the projector source (or, at least, close enough).

Obviously the more rays that are traced from the 'screen' out to the 'reflector', the more chance of hitting one which will make it back to the projection source - but also the more work will be involved in the render. Two factors control this - the 'resolution' and the 'threshold'. The 'resolution' forms a grid of points sent out from each point on the screen to the reflector - ie, resolution x resolution rays (doubling the resolution will result in 4 times as many rays). The 'threshold' is a measure of how close to the projection source the reflected ray is before it is considered as a 'hit', so smaller values for threshold will reduce the chance of any one ray from 'hitting' the projector but will give a higher quality result.
Here's my setup :

I've used displacement to create a rippled reflector :

The OSL code - use the Text Editor, create a new block and paste this :
shader reflect_texture(
    vector Point = P,
    vector ReflectorTarget = P,
    vector ProjectorOrigin = P,
    string FileName = "",
    int Resolution = 10,
    float Threshold = 0.999,
    float ImageScale = 1.0,
    output color Color = color(0.5,0.5,0.5)
    ) {

    color Accumulation = color(0,0,0);
    int AccumulationCount = 0;
    float Distance = 0.0;
    vector Normal = vector(0,0,0);
    float Hit = 0.0;

    vector Target_to_Projector = ProjectorOrigin - ReflectorTarget;
    vector imageHorizVector = normalize(cross(Target_to_Projector, vector(0,0,1)));
    vector imageVertVector = normalize(cross(imageHorizVector, Target_to_Projector));

    float Step = 2.0 / Resolution;
    vector randomvect = noise("cell", Point*5000);
    float randoffsetx = randomvect[0]*Step;
    float randoffsetz = randomvect[2]*Step;

    for (float x = -1.0; x <= 1.0 ; x+= Step)
    {
        for (float z = -1.0; z <= 1.0 ; z+= Step)
        {
            vector ReflectorPoint = vector(ReflectorTarget[0]+x+randoffsetx, ReflectorTarget[1], ReflectorTarget[2]+z+randoffsetz);
            vector point_to_reflector = ReflectorPoint - Point;

            // trace the ray to find the normal at the point it hits
            if(trace(Point,normalize(point_to_reflector)))
            {
                getmessage("trace", "hitdist", Distance);
                getmessage("trace", "N", Normal);
                //getmessage("trace", "hit", Hit);
            }
            else
            {
                continue;
            }

            // reflect it
            vector reflected_ray = reflect(point_to_reflector, Normal);

            vector reflector_to_projectororigin = ProjectorOrigin - ReflectorPoint;

            vector separationVect = (normalize(reflector_to_projectororigin) - normalize(reflected_ray));
            float separationDist = sqrt(dot(separationVect, separationVect));

            if (separationDist < (Threshold*3))
            {
                //...it's a hit...
                float x_offset = (dot(imageHorizVector, normalize(reflected_ray)) / ImageScale ) + 0.5;
                float y_offset = (dot(imageVertVector, normalize(reflected_ray)) / ImageScale ) + 0.5;
                if ((x_offset >=0.0 ) && (x_offset <= 1.0) && (y_offset >= 0.0) && (y_offset <= 1.0))
                {
                    Accumulation += texture(FileName, x_offset, y_offset)/pow(2,separationDist/Threshold);
                    AccumulationCount++;
                }
            }
        }
    }
    Color = Accumulation/(Threshold*Threshold)/Resolution/Resolution/100;
}

Here's the material :

Set the Script node to the script and click the refresh button to ensure it's compiled. Note that for OSL you'll need to use a version of Blender compiled with OSL support and have enabled Open Shader Language in the Render properties. I've driven the input coordinates in the Combine XYZ nodes from the locations of empties within the scene to allow them to be easily manipulated. Note also that the FileName indicates the absolute path to your source image unless prefixed with ‘//‘ to indicate a path relative to your saved .blend (note that it cannot be a packed or ‘internal’ image).
Here's my source image :

And here's the result :

Blend file attached
EDIT : Here's another rendered result to show the effect of reducing the Threshold for a sharper result. Here I decreased the Threshold to 0.001 and increased the Resolution to 200. I also added a Subsurface modifier to the reflector mesh (set to a factor of 3) and reduced the size of the ripples on the reflector so that the distortion was not so pronounced.

This is now sharp enough to make out the text at the bottom of the image (although it's obviously distorted by the reflection and is mirrored left to right). This obviously took much longer to render. Quality could be further improved by increasing the number of render samples and/or decreasing the Threashold parameter further (but requiring longer render times)

Great answer.  What's the reason behind the random offset?

Thanks. The random offset is to ensure a spread of points over the reflector - otherwise it will just hit the same fixed grid points each time.


text:
Blender for CNC, what to export to?
Blender has 3d printing tools as well as STL exporter. That is good for both hobby 3d printers which all use programs which use STL (eg. Repetier-Host) as an interchangeable format as well as professional 3d printers such as the ones by Solidscape, the users of which mostly use the Rhinoceros (Rhino) program which imports STL files exported by Blender just fine. This is also true for 4 axis CNCs.
However, getting something from Blender to be (2D) CNC milled/laser cut doesn't seem as easy.
From personal experience from using services of both, common programs such services use for CNC milling and laser cutting is AutoCAD and CorelDraw. They ask formats which these programs can open. Blender can export to DXF, STL and many other formats. For some reason with the formats these programs ask, either Blender exports incomplete data or  wrong/different data, because both these programs import them as wires, no surface data is preserved.
I've had this issue both with CorelDraw and AutoCAD, with different services, and both had to take my model file and modify them in their own programs by creating surfaces  from those lines, a time consuming process. I have to pay extra to get the model "cleaned up" and in worst case the CNC milling/laser cutting service provider will refuse to do that and tell me to send them proper drawings, and rightfully so.
And this is not a limitation of these programs, a DXF exported by another program (for example Pepakura Designer) imports fine.
So I hope we can find a solution here, I believe an answer would benefit many people who might be forced to use another program to design their milled/cut parts right now like I do.
Example Blender model (.blend is attached):
http://www.pasteall.org/blend/42404

Now, let's look at what formats these programs can import and how they import them.
1) AutoCAD (version 2013 and 2015 tested)
From the formats Blender exports it only imports DXF. Blender can export DXF, however when it is imported only lines are imported, no polygon (surface) data.

2) CorelDraw (version X5 tested)
From the formats Blender exports it also only imports DXF.
Same issue as with AutoCAD:

3) Rhinoceros (version 4.0 tested)
Being a 3D program, imports OBJ, STL, DXF, X, etc. Imports even the DXF exported from Blender just fine. Sadly, most CNC service providers I've come across don't use Rhino, mostly jewelers do.

I have not been able to test other programs yet such as Solidworks.
You can say since there is at least one program which imports the data, then it is not a Blender issue and shouldn't be asked. I disagree for the following reasons:
1) As I've mentioned, AutoCad as well as CorelDraw import polygonal data from other programs such as Pepakura Designer just fine. This is enough proof that Blender is at least partially to blame, or at least it can export the data differently like Pepakura does so these programs will import it correctly.
2) I believe it is important to make Blender a practical tool for designers CNC milling or laser cutting their designs. Regardless which tool is to blame, it is best for Blender to offer Blender users some way/workaround/pipeline of getting their designs as a usable file.
How can we go around finding a solution here?
Since both these popular programs (Corel, AutoCAD) only import DXF, I see the only solutions being:
1) Finding a way to export DXF data so they will import it properly.
2) Finding a 3rd party tool (free or open source preferred) that will convert an intermediate file format exported from Blender to DXF which these programs will import properly.
For the record, when selecting different options in the Blender DXF exporter ("POLYLINE", "POLYFACE", "3DFACE"), nothing changes when importing in these tools.
Also for the record, if you wonder why use a 3D editor like Blender for cutting in 2D CNC, the answer is simple: 2D CNC is not just used for 2D cutouts, or more accurately the 2D cutouts might be 2D pieces that assemble together to make a 3D object like a computer case.
Here's the actual model this 2D cutout was taken from:

It had to be made in 3D to make measurements and make sure everything is in correct position and fits with the rest of the project pieces.

While it may not provide the export formats you are looking for I expect you will be interested in the Blender CAM project. If the g-codes it makes are not helpful, it is still a place of contact for other blender users that use blender for CAD/CAM. Also if the DXF exporter does not export correctly you should report it as a bug and help testing, so that it can be improved.

These services don't take g-code from the customer. And I don't know whether Blender's DXF exporter is buggy and what it is doing wrong, I'm asking.

You appear to have access to the other apps that export correctly. Make a simple test object in each and compare the exported file.

Compare the exported files? I'm not a programmer, I can't just check contents of a file with a DXF format reference on hand and figure something out. Nor can I debug Blender every time there is some issue, most users can't, you seem to think otherwise with your suggestions.

As far I know, Blender DXF exporter is capable of passing 3D faces (https://i.sstatic.net/Vwhbc.png) (did you notice your shot was taken in Autocad Wireframe view?). I'm not an expert of CNC, if those exported DXF don't work even if they are correctly imported in AutoCAD, I would suggest to add more information about the milled/laser cut file format necessities.

What mode do you use when exporting DXF in Blender and what do you use to exit wireframe mode in AutoCAD? Could be lack of understanding of their own program by the millers. Because they want filled parts (not wires), but you say it is shown as wires simply because it is in wireframe mode.

"3DFACEs"; once clicked, the text "2D Wireframe" in the viewport's top left corner shows a drop down menù where you can change the view style; test version: Autocad 2015.

Wow, you are absolutely right: http://i.imgur.com/eWfOSPr.png . It seems both CNC companies I've dealt with simply don't know about this because they have not dealt with DXF files storing polygon data rather than curve surfaces. Is there a quick way to convert these into filled lines? Blender has a command to convert ngons to curves, but they are not filled, I imagine AutoCAD has to have something similar. I'll let the CNC operator know about it. Thanks.

Most CNC Controllers (on the commercial end anyway) implement the ability to use a DXF file. That being said, they are implemented in their own way, and not usually per any standard other than what is in their own documentation. In other words, DXF is just a geometry interchange format. There is no standard inherently within it that will enforce a standard for the milling process.

You should find this article interesting.

@sambler I was just gonna post that! ;-)

Sorry, I just don't see how any of the answers is an answer. Alternative program to Blender is not an answer. Opinion that Blender shouldn't be used for this is not an answer.

I've only had some tangential contact with the area I am not much into CNC milling myself but I think your problem comes mainly from the fact that, to the extent of my knowledge, 2D (as you mentioned) CNC milling requires bidimensional contour information of your object, that means a a 2D representation instead of the 3D object itself.
That would mean representing elevations, plans or sections of said object for export, and that is probably why they mostly use Corel (and AutoCAD to a lesser extent) as their main software.
They are illustration-type 2D layout or CAD programs because they require 2D polyline, spline or bezier curve based information to generate a path the machine drills can fallow.
Now Blender being primarily a mesh based subdivision modeling tool is particularly unsuited for this type of work. Not only is blender bad at producing 2D representations of it's objects; mesh based 3D models are particularly unsuited for extracting that type of information from them to begin with.
Mesh models being made entirely of triangles can only export polygonized straight-segment-based representations of it's geometry, not smooth curves. That is generally the role of CAD based 3D modeling software which generally used ACIS solid Modeling or NURBS based geometry engines to create it's shapes.
Possible Solution
If you plan on making primarily "extrusion based" geometry like like plates or or cut sheet based geometry, like the one in your image, maybe you can start using a bezier-curve based modeling technique instead, more suited and simpler for this type of geometry.
This will also have the added benefit of producing clean curve based geometry and you wont have to worry about triangulation or filling the caps.
You can then use some of the solutions in this answer to export it as SVG based curve. I believe Corel will be able to correctly import SVG vector drawings and produce real contours from it.
As sad as this may seem, it unfortunately still feels like a hacky workaround with inadequate tools.
Alternatives
As a side note I believe a NURBS or Solid modeling based software would be a lot better suited for this type of work, like FreeCAD or OpenCAD or if you don't mind commercial applications MoI is a really good alternative and a relatively cheap one considering the high price of the other available tools out there.

I have to respectfully disagree that Blender is not meant for this kind of work. Few reasons: 1) 2D CNC machines can make 3D objects that are made up of 2D cutouts. Even the above sample is a 2D cutout from one sheet of a 3D case for a professional equipment, designed in 3d in Blender. I obviously want to see how it looks in 3D so using Blender rather than a 2d tool makes more sense. 2) It might be true that NURBS based modellers are easier to use for this, but that does not mean polygonal modellers aren't suited. As mentioned, 4 axis CNCs and 3d printers use STL files which use polygons.

Continued: the suggestion to use curves in Blender isn't practical because 1) curves lack many operations and modifiers you can perform on meshes and 2) my models are already made of polygons and it took me hours to model each.  As for the other tools you suggest to use, well I think suggesting another tool to use for the actual modelling besides Blender is not really an answer for blender.stackexchange.

@LeoErvin I stand behind this answer. +1 from me. Blender is not for CAD work - I don't know how many times I have to tell people, it only brings trouble. Yes, you can stubbornly try to make CAD work inside Blender, it is the same like trying to cut a steak with a spoon - wrong tool. The correct tool to use is FreeCad and alike. If you need you can always export into Blender for rendering if you need.. If you pay someone he/she could make you a working exporter, but as it is now it is no use.

@Jerryno Completely useless comment. You make statements, not arguments. You stand behind arguments I've addressed. Either make your own arguments, or respond to my responses to the arguments you support. Or don't post, nobody cares about mere opinions and statements. On top of that, good job decreasing the Blender user base with your baseless opinion you "don't know how many times you have to tell people". And were you the one who made an answer and deleted it?

@LeoErvin No, did not make answer and deleted it. There is no need for arguments, because the problem is obvious - there is no convenient way of exporting CAD files for manufacture - you already know it. Because of this I state Blender as of now is the wrong tool for CAD work. There are other reasons (mostly that the dimensions are not procedural and dependent on each other like in CAD software, so if you change 1 part you may need to change all of them), but the exporting problem alone should be a reason to use a proper tool.

@LeoErvin To prove my opinion is based on logic, read this answer: http://blender.stackexchange.com/questions/53293/is-blender-actually-useable-for-engineering/53299. There are several statements, easily verifiable, each standing as an argument why Blender is the wrong tool. I bet you don't use CAD software much, because if you did, you would see the night and day difference and we wouldn't had this conversation.

@LeoErvin And also no, I am not decreasing the Blender CAD user base. Blender itself is decreasing the user base by having no suitable tools for CAD tasks. If Blender had those tools and I was lying, not speaking the truth, then yes - I would be falsely decreasing the Blender CAD user base by negative propaganda.

@Jerryno Still completely useless comment. 1) "the problem is obvious" - obvious for you, you still have to make an argument, just because it seems obvious for you doesn't mean you can make baseless claims. This is just logic, I don't know why I even have to explain this to you. 2) Just because Blender doesn't appear to properly export to DXF at the moment does not mean it is the wrong tool to use. If this was the mentality everyone had Blender would never improve, people would just switch to Maya or C4D. And it has nothing to do with Blender not being a primarily NURMBS based editor.

"dimensions are not procedural", "polygons rather than NURBS", etc, etc. look I already addressed this (as I told you, read my above comments) just because you feel Blender is harder to use does not mean it is the wrong tool for this task for everyone, on top of that, it is simply wrong logically to turns this claim into Blender not being able to do it, which is the whole question. I asked how to do it in Blender, I didn't ask whether it's easy compared to some other tools out there. I don't care, so get over this already, will ya?

No, you don't have to lie to alienate people who want to make some models which parts have to be laser cut or CNC milled from using Blender. You're spreading an idea that Blender can't do it and at the same time you spread the idea that it can't do it easily. Look, Ive made this in Blender at it's been cut from aluminum http://i.imgur.com/COiiC57.png, http://i.imgur.com/2a4TfnQ.png

I've made freakin this in Blender and laser cut and glued: http://blender.stackexchange.com/questions/46113/how-to-make-all-quads-or-ngons-on-your-mesh-planar-2d , http://i.imgur.com/gEFMU7D.png , http://i.imgur.com/leSR29a.png Both weren't hard or time consuming to model via polygons for me. I don't need you telling me whether I should be using  fork or a spoon, I asked a specific question, stick to it or go "help" someone else.

Let us continue this discussion in chat.

There is a Blender add on that I am currently developing.

G code visualizer
G code convert/import/export
G code sender
CNC control
CNC configurator

... can perform similar operations.
It works more efficiently with curves for now. Development work continues for 3D objects.
You can access the add on from this link:

https://github.com/manahter/nCNC

Simply Engrave Text in 5 minutes video:

https://www.youtube.com/watch?v=CYr4NhJMGCA

Mini tutorials:

https://bit.ly/nCNC-Tutorial-Videos

nCNC Add on wiki:

https://github.com/manahter/nCNC/wiki

If you look at the specification for G-Code, then you will most likely be able to accomplish most of your work with very minimal commands eg. "G90" & "G1".
Your main problem is that most milling centers will not assume that your code is correct, and for good reason should not. One of the biggest reasons for this that you must realize is, parts on a mill anyway have points that the base material must be fixed by mechanical methods to keep it down on the milling table, and to assume that your code is remotely trustworthy would also need to require that your code would avoid running their tooling into these mechanical fixturing devices.
There are many factors why milling centers can not just trust code, but the above is the main one.
You may be able to provide your fixturing within your model to show where this will happen, and some sort of "post" (visual preview of the tool path) to provide the confidence to the machining center that you have taken the appropriate precautions.
There are also other "M" Codes that would be best for the Machining Center to apply on your behalf, as they could be unique to both the machine and the tooling being used (eg. Whether your End Mill should be turning Clock-Wise, or Counter-Clock-Wise). There are also safe RPM limits to run any particular end mill, so the machining center will no doubt want to control this as well.
You will no doubt need to make clear what "you" are considering your "Z-Zero" location. It is fully acceptable for this to be commonly the top of a spoil board material, or at the top of the blank material. This could be worked out with the preferred method of your machining center.
There are also different methods to set where a home position can be (0,0,0), and different G-Codes to deal with that as well that should also be applied by your machining center.
One other main consideration is the tooling.
Milling is primarily done on the center-line of your end-mill.
This means that you will have to accommodate for its radius from center.
If you are using a flat mill, this will probably be the easiest (but there are many shapes of tools - So you must know them, and how to accommodate for them).
Beyond this. G-Code itself is pretty simple.

G90 (<-- Set the positioning mode to Absolute)
(<-- Your Coordinate offsets should be set by the milling center here
  -->)
(Assuming your "Z-Zero" point is at the bottom of your blank material)
G1 0,0,10 F100 (<-- Puts the machine to X:0 Y:0 Z:10)
M3 S24000 (Usually starts the machine to Spin Counter-Clock-Wise @
  24,000 RPM)
G1 5,5,0 F100 G1
10,5,0 F200 G1 10,5,10 F200 M5 (Stops the spindle)

The above code just cut a 5 unit wide slot in your material at full depth.
You could write that pretty easy by querying position (vertex locations) in Blender. But you have to know what your milling center will accept.

G-Code is out of the question, for the reasons you mentioned. Only options seems to be DXF, or whatever other format you'll suggest. So er, thanks for the clarifications, but this is not really an answer now, is it?

It is an answer if you were able to do the coordination, if that sounds like too much effort on your part, then I think your next best step would be to recreate from "Blender">>"Python" a .lsp (LISP file) file that would re-build your geometry in AutoCAD. The API is pretty available and hasn't changed enough over the last decade to be concerned with it not working.

@LeoErvin, I seem to remember having to send something out of house for a particular project before my company incorporated CNC milling in-house. They allowed for me to export from Blender using the .STL file format. I did some looking and I believe that Delcam uses an ArtCAM package that pretty much autoDetects the 3D part, and bases it tool paths from there with whatever sorcery like algorithms they use. Anyway, It might be worth while getting in touch with them to see if there are any customers of theirs that you could reach out to to get your blends milled - Hope it helps.

@LeoErvin, Art CAM's Website. It seems that they can take both STL & OBJ so right out of the gate you have some Blender options. It also takes some Image options, so for parts that are basically 2D such as your examples, I believe that your machining center can just specify the thickness of material to make certain they get all the way through it in terms of depth, but would allow you to render an orthographic 2D image file.

How is it an answer if like I said G-Code is not an option. What coordination? And as I have said I'm not a programmer to write a FreeCAD exporter or rewrite the DXF exporter either.

There is a gcode plugin for Blender to work with HAASBOT alike CNC machines
There's also grashopper but not sure if that would fit your needs.

source: Stack Exchange

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

authors: Евгений Синг

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

sort: votes


text:
equirectangular rendering for Blender Internal?
Can such frames/videos be rendered in Blender Internal as well?
If not, how indirectly?
EDIT: The below solution is great as long as you can write your own Python script and only render solid objects. When you need things like particles/hair, it won't work as those won't be reflected.

It would be possible to bake the scene onto a sphere and repeat it for every frame.

How do you do that? Repeating that for every frame could be achieved by a Python two liner I think.

Yes that is easy to do with a sphere with a shadeless material with full reflection, and a texture set tho the sphere with the resolution of the video you want to make, I assume repeating the process with python for each frame should be easy too, but that's beyond my knowledge.

You mean an inverted (normals) sphere, large enough to fill the whole volume, UV mapped accordingly? I'm not sure I understand, will I need to fetch the generated texture instead of camera render?

The sphere should be very small at the location where the camera supposed to be, and then with python you can bake the result for every frame. I can post a partial answer without the python part.

Here's a Python code for doing something every frame, I know a bit of the API: http://www.pasteall.org/60847/python  I'm not familiar with baking, if you tell me where it is in the menu I can update the code

Related: http://blender.stackexchange.com/questions/46891/how-to-render-an-environment-to-a-cube-map-in-cycles

First create a sphere and in edit mode select the triangular fans on the poles of the sphere and inset to very small size using I button and delete the triangular fans leaving very small holes on the poles.

Then unwrap the sphere using follow active quads, position and scale the UVs to fit the UV/Image editor window.
Once the sphere is unwrapped add a new texture with video resolution you want (1920x1080)

Then add a material to the sphere, enable Shadeless, Mirror and set Reflectivity to 1

Then scale the sphere to small size and position it where the camera should be and add Subsurf modifier with at least 2 subdivisions to reduce texture distortion.
Once all the steps are finished you can use  the python script to bake the textures for each frame in a sequence.

Very odd deformations when doing this. http://i.imgur.com/fHXxry2.png  Maybe the mirror quality can and has to be changed somewhere.

Thats how it should look like but you need to make an image wider, like the video output you want.

Oh, and I forgot to add, to reduce the image distortion add Subsurf modifier with at least 2 subdivisions and set it to smooth shading.

Looks better. Any chance antialiasing can be enabled for mirror texture?

@LeoErvin I'm not sure if this option exist for baking

Seems like particles aren't reflected. Not an option for me...

The above solution doesn't seem to support non-solid objects such as some particles which are not mirrored. Here's an idea: render the scene with Blender internal as 6 cube maps, then load them back again in Blender and map to a sphere or cube with inverted normals, set it to shadeless and position the camera inside it, then render just that with Cycles with the panorama/equirectangular mode.
Will need some Python scripting to automate all this and do animations.
Maybe just rendering with BI as cubemap then doing the 2n step with a 3rd party tool will be faster, however I'm not aware of such p

I'm sure with a minor edit this script, combined with the above solution, will allow to render an equirectangular animation or frame in in Blender Internal:
import bpy

# remember current frame to switch back after the script is finished
current_frame = bpy.context.scene.frame_current

mesh = bpy.context.scene.objects.active.data

for i in range(bpy.context.scene.frame_start, bpy.context.scene.frame_end+1):
    # set current frame
    bpy.context.scene.frame_current = i

    # create an image which will store the baked data
    image = bpy.data.images.new(str(i)+'.png', bpy.context.scene.render.resolution_x, bpy.context.scene.render.resolution_y, alpha = 0)
    image.file_format = 'PNG'
    image.filepath = "//"+str(i)+".png"

    #set the active image for each uv:
    for uvface in mesh.uv_textures.active.data:
        uvface.image = image

    # bake
    bpy.ops.object.bake(type='COMBINED')

    # resave image with baked data
    image.save()

    print ("Frame "+str(i)+" complete")

# switch back to the frame you were on before running this code
bpy.context.scene.frame_current = current_frame

Currently it gives this error:
Traceback (most recent call last):
  File "C:\Users\User\Desktop\internal.blend\Text", line 22, in <module>
  File "C:\Program Files\Blender Foundation\Blender\2.75\scripts\modules\bpy\ops
.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: No active image found in material "Material.002" (0) for ob
ject "Sphere"

If someone can tell how to set the "active image" for a Material, then I think this script will run fine.

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


text:
Rigging a ross yoke and pistons
(For those not familiar with the Ross Yoke Engine, this animation seems to be the clearest available animation of how the Stirling Engine works with the Ross Yoke.  I didn't move the animation inline because it is embedded in the web page. - Marty)
So I am animating a Stirling engine and I'm trying to rig a proper Ross Yoke instead of a regular crank shaft, like so:

and can not, for the life of me, figure out how I would include the slide pin action. Basically I wind up with both pistons moving in phase.

I have the file in dropbox
HERE
For the record, yes I do know the slide pin is way too low on the yoke; I will address that once I can actually figure out this rig. I've used blender for years for CAD stuff and I'm basically a novice when it comes to animation and rigging. Any help would be greatly appreciated, as I've basically exhausted my knowledge on the subject and whatever tutorials I can find.

https://blender.stackexchange.com/questions/102990/how-can-one-rig-a-stirling-engine-piston

it is always a good idea to link a video how it should work - not everybody know how the Stirling engine is moving.... ;)

@DuarteFarrajotaRamos thank you but it's the ross yoke part that I'm trying to get working and those are also alphas style Stirling engines, but on a crankshaft instead.

@Chris I'll add a link to a video now, thanks

I've added a pointer to an animation, but it's embedded in its web page and can't be embedded here, as far as I can tell. For those unfamiliar: Ross Yoke is a means of converting the linear motion of pistons in a Stirling Engine into rotational motion.

i can offer you this solution: [1]: https://i.sstatic.net/I33Nn.gif but....it has 3 dependency circles, and the positioning of my bones isn't perfectly right, but it works (and of course you can position them right and it will still work). The gif is exactly from my solution. Here are a lot of "knowitalls" and perfectionist - for them the solution is of course bullshit, but if you are interested in a working solution - i will offer that to you. But i just wanna be sure you are searching a solution, not perfection....

@Chris I hope I'm not 'one of those'... I think you should post as an answer..

@RobinBetts: no, you aren't - and you know this ;)

You mention a slider, so this assumes your Ross Yoke is of the type in which the yoke is constrained by a slider-post, which engages with a slot in the yoke.
This rig is arranged in the space of a 'Root' Empty, which enables it to be rotated and moved around without falling apart.  That introduces one constraint that, as far as I can tell, would not be necessary if it was fixed to the World. We are looking down Z for these illustrations.
There is a right-triangle in the mechanism that lets us use Pythagoras to determine the height of the piston-heads:

If we know the location of right-hand end of the yoke, (the length of a) and the length of the piston-rod (c), then the height of the piston-head (b) is  sqrt( b**2 - a**2 ) .

The Root is the cube at the base. The light blue rotating element, the little yellow slider-post,  the circular Empties at the yoke tips, the pink piston-heads, and the dark-blue cylinders are all directly parented to it.
The green yoke's origin is at its lowest point, and it is parented to the rotator, off its center.
The yoke has a Locked Track constraint, orienting its Y towards the slider-post.
There are 2 plain-axis Empties, ('yL' and 'yR') parented to the yoke, positioned at its tips.
The 2 circular Empties ('yLL' and 'yRR') are parented to Root, but with Copy Location constraints on 'yL' and 'yR', This is to give us access to the location of the yoke-tips in Root space, by using 'Local Space' in a driver.

The length of the piston-rod is 3. The Y of the the right-hand piston-head ('pR') is driven by a function of  the X and Y of 'yRR', and the X of  'pR' itself, using Pythagoras:

..similarly on the other side.

The piston-rods are parented to the Empties at the yoke-tips, and also have Locked Track constraints, aiming them at their respective piston-heads.

If your linkage is of the other type, constrained by a rocker arm, then there's a similar solution, (The best one I think of does use bones, with an IK elbow).. I'll add that if necessary.

Update:
Be aware -> i renamed some of the bones.
I made it to rig it without dependency cycles
Bone Rotated has now an IK constraint:

There is now an empty which has a copy location constraint to the rotator bone.

the rotated bone is now flipped and parented to the side bone

result:

ok, as i already mentioned in the comments, there are dependency cycles in my rig - so Blender says, there is an error, but...the animation works fine.
Also my positioning of some bones are not completely in the right place, but by changing the length + position of some bones you can correct that easily. I was just too lazy to correct that...
So...create an armature, give that bone some x rotation + keyframe, press Shift-E in the timeline -> constant interpolation, and you get the rotation of the lowest bone.

In edit mode, select the tail of the bone, press E and extrude another bone (Bone.003 in my case).
Add another bone (Fixed) like this, make sure it is not parented.

Now add damped track to Bone.003 with track to Fixed.

And add damped track to Fixed with track to Bone.003 (this will cause the dependency cycle).

Now copy bone 3 and move them a bit to the left and the other one a bit to the right and make sure that both are parented to bone.003, so they will move and rotate with bone.003.

From Bone.005 extrude another bone (left cylinder mover) straight up. (make sure it's parent is Bone.005 which it should be automatically if you extruded it with E).
Now extrude another bone from that newly created bone (Left cylinder). This bone i just created so that i could copy the z location from it.
Now add another bone for the cylinder movement, which has no parent (left cylinder). It gets this copy location constraint:

result:

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


text:
Making object show up when Custom Property condition is met

My objective here is to make an object displaying the letters FK to show up inside the gear when the 1 - FK Custom Property is all the way to 1 and the same for IK and FK/IK

This is a problem that can be solved with Drivers.  You create a driver from the custom property and apply it to the property you want to control.  For my example, I'm going to use the IK-FK (hand.l) switch of a Rigify generated rig.
Creating the driver is easy:

hover over the property's input value.
Right click
Select Copy as New Driver from the popup menu.

The question is this case is what to driver?  I would create two text objects, one with "IK" as the text, the other with "FK".  Ideally, I would drive their viewport and render visibility; but Blender doesn't allow that, so I'll compromise and drive their material's Alpha setting.

Create a text object and edit it to say "FK".
Add a material to it.
Go to the shading tab and add a driver to its Principled BDSF's Alpha setting.  You add a driver in a way similar to creating one:

Hover over the input for Alpha
Right click
Select "Paste Driver"

The input will change color to indicate that it is now controlled by a driver.
But this driver is a default, and we have to change it.  So

Hover over the input for Alpha
Right click
Select "Edit Driver" from the popup menu

A new popup will show up and we have to change a couple of things in it to get the behavior you want.

Change the type field to scripted expression.  New entries will appear in the editor.
Enter IK_FK == 0 in the Expression field
Click "Update Dependencies".

If you're using Cycles you're done, but if you're using EEVEE you have to change a setting in the material so that the alpha channel will work.

Go to the Material Properties tab of the Properties Editor
Open "Settings" if it's not already open
Change Blend Mode to Alpha Blend

Follow the same sets for the IK text, except enter IK_FK == 1 in the expression field.
NOTE: I used Boolean expressions because the IK/FK switch can be set to anything between 0 and 1.  This will only highlight the text if the switch is exactly 0 or exactly 1.  You may want to use a <= or >= in the appropriate expression if you want at least one of the texts always displayed.


text:
Does Blender run on ARM-based processors
I am using Blender on a Mac application called 'Parallels' which is a Windows computer for the Mac (https://www.parallels.com). However, Blender fails to start when using the Parallels app. I tried this both on 2 Macs: an M1 Mac Studio and an Intel MacBook Pro 2017. Both gave me the same results.
I reached out to their support page, and they wanted me to check whether Blender works on ARM-based processors or not.
Thanks

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.

Blender has had an official Apple ARM port since a year ago (April 2021) and you can find daily builds and official releases on the Foundation's web site; as well as various Linux arm packages on other sites.
However, if you're having trouble with parallels on both Intel and Arm, it sounds like there's a problem with parallels.  You would need to go to the Parallels forum to find out more; as we're not likely to have answers here.

There is an update to this. Starting from Blender 4.2 you can get the official Windows ARM builds right on the daily builds page. Support for the new architecture is currently in the Alpha stage (hopefully it will be stable when 4.3 is out).


text:
Windows 7 Ultimate Service Pack 1 32 Bits Blender Installation
Which blender version is compatible with windows 7 ultimate service pack 1 32 bits from where I will download it share link what is the procedure step by step to install blender.

The foundation has a Requirements web page where they discuss this.  Specifically about Windows 7 they say:

Since Blender 2.93 Windows 7 is no longer supported. Microsoft discontinued Windows 7 support in January 2020

So, any version prior to 2.93 can be downloaded from the previous versions page.  Download, unzip, and run.  Be sure to pick the Windows version.
But I strongly recommend upgrading Windows.  7 has many bugs that are security risks.  If you put a Windows 7 system on the internet it is likely to be compromised .

Sir I download blender 2.79b but it not works on windows 7 ultimate service pack 1 32 bits kindly help me.

@harjinder did you download this version?  If so, what did you do next, and what error are you getting?  Also, you might want to try this version instead.  You don't unzip that one you just run it. It will install 2.79b


text:
Display preset RGB values in a panel (and call function when clicked)
For clarity, this question was closed for a while after I added the clarifying statement inside the parenthesis so I created a new question asking the same thing. This question was later opened and now there are two very similar questions.
I have a panel in which I want to display a few preset colours that a user could then click on but not change the value of (IE, I don't want the colour-picker dialogue to pop up like when clicking a FloatVectorProperty). When a color is clicked I want to call a function to do some things behind the scenes.
This image from windows paint is basically what I want:

You can use layout.template_node_socket(color=(R, G, B, A)) but as far as I know there's no way to make it clickable, neither do I think its very good UI wise (I'd much rather have a square).
So my question, is there a way to display a coloured square that's clickable (and calls a function) in the UI?
EDIT
In this gif from @pyCod3R (using a palette) its showing the colors exactly how I'd like it to be but there is a + and - sign which adds/removes indices to the list. I can't allow users to modify the list because its fixed and no items should be added or removed.
From what I can tell there isn't a way to call a function when a color inside the palette is clicked, am I wrong and there is a way to do it?

You want to use a color palette. see this answer for how.

Does this answer your question? How do i create Palette UI object

My question was poorly formulated, a palette is only a partial solution unless I'm missing how to remove the "+"/"-" signs and how to call a function when a color is clicked.

Have a look into How do i create Palette UI object and How to get a specific color/slot from a Color Palette
Quickly combined the code of both answers to display 50 random generated colors and their rgb values directly on the panel. Notice that Alpha is not supported, PaletteColor is a float array of 3 items: https://docs.blender.org/api/current/bpy.types.PaletteColor.html#bpy.types.PaletteColor

Minor changes to @batFINGERs code from: How do i create Palette UI object
import bpy

class PaletteDemoPanel(bpy.types.Panel):
    """Creates a Panel in the tool panel of image editor"""
    bl_label = "Palette Demo"
    bl_idname = "MATERIAL_PT_palette"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'

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

        ts = context.tool_settings
        palette = ts.image_paint.palette
        sel_r, sel_g, sel_b = palette.colors.active.color

        if ts.image_paint.palette:
            layout.template_palette(ts.image_paint, "palette", color=True)
            layout.label(text="Active Color: {:.2f} {:.2f} {:.2f}".format(
                sel_r,
                sel_g,
                sel_b))

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

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

if __name__ == "__main__":
    register()

    # Add a new pallete
    pal = bpy.data.palettes.get("CustomPalette")
    if pal is None:
        pal = bpy.data.palettes.new("CustomPalette")

        # Add a single color
        red = pal.colors.new()
        red.color = (1, 0, 0)

        # Add random colors to the palette
        from random import random
        for i in range(50):
            col = pal.colors.new()
            col.color = (random(), random(), random())

        # Make red the active/selected color
        pal.colors.active = red

    ts = bpy.context.tool_settings
    ts.image_paint.palette = pal

This seems to be exactly what I'm looking for, thanks!

How would I trigger a function call when a color is picked?

Is there a way to disable the "+" and "-" signs? I cant allow the users to add more or remove colors since the list is fixed.

@CybranM template_palette() is hard coded in C. I'll do some research and let you know.

If you want somewhat similar without all the extra elements coming with template_palette() IE +-, a fixed list and also execute an operator when the user clicks one of the colors... you can implement some sort of dynamic operator for all colors, and display only the icon on the panel.

Example script using some of the default icons (If you want to use custom icons, have a look into: How to implement custom icons for my script/addon?).
import bpy

colors = {
    0: {"Color": (0.3, 0.3, 0.3, 1.0),
        "Icon": 'COLORSET_01_VEC'},
    1: {"Color": (0.5, 0.4, 0.5, 1.0),
        "Icon": 'COLORSET_02_VEC'},
    2: {"Color": (1.0, 0.4, 0.5, 1.0),
        "Icon": 'COLORSET_08_VEC'},
}

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    color: bpy.props.FloatVectorProperty(
             name = "Color Picker",
             subtype = "COLOR",
             size = 4)

    def execute(self, context):
        context.scene.active_color = self.color
        print(self.color[0], self.color[1], self.color[2], self.color[3])
        return {'FINISHED'}

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

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

        row = layout.column_flow(columns=18)
        for k, v in colors.items():
            p = row.operator(SimpleOperator.bl_idname, text="", icon=v.get("Icon"))
            p.color = v.get("Color")

        r, g, b, a = context.scene.active_color
        layout.row().label(text=f"Active Color: {r:.2f}, {g:.2f}, {b:.2f}, {a:.2f}")

def register():
    bpy.utils.register_class(SimpleOperator)
    bpy.utils.register_class(HelloWorldPanel)
    bpy.types.Scene.active_color = bpy.props.FloatVectorProperty(
             name = "Color Picker",
             subtype = "COLOR",
             default = (1.0,1.0,1.0,1.0),
             size = 4)

def unregister():
    bpy.utils.unregister_class(HelloWorldPanel)
    bpy.utils.unregister_class(SimpleOperator)
    del bpy.Scene.active_color

if __name__ == "__main__":
    register()

UI code comes from Could I see a simple example of using a color picker in a script?
To refute claims in the comments, it works with custom icons (32x32 px) representing the colors as expected:

Another approach to achieve a very similar result and trigger an event is to use a series of BoolProperties (as elements of a collection) which also allows to have an active item.
The principle is the same as in my prevoius answer using operators. You can display the BoolProperty only as an icon and generate the icons for the colors on the fly by adding a new preview collection (as you normally would do for custom icons) and then assigning a pixel array of the color to each new icon added: https://docs.blender.org/api/current/bpy.types.ImagePreview.html

Example of a color palette using BoolProperties and assigning the selected color to the object's diffuse color property using the update function (make sure viewport shading is set to solid).
import bpy
import bpy.utils.previews
from random import uniform

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

    def draw(self, context):
        layout = self.layout
        scn = context.scene

        col = layout.column(align=True)
        row = col.row(align=True)
        active_item = None
        for idx, item in enumerate(scn.color_collection, start=1):
            row.prop(item, "active", icon_value=item.icon, icon_only=True)
            if item.active == True:
                active_item = item
            if idx % 11 == 0:
                row = col.row(align=True)

        if active_item:
            row = layout.row()
            r, g, b, a = active_item.color
            row.label(text=f"Active item: {r:.2f} {g:.2f} {b:.2f} {a:.2f}")

def random_rbga(alpha=1):
    return (uniform(0, 1), uniform(0, 1), uniform(0, 1), alpha)

def update_callback(self, context):
    if self.active:
        for i in self.id_data.color_collection:
            if i.name != self.name:
                i.active = False
    # set the diffuse color
    obj = context.object
    obj.active_material.diffuse_color = self.color

class ColorCollection(bpy.types.PropertyGroup):
    # name: bpy.props.StringProperty
    active: bpy.props.BoolProperty(default=False, update=update_callback)
    icon: bpy.props.IntProperty()
    color: bpy.props.FloatVectorProperty(
         name = "Color",
         subtype = "COLOR",
         default = (1.0,1.0,1.0,1.0),
         size = 4)

# We can store multiple preview collections here,
# however in this example we only store "main"
preview_collections = {}

def register():

    # register the classes
    bpy.utils.register_class(HelloWorldPanel)
    bpy.utils.register_class(ColorCollection)
    bpy.types.Scene.color_collection = bpy.props.CollectionProperty(type=ColorCollection)

    # clear the collection
    if hasattr(bpy.context.scene, "color_collection"):
        bpy.context.scene.color_collection.clear()

    # generate colors and icons
    pcoll = bpy.utils.previews.new()

    size = 32, 32
    for i in range(32):

        color_name = f"Color{i}"
        color = random_rbga(alpha=1)
        pixels = [*color] * size[0] * size[1]
        icon = pcoll.new(color_name) # name has to be unique!
        icon.icon_size = size
        icon.is_icon_custom = True
        icon.icon_pixels_float = pixels

        # add the item to the collection
        color_item = bpy.context.scene.color_collection.add()
        color_item.name = color_name
        color_item.color = color
        color_item.icon = pcoll[color_name].icon_id

    preview_collections["main"] = pcoll

def unregister():
    for pcoll in preview_collections.values():
        bpy.utils.previews.remove(pcoll)
    preview_collections.clear()

    bpy.utils.unregister_class(ColorCollection)
    bpy.utils.unregister_class(HelloWorldPanel)

    del bpy.types.Scene.color_collection

if __name__ == "__main__":
    register()


text:
Curve modifier issues

Here is the problem, when I use curve modifier. How can I fix it?

Sorry, you need to be more specific with your questions. People can see something is wrong, but without detail they can't tell what.

Mk... When I add a modifier, istead of normal ruffles, I get this. I had the same problem with top ruffles, but I just needed to rotate ruffles. I don't know how to make bottom ruffles normal and I don't understand why this happens


text:
Objects with negative mass?
I'd like to simulate balloons floating up, while other objects are falling down, which I cannot fix by reversing gravity. Is there any way to simulate this, simulating Archimedes' Law?
This is more of a general question about Blenders physics, but for the scene at hand I'm working on about a hundred balloons rising, and confetti and serpentines falling. The balloons have numbers on 'm, so these were generate through a script. It is not a particle system.

Another solution using RigidBodies, Zero gravity and a Texture Field:
Note that all the balloons here are single user object instances all with RigidBodies.

turn RigidBodies World Gravity to 0.0
Add a texture field which uses RGB values of the texture to determine the force (using a Color Ramp). R or G or B values of 0.5 correspond respectively to 0.0 force in the X, Y or Z axis. 0.0 R, G or B values correspond to +1.0 force and 1.0 R, G, B values correspond to -1.0 X,Y or Z force. Its means that a downward Z axis force of -1.0 corresponds to R=0.5,R=0.5,B=1.0, and an upward Z axis force or 1.0 is R=0.5,G=0.5,B=0.0. Thus the blueish/yellowish texture below. See https://docs.blender.org/manual/en/latest/physics/forces/force_fields/types/texture.html for details

Also note that I am using a Clouds texture here which is 3-dimensional which explains why the balloons are sometimes switching direction, when they pass through a 3D space where the 3D texture is changing color. May be using an image texture or tweaking how the texture is build would prevent that.

Option using a combination of Gravity, Forcefield and flow option:
 1. adjust your gravity down

add a Forcefield of type plane just below the emitter (very close to the origin). Check out its settings here:

This is making the balloons go up and down but I am sure that you can tweak it to your desire.

I'm not using a particle system here, so I guess Bruno's suggestion is not going to work.

OK no problem. Please add some more detail on the context and your constraints in your original post. You can use the Edit button to do so. This way, that will avoid confusion.

One possible solution is to use contraints to tie the balloon's position to that of a hidden "anti-balloon" (represented bellow by the smaller cube), inverting the Z component, however.

Apply regular Rigid Body physics to the anti-balloon and, by tweaking the constraint's influence setting, you can get yourself a more natural-looking animation, seeing as balloons accelerate upwards at a much slower rate than (anti-)gravity would have them do.
Make sure to hide the anti-stuff and disable them in renders, possibly also in viewports.
N.b.: it might suit you better to copy only the inverted Z component of the anti-ballon, or to use two constraints: one for the Y and X components, with full influence, and another one for the Z component, with reduced influence.

I played a bit with this, but it is too limited for my purpose. For instance, this does not work for a cloth simulation. I can animate the balloons, but I just want to benefit from Blenders  physics simulation. Looks like Blender is not very useful for anything but the most trivial simulation.


text:
Duplicate object including physics settings in python for Blender 2.8?
I can duplicate an object and its materials in python for Blender 2.8; so far so good
How do I copy its physics, say Cloth, settings?
Code so far, manually copying the settings I need:
balloon=bpy.data.objects['Balloon']

dup= bpy.data.objects.new(balloon.name, balloon.data.copy())
dup.active_material= balloon.active_material.copy()

bpy.context.scene.collection.objects.link(dup)

# Copy cloth modifier
bpy.context.view_layer.objects.active = dup
dup.select_set(True)
bpy.ops.object.modifier_add(type='CLOTH')

# Copy cloth settings
dup.modifiers["Cloth"].settings.use_pressure = True
dup.modifiers["Cloth"].settings.uniform_pressure_force = 2

```

Hi. What code have you got so far and where specifically are you getting stuck?

Added a code fragment, where I am manually adding a new modifier, setting its properties.

Does this answer your question? How to duplicate an object in 2.8 via the Python API


text:
Blender 2.8 render contains bad stripes?
Trying to render an image, only to find the result contains bad stripes, both in Eevee and in Cycles. What is going on here? The viewport render looks okay, though...
Blend file: enter link description here

is it possible to share the .blend File?

Hmmm, I solved the problem by replacing the offending balloon, but forgot to save the problem file. I understand this makes it impossible for you to help, sorry about this.

The problem is in Cloth and Subsurf being in the wrong order in the modifier stack: Cloth must come before the Subsurf. For some obscene reason, this doesn't show in the viewport, not even in the render preview in the viewport, but it does give  horrible results in the final render.


text:
How to align mesh parts?
Suppose I have a mesh containing, among other things, two cubes of different sizes, both oriented so that the main axes of these cubes are parallel to the world axes.

How can I align these cubes so that the top planes are at the same z coordinate, leaving other coordinates unchanged?

One way to do it is to separate these cubes into two different objects, and to align these, but the original object contains a lot more than the two cubes, so it needs to be reconstructed after the alignment, which is too much effort.

could you please make some screenshots to make it more understandable?

moonboots is right, indeed.  Pictures added.

Use Snapping.
Select the vertices you want to move.
Enable snapping (magnet icon) and set it to Snap to Vertices.
In a lateral Orthographic view move the vertices you want to align.

Other tools to be aware of:
Scaling to zero.
Select all of the vertces and scale to $0$ on the axis you need.
In this example all of the vertices are scaled on the z axis, this is done pressing SZ$0$:

For a more precise alignment, copy the coordinates of a vertex in a given axis, and make the selected vertices be at such coordinates using the Item > Transform tab.
You can set the coordinates to global.

To copy and paste values, just move the cursor over to the value you want to copy and press Ctrl+C to copy and
Ctrl+V to paste

Took me a while to understand the semantics of the various snapping options, but this is exactly what I need! Thanks for sorting me out

@eezacque Hey :). If susu's answer solved your issue, please mark it as accepted ✓.

@JachymMichal I like your answer better.

Thanks :) Perhaps I'll get the sweet sweet green checkmark next time :)

You can also use active vertex for snapping

Select the vertices you want to move
Use Pivot > Active Element and enable Vertex snapping
The last selected vertex will be used for snapping


text:
Differentiating between instances in geometry nodes?
I am trying to create a procedural tree by distributing 1st order branches from a trunk through a 'distribute points on faces' node, 2nd order branches from 1st order branches, and so on. However, currently all instances of 1st order branches are identical, which could be solved by giving the 'distribute points on faces' node of each instance a different seed, but I have yet to find a way to differentiate between instances. Can this be done in blender 3.0?
I included a .blend file of an abstract tree, with trunk, branches, and points on branches, which illustrates that all branches are identical.

blend file

Yes! :) It can be done.
I believ that the best way to grow up a general tree in blender 3.0 and 3.1 is to use curves in geometry nodes.
In the node setup below all branches are unique. Also branches change there start thickness and start angle along the trunk.
For Blender 3.1.

With the "Noise Texture" node you have ability to change deviations of trunk and branches.
Exact count of branches is equal to the "count" value in "Curve To Points" node.
With the left "Map Range" node you can control trunk thickness.
With the right "Map Range" node you can control branches thickness.
With the central "Map Range" node you can control branches start angle.
With the "Value" node connected to "substract" math node you can make all branches a bit thiner then trunk.
With "Trim curve" node you can remove branches from the unwanted areas of the trunk. Now this node remove branches from the lower half of the trunk.

For Blender 3.0.

The node setup is very similar. But in blender 3.0. curve parametr do not work correctly via capture attribute. So you should use position Z axis instead of it.

Exactly what I need, thank you so much for this node setup! I'm structuring it right now, and expanding it, so I can generate 2nd order branches, 3rd order branches and so on. I'll share my node setup when done...

@eezacque you are welcome :)

Looks like you hit a subtle difference between blender 3.0 and blender 3.1. Correct me if I'm wrong, but I think in 3.0 the To Max value of the middle Map Range node is ignored? The problem seems to be that in 3.0, the Curve parameter is not correctly captured? Any thoughts on this?

@eezacque Yes, you are right. Probably curve parametr is not correctly captured in blender 3.0. But you can try to use Z position instead of it.

@eezacque I edited my answer, and add illustration specially for blender 3.0.

Worked out my own tree setup, but the weakness in this approach is that the tree is not one connected mesh, so a subdivision surface modifier can easily pull it apart.


text:
Motion blur with vector in compositor
I'm trying to follow along this tutorial here.
It's a simple tutorial where the instructor ends up adding motion blur on a blue monkey, but without using the "motion blur" in Render properties. Screenshot from the tutorial, result:

It seems like blender is updated, and "vector" is no longer defined in the "view layer properties" - is the new input called the "normal"? Anyways here is my attempt to get motion blur on a moving cube. It's not working.

Any ideas?
Edit //
I'm using Blender 3.4.1 can't find the vector option in ViewLayer

I'm seeing vector in properties/view layer (in passes/data).  In 3.4.1.  Are you sure you're looking in the right place?  "Normal" is not the same thing.

Just upgraded to 3.4.1, still not visible

You are using Eevee then? in Eevee MB is so cheap, you don't need to fake it. Updated my answer

This option is not available in EEVEE, try to use Cycles instead.
It seems to be EEVEE Next will have vector pass.

You are using the Normal pass as motion vectors. Do this in the View Layer Properties:

That makes the Vector output (see your 1. screenshot) appear and you can use it with the vector blur node
If you are using Eevee, the option will not be available, because it is very cheap anyways and would actually take longer to apply it in post, just make sure it's enabled:

I don't have that option in Linux blender 3.4.1.. Did you do anything in the settings to get this option? (see new image in description of the issue)


text:
Selecting faces within a given radius
How would I construct a simple loop in Blender (via Python scripting) to select all faces (or all vertices) within a given radius? I'm not able to find a description of how Blender indexes it's vertices.  I suspect it's something like..
for v in vertices
   if v.radius < 10
      v.select = True

To illustrate, I've added an image of the vertices that I would like to select.

This script will calculate the distance from the object center.
You can change the object center by pressing Ctrl+Alt+Shift+c
import bpy
from math import sqrt

#http://blender.stackexchange.com/questions/7144/how-to-get-the-distance-between-two-objects-in-the-game-engine

def get_distance(p1,p2):
    distance = sqrt( (p1[0] - p2[0])**2 + (p1[1] - p2[1])**2 + (p1[2] - p2[2])**2)
    print(distance)  # print distance to console, DEBUG
    return distance

o = bpy.context.object
vertices = o.data.vertices

#switch to OBJECT MODE to perform the selection
bpy.ops.object.mode_set(mode='OBJECT')

#calculate the distance from the center
center = [0,0,0]
for v in vertices:
    distance = get_distance(center,v.co)
    if distance > 10:
        v.select = True

#switch to EDIT MODE
bpy.ops.object.mode_set(mode='EDIT')

Param -- Your code does the trick, I've been checking through the points and the boolean logic with the console. Using 0.8 as my radius (in place of your 10), it does not seem to be selecting the vertices, even though it's reading half of the distances as > 0.8, and the other half as < 0.8.
Edit: I had toggled on the Object mode. Your code works fine, thank you!

I've edited the script

You might start by reading through the Templates available.
TextEditor -> Python -> BMesh Simple Edit Mode.
The following snippet is a small modification of the template, but is by no means a particularly efficient way to find the faces within a certain radius of a given coordinate. Merely to illustrate one step, here the coordinate i'm searching around is the active face.
# This example assumes we have a mesh object in edit-mode

import bpy
import bmesh
# from mathutils import Vector

# Get the active mesh
obj = bpy.context.edit_object
me = obj.data

# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)

# this is a coordinate like Vector((0,0,0))
active_median = bm.faces.active.calc_center_median()

# Modify the BMesh, can do anything here...
for f in bm.faces:
    f.select = False
    if (f.calc_center_median()-active_median).length <= 3:
        f.select = True

# Show the updates in the viewport
# and recalculate n-gon tessellation.
bmesh.update_edit_mesh(me, True)

here I hardcoded the 'epicenter' of the search sphere using the median location of the active face, but you could change that to the location of the 3d cursor. (if the object's origin isn't at (0,0,0) or has unapplied Transforms you will also need to take the object's Transform matrix into account )

A great module for spatial searches is KDTree , and it has adequate examples on the API page.

For some reason, my code is getting hung up on "me = obj.data" -- "AttributeError: 'NoneType' object has no attribute 'data' "

you do need to have a Mesh object in EditMode with one face active/selected to run this particular example.


text:
Pack external data did not work?
on my project I've used some textures and now I have to render it but on another computer.
Since I used a lot of textures, I packed them in my file (or at least I thought I did it) by choosing File->External Data->Pack all into .blend .
Blender told me that 31 objects where packed, but when I moved the file in the another computer the texture are not showing (they're pink as if they were missing).
Which step did I miss?
Also, I have some objects that I appended from another file (not linked); do I need the original file to show them in my .blend or since they are copies I don't need that?
EDIT: ok, strange thing. Now if I go into texture mode the texture are shown, but if I go into render mode they are all pink. What's happening?

It works for me, on 2.76, but I tried something simple. Which blender version are you using, and on which platform (windows, linux, OSX, etc)?

@m.ardito I'm using Blender 2.73 on windows 8.1

I have a 2.73 on win7, I just tried and it works... weird. Of course, you have to save the file again, after using "pack all" command... but I'm sure you did. Could it be that the .blend is read-only when you open it and try to pack all? to pack textures, you need to be able to modify that blend...

How can I check if the blend file is read-only? Anyway, I've edited the question because now it's getting weirder... in texture mode they are shown but not in render mode. How it is possible?

Ok, pack is working, at least: is the object that should have textures completely pink, or it show the textures but they are mostly pink?

The objects are completely pink, as if they are not textured...

Maybe there is something with the paths? Should I change them to relative/absolute? Or that doesn't count?

Let us continue this discussion in chat.


text:
Map multiple textures to a face individually
I have two textures mapped to a uv unwrapped face but one of them is the wrong scale. If I change the uv map to make it right it throws off the other texture. Is there any way I can have multiple uv maps for the same face so I can scale one texture without changing the other?

Yep, you can manage them in Object Data > UV maps:

To use a particular map, you can select it via the UV map node (cycles):

Or in the texture settings (BI):

Arrgh . . . you beat me :P

Use the node . . .

You can access your different UV maps while unwrapping in the UV Image Editor:

That way you can unwrap the first one, finish, and then unwrap the second one differently. Access them in the material as shown in Gandalf3's answer.


text:
Is every frame of a animation stored in RAM
I am currently rendering a animation and it will take a long time but before I let it run for hrs I want to know if every frame of the animation is stored in RAM because my PC only has 2 GB and I don't want blender to stop half way through and have to start again. If this is a issue is there a way to render part of a animation and do the rest later?

No, they're not stored in RAM. For image sequence output, each frame rendered will be immediately written to the disk. Even video output using FFMPEG directly writes to the disk by chunks.
I've tried rendering CG animation directly to video (not recommended) for hours, and there's no sign of increasing memory usage over time.

Also see http://blender.stackexchange.com/q/4874/599 and http://blender.stackexchange.com/q/3470/599 for more info on why it's not recommended to render straight to a video file.


text:
Rendered image looks pixelated
When I hit F12 to render an image and zoom in it is quickly pixelated.
How can I render a higher res display? I have looked through the settings and couldn't find a solution.

Check too that you didn't accidentally zoom in the render with your mouse scroll button.

You can set the output resolution of the render in the Properties Editor > Render settings > Dimensions Panel:

For a description of each of these settings, see the Manual:

Resolution:
The Dimensions section has settings for the size of the rendered images.
By default the dimensions SizeX and SizeY are 1920×1080 and can be changed by adjusting the X and Y fields. These buttons control the
overall size of the image.

Percentage:
Slider to reduce or increase the size of the rendered image relative to the X/Y values above. This is useful for small test renders that have the same proportions as the final image.

Note you can quickly increase or decrease the resolution while keeping the same aspect ratio by setting the Percentage slider below the resolution settings:

Note that to set the Precentage a value greater than 100% you will have to type the value in directly.
For Blender 2.8+ the render size is now in the Properties Window > Output Properties tab

Other methods
Note that it is possible to type a quick python math expression such as 1920*2 directly into the value box: (helpful for quick arithmetic to precisely set values. This works for all value boxes, not just resolution settings)


text:
How do I chain shape keys?
I need to animate a multi step change in a mesh like this

I set a shape key for the base and then step 2 fine but when I used new shape key from mix it applied the transformation for both step 2 and 3.

How can I get the shape key to only apply changes from step 2 to 3 and not from 1 to 3?

If you add two shape keys without the new shape key from mix option, you can animate them separately. It is Important is that you keyframe the 2nd part of the animation with influence 0 for the duration of the first part. This way the 2nd part does not start before it is supposed to do.

Editing the shape for extrusion: In Edit Mode a loopcut is added at the top of the extruded cube to create the geometry required for the second part of the animation.

Is it possible to start editing the 3rd shape key starting with the mesh from the 2nd? On yours both keys are modifications of the base shape

Sorry but I don't get what you mean.

for example if I wanted to extrude from the top end of the part that sticks out I could not do that starting from the default cube because that part of the mesh does not exist yet.

@Qwertie Now I got it. I simply extruded the top face of the default cube and added a loop cut to create the face which is extruded to the left side. The shape keys work always on a single mesh. Added an image to clarify this.


text:
Move vertices to center of mirror modifier to join with other side
I have this model and I would like to join the 3 vertices selected by moving them to the center of the mirror modifier.

How can I join up vertices with the other side of the mirror modifier?

Found out there is an option in the mirror modifier settings called clipping that lets me drag the verts right to the center and they will stop when they meet


text:
Fast way to remove internal faces for multiple objects at once
I have some blends which have multiple objects and I want to turn them all in to one object with no internal faces for 3D printing. Currently I have been repeatedly applying a boolean modifier but this takes a lot of time as it has to be done for every single object I want to join. Is there any fast way to select all of the objects and get the same result as a union boolean modifier?

https://blender.stackexchange.com/questions/43150/removing-internal-geometry-before-3d-printing and https://blender.stackexchange.com/questions/50351/how-can-i-delete-internal-vertices-faces-and-edges and https://blender.stackexchange.com/questions/71687/removing-internal-geometry

Does a Ctrl + J to join the meshs is what you ask ? Otherwise I don't have an answer. Maybe you should take a look at the add-ons, I think there is one with the booleans, but I don't remember its name, but I think it isn't on Blender by default.

Note that Ctrl+J joins multiple objects into one object with multiple meshes; it doesn't edit geometry of meshes inside object datablocks in any way which is what OP would like to do