UV Maps Angled & Stretched Incorrectly I'm trying to make a simple crate model with a pixellated texture, but unwrapping the mesh results in an oddly distorted and angled mess of a UV map. I've already calculated that the texture needs to be 102 x 136, and the only thing stopping me from finishing is the distorted UV map. All of my transform settings are applied, and I've tried both angle-based and conformal UV mapping with both giving the exact same results, shown in the following screenshot.

Is there any way to fix this?

It's generally very unusual to have a non-square UV map, and it's also pretty unusual to have a UV map that isn't based on powers of two. I don't know how you've come up with those numbers but you're almost certainly best off sticking to 128x128 if that's the rough size of texture you're looking at.

The non-square UV map is the reason you're having this problem, and if you really need it, there is a quick fix:

Select everything on the UV map and scale it by the ratio of the map itself. So in your case, S to scale, Y to constrain to the Y-axis, and then type 0.75 (102/136) as the amount and it will correct the distortion.


Scaling UV map to bounds but preserve mesh proportions I am doing Project from view with scaling to bounds, but it doesn't take proportions into account. There is a checkbox about correct aspect ratio, but it is useless.

Is there a way to do it quickly, without messing in UV editor with enabled snapping to pixels, to prevent unnecessary stretch when scailing to bounds.

Example with an oval shape :)    :

1: UV Mapping  >  Project from View.

2: In the UV Editor open the UV's menu and choose Pack Islands, turn off the Rotate option.


Not showing texture after uv maping and importing png image? I am just learning blender..I made a 3d character and unwrapped it.. But when I opened the image in UV editing window it didn't show the any texture.

https://www.mediafire.com/folder/feo73886r4aer/character

I had to reload your image texture from disk to get it to show up. Once I did that I just changed the viewport mode from Solid to Textured and the textures appeared.


Newbie question about extrusion of hemispheres I am trying to extrude a small section of a hemisphere into a flat surface (like the depressions in a Mancala board....or the death star main gun).  Correspondingly, I want to extrude a matching section outward in different flat surface to fit into that depression.

I have been scouring the web for tutorials, but not much has come up with adequate explanation for someone just beginning.  What is the correct/best way to do this?  I have seen some people make small extrusions, then scaling, then extruding, and scaling again (Repeatedly), but this seems a little....like a hack rather than a proper method to do what I'm looking to do.

Any help would be appreciated!

bottom left:
Create a sphere and a cube.
Set a Boolean modifier on the cube.
Set the modifier's operation to "difference" and use the sphere for its object.

bottom right:
this is the result

top left:
Subdivide a plane or mesh 2 times
Inset the 4 center faces
Extrude
You could at this point select the extrusion and hit alt shift s to spherize the center. Otherwise, just try to make the shape I showed up there by hitting shift+z while scaling the center most verts.

top right:
this is a subdivide modifier applied to the top left mesh


Python to Replace Skechup Material to Cycles Material I'm using the Blender to make all my works university (architecture), but in my job the people use Sketchup for modeling and V-Ray for rendering.
I want use Blender, cause liked more then others, the problem is that to rendering with Cycles, I have to need import the Skp file, change all materials (or set), create lamps etc... How to make a Python script that replace the materials by one list in all objects on the scene?

For example:

Cube.001 have the material "OldMaterial.01" in one face, and "OldMaterial.02" in others.
Cube.002 have the material "OldMaterial.02" in one face, and "OldMaterial.03" in others.

And we have the list:

For "OldMaterial.01", replace to "NewMaterial.01"
For "OldMaterial.02", replace to "NewMaterial.02"
For "OldMaterial.03", replace to "NewMaterial.03"

And the script replace all materials for the match in the list.

That will be increase so much the workflow Sketchup - Blender!

Thanks for now!

Every object has a list of materials it uses in it's material_slots property, this is shown in the material properties, each slot contains the material used. By looping through this list you can change the material assigned to each slot.

I would setup a dictionary of old-to-new names to use for the conversion process.

import bpy

matnames = {
    'OldMaterial.01': 'NewMaterial.01',
    'OldMaterial.02': 'NewMaterial.02',
    'OldMaterial.03': 'NewMaterial.03',
    'OldMaterial.04': 'NewMaterial.04',
    'OldMaterial.05': 'NewMaterial.05',
    'OldMaterial.06': 'NewMaterial.06',
}

for obj in bpy.data.objects:
    for slot in obj.material_slots:
        slot.material = bpy.data.materials[matnames[slot.material.name]]


Particles appearing at different locations when rendering I have set up a Biod particle System to follow a leader. No child particles. However, when rendering the particles seem to be at different places. When going to the first frame the particles seem to not have moved at all even so they are set to start at frame -100 and end at frame 0. I have baked the cache to see if that helps.
This example shows the particles at frame 60.

you have set the visibility of your cube in trash  in viewport to "hidden", but not in render.
so press the filter button

tap on "disable in render"

and then mark your cube in trash as "disable in render" too...else it will be rendered.


Why wont mirroring of the Brush work properly? I want to do the texturing but I countered a problem I couldn't solve.

I thought the x-axis is red and the y-axis green.

But when I turn the mirror in texture paint on x-axis it mirrors the paint around the y-axis and with y-axis enabled the other way round.

On top with y-axis enabled it is strangely shifted.

I already tried setting the origin of the model to volume and moved the object to the center with Alt + G , but it didn't change. Also I tried to texture paint a cube in a new file to see if it's working there and it does properly. Next I tried to copy the fly to a new file and texture paint it over there but I encountered the same problem.

You may need to go in edit mode and select a single loop of vertex to snap the cursor to that will allow you to place the origin center so that your object will paint correctly. A common problem for mesh that has been moved in edit mode away from the origin is this effect, that the center will be offset incorrectly.


Metaball-style merge effect on two modelled and realistically textured human heads possible? I would like to create a complex animation in which two rigged objects - human head models in this case - merge together as they float next to each other with a similar effect that metaballs have on each other.
Is this possible in any way? I'm trying to find the best way for the skin to pull out from the parallel side of each head and have them merge (With the merged skin materials being seamless), similar to a metaball interaction but with a detailed skin material. The only example I can think of which is along the lines of what I'm aiming for is the split-face scene in The Thing (2011) (Very graphic) at the 2:20 mark. (I'm not aiming for this much realism of course.)
Like that but with the heads floating and magnetized to one another. I'm also hoping to have the faces animated on their own before the merging/smashing together takes place so they'll be rigged but this question is only regarding the mesh & material merging effect specifically.
As far as I know, you can't model and animate metaballs with as much detail and variation that a human face requires or convert part of a mesh into a meta object so would this work by keyframing the skin meshes towards each other in a stretching fashion then merging them into one mesh at the desired frame?

Combining the meshes with the Boolean modifier and then smoothing out the result is an idea worth exploring. Example:

Settings:

If the two faces have very different shapes, you could use a shape key to morph both faces into something in between, so that they blend more nicely.
You can also use additional boolean modifiers if you want to ensure that the merging faces don't pass "through" each other (i.e. if you don't want the moving monkey's right ear to be visible near the end of the animation, you could "mask" it out with another Boolean intersection modifier).

keyframing the skin meshes towards each other in a stretching fashion

You can also add various distorting modifiers before the boolean merge to achieve the magnetic stretching effect you describe (e.g. with a Lattice modifier or similar).
Challenges
While the basics of this technique are easy to implement, you might run into difficulties if you want a more complex animation:

This technique forces you to use a smoothing modifier, which might be undesirable. However, you could fade it in as part of the effect and fade it out when the animation is complete.
The faces need to be single, non-self-intersecting objects. This means that you would most likely have to deal with other components, such as eyes, individually. (In the example above, I modified the Suzanne model so that the eyes are connected components).
UV texture coordinates will be unusable due to the boolean modifier. I can suggest either texturing your model procedurally, or rendering another version of the animation with textures, but without the merging effect and then combining these two renders during compositing.


UV map node not working in preview I'm using an UV map node for some cycles materials, both being generated by a script of mine.
Everything is OK in the viewport and in renders but in the material preview tab it appears with an uniform color corresponding to the right border of the texture.
As soon as I disconnect the UV map node from the diffuse texture, the preview is OK again. If I reconnect it the preview shows again an uniform color. It this so for the Diffuse shader or the diffuse entry in the principled shader.

If I play with the UV mapping, either with the mapping node or the mapping in the Properties -> Texture tab, it seems that I can change the position but in the preview pane any change in the size seems to not have any effect.

I suspect UV mapping used for the viewport & render are not the same than for material preview.

So the question is "why the preview show only the color on the border of the texture while what can be seen in the viewport or in renders is OK since it corespond well to the texture and the UV map"?

Here I tried another node to see the difference


Textures are shifted in Cycles render When I try rendering my model in Cycles, it warps the textures for whatever reason - here is an picture to demonstrate:

The windows should look the way they are on the right in the 3D view. What is be causing this?

It looks like you have already unwrapped your model, so I am guessing that the problem is that Cycles isn't using the UV map you have created.

To tell Cycles explicitly to use a particular UV map add an Input > UV Map node and plug it into the Vector input on your image texture.  Make sure that the correct UV map is selected on the UV map node.

Alternatively, you can check which UV map is being used as the default UV map under Object Data properties panel > UV Maps rollout.  You can set the default UV map by clicking on the small camera icon next to it.

This will only have an effect if there are no mapping coordinates explicitly defined for a texture as above.


mapping using cylindrical map via script I'm trying to create a default mapping mode for an object. I followed through understanding the python API for blender, and things are making more sense at this point, however I'm not able to create the UV map I wish on the object. Code below:

import bpy
from os import getcwd

file = getcwd()+'/data/naturalSat/models/2_Pallas_101.obj'
print("Testing")
imported_object = bpy.ops.import_scene.obj(filepath=file)
obj_object = bpy.context.selected_objects[0]
print("processing: "+obj_object.name)
#Extract the mesh and smooth all polygons
output = obj_object.data
for face in output.polygons:
    face.use_smooth = True

bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.uv.unwrap()
bpy.ops.uv.cylinder_project(direction='VIEW_ON_EQUATOR', scale_to_bounds=True)

#export
filePath = getcwd()+'/'+obj_object.name+'.obj'
bpy.ops.export_scene.obj(filepath=filePath)

Am I doing this correctly? one of the concerns I have is that the cylindrical_project arguments is direction = 'VIEW'. I'm loading a python script using the command line, so headless mode.

I am not a professional myself, but the code looks okay, I guess. Your direction isn't "view", though, but "VIEW_ON_EQUATOR", you could also use "VIEW_ON_POLES", "ALIGN_TO_OBJECT", though: see the documentation

If it's "right" or "wrong" depends a little on the shape of your objects and how you want the unwrap to be aligned to it. Maybe try out all three and see which one fits best?


How do I access grease pencil data? I would like to be able to extract start and end points of grease pencil line tool, the one used for annotations in 2.80.

It would be great if I can get the data in 3d view and 2d screen view in Python.

thanks

Grease Pencil (GP) data structure is like this:

GP-Object --> GP-Layers --> GP-Frames --> GP-Strokes --> GP-Stroke-Points

Now, the python commands to get different GP-data,

#1) To get the GP-Object data
GPObj = bpy.data.objects['GP Object Name'].data

#2) To get the GP-layers, use layer name or index.
GPLyr = GPObj.layers['Layer Name']

#3) To get the GP-Frames, use index. But there are other properties of the layer
#   you can access e.g., opacity, thickness, select, etc. You can add or remove the frame.
GPFrm = GPLyr.Frames[0]

#4) To get the GP-strokes, use index. You can add or remove a stroke, change the
#   display-mode, line-width, material index, etc.
GPStk = GPFrm.strokes[0]

#5) To get the GP-points, you can use the index to get individual points.
#   You can add or remove points.
GPPts = GPStk.Points

and each point has info about the location, pressure, strength, uv-rotation, etc. With the help of "foreach_get()" function, you can get the location (or pressure, strength, uv-rotation) of all the points.

#6) To get the location of single GP-point
loc = GPPts[0].co


Select outer layer of hollow object I currently have a hollow sphere, and I want to select the faces on the outside layer of the sphere, but when I do B + LMB to select faces, it only selects the faces on the interior layer. Here's an example:

And here's a zoomed in version:

How can I select the faces on the outside layer?

If you are using a Solidify modifier, you can't select the 'virtual' geometry generated by the modifier separately until it is applied.

The faces coloured in orange here are the real geometry, and the grey faces are 'virtual' geometry, this can't be selected separately. If you want to do something with the outer or inner layer you will need to Apply the modifier, that makes all geometry of that object 'real'.


Keyframes Keep Disappearing! I've imported an fbx with an "in place" walk cycle from mixamo.com (see below). I then parented the armature to an empty as a way of animating the "in place" walk cycle (tutorial here). My problem is that with the armature parented to the empty, now I can't find the walk cycle keyframes. No matter what I click on, they will not appear in the dope sheet. In the outliner below, I've clicked on where I think they would be but they don't show up. Any thoughts on why those keyframes are not showing? Unfortunately, I can't get the blend file down to a postable size.

Here's what I mean by "in place" walk cycle:

I know this is an entire year late, but this worked for me. Click the button that says "Only Show Selected" (the arrow icon!)
Then my keyframes appeared. Apparently they're grouped under the vertex groups or something.


How can I make two objects look like one? As the titles says, I want two objects to LOOK like they are actually just one. I dont plan to actually combine anything, for flexibility purposes.

Here's an example scene for what I've got going:

Simple enough. But I'd like to make it so the sphere and cone seem to be one with their respective clipping objects.

I've tried such a thing with the Boolean modifier(with subdivision for smoothness) and it does achieve fake connection between objects:

But not to the degree I want. I'd like them to look like they are combined more smoothly, with wider angles and not such a tight wedge together.

I heard rumor of someone using a depth layer compared to other passes in some way to make things look blended together.

I see how that might make sense, as things within the same distance have nearly the same shade.

  ...shader which samples the depth texture in the transparent render
  queue, compares this depth with itself and sets its opacity based on
  the distance. (In order to sample the depth texture, the object has to
  be rendered in the transparent queue.)

I think this was something being done in Unity. But I can't understand what's being mentioned here. They even mentioned rendering this over only specific vertex groups in order to not end up blending ALL objects together.

Might anyone have any other suggestions? Or understand how to execute what's mentioned?

You can use the Bevel node that you can find under Input category in the nodes Add menu.

This will however require joining the objects, but it will give you a bit more control than booleans. If you need to move the objects, you can use Hooks:

If you run into other issues in your workflow because the objects are combined they might be possible to solve too.


How to enable GPU rendering with my Radeon card in Linux? I am currently running Ubuntu 15.04 64-bit on a machine with a Radeon R9 270X GPU.

I've grabbed the latest 64-bit Linux build from this page (currently 2.75-a08f8a4) and I have installed the latest Catalyst drivers directly from AMD's website (currently 15.20.1046-150622a-186193C).

However, no matter what I do, I still don't see an OpenCL option anywhere in Blender's user preferences:

What am I missing or doing wrong?

Note: I tried setting the CYCLES_OPENCL_SPLIT_KERNEL_TEST=1 environment variable but it made no difference.

AHA!

So it turns out that I needed the ocl-icd-opencl-dev  package installed. Once I installed that package...

\o/


Blender renders the input video instead of Composite node I stabilized a video in the Movie Clip Editor and used the result as a Stabilize 2D block in the Node Editor. But, when I animate it, it is reproducing the original video, instead of the Composite block.

I followed a Blender 2.72 tutorial by the letter, so it could have something to do with the version, but why would Blender get the input instead of the output? What am I doing wrong?

I solved it by trial and error. The Video Sequence Editor didn't have the scene strip. I thought the Composite block alone would override it if it were empty.


Error when trying to mirror vertex group, to get symmetrical weight paint This is my first character model. My mesh has had its limbs and centers weight painted (one leg, one arm, its head, its body) The mesh is symmetrical on the x axis, and im trying to mirror the weight paint from one arm to the other based on this tutorial: https://youtu.be/m3izfPRnS7Q

It says to clone one of your vertex groups and then use the little arrow next to the list of vertex groups and with the clone selected, press mirror vertex group. When i do this i get an error saying "0 Vertices mirrored,  4180 failed". 4180 is the number of verts in the entire model. I have looked at similar questions to this and tried their answers with no luck. I'm completely out of ideas.
Edit:

Okay, there are 3 things you'll have to change for this to work.

First, make sure your armature and model have their rotation, location and scale cleared. press Alt+G, Alt+S, and Alt+R, then position them so they are aligned again.

Second, make sure your naming conventions in the skeleton are consistent. The bones on the left should have the naming convention with a ".L" suffix, like for example "forearm.L". On the right side, bones must have the EXACT SAME name except with the ".R" suffix, otherwise mirroring weights will not work.
The easiest way to accomplish this is to create the left side of the armature only, name all the bones, and then mirror the left hand bones to the right side by centering the 3D cursor (Shift+C), scaling with the 3D cursor as the pivot point (.), then duplicating the left hand bones, right clicking so as not to translate them, then scaling them by a factor of -1 on the x-axis (S, X, -1, Enter). Then using Space Bar, search for the "flip names" command to change these bones from the .L suffix to the .R suffix.

Third, the mirror modifier will do all your weight-mirroring work for you since your mesh is already perfectly symmetrical. just delete all the vertices left of the origin. The mesh will even be poseable without applying the mirror modifier, and when the mirror modifier is applied, the weights will be mirrored.
Just remember to place the mirror modifier above the armature modifier.

I hope this is helpful!


Parent for trackers with python script I have this script:

import bpy
track = bpy.context.selected_objects

for i in track:

    bpy.context.scene.cursor_location = i.location

    bpy.ops.object.empty_add(type='CUBE', radius=0.05)

Track are the trackers and I want to parent the trackes to the emptys that where created.I try this script but it isn 't working:

import bpy

track = bpy.context.selected_objects
em = []

for i in track:
    bpy.context.scene.cursor_location = i.location
    new = bpy.ops.object.empty_add(type='CUBE', radius=0.15)
    em.append(new)
    bpy.ops.object.parent_set(em)

I just want to make my life easier.Thanks for any responts.

F.Y.I. : I 'm doing facial motion capture. I track the markers reconstruct them and then I did constraints to F-curves.I want the trakers-empties to align to the bones of the face of the pitchipoly human, before I constaint the bones location to the trackers-empties(copy location). I thought that this solution is simple, but the trackers-empties where too many so I thought to make a script.

Much simpler without operators, using API methods

import bpy

context = bpy.context
scene = context.scene
for o in context.selected_objects:
    # create an empty
    empty = bpy.data.objects.new("%sEmptyParent" % o.name, None)
    empty.empty_draw_type = 'CUBE'
    empty.empty_draw_size = 0.15
    # link to scene
    scene.objects.link(empty)
    # make object parent
    empty.location = o.location
    o.location = (0, 0, 0)
    o.parent = empty

All transforms (loc, rot and scale)

    # make object parent
    empty.matrix_world = o.matrix_world
    o.matrix_world = Matrix.Identity(4)
    o.parent = empty


Subdivide hexagon surface into equilateral triangles I'm not very experienced with Blender and I'm looking for a way to subdivide a hexagonal face into triangles. Basically I want to turn this:

into this:

while having the ability to control the subdivision level.

I know I could build the hexagon by hand, triangle by triangle, but perhaps there's a quicker way?

Well after some fumbling around I found a way to do it non-destructively.

You first have to subdivide your hexagon once by hand, you can do subsequent steps procedurally using modifiers

Poke the faces of your NGON hexagon with Alt + P
Eliminate every other radial edge so you end up with three quads
Add a Subdivide modifier set to Simple
Then add a Triangulate modifier
Adjust the subdivision level through the Subdivide modifier


Import vertices from .OBJ and then convert all to dynamically linked objects I am generating a large network of vertices and edges in another app and exporting them into a Wavefront (*.obj) file for import into Blender. All the vertices are in a group, say "nodes".

Is there a way to, after importing the .obj and selecting all the vertices in the "nodes" group, to dynamically link them to an object in another Blender file?

There are hundreds of these vertices and so adding objects at all their locations isn't feasible.

If working with plain unconnected vertices is a problem, I can replaces them with small cubes or something.  The point is to later convert them into dynamically linked objects to anything else of my choice.

NOTE: The main point is to just save time and resources when dealing with 1000's of duplicated objects that I may need to modify later.  So, the answer doesn't have to fit the question 100%, e.g., the dynamically linked part is optional.

Thank you,
Al

Blender's dupliverts feature can duplicate an object at every vertex of an object.

Parent the object to the vertices only object by selecting the object you want duplicated then shift select the object that has only vertices and parent them by pressing ⎈ CtrlP and selecting object. Then in the Object properties under Duplication enable Verts.


Extrude/scale on cylinder I'm trying to make a window in a tower but the tower is made with a cylinder (32 vertices), set smooth from the left panel (Tools > Transform) and select auto-smoth (30d°) in data panel.
The create a window using another object and a boolean difference operation.
when I extrude and scale to add detail on window the result is not clean (see screenshot 2 -> square things in the mesh).
Does anyone already handle this problem?

Made without Booleans, this sort of topology stands up to pretty close scrutiny, (if you don't mind the holding loops around the tower).

The extra vertical loops in the cylinder that help define the curvature of the arch were created by selecting the relevant edge-rings, and using CtrlE > Subdivide Smooth.

The arch can be formed  by selecting its central vertice(s) and in Proportional Edit, GZ, raising it/them in Z.

Then an inset and extrusions to create the holding perimeter and the thickness of the window, and an extra edge loop to hold the sharpness of its bottom corners.


How to make spiral stairs Im making a water tank and to its side i want to make spiral stairs. I have tried 2 method but did not work for me both. I have add a spiral curve so that a single stair can rotate along the curve with the dupliframes. Then i added a array modifier and empty to control. I got this result the stairs not matching the side walls. And i want the result of the curve rotating in that way i want my stairs to be curved. Any suggestion

New result with empty

With screw modifier result

A suggestion is to use the Screw modifier for the railing walls & keep the array for the steps. You can control the height of the screw with an empty and the diameter either by scaling in object or edit mode.


How to specify a traceset in OSL In the OSL spec, there is a an optional parameter in a trace call for a 'traceset'.

I would like to restrict a trace to only hit the same object. The solution I have right now is to get the object name and test the trace object name after it hits like this:

// start OSL code fragment
string thisobjname = "";
getattribute("geom:name",thisobjname);
int hit = trace(P,
           ((_var_42 - 0.5) * 2.0),
           );
string hitobjname = "";
getmessage("trace","geom:name",hitobjname);
if( hit && hitobjname==thisobjname)
           printf("trace hit the same object");
// end OSL code fragment

I tried the following, but it does not work.

// start OSL code fragment
string thisobjname = "";
getattribute("geom:name",thisobjname);
int hit = trace(P,
           ((_var_42 - 0.5) * 2.0),
           "traceset", thisobjname
           );
string hitobjname = "";
getmessage("trace","geom:name",hitobjname);
if( hit)
           printf("trace hit the same object");
// end OSL code fragment

How does the 'traceset' need to be formatted to work? Is there something else wrong?

I have traced this back to the OSL code where the 'traceset' is accepted and passed out to the compiled 'oso' file. This is further passed to Cycles to be executed and does indeed include the 'traceset' string.

However, on picking through the Cycles source code I came across the only reference to 'traceset' in the following function (trace) :

bool OSLRenderServices::trace(TraceOpt &options, OSL::ShaderGlobals *sg,
    const OSL::Vec3 &P, const OSL::Vec3 &dPdx,
    const OSL::Vec3 &dPdy, const OSL::Vec3 &R,
    const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy)
{
    /* todo: options.shader support, maybe options.traceset */
    ShaderData *sd = (ShaderData *)(sg->renderstate);

    /* setup ray */
    Ray ray;

    ray.P = TO_FLOAT3(P);
    ray.D = TO_FLOAT3(R);
    ray.t = (options.maxdist == 1.0e30f)? FLT_MAX: options.maxdist - options.mindist;
    ray.time = sd->time;

    if(options.mindist == 0.0f) {
        /* avoid self-intersections */
        if(ray.P == sd->P) {
            bool transmit = (dot(sd->Ng, ray.D) < 0.0f);
            ray.P = ray_offset(sd->P, (transmit)? -sd->Ng: sd->Ng);
        }
    }
    else {
        /* offset for minimum distance */
        ray.P += options.mindist*ray.D;
    }

    /* ray differentials */
    ray.dP.dx = TO_FLOAT3(dPdx);
    ray.dP.dy = TO_FLOAT3(dPdy);
    ray.dD.dx = TO_FLOAT3(dRdx);
    ray.dD.dy = TO_FLOAT3(dRdy);

    /* allocate trace data */
    OSLTraceData *tracedata = (OSLTraceData*)sg->tracedata;
    tracedata->ray = ray;
    tracedata->setup = false;
    tracedata->init = true;
    tracedata->sd.osl_globals = sd->osl_globals;

    /* raytrace */
    return scene_intersect(sd->osl_globals, ray, PATH_RAY_ALL_VISIBILITY, &tracedata->isect, NULL, 0.0f, 0.0f);
}

Note the comment /* todo: options.shader support, maybe options.traceset */ - this is the only mention in Cycles source of 'traceset'. So, although the 'traceset' is passed into Cycles from the OSL shader it is not actually processed. This would seem to show that the 'traceset' option of the OSL 'trace' call has not yet been implemented.


Trouble selecting and extruding specific polygons (python) Trying to extrude specific polygons. Instead, it's duplicating the whole mesh. I know some kind of updating is required, just having trouble finding the correct solution.

import mathutils,bpy

S=100
c1 =  mathutils.Vector((2/3,3/4,4/5))*10
c2 = -c1

for o in bpy.data.objects:
    bpy.data.objects.remove(o)

def Box(c1,c2):
    bpy.ops.mesh.primitive_cube_add(enter_editmode=False, location=(0, 0, 0))
    bpy.ops.object.mode_set(mode = 'EDIT')
    bpy.ops.transform.resize(value=[abs(n/2) for n in (c1-c2)])
    bpy.ops.object.mode_set(mode = 'OBJECT')
    bpy.context.object.name="Box"
    return bpy.context.object
box = Box(c1,c2)

def Extrude(box,S,c1,c2):
    epsilon = 1e-04
    mesh = box.data
    polygons = mesh.polygons

    bpy.ops.object.mode_set(mode = 'EDIT')
    bpy.ops.mesh.select_mode( type  = 'FACE'   )

    for c in [c1,c2]:
        for i in [0,1,2]:
            sa=[]
            pci=None
            for p in polygons:
                pci_=p.center[i]
                s = abs(pci_-c[i]) < epsilon
                if s: pci=pci_

                p.select = s

                sa.append(s)
            print(sa) # confirming the correct poly selections

            si = -1. if c[i]<0. else 1. if c[i]>0. else 0.

            movement = [0,0,0]
            movement[i] = ( (S/2-abs(c[i])) - abs(pci) ) * si
            bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value": movement})
Extrude(box,S,c1,c2)

seems vert and edge selection was being extruded too, so they needed to be cleared with bpy.ops.mesh.select_all(action='DESELECT'), and mode_set flips to update mesh's selection, and then extrusion result:

def Extrude(box,S,c1,c2):
    epsilon = 1e-04
    mesh = box.data
    polygons = mesh.polygons
    for c in [c1,c2]:
        for i in [0,1,2]:
            sa=[]
            pci=None
            bpy.ops.object.mode_set(mode = 'EDIT')
            bpy.ops.mesh.select_mode( type  = 'FACE'   )
            bpy.ops.mesh.select_all(action='DESELECT')
            bpy.ops.object.mode_set(mode = 'OBJECT')
            for p in polygons:
                pci_=p.center[i]
                s = abs(pci_-c[i]) < epsilon
                if s: pci=pci_
                p.select = s
                sa.append(s)
            si = -1. if c[i]<0. else 1. if c[i]>0. else 0.
            d = [0,0,0]
            d[i] = ( (S/2-abs(c[i])) - abs(pci) ) * si
            bpy.ops.object.mode_set(mode = 'EDIT')
            bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value": d})
    #bpy.ops.object.mode_set(mode = 'OBJECT')
Extrude(box,S,c1,c2)```


Are there any viable ways of using the particle system with micro-displacement? I've watched a couple of videos dealing with micro-displacement. On one of them, the author had mentioned that it doesn't support the particle system as of now. I know this is an experimental feature and would possibly solved by the next major release of Blender. Are there any suggestions for substitutes or any other methods for adding a particle system to such a mesh?

I had figured out how to solve that problem. I used a duplicated mesh without the adaptive displacement modifier and scaled it to a point where it barely beneath the mesh. However, I used that technique on a standard human mesh, so it may not work as properly on a highly irregular mesh unless that mesh matches the projected displacement.


What is the difference between a meta-object and a mesh I have been using Blender for a year now, and I have wondered many times,"What is the difference between a meta-object and a mesh?" What exactly is the difference? Why can a mesh not be calculated like a meta-object?
How does Blender calculate the material shaders for the metas?

According to the Blender Manual:

  Meta objects are nothing more than mathematical formula that perform logical operations on one another (AND, OR), and that can be added and subtracted from each other. This method is also called Constructive Solid Geometry (CSG). Because of its mathematical nature, CSG uses little memory, but requires lots of processing power to compute.

In contrast, a mesh object is defined by Wikipedia as follows:

  A polygon mesh is a collection of vertices, edges and faces that defines the shape of a polyhedral object in 3D computer graphics and solid modeling. The faces usually consist of triangles (triangle mesh), quadrilaterals (quads), or other simple convex polygons (n-gons), since this simplifies rendering, but may also be more generally composed of concave polygons, or even polygons with holes

Also helpful to see the Wikipedia page on Metaballs to further compare the differences between the two, and see the history of the object outside of Blender.

To directly answer your question, a mesh cannot be calculated in the same way as a meta-object, because a mesh object is described as a collection of vertices, edges and faces defining the shape of the object, while a meta-object is only a mathematical formula doing the same.


fence mesh duplicates along mountain plane I want to have a "picket fence" go along a slope, like this picture kind of:
I have a pre-made mesh for the ground (a.k.a., I don't want to remake it / automatically make the fence follow some kind of path, my actual mesh is an ANT terrain).
I can easily make the fence mesh from any number of tutorials (and duplicate it using the array modifier), but I'm not sure how to make it go around a mountain mesh / keep the same height etc. My mesh looks a like this:
I want the fence to run in a complete circle all the way around the mountain on it's slope.
Any ideas?

You can use Animation Node to create a spline that follow the surface of the terrain and then deform the mesh on it just as you described.

First, create a curve that define the path of the wall, sample some points on it, ray cast them on the terrain, create a new spline from those projected points:

The same applies for the any spline, a circle for instance:


How to reduce Noise in a Dark Cave scene So currently I'm watching Andrew Price's tutorial on "How to Make a Cave in Blender - Tutorial". I've made some progress, and decided to make a nice render - this is a screenshot of the rendering progress:

You can't see that well, but the rendering is at path tracing sample 2000 of 1000000 (one million). By then it's been running for two hours. But when I compare this picture with Andrew's final render of his cave, I notice the differences:

You can notice mine scene has a lot of noise compared to Andrew's, which is silky smooth (Even though my picture is bigger). How many samples should I have? Am I missing some rendering settings? Should I let the samples do their thing all the way to one million? (There's 1057 hours left... that is 45 days)

I've followed that same tutorial a while ago when I was just starting, and I might be able to help a tiny bit. This is what my result looked like:

That is 1440p. I think I used 2000-3500 samples for the final render. And I only used that much because I left my computer on overnight and while I was at school. It took a long time, somewhere in the realm of 14 hours.

That being said, I realized fairly early on that there is a limit to how good a picture can look given the scene and settings, no matter how many samples you use. I think my picture would have just as much noise if I used 10000 samples; after a certain point it just doesn't matter.

That being said there are several things you can do to increase quality and time of your render, and I highly recommend that you look up how to do all of these. Here are just a few of them:

Use GPU rendering rather than CPU.
Change the tile size to accommodate the type of rendering (CPU or GPU).
Turn down the amount of light bounces.
Use portals.
Bake the Lighting.
Decrease the resolution.

The most important thing you can do as a beginner at your stage is this: don't judge your render until you are closer to being finished, there is a lot you can edit along the way. Also there's absolutely no point to using an absurd amount of samples to preview an image, (again, until you're closer to being finished) you're going to add more to it anyway, and the preview isn't supposed to look like the final result.

If you're an absolute beginner, I would highly suggest starting somewhere easier. tutor4u (youtube) has some amazing step-by-step tutorials for a lot of things. As a novice myself, my main advice is to not overload yourself with scenes as advanced as the one you're trying to do, (and don't use 1 million samples, even 2500 is too much).


How to start/stop wind blowing at a specific frame? I am running a simulation where I have wind blowing a ball. Very simple stuff. I need the wind to stop blowing after frame 210. I did this earlier but now I can't find where I set the end frame for the wind. It was similar to the start and stop for the animation but it was specific to the wind. I am wondering now if I was seeing things. Help please! Thanks in advance.

Make sure the force field is not hidden. Select the force field (wind) in the outliner or 3D view. The key frames you set will then show up in the timeline and in the Animation Editor.

Insert a keyframe with a value of zero at frame 210 to stop the wind. If you want the wind to stop abruptly set a keyframe at 209 equal to the value of the keyframe before it.


One light for object shadow and another light for ground shadow i want to have a toon effect on the objects and for the ground shadow i need a different lighting angle, otherwise i have too long shadows... i work for this in cycles render mode.

have one SUN at the moment, and it casts a hard shadow on the objects.
how do i get the second SUN to just cast the ground shadow on the ground plate?

thanks in advance

This is doable with layers and render layers as cegaton suggests.  Here is one way to set it up.

Put all your objects (except ground and lamps) on layer A.
Put the ground on layer B.
Put the "object shadow lamp" on layer C.
Put the "ground shadow lamp" on layer D.

Set up your render layers as follows:
Render layer one (objects and object shadows): include layer A (objects) and layer C (object shadow lamp).  Exclude layers B and D.

Render layer two (ground and ground shadows): include layer B (ground) and layer D (ground shadow lamp).  Exclude layer C.  (Do not exclude the objects on layer A, you still want them to cast shadows.)

Don't forget to check "Transparent" under the Film tab in the render settings.  You can handle your background/environment in another render layer, with no objects and an Environment pass.

Then composite the two layers with an "Alpha over" node.

Objects and object shadows:

Ground and ground shadows:

Composite:

Composite with environment:


"Failed allocate render result, out of memory" on render - Cycles Blender 2.79b I am working on a little personnal project which contains two scenes (no animation, just a fixed render). Almost all the assets are linked from other blend files.

Yesterday, I rendered the first scene without problem.
I tried to render the second scene, and there is the problem. The viewport renders the scene just fine, but when I hit the render button, I just get an error message : "Failed allocate render result, out of memory".

I can't get why. It gives me this message on GPU render and CPU as well.

I work on Windows 7 64bits, 8Go RAM, nVidia 1060 gtx 6Go. Blender 2.79b.

Thanks,

Sorry guys !
I just saw I put "1000 %" on the render size instead of 100% ! That was the cause !


Initial animated particles on a force field path: How to control/hide? I can hide the emitter easily and control the end where the particles "die out".

Yet I'm also looking for a way to hide the initial portion of particles lumped up i front of the cue of a system with a path force field.

Yet I need a procedure to control/hide the initial particles on the curve like you can hide the "unborns".

Please keep in mind I'm going for the "non-curve-guide" method since I learned this will produce the best result.

Kind regards, Mikael

Texture mask to hide unwanted particles in center (red outline) but keep surrounding visible (green outline).

Emitter object's coordinates controls spherical texture which gradient splits material in two shaders: default and invisible (holdout or transparent BSDF for your choice).

Holdout is easier for render but needs compositing, while transparent with many overlayed particles need many transparency bounces to get clean results.


Why is the object move arrows no longer fixated to it? not sure what I did but when selecting the move tool the arrows around the object popup, however when I move the object the arrows themselves stay fixated. I would like the arrows to be fixed on the object itself like the default setting. Any idea how to fix this?

As per @FFeller solution in the comments I assigned the 3D cursor as the pivot point.
Docs


Snap two nearly identical objects exactly together I have two objects that were originally the exact same object.  I duplicated one, and then made changes to it, rotated it, cut it, etc...
I'd like to overlap it with the original (both objects pictured here):

And, regarding everything but the things I changed on purpose, I'd like it to overlap exactly.  I.e. not simply really close with trial and error of rotating, but for instance if I could pick 3-4 vertices on each object and have them snap to each other, that would be great.   Any idea how to do this?

If you haven't applied any of the transforms on your duplicate, pressing Alt+G should put it back where the original object was. Repeat that shortcut replacing G by R then S to cancel object rotation and scaling.
On the other hand, if you have applied transforms (with Ctrl+A), or selected all vertices then moved everything in edit mode, or moved the duplicate's origin in any way, then you will have to play around with the set origin and the cursor snap option. I would do it like this:

In Edit mode select one vertex from your duplicate (one that hasn't changed position), then press Shift+S and click on "Cursor to Selected"
In Object mode go to Object > Set Origin > Origin to 3D Cursor
Select the original object and in Edit mode select the same vertex, then like in the first step set the cursor to that vertex.
Back in Object mode select the duplicate and do Shift+S and click on "Selection to Cursor"

But...
... exactly overlapping faces don't get along. They usually fight over which one should be displayed and when Blender doesn't find a clear winner it ends up showing a bit of both which looks glitchy and wrong. One way around that is to scale up a tiny bit the part you want to show. Or even better, delete that part of the original mesh, then you can even merge back the two objects into one.


Rendering became grey after I added an object, not a clipping problem, screenshot attached My animation rendered great until I added a blender object to it, it became grey and is showing the added object as a plane object. Camera clip end is set at 4000m so not the cause of the problem. Any idea please?

From informations you provided:

I don't think your render became grey because you added an object
Grey render in your screenshot is probably Viewport Render Image
(see Manual for more info)
Fact that your render is OK now, with this kind of rendering, is probably because you switched viewport draw mode from "Solid" to "Render", but it has nothing to do with regular camera rendering it is still only viewport render.

To get proper camera render use shortcut F12 (or use this function via top row menu Render > Render Image)


Is there a way to render out an animation from the 3D view? Is there a way to render a sequence of frames from the "3D view" (not the final render, but in solid mode, for example), except the screen capture?

Click the movie icon beneath the 3D View

Here is the menu venue


Cryptomatte & Render Layers: is it possible to recover Cryptomatte from a .PNG sequence? I will try to explain my noob-problem a little deeper.

I have a 3-days-render just done as a PNG sequence. I enabled Cryptomatte pass before rendering, but I eventually realized that the png sequence doesn't have Cryptomatte pass.

In other words, I need the Cryptomatte pass, but I can't find a way to not to re-render the whole scene, possibly in another more compositing-oriented format like Open Exr Multilayer, making it possible to load the actual render in the compositor.

Another thing: I know that my render is stored somewhere in cache, where Render Layers load the actual render into the compositor. The problem is that this 3-day-render I've just done, has crashed 2 or 3 times during the whole process, so the Render Layer in my Blender project seems to be empty.

Is there a way to recover my Cryptomatte pass, without re-rendering again the whole scene?

Why is it, every time I close Blender, my Render Layer in the compositor seems empty, losing the Cryptomatte pass?

Thanks all
Guglielmo Ruben

Unfortunately there is no way to recover the Cryptomatte render passes, since .png isn't capable of storing them. For an explanation of the Cryptomatte format you can take a look at this answer. You will have to render it again and store the result in a Multi-layer OpenEXR.

  Why is it, every time I close Blender, my Render Layer in the
  compositor seems empty, losing the Cryptomatte pass?

Blender caches the last rendered frame and its render passes for compositing, they're not stored in the .blend file though and therefore not persistently written to your hard drive. Once you close Blender that data is gone.


HIDE_HEADER in bl_options over rides the panel location in the UI I am assembling my first add-on and I have a particular order I would like my panels to stay in inside the UI. This is easily done by rearranging the order in which each panel is registered.

However, one of my panels I would like to hide it’s header and as soon as I use the bl_options to remove the header my panel jumps to the top of all my panel list.

I have a quick test code shown below with 3 panels. As you can see I have it setup so panel 3 shows up second in the panel UI. Run the script and you will see the 3 panels N Panel in the order as intended. Then un-comment the line "#bl_options = {‘HIDE_HEADER’}". Then IMPORTANT close blender. Reopen blender, run the script and the panel 3 header is hidden but it moves to the top of the list. If you DO NOT close Blender and rerun the script after the change the panel stays in place and hides the header…it appears to work. But this is the last UI register. You have to close Blender and reopen to get it to reset the UI and see the issue.

import bpy

def main(context):
for ob in context.scene.objects:
print(ob)

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

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

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

class HelloWorldPanel1(bpy.types.Panel):
bl_label = “Hello World Panel1”
bl_idname = “OBJECT_PT_hello1”
bl_space_type = ‘VIEW_3D’
bl_region_type = ‘UI’
bl_category = ‘Mine’

def draw(self, context):
    layout = self.layout
    row = layout.row()
    row.operator("mesh.primitive_cube_add")

class HelloWorldPanel2(bpy.types.Panel):
bl_label = “Hello World Panel2”
bl_idname = “OBJECT_PT_hello2”
bl_space_type = ‘VIEW_3D’
bl_region_type = ‘UI’
bl_category = ‘Mine’

def draw(self, context):
    layout = self.layout
    row = layout.row()
    row.operator("mesh.primitive_cube_add")

class HelloWorldPanel3(bpy.types.Panel):
bl_label = “Hello World Panel3”
bl_idname = “OBJECT_PT_hello3”
bl_space_type = ‘VIEW_3D’
bl_region_type = ‘UI’
bl_category = ‘Mine’
#bl_options = {‘HIDE_HEADER’}

def draw(self, context):
    layout = self.layout
    row = layout.row()
    row.operator("mesh.primitive_cube_add")

classes = [
SimpleOperator,
HelloWorldPanel1,
HelloWorldPanel3,
HelloWorldPanel2,
]

def register():
for cls in classes:
bpy.utils.register_class(cls)

def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)

if name == “main”:
register()

Any ideas of how to keep this from happening would be greatly appreciated.

Sub Panels

Blender now has subpanels. Recommend making "Holding Panels" and make your other panels children.

Example https://blender.stackexchange.com/a/155517/15543

On rearranging panels

  This is easily done by rearranging the order in which each panel is
  registered.

Maybe a poison chalice.  Remember the user can move panels around. The expected result is the register order.  Been my experience this is (generally but) not always the case.  Registering panels in startup scripts places them higher than via addon.

As mentioned above, would now use subpanels.

If the same issue is the case re a headerless panels panels moving to top, recommend using an appended or prepended draw method.

Here is example rejigged from link above

Panel 2 and 3 are children of panel 1. Both panel 1 and panel 3 are set to hide header.

2 results of running script below. Both preserve order. The render of the no header subpanel is strange (bg color).  Panel 1 is Ok, perhaps explains why no header panels are moved to top.

import bpy

class EXAMPLE_PT_panel_1(bpy.types.Panel):
    bl_label = "Panel 1"
    bl_category = "Example tab"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_options = {"HIDE_HEADER"}

    def draw(self, context):
        layout = self.layout
        layout.label(text="This is panel 1.")

class EXAMPLE_PT_panel_2(bpy.types.Panel):
    bl_label = "Panel 2"
    bl_category = "Example tab"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_options = {"DEFAULT_CLOSED"}
    bl_parent_id = "EXAMPLE_PT_panel_1"
    def draw(self, context):
        layout = self.layout
        layout.label(text="This is panel 2.")

class EXAMPLE_PT_panel_3(bpy.types.Panel):
    bl_label = "Panel 3"
    bl_category = "Example tab"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_options = {'HIDE_HEADER'}
    bl_parent_id = "EXAMPLE_PT_panel_1"
    def draw(self, context):
        layout = self.layout
        layout.label(text="This is panel 3.")

classes = [ EXAMPLE_PT_panel_2, EXAMPLE_PT_panel_3]

from random import shuffle
shuffle(classes)
classes.insert(0, EXAMPLE_PT_panel_1)
print(classes)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)

def unregister():
    for cls in reversed(classes):
        bpy.utils.unregister_class(cls)

if __name__ == "__main__":
    register()

Here is another example that dynamically generates n panels.  Test script uses driver namespace to hold panels to unregister while running from __main__

Gives some options to play around with. There is a bl_order flag that the base PropertyPanel (Custom Props) uses always be at the bottom.

import bpy
from  bpy.app import driver_namespace as dns

for p in dns.get("panels", []):
    if getattr(p, "is_registered"):
        bpy.utils.unregister_class(p)
else:
    dns.get("panels", []).clear()

from random import shuffle

use_parent_zero = True
hide_second_headers = False
n = 5 # number of panels
shuffle_order = True
random_shuffle = False

order = list(range(n))
if shuffle_order:
    shuffle(order)

class TestPanel:
    bl_category = 'TestPanel'
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"
    bl_order = 0

    def draw(self, context):
        layout = self.layout
        cls = self.__class__
        layout.label(text=f"{cls.bl_label} Order {cls.bl_order}")

panels = [type(f"Panel{i}",
                (TestPanel, bpy.types.Panel),
                {"bl_label" : f"Panel {i}",
                 "bl_idname" : f"TEST_PT_Panel{i}",
                 "bl_order" :  TestPanel.bl_order + order[i],
                 }) for i in range(n)
                 ]

panels.sort(key=lambda p : p.bl_order)
if random_shuffle:
    shuffle(panels)
print([(p.bl_label, p.bl_order) for p in panels])
for i, p in enumerate(panels):
    if i and use_parent_zero:
        p.bl_parent_id = panels[0].bl_idname
    if i % 2 and hide_second_headers :
        p.bl_options = {'HIDE_HEADER'}

    bpy.utils.register_class(p)

dns["panels"] = panels

About the only conclusion is sub panels are displayed in registered order.


In need of help concerning making a knot animation (paths etc.) I'm in need of help to get the same result as the one shown in this video: https://www.youtube.com/watch?v=Gk5tOOD_ArY&t=39s . I'm wondering if there's a guide how to make something like this. Please help.

My main problem is parenting the rope to a path so that the whole rope follows/curves along the path.

You don't have to move the rope, Depending on how you construct the rope you could animate either the Bevel Factor or the Dupliframes end frame, and have the rope 'grow' along the path.  It seems that this is what they've done in the linked video.  Albeit with some rotation to make it appear to be moving.


Animation does not Scrub I'm using mp4 video projected onto a 2d plane in the 3d viewer, but cant get them to animate or scrub through timeline in texture or material mode unless I open up an extra window with cycles render on. Is there a way to simply allow it to animate without having to open up an extra render preview window?

PS: Thanks for the support on my last questions. you Blender Gurus are the best!

If you use video as reference, best way to do this - using image empty.

Image empty always shows current frame; over methods, that i'm tried gives +-1 frame offset. To add image empty press Shift+A -> Empty -> Image


UV unwrap causing texture to warp So here is the front face of the house i'm modelling. it's completely flat of course. Once i tried to UV unwrap it all the edges are going off in strange angles making the texture applied looking warped. The left window is particularly severe in this case

(the texture on  the interior doesn't matter since it cant be seen once rendered)

I watched a blender guru video and he mentioned that i should keep all faces with 4 edges, creating a square so that's what i've tried to do throughout this project. Can provide any additional pictures or info if needed.

Any help much appreciated thanks <3

Once you have your model done, then do the unwrap. It looks like you are trying to do the unwrap as you go, and the model is not square and level in relation to the vertex positions. If you select all the faces there in the front of the object and in the matching view select 'project from view' then the texture should not warp - but you will need to do this for each side of the model, and you will have to adjust for scale matched to the texture.


Can't flip pose properly I have a problem with flipping pose, I try to do the same thing as in this tutorial. On 3:25, he flips the pose by Ctrl+C, Ctrl+Shift+V. In my case, it only flips some rotations, but legs stay in the same place:

I did everything exactly like in this video.
I've tried to changing from "ZYX Euler" to "Quaternion" (saw this in some other question here) but it didn't helped.

Here is my blend file: http://www.pasteall.org/blend/37298

Your IK foot bones are not named properly that's why blender doesn't know how to mirror your pose.
Give them IDENTICAL name with Left and Right prefixes (LeftFootIK, RightFootIK)


Bending a model with Simple Deform vs Lattice that's Simple Deformed Why shouldn't I use the Simple Deform modifier directly to bend a mesh?
Details
I made a low-poly shield that's flat.  To bend it, the tutorial I followed suggested to use either

Proportional edit (with a decent falloff curve)
Lattice modifier

Another shield creation tutorial demonstrates option 2 where the lattice itself is made a tight bounding box of the shield and then deformed using simple deform.  The model itself is applied the lattice modifier with said lattice.
When I asked the tutor if I can apply directly use Simple Deform, he said "not really", without explaining himself.
Why do people go through the lattice way?  Why is it not advisable to directly use the Simple Deform modifier on the mesh itself?  Blender's manual seems to use it as-is while experienced modellers don't.  What am I missing?

Different out-of the box outcome
My wild guess would be that you'll simply not get the same deformation. Propotional editing is using a smooth falloff by default, while the Simple Deform modifer is bending linearly...it's a nuance, but if you try, there is a different shape as outcome. Same for the lattice modifier. With the Simple deform modifier you basically get one thing, with the other you have more room, they are more flexible.
At the end I think he is suggesting to use the tool beacause without it you'll not get the exact deformation he was looking for.
You can easily experience the difference by doing the inverse: try to get a perfectly circular deformation using proportional editing. You'll find more challenging than you expect.

Another reason could be that you cannot straight use the Simple deform modifier, but you'll have to rotate your object from the XY plane to get a proper result, while in all the tutorial the shield is right on that plane.


Where is the implementation of the Cycles image-nodes sampling? Where is(are) the function(s) that, in the image node, transforms a point in UV space (vector that goes into the node) to a color (color of the pixel of the texture)? I can't seem to find such. Thank you very much in advance.

What you are looking for is in

\scripts\addons\cycles\shader\

You want to look into:

node_texture_coordinate.oso
node_image_texture.oso

You will find there links to appropriate .osl or .h files.

In those you will find the code and implementation.


Remove double vertices for multiple objects at once I'm using cell fracture to cut a model into a lot of objects and need to uv map the insides of the faces correctly onto the same UV map as the outside faces.
By using a UV project modifier for the inside faces, the inside faces are unwrapped, but in a separate UV map.

I need to export it to unity3d, which only uses 1 uv map, so I need to copy the UV coordinates in the inside map to the outside map.

I found some ways that would get me close, but I need to do some operations by hand for each object, which takes too much time.

I could join the all the objects, but then I would need to separate each piece one by one, as cell fracture also splits edges, meaning I cannot use P> by loose parts to split all the pieces back into individual objects.

If I could remove double vertices and make the inside faces and outside faces for each piece connected, I would be able to separate by loose parts after I joined and unwrapped, so is there a way to do this for multiple objects all at once?

Is there a way in blender to repeat a certain action (e.g. remove doubles) on multiple objects?

You can disable the edge splitting behavior of cell fracture:

Or if you don't want to re-fracture your object, you could join all the objects and then remove doubles. This way the split edges should be re-joined, and separate by loose parts should result in the same objects as before the join.


How to create a continuous flow of water? I have built a water slide and pool and I want to make a animation of the water running down the slide and into the pool. The problem is I need the water to be created at the top and go away at the bottom to create a continues stream of water. What would be the best way to do this?

You will need an Inflow object and an Outflow object.

Setup your domain object. Add a cube that encloses the entire area you want the water to go (don't make it to big though, as the larger it is the more CPU time your bake will require). Then add a fluid modifier in the Physics panel with the type set to Domain
Add the inflow object at the top of the slide and the outflow object at the bottom. Add fluid modifiers with the appropriate types to the objects.
Add an Obstacle type fluid modifier to the slide and anything else you want to collide with the fluid.
Bake


How to make particle grains move across screen on render? So for a video I'm working on, I'm trying to achieve an older film effect so I followed this tutorial:

https://youtu.be/-1zr1zFQawA

I worked out surprisingly well for the most part but I noticed that neither the vertical lines or grain move across the screen in the video like they're supposed to.

Watch closely from 43:30 - he adds a keyframe to some node values and then adds a noise modifier to the the keyed value.

A little later about 47:05, he adds a translate node and keys the x and y values to get some parts moving across the screen.


Why are my faces warped? I'm having a weird issue with these faces.  In the first example, I used the boolean modifier to cut a hole, and as you can see the faces around the knob have this warped/sunken look:

In this second example, I extruded a face and the same result happened:

Does anyone know what's going on here?

Click on the mesh and go to vertex tab and click auto smooth


how to save material library Q1. I have made 2 material and i want to save the material for life time. When ever i open in the material it should be saved in the material list and when i need i have to just click and use it. Is it possible if yes then how?

Q2. And where the file is store so that i can attach that file to my mail if the blender is corrupt i can again install that material file again.

The Blender default start-up file is named "startup.blend". On the version of Windows that I use for Blender, the file is located in a sub-folder of the users folder on the drive upon which Windows is attached named AppData\Roaming\Blender Foundation\Blender\VER\config, where VER is the Blender version number. I don't know enough about Blender on other platforms (MAC, Linux) to know exactly where the startup file is located there.

One way to do what you want is to start a clean instance of Blender, create your desired materials as data blocks assigned to the default cube, and then overwrite the default startup.blend file with the version you altered. Doing this will make the material library permanently available as part of the start up default. Note, though, that if there is a chance that you might want to use the original default file at some point, you may want to create the desired materials as a data block or data blocks of the default cube, and use the "Save startup file" option of the file menu (keyboard shortcut CTRL-U) to save a copy of the start-up file which would load instead. Doing this, will allow restoration of the default start-up file, by choosing "Load factory settings" on the file menu more easily than if you overwrite the startup file.

Instead of assigning the materials to the default cube, you can create your two materials ans click the F button next to the material's name (Save datablock even if it has no users)
that will allow you to save your startup and keep your materials always available without assigning them to your cube.


Pixelated reflections in eevee I created a glass material using the Principled BSDF node. I have a high resolution hdri set as the world environment texture.
However the reflection in the glass material looks very pixelated.

Does anyone know the reason behind this?

OK, I think I found the solution. In render settings, go to Indirect Lighting and increase the Cubemap Size. Increasing Filter quality also helps.


Particle Modifier - Repeat for Infinity I'm wanting to create a wave-like effect where particles are emitted from a mesh every X number of frames.
Particle modifiers have a Start and End frame setting, but what if I just want that particle modifier to repeat itself for infinity?  I want the particle system to spawn some particles, stop for a set time, then spawn some more particles, creating waves of particles that will keep coming forever.
I don't know how to do this with blender.  It is a start and end particle system.  That's it.  What can I do?

You can control particles emission with animated Black & White Color influencing an emission Density.

In this example

particles are emitted from circle's vertices (but source can be Face or Volume as well)
by default are particles emitted all the time
with Texture (Color) you can influence density of emitted particles

Technically you don't let blender to stop / start emitting particles, but texture says how much dense particles should be emited. Black color means emit zero particles, White means full density of emitted particles.
Animation Sequence
Go to Particles Properties editor > Texture and ad New.
Switch tab to Texture Properties and select type Image, simply because it is black by default, so you don't have to setup nothing else. Just go to Influence panel and enable Density

Now you have two options

animate color from black to white or
I decided to animate Density parametr from 0 to 1

... means zero influence of black density - it let particle system emit as normal, one means full influence of black density that is zero particles.
If it is too overhead you can choose first option and in Texture enable Color Ramp and animate color. Result is the same.
Set one cycle of keyframes and go to Graph editor and change interpolation T to Constant that will works like switch ON/OFF in time.
Animation Repeat
To let blender repeat this animation open Graph's editor properties (side panel) N, go to Modifiers tab and add Cycles


How to do this type of trailing effects? Here is an example of how I wanted to do those types of trailing effects as seen in this video:
https://www.youtube.com/watch?v=zXOAtC7MOLE

Now how do I do this effect in blender?

In order to reproduce the effect it is useful to know how it would have originally been produced.
At the time of the original effect being produced (early 1970s) there were not the digital tools available now. All video effect would have had to have been produced either via completely manual processes or via analog video editing techniques. In this particular case the effect is produced via video feedback where the existing image is fed back into the next frame so as to produce the 'ghosting'.
The video would have been shot in reverse (so the ghost images would have projected back from the text instead of coming out of the background) and the frame sequence reversed (by playing back in reverse). Multiple instances of the same shot would have been overlayed (with colour adjustment) and used to mask out the preceeding sequence so as to layer multiple colours over each other to produce the final shot.
We can produce similar results with a very similar (but much less labour intensive) process.
The first step is to set up the 'video feedback' to produce the ghosting. This has already been covered in https://blender.stackexchange.com/a/212906/29586 where it's used to feed back the previous frame for a 'life' simulation. The same technique can be used for other feedback effects.
Setup the scene with the camera pointing at a plane. Place your 'text' object (or whatever you want to 'ghost') in view of the camera.

Set the output path in the render output properties to a suitable location and create the material for the plane.

The Image Texture is set as a 'sequence', pointing at the same location as the render output location. The number of frames should be set to at least the number of frames of your animation and the Offset set to '-1' to indicate it should be one frame behind the render.
Rendering the animation should result in no change in the image (since the rendered image from the previous frame is the same as this current frame).
Alter the material so as to inject a difference between the frames and show/hide your text at appropriate times. I opted for a rotation, zoom and distortion - similar if this had been achieved with a 'real' camera, producing the following material and result.

Now the VSE can be used to combine and layer mulitple sequences together with Modifiers used to adjust the colours. The final frame is retained at the end for persistence.

Note that here I've imported the Strip from the relevant frames of the redered result. In the strip properties (on the right) the 'Reverse Frames' allows you to reverse the sequence. I've added a 'Color' strip at the bottom for a black background and set each of the 'layers' Blend mode to 'Screen' so that they overlay. Duplicating the strip and offsetting each duplicate gives the different 'layers' and the Modifiers can be used to adjust the colour with a Color Balance modifier.
This produces the following result :


Red & white dotted line on outside of view Idk what I pressed but I can't get this red & white dotted line to disappear. It's preventing me from using my shift/ctrl movements with mouse scroller while having circular/rectangular selection active. Anywho know how to deactivate it?

The border looks like a Render Border (activated by Ctrl B in the 3D view in Object Mode). It can be deactivated with CtrlAltB.

I don't think it's connected with navigation being disabled while in brush (circle) select mode. The scroll-wheel is taken over to determine the size of the brush, and Shift is occupied to switch from select to deselect.


Light reflection and refraction in Blender Internal? I have noticed when trying to make a mirror in Blender that it does not reflect light onto other objects properly.

Also, it seems that setting the IOR (Index of Refraction) for transparent objects does not effect light either.

How do I get reflection or refraction effects in Blender?

You need to use a ray-tracing render engine. Blender's internal render system has a ray-tracer, but it doesn't have the ability to reflect or refract light beams. You could possibly use Cycles for this.


Error in script for the BGE AttributeError: KX_GameObject.worldLinearVelocity is missing a physics controller

This module stops running when it meets the "cam.worldLinearVelocity" command keys. It used to run before I parent the camera to an empty and the empty to the vertices of a cube.

In the lines where the error occurs I changed the camera speed so the camera would move accordingly when the mouse cursor would be near the edges of the screen.

Below are 2 pictures to clear things a bit and the module itself.

 (even if I change the empty and the cube player into dynamic or static nothing changed, same error)

import bge

bge.render.showMouse(True)

scene = bge.logic.getCurrentScene()

cont = bge.logic.getCurrentController()
sens_wh_up = cont.sensors["wh_up"]
sens_wh_down = cont.sensors["wh_down"]
cam = scene.active_camera

mousePos = bge.logic.mouse.position
mX = max(0.0,min(1.0,mousePos[0]))
mY = max(0.0,min(1.0,mousePos[1]))

if mX < 0.05:
    cam.worldLinearVelocity.x = -5*(2-mX)
    cam.worldLinearVelocity.y = (0.5-mY)*5
elif mX > 0.95:
    cam.worldLinearVelocity.x = 5*(2+mX)
    cam.worldLinearVelocity.y = (0.5-mY)*5

if mY < 0.05:
    cam.worldLinearVelocity.y = 5*(2+mY)
    cam.worldLinearVelocity.x = -(0.5-mX)*5
elif mY > 0.95:
    cam.worldLinearVelocity.y = -5*(2-mY)
    cam.worldLinearVelocity.x = -(0.5-mX)*5

cam.worldLinearVelocity *= 0.9

if (sens_wh_up.positive):
    cam.ortho_scale = cam.ortho_scale+5
if (sens_wh_down.positive):
    cam.ortho_scale = cam.ortho_scale-5

What am I doing wrong? What exactly is the physics controller that I am missing?

If you parent a physics object to another object it becomes a static object.
  Therefore there is no velocity anymore.

It was answered to me in another forum.Thanks for all the effort.I 'll mark it answered if I find how.


Maya LT / Cinema4D Rig to Blender? Is there a way for us to export Maya LT or Cinema4D Rig to Blender?
Even if we need to redo the controls, it'd be a great start!

Cheers

You always have the possibility to handle the I/O using FBX. FBX can save skeletal and skinning information. Constraints and controls would have to be rebuild. Also the bone orientations and rotation orders might be different and need to be adjusted manually, depending on the import and export settings. All in all if you manage to reduce the source file to just skinned mesh, you should be able to reuse at least some of the work you have already done.


How to open a .glb or .gltf file in blender? My question is about opening .glb or .gltf files in Blender. I don't see these extensions in the Import options, although Export allows me to create files with either of those extensions.

Blender comes with glTF-Blender-IO pre-installed since 2.80.

This is a refactoring of the original Khronos glTF exporter, combined with @Julien's importer.  Both of the original projects should be considered obsolete in favor of the newer, combined glTF-Blender-IO project.

The Blender Manual includes documentation on ways to use glTF.


How to delete recorded position of mesh on animation timeline? I've got problem with my animation. I've got a sword in my scene, but I somehow animated it so that its handle starts falling down when I play through the timeline, and I don't know how to delete this.

Look at the picture, there's some orange line at timeline bar - that's what I want delete.

You set the handle as a rigid body. The yellow line in the timeline shows you how much of the physics Simulation is cached. To delete the rigid body and all of the motion calculated from it Select the handle, then in the physics tab of the tool bar press remove.

You can also get to the physics settings in the physics tab of the properties window.


Jittery physics trying to get a tube to roll in 2.8 I've subdivided and extruded, then copied, rotated and joined the base shape to create a grooved frame. The center of mass is the center of the frame.

I've then added a cylinder to sit inside the groove. I tilted the grooved frame slightly so the cylinder will roll. The center of mass on the cylinder is correct.

I've given the frame the passive rigid body property and the cylinder active. Both set to mesh. This is what happens:

I tried all the stuff in this previous answer:

Rigid Body Problem - objects not colliding

Any help is much appreciated.

EDIT:

I went back and re-built everything using some of the suggestions and still no luck. Uploaded the .blend this time.

I find if I turn these settings up and turn sensitivity,Margin to 0 I get good results in similar simulations.


Problem with getting a clear and smooth glass surface Dear Blender Community,
right now I am trying to make a transparent glass shape with objects inside.
I tried to smooth the shape via subdivison and smooth modifiers.
With the subdivision the glass has a nice clear look but i get a lot of hard edges

Without it appears smoother but unfortunately it is appears less clear

Do you have an idea how I can get a smooth an clean look for the shape.
Thank you :)

topology without subdivision

topology of the model with applied subdivision results in having bulky edges

A couple of changes to default settings
The Principled BSDF shader has a default Base Color around .8, which means glass will be a little dark by default.  You can raise the base color to 1.0 for perfectly clear glass.
These dark spots -

are caused when the light reflects internally a number of times that exceeds the number of bounces allowed in render settings.

Usually it's the number of Glossy bounces which you can change here:

You can learn more listening to this talk.
To the model
When modeling for subdivision it is often to your advantage to leave your mesh as low poly as possible, and let the interpolation algorithm do the work of placing the additional vertices with mathematical precision.  Shade Smooth will do the rest by interpolating the normals between the generated faces.
Observe the following model, and see how it is represented in edit mode.

(5 levels subdivision)

The glass tubes might be easier to construct using a curve.  This takes a lot of the work out of positioning.  I added a solidify modifier to this curve.

As a bonus, the curve may serve as a constraint for animation.


Rigid Body Issues (Chain is passing through object and not following the mesh) I created a simulation setup where chains fall on the object and the object moves and physically the chain should move along but it is not happening so. The chain stays there and the object moves away.

This example uses the same arrangement mentioned in my comments above in that the falling object is parented to another which is to drag it along (or down) with it.   It's been done in Vers 2.77a. (Blend file below)

With this one, a necklace wouldn't be rigid when it lands, so it's best to keep the array and curve modifier's active so both can be adjusted to emulate real world physics. i.e. deform the necklace's curve.
Soft-body physics etc. can be tried but for this sort of job emulating physics with a few simple keyframes and hooks is arguably more effective and efficient.
To begin with, a circle curve in Edit mode has just 4 control points.  Intermediate CP's can be added by selecting two adjacent points and using "Subdivide". (press W)  Reshape the necklace as necessary at frame 1.
Six CP's are used here.  Nth, East, Sth & West, with two subdivides, SE & SW.
If it's going to be noticed, the chain's array modifier's link offset-value, will need minute adjustment via a keyframe when the array comes to rest.  This will prevent an overlapping link appearing at the array's original starting link.
Animate the hooks to deform the curve-circle and emulate physics.  The Graph editor makes this a relatively simple task, reshaping each hook's curves accordingly.  (See the Blend file -> Graph Editor)
-============-
The large circle-empty designated "Nav" (navigation), parents everything involved with the necklace. i.e. the original array, the curve circle, and hooks, to keep it all together.  The 'Nav' in turn is parented to the bust.
It's the Nav-empty that's keyframed to take the whole thing down initially, and on impact the hooks take over to deform the necklace's curve-modifier.  The bust when moved, takes the whole thing with it.
You would do the same thing when the bust (or character) is moving about, simply deform the necklace's curve to suit and emulate physics once more.
If you're looking to the physics engine to do it all for you as a game engine might, I'm not sure that would be practical in Blender.


Is there an easy way to select the side of a disk-shaped object? I have downloaded a few models from a site that the presenter in a YouTube tutorial mentioned. The ZIP files contained several formats like 3DS, but since Blender seems to understand only "obj", I used that format. The problem is all models I downloaded from that site are one giant object without any texture. That is, a table is one object, and a chair is one object.

So, I think I need to select a logical part of the object and apply different textures. The presenter seems to have applied a metal texture to the side of the table and a wooden texture to the top surface, but he did not explain that part. So, I am not sure how to select the side of the desk object.

Other than manually clicking all the faces on the side, is there an easier way to select the side of a disk-shaped object?

In Face select mode you can select areas bounded by seams.

At some time or another you are probably going to have to UV unwrap your models to add "image" textures so why not start now :)

Once the seams have been added then you can select individual areas bounded by seams with the L key. see screenshots below


Some meshes follow the armature and some don't I'm new to blender and hoping to get some help! I'm playing around with the animal crossing models available on the-models-resource. The models are already rigged. I'm able to get the clothing and shoes meshes to move with the body by selecting the clothing mesh > modifier properties > set the body's armature to be the one mesh deforms with. This works for clothing and shoes. For some reason it does not work with hair and headgear, does anybody know why?

Dress and shoes working as intended

Hair and hat don't follow even though all settings are the same...
Here's the file: https://pasteall.org/blend/61aa6f7e31bf47f3a17ba91ce420e41b

This rigging seems messy, probably because it comes from a game that has its own system, so it would take too long to fix it all, but a quick fix for the hat for example: Go in Edit mode, select all the vertices, go in the Properties panel > Object Data > Vertex Groups, change the name of Root to Root.001, which is the name of the bone that is supposed to control it, then click Assign.


Blender 2.82a very slow compared with 2.79 I am coming back to use Blender after a bit of a break of a couple of years. I did a lot of work using version 2.7x. I am now trying to use version 2.82a.

My PC is running Linux Mint 19.3 I have 32GB RAM, 16 Core Ryzen Threadripper 1950X and 12GB GTX 1080Ti. I have the nvidia drivers installed and I am using CUDA.

What I find that for a modest sized model (approx 1M verts) version 2.79 is very responsive with zero lag. With 2.82a everything lags, not just zooming or moving the model but also menus and any selection can take seconds.This is in Solid viewport mode, so no textures or rendering.Render speeds are OK.

Are there any ideas as to how to fix this?

Thanks
Baz

I had this same problem and I found a few ways to fix this. By default, the resolution % in 2.8 is set to 100%, whereas it was always 50% before. This only applies to renders however, not really anything else. You can find it in the Output tab underneath your dimension. Another thing you should do is make sure Blender is using your GPU. In your Render tab it may tell you it's using GPU compute but you need to go into your Preference settings and make sure it is using Cuda. I found all this out this morning and my render times went from 2 minutes to 12 seconds, and my playback is a lot smoother.


material request for this soft body object I am having some trouble getting the material just right for the look of this object.
appreciate any help, thank you

Here is a try, basically it's a mix between a basic color with a Wave texture plugged into it (perturbated by a Musgrave), a Subsurface Scattering in order to give it this kind of translucency, a Layer Weight to give it emission on the circumference and a bit of Emission to keep the translucency even in the dark areas:


Blender Importer/Exporter Addon updating to 2.8 I guess I need help. I have a plugin (not my code, no OSL) that was written for Blender 2.7x and was working well. It was importing and exporting certain game specific mesh formats. Now I am trying to convert that script for my personal use to Blender 2.8x.
Never been written some Blender addon at all, so my first attempt. A lot of changes I've done already and the plugin is flawlessly activating/deactivating in Preferences now, which is good.
My problem was: I was checking import/export menu (like I am used from Blender 2.7) but the addon doesn't show the options there. First I thought it was not working but I've noticed now it is in the Shift+A menu (where it adds a new type, which is working as well). But it's very unusual to have importer/exporter options in that menu? :)
Can someone point me in the right direction why it is doing that and how I can get it in the exporter menu properly?

and to answer my own question, finally I found it via Texteditor.
The needed command is TOPBAR_MT_file_import e.g.
bpy.types.TOPBAR_MT_file_import.append(menu_func_import)


Boolean not working for all faces in an object Blender 2.79b, Win7/64...
I've combined several mesh objects into one (using Join) in order to operate on them all with one Boolean shape without having to duplicate lots of modifiers (and other things).

However, at least one part of my new combined object seems to ignore the Boolean modifier. Here's the object:

I've highlighted the part which doesn't get Booleaned.

Here's the result of Boolean intersection with a scaled cylinder:

Also, note that the corresponding component on the left side is completely absent when the Boolean modifier is applied.

For completeness, here's the Boolean flipped to Difference mode. Again, one of these components is absent, and one is unclipped, but the other way around from the Boolean=intersect case:

So, I'm wondering... These components are identical, and so one was a copy of the other, flipped and translated. I didn't apply the location or rotation before joining. So I'm thinking that maybe when the Boolean modifier is active, one of these components is correctly clipped, but the other one is flipped and translated to be on top of the first one, and is missed by the Boolean modifier. Maybe.

However, what I'm missing is understanding how the rotation and position of components can persist even when they're all combined into one object. And more importantly... how to fix this! I tried separating by loose parts, then applying position and rotation to those two components, then re-joining, but it didn't change anything.

Or maybe it's nothing to do with rotation and position, but there's some strange property of these polygons...?

Ideas?

In this case, removing doubles in the mesh resolved the problem.


Thin faces warning 3Dprint tools I am using an industrial grade 3d printer, it has a voxel acuracy of 23 micron.
Although i cannot show my model here, its about 1000 times larger then the default suzan, as i export it later to STL, and as blender isnt aware that the default stl scale for 3d printers is mm.  (the STL format itself has no size, but scaling it 1000 times works well)

Anyway with those large objects in reality just a few centimeters tall, i kinda get random warning of thin faces.

Is this normal, or should it reported as a bug ?.

There are two ways for you to handle this.

The first is through the length unit settings in the scene tab of the properties panel (bottom right in the image below). You can simply set the scene units to millimeters instead of meters (which is the default), and the 3D printing toolbox tests will update accordingly.

The other one is by changing the thickness threshold in the 3D printing toolbox thickness tests to whichever is the limit you're aiming for (which corresponds to your 3D printing tools and materials).


Leg Control Bone Disappearing in Pose Mode This is pretty strange for me. I have the bottom half of my mesh in edit mode shown below. Everything seems normal here. No bones are missing.

Then once I go into pose mode, the LegCtrl.R is missing. And obviously I can't manipulate the leg easily now. What's going on?

Blend File:

It looks like you have hidden the bone by pressing H. In pose mode press ⎇ AltH to unhide all bones.

Another way is to find it in the outliner and unhide the one bone.


How to make object A a parent of object B via Blender's Python API? I have two objects each of them hold in a variable. Now I want to parent them so object A is the parent of object B. How can I do this using Blender's Python API? I know there is a parent_set operator in Blender but I don't know how to set up the selection in the scene via Python so I just have to call

bpy.ops.object.parent_set(...)

It looks like there is a parent attribute on objects which I can use like

b.parent = a

How can I use that?

Avoid all the dancing around using bpy.ops and that setting selection and active. Most of those bpy.ops commands are meant to be called by the UI once a user clicks a ' parent to x ' button , etc.

You are on the right path by using the .parent  attribute. All you really need are the names or references to the objects and you can parent much, much simpler.

import bpy

objects = bpy.data.objects
a = objects['Cube']
b = objects['Cube.001']
b.parent = a

There are times using a bpy.ops is a reasonable solution, but in this case the lower level solution of using b.parent = a is functionally equivalent and fewer lines of code.

Edit

In the comments of this answer we discuss how to decide when to use a member of bpy.ops, but CoDEmanX has a fine clarification here


White edges on render I'm getting these weird white edges on certain textures (appears only to be on those that have transparency in the texture.

It only appears in render result and not when I'm actually in the workspace itself. I've read around many times and can not find the answer so have always resorted to removing grass and leaves, however, I'd like to keep them in on this render. As it's going to be an animation and would look better.

I'm using Blender engine as cycles doesn't work right with Mineways imported worlds (you have to do extra work which I don't know).

I know nothing about nodes, just putting that out there. So if your suggestion involves nodes (alpha over) keep in mind I'm an idiot when it comes to nodes never learned them.

OK, I'm leaving this question up as I've seen others ask as well. But... I went to texture, in the alpha section I unchecked use and it works perfect.... No idea...


blender (2.92 BETA) liquid simulation with viscosity becoming really stretched on one side I am experimenting with the new "Viscosity" feature in the liquid settings in blender version 2.92  Everything was working the way I wanted it to, until I noticed that during the simulation, the liquid becomes very stretched out on one side, almost as if it is attached to something and can't break away.  It's hard  to explain with words, so I'll show you.(see below image)

As you can see, it looks like the fluid is trying to hang onto the emitter, causing it to become stretched, and I can't figure out why.
I know that this is an experimental version so maybe this is a bug but I don't feel like it is, any help at all is welcome.
I will share my file with you, but the simulation will only work correctly if you open it using the current BETA version of blender 2.92, which you can download from blender.org if you wish.

(PS,  if anyone has any questions about some of my current settings that I have, let me know and I can post pictures of them)

Because you are too close to a Domain border and since you have set collide with all sides of domain it probably stick to it.
When I move it at center it seems to be fine.

Consider if Domain dimension 28 m is necessary. For realistic result is better to work with real size. To avoid possible issues Apply Scale Ctrl+A to all simulation participant to get them all at scale one.


How to render casted shadow on surface only How can i render a character + the shadow it cast on a surface but not the surface itself?

I would use it to

Render my background only once (if nothing moves in background) so i would be saving a lot of time
Better effects with transparency gif

Cycles Render
Select the surface object, go to Object / Cycles settings and check Shadow Catcher.
In Render / Film, check Transparent.
Blender Render
Select the surface object, go to Material / Shadow, check Shadows Only.
In Render / Shading / Alpha, select Transparent.


How do I create a curve like Hoss' Hat? I am still learning to 3D models, but I feel this hat can be a good learning experience for someone who wants to go into Game development. The first model I made I finished the curves but they looked like garbage. If any could tell me the best course of action for these hat curves I would be very grateful!

You should begin with less edge loops. Also, use the Mirror modifier as the hat seems rather symmetrical. Now you could do it with some extrusions, but maybe it's better to keep concentric circle to have a better topology. So enable the Proportional Editing option, drag up some vertices and edges, then inwards. At the end, add a Solidify modifier to give thickness, and a Subdivision Surface to smooth it.


Scaling edges relatively to the shape I'm making a track for a racing game and I want to make borders with a wider area at the top. How can I do this with Blender ? The scaling tool doesn't do what I want to achieve.

There are probably other ways of doing it but here is at least one. Sometimes you will need to create temporary geometry to instruct the tools what to do. In this case we need to have face normals so the inset tool could be used with depth.


Have Lamp/Light automatically rotate towards an object or the 3D cursor How can I rotate a Hermi light source so that it shines towards a specific object or the location of the 3D cursor?

Bonus if the light source adjusts its orientation if I manually move the tracked object.

It don't have to work for animations, I've got only a static scene.

I already tried the Object Constraints "Track To" which was mentioned in a similar question but I have to choose between X, Y, Z axis but I want all three?! Am I just using it wrong?

You can't track to the 3D cursor but can easily track the lamp to an object via the Track To constraint.

Select the Hemi lamp and add the Track To constraint as follows :

Here I've set the Target to an Empty. Note that the To is set to '-Z' and Up is set to X (but could just as easily been Y - it must not be set to the same axis as To otherwise the constraint is invalid and will not work).

Moving the Empty will now automatically orient the lamp to point to the Empty. This will work equally well for Sun, Spot, and Area lamps but is obviously not generally relevant for Point lamps (since they don't have direction).

It is unfortunately not possible to automatically point the lamp to the 3D cursor (except, perhaps using a python handler) but this shouldn't be necessary as it's a simple case to move the Empty to the 3D cursor via the Snap-To menu (Shift-S, Selection to Cursor).


Make a Passive Rigid Body Disappear I have a scene where balls are falling inside an invisible passive cylinder and after a moment I would like a larger ball for each color to squash them but I do not want to employ cell fractures because my cylinder is invisible so, is there a way to keyframe my ball containers and make them totally disappear so that my balls will explode all over the place?

I have figured out the answer to my problem. It seems you can keyframe a rigid body's collision group and so I did. by pressing I on the collision group layer and positioning your marker to the specific keyframe where you want your rigid body to not affect other meshes.


Object disappears when zooming out I am on blender, and I have imported an object. I believe that the object is so large that it doesn't fit the environment when zoomed out for a view of its entirity. It would be nice if you could include a python cript to your solution.

Here is how it looks:

I do not know python, however you can change the depth of field to make it bigger or smaller to make you able to see the object in it's entirety.

Go to the Properties Panel (N) -> View -> Clip and change the End distance to increase the field of view and allow the whole object to be seen when zooming out.

Be mindful that it may slow down your computer is the object in question is very big and complex.


Complex Collision Boxes I'm trying to get a ball to go through in between the cup gear things shown in the screenshot below.

It seems that the collision box does not consider the cups. Yes, the ball fits and they are rotating in the right direction.

If there is already an answer to this, please link it.

If you have any questions about what is going on/ what the project is, feel free to ask.

You need to change the collision type for your wheels/cups objects from Convex Hull Into Mesh, otherwise only the physics system will only interpret it as if it was covered in tape.

This of course will be at the expense of performance, more complex bounds types are slower to calculate, so you should always use the simplest bounds type that will yield an acceptable result.


Blender 2.8 - how to eliminate a shadow I have a scene that I otherwise like, but has a shadow on a plane (image) that is serving as a backdrop.  Is there a setting I can adjust on the plane/image that will eliminate shadows cast on it?

Thanks in advance!

You wont get any shadows if you are using an Emission shader in your material for the backdrop.


Ticks in my animatrion? Im trying to find the amount of ticks in my animation. My animation is 100 frames long and I am running at 60 fps. How can I figure this out?

number_of_ticks = (animation_length/animation_fps)*game_fps
in your case (100/24)*60 = 250

you can set the animation frame rate in the render tab :

also you can set the game frame rate in the world tab :