text:
Vector Imported curves not moving on Z axis
I wanted to make some 3D infographics, so I imported some vector images into blender via Inkscape. Normally, I can edit and move the points on a curve through all three dimensions, but for some reason these will only move on the x and y axes.
I want to make the arrows point up and around as well, but this kinda impedes it.

Using a 2D curve implies that the Local Z coordinate of each control point is 0.

From the Blender manual's page about the topic:

By default, new curves are set to be 3D, which means that Control Points can be placed anywhere in 3D space. Curves can also be set to 2D which constrain the Control Points to the Curve’s local XY axis.

In a 2D curve you can't even set it's origin's Z coordinate with the 3D cursor. It is forced to lay on the plane where the the control points are.
You should switch the curve nature to 3D to be able to move them up and down.

I think I tried that before, and the plane that was created from the points got totally bizarre. I'll try it again though....

I know, handlind 2D curve is much easier. Their are just 2D. When converting to 3D curves, there are more things to consider to make it look right.

So would it be easier to fix these curves, or just hand model my own using the others for reference? I added the what it looks like up there.

It depends on which way you are going to use them, your projet's goals... Anyway I would use them, the difficult part is handling a 3D curve, not drawing the 2D contour.

Consider that until you don't have faces the Solidify modifier can't help. http://postimg.org/image/4k9pkwt4d/ And remember to adjust the Normal size with an appropriate value for your geometry size


text:
How do I conditionally select an index within geometry nodes?
I would like to have a conditional fork in my geometry nodes logic, based off index.  In programming it would be like if (index == 5) { ... }.  How are conditional branches or forking done in blender?  How do I select a path through my nodes based off index?
In terms of research, I found a similar question, but the way it does conditional selection is through a "selection" input on a "Instance on Points" module.  I don't think I need (or want) the "Instance on Points" module as it seems to bring in other geometry.  There's another question that also answers with this module here.  Maybe it's the only way.
I also tried switch node, but had a circle can't connect with diamond situation.

The node I think I'm looking for is a boolean controlled pass-through.  It has an in, an out, and a boolean input to decide whether what's coming in goes through.
EDIT: found a proposal for that node and the current workaround (I think) https://blender.community/c/rightclickselect/18bbbc/?sorting=hot

Have you tried Separate Geometry?

It was the first thing I tried.  I didn't find it to be a very elegant solution.  I had linked geometry and a lot of drivers to try to make things work.  Coming from a programming background, it makes more sense to me that -- if I want a conditional -- I should use conditions.

...correct, but you cannot switch geometry in this way. What exactly do you want to do? Do you have a specific example?

You can conditionally select an index within geometry nodes just as you are doing.  You could send this selection that you have, via your math node, to any number of operations that operate on selections.  What you cannot do is send a selection to the switch input of a switch node.
You say you're from a programming background.  Cool, nodes are just a graphical programming language.  Switch is a function.  We can write it out in pseudocode if we want:
geometry Switch(bool Condition geometry outputIfFalse geometry outputIfTrue) {
 if Condition return outputIfTrue else return outputIfFalse; }

That's really simple, right?  It doesn't do any mixing between the geometry.  It doesn't join.  It's not overloaded with a bunch of specific cases in case we send it different types of parameters.
You have a variable called DuplicateIndex.  This variable is an array of integers.  Because you have two instances, this is an array of size 2.
"Less than" is another function.  This is an overloaded function that can take multiple kinds of inputs.  It can take an array as an input, in which case it outputs an array of booleans; or, it can take just a float or integer or something, in which case it outputs a single boolean.  We are sending it an array, so it is outputting an array as well.
But we can't call switch with an array parameter for its boolean input!  There's not any way to reasonably cast an array of booleans to a boolean.  Our compiler throws an error.  In this case, that warning manifests as the red line from result to switch input, indicating GN's version of a type mismatch.
What would we do if we want only the instances with an index less than six?  (Which is all of them.)  We might call Separate Geometry.  Here is roughly what that does, in my pseudocode:
geometry SeparateGeo (geometry InputGeo, array of booleans Selection) {
 geometry OutputGeo = InputGeo.duplicate();
 for which in Selection {
  if (not which) OutputGeo.delete(OutputGeo.points[which]);}
return OutputGeo;
}

Separate Selection is a loop of conditionals.  Most GN operations are loops, and anything with a "selection" input is a conditional.  Unlike Switch, it accepts an array of booleans as an input.  If you want to send something an array of booleans, you can use it, and you can't use Switch.

I think the reason a switch geometry doesn't work with fields (geometry-context based data) is because there are two contexts, and it could turn out that it wouldn't be a switch node but rather a join geometry node with a pass-through condition [This might be what you want, but that doesn't fit with that nodes function].
The solution is to either use Delete Geometry, which is an inverse "pass-through" node, or use a Separate Geometry, which is just a delete geometry that gives you both sides of the selection.
I think for you (if I understand you correctly) is to use a delete geometry with the selection inverted (use a Boolean Math set to not).

Delete geometry is awesome for this use case.   It's exactly a passthrough, just with the boolean inverted.

source: Stack Exchange

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

sort: votes


text:
Bending array around an object
So I am trying to make the grate circled by red follow the route marked by black, I am not sure how to make it follow the whole path evenly however. How would one go about making the grate fill in the groove? I need the grate to fill in the groove marked by black without being deformed as well.

File download here:

Add a curve which follows the object you created, then setup a curve modifier. The problem is that the curve modifier sometimes deforms the mesh quite strange (especially at sharp angles) and I don't know if it will work for you, guess you'll need to try :)

I was thinking curve but was worried about it deforming stuff, is there a setting that allows me to keep the vast majority of shape geometry intact?

And also is there a way to snap the curve to the geometry I want the array to follow so I don't have to line it up by hand?

You can combine array and curve modifier, if that was your question, but I'm sorry, don't know about the deform stuff

I think you could apply the techniques from this video to your model.

I want it to bend like this around a corner. https://gyazo.com/864c4d163a0b5bfb802d9b23746aa0e6

I used the bend modifier but I want to learn how to do it with array.

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


text:
procedural label texture
how is possible make a label design all with nodes with the shader editor in Blender (basic rectangles shapes and letter)?
I add the final result done with Illustrator.

Typography in nodes is really involved :p

how is involved?

If you have an image texture of the text, that's simple, but if you're asking how to create the letters with math functions in nodes, it's a lot of work

oh i know but is just this the question, how can do it with only the math nodes...
this was a great suggest for the development team https://blender.community/c/rightclickselect/cbfbbc/

Someone asked for pointers about that some months ago. They have put videos about it on their youtube channel. Look for the very first videos https://www.youtube.com/c/DrBlender/videos

If you're using Cycles, you could try to find a way to call some external font rendering library with OSL.

@WillChen no, for this project i use eevee

i have find this, but look like hard to use https://www.blendswap.com/blend/24437

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


text:
Joining 2 or more armatures makes the not joined disappear but still be listed,selectable and have keyframes, and their actions "freeze". Bug?

Apparently this is a series of more than 1 questions actually, the part in bold sums it up.
Was experimenting with animations, armatures and instancing. Tested it by making a palm tree where the stem has it's own armature and the fronds each have their own too. The fronds' models and armatures are copies of a original made by instancing and making them real, each bone was renamed with the method ".000". There is where the problems start.
Each copy is assigned the newly created armature on the armature modifier and surprisingly the vertex groups are also renamed automatically, but actions do not copy. Have to make new action for each new armature, not sure if it's a limitation of instancing. Keyframes can be copied between each frond's armature's action with no problem though.
Renaming each bone of each real copy's armature makes the bones of the other copies that weren't touched yet be renamed in the exact same way, but bones of armatures that were already changed are not affected. Not sure if it's yet another limitation.
When the stem's and fronds' armatures are joined with the stem's as the main (last selected), in any number and in any way, any other armature not joined get the problem mentioned in the title. Copying the original frond's keyframes into the stem's action (now entire model's action) do not work properly anymore, even if bones are named propperly and there were no problems copying keyframes pre-joining.
Leaving the original frond unjoined, it's keyframes can be copied, but any other action it has become unnapliable despite appearing in Graph editor and being able to be set on the Action in Action Editor and Outliner. No other action produces visual effects anymore and selecting any action other than the one active when the other armatures were joined makes the active one not work anymore too.
One workaround is to join everything at the same time, but then the original loses the action even if it isn't joined. Other workaround is to first copy the original frond' keyframes, join just one frond model and armature to the stem, paste the keyframes then delete or unlist everything else, then just copy the bones inside the single armature and the fronds inside the single mesh both in edit mode.
Anyways, having any other armature and unnactive actions become phantoms after joining 2 armatures seems like quite the bug

Coudn't reproduce the issue despite it existing for about 3 days before, that is the reason the "post-joining" examples are "visualizations"

A blend file would be very helpful, along with a few screen shots. (How to add a blend file)

@MartyFouts Thanks. Just added the file, thankfully it's from before joining the armatures so more pople can see the thing in action themselves. Also added some visual explanation, it's a mess but still explains the issue fully

This is not a bug, it's the expected behaviour, related to Blender datablocks structure.
Some work is needed to get the result I presume you want (a single mesh with a single armature to get exported as Fbx with the complete tree animation).
To address the problem solving you have to realize that every Blender object is constructed by many datablocks: i.e. your StemSkelly armature uses the armature datablock named "Armature" (you can read its name and its users on the green little man icon on the properties panel).
The problem lies in the fact that you have 25 different FrondSkelly objects (.001, .002, .003, ......) which ALL relie on a single Armature named "Armature.001".
The same happens with the frond meshes, which are named "Palm front healthy.001, .002, .003, ..., but they all rely on a single mesh datablock named "Cube".
When you join the armatures you are joining theese two datablocks (Armature and Armature.001), which both are merged into "Armature", while "Armature.001" doesn't exist anymore (and this freezes all others animations).
A working workflow I used to solve the issue is this:
Delete all copies of the fronds.
Apply (Ctrl A) all transforms both to original frond and frond rig objects.
Add a root bone and make it parent of all frond rig, make sure that moving root bone will move all frond mesh (delete the vertex group named "Base").
Set the stem rig in rest pose.
Use Shift D to duplicate frond and frond rig.
Create a copy of its action and add a Loc Rot Scale keyframe to its root bone to place the frond in the correct place (it's important to leave the frond rig to be joined in world origin, same as stem 000, 000, 111, and use animation data to move the mesh in its correct place).
Add a "Child of" constraint to the root bone pointing at an appropriate stem bone.
Join the frond mesh to the stem mesh and the frond rig to the stem rig.
Open NLA editor, use the "Push down" button in the action editor to send the stem action to NLA, and add the frond action (that with the LocRotScale keyframe added).
Repeat for all others frond, checking the corrispondence between bones names and vertex group names after joining mesh and rigs (in my example I had to rename the vertex groups numeric suffix).
When finished and working you can bake the whole NLA stack of actions, to create a new action using visual keying and deleting all constraints, to obtain one single complete exportable action, acting on one single mesh with its single armature.

Just LOVE IT! Thought I had got this datablock stuff down already, guess I am heading back to the manual, gotta learn that thing for sure. Yes, that's exactly what I was trying to do. Tried instancing because it's a good way to repeat an object many times, thought it would copy everything from the original when made real, but it just makes many copies relying on single datablocks and a nightmare to animate... Loved the addition of this workflow, it's just perfect to my needs

The only drawback is that in rest pose the tree will have all its fronds overlapping in the same base location. If this is a problem you'll have to find another workflow, but I think you understood the basics step you need to follow!


text:
Low Poly Mountain Terrain
Timothy J. Reynolds has these awesome mountains -
but the closest I've got to modeling one of these cool mountains is:

What lighting or modeling am I missing?
EDIT: I use cycles, so preferably I want a solution in blender cycles.

I have an idea on how to make more contrast, try making the background a dark grey, then render the image with transparent background (Render>Film>Transparent checkbox) and paste the image on a white background

Are you just looking at his lighting/post?  Or are you going for how to model the buildings, mountain detail, etc?

@MikeBelanger Lighting/post & how to model the mountains. Thanks for asking!

Thank-you for posting this!  I'm a fan of Tim's work too, and it's nice to see people trying to re-create each others looks.  I made an edit just to say you're not looking at modelling the structures in the image, that way nobody gives a tutorial about modelling the structures.

Hi, Welcome to BSE! I know that we don't really make this clear enough, but could you please keep your questions down to one per post? We don't want half of our answer to be about one thing and the other half to be about another. We're already seeing this happen. It could become a big mess if left untended. Thanks!

Looking at it, I bet he hand places each of those polygons, using his artistic eye. The best way to learn would be to attempt to exactly replicate a work of his, and that should give you a feel for the right size shape and placement.

@GiantCowFilms Ok, thanks for your advice!  But what does you mean by hand places?

Here is what I got:

Analysis:
According to the result, there are some evidences that the author might very possibly take AO pass into account:

So the basic idea is to multiply AO pass with Image pass something like this:

Then it should come with a few color related nodes such as Color Correction, Color Balance, RGB Curves, etc. to mimic the tones for each channel, something like below:

Materials are very basic, no magics I bet. Just use Sun lamp with a very small size value to get sharp shadow:

There are generally two methods to model poly mountains:
Method A:

Create a plane, then subdivide and decimate:

Apply all modifiers, then paint vertex weights in Weight Paint mode, and use it for a Displace modifier:

Method B:
Use Sculpting tools. Use dynamic topology to create these randomized triangles, and use Flatten brush to create the flat tops:

THANK YOU.  I will reward you with the 50 reputation soon.  I have some questions, though.  So which method did you use to make the scene?  (A or B)

A here to be honest. Plus a little further tweak such as selecting faces of each peaks then scale along Z axis to make them real flat.

Or you can simply add a Decimate modifier to the high poly mountain that has already been modeled.

You are not just just limited to the material and lighting,A process you all forge about is post production you can change the mood and the look of the image completely in post.
Here is an example for contrast enhancement for your image just by using a single node:

What is also useful is the extra passes you have like the Normal pass which can be used to do exactly what you want in here.
Here you can see what I did to make the image more contrasty and appealing:
you can see the original in the render layer node.

I added a vector Normal node and choose a good angle and then overlayed it on the image to get the contrast based on the geometry.
I can also see some fog in the scene which can be done using the mist pass.
Which will give something like this:

It is barely seen, because the scene is just too small but in your scene it will look good.
Edit
To make the mountain you can use an addon called ANT landscape which is in master so just enable it.
Add this landscape and play with the options to get what you want.

Edit the mesh to suite what you need,I flattened the top of the mountain and made it circular.
Then I added a decimate modifier and checked trianglate,decrease the ratio to get what you want.

And then you have your mountain:

Buy using the all the techniques,We can get this result:

And here is the blend file:

Thank you! The contrast based on the geometry I think will help a lot! But, do you have any idea on how to model one of those mountains?

Tim's also has much sharper shadows, which probably contributes a lot to the "contrasty" look.

@AlexSafayan I edit the answer.

Ok, I think you have the answer, but could you also show a render of the mountain?

@AlexSafayan Here is a render and the blend file.

No one mentions baked Ambient Occlusion into textures, that's what makes it look like it looks. Here is explained what that is:
What is Ambient Occlusion?
Here I marked the areas where you can clearly see it (it is noticeable everywhere though). Btw. AO makes the model look dirty, it put's shadows in areas that are lit and shouldn't be darkened:

The rest of the look is a filter post-process. With that you can match the colors, adjust tone of shadows, contrast etc. To analyze the filter-effect, you can look at the image histogram:

You can see that the contrast is lowered, with lacking blacks in all channels. Furthermore the blue channel is boosted in lower half so the shadows are tinted blue. Here are all the filter effects reversed:

But no amount of tweaking normal pass or filtering colors will add the very noticeable AO in the original.
You can use baked AO into textures, AO pass, or custom render using AO shader and overlaying over render. Here are some Ambient occlusion related questions:
How do you bake ambient occlusion for a model?
Adding Ambient Occlusion to Material
Emphasizing Cycles Render Ambient Occlusion
As the question also asks about lighting, here comes the analysis:

there are sharp shadows -> the light is a point-light with no size
the shadows are parallel -> the light is very far away
the shadow areas are also lit -> there is also a uniform environment lighting
there is Ambient Occlusion
there is most definitely a normals edit trick as other answers suggest. It is very common with such low-poly renders and it gives a control that would be a shame not to use.

Could you explain a little more, maybe adding some screenshots?

I think this is actually the correct answer, but it needs a lot more information to be a sufficient answer.

Oh I didn't notice this answer before I posted mine. We got quite similar inference on the AO part. :)

@LeonCheung I think we are both correct, the AO is definitely there:)

Looks like there's quite a few triangles in the mountains, so its probably best to make some kind of subdivided, organic shape and throw a triangulate modifier on the stack.

You can use the normals to determine the colors of the faces.

The material is here :

Input on normals
A mapping (x or y rotation) allows to change "faked" light angles
A color ramp to choose your colors

Edit : a variation to add more contrasts (just change the color ramp) :

Not what I'm looking for, these mountains look nothing like the example.

@AlexSafayan can you detail more ? In fact, I dont understand if your question is about the shape or the colors or other ?

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


text:
Guillaume Kurkdjian Water Material
Guillaume Kurkdjian has this really cool water:

How can I achieve this water in blender cycles? (material and modeling of the water)
The closest I've gotten is this:

This is the material settings for the image above:

@cegaton Updated!

@cegaton Sorry for that, edited again!

Looks to me like there's probably some Volume Scatter in there too. Look at how the land interacts with the water on the left side, in the shadow.

Here is a try:

Analysis:
According to the source artwork, there may be some shaders used. However, the key parts can be: Glass/Refraction, Translucent, Glossy, etc.
So after a few trial and errors, a possible setup might be:

Besides, post processing like compositing can also be included:

To model the water shape, here is one way:

Example file:

Just put the IOR at 0.9, roughness at 0.2 and make the background white at 1 energy + a sun lamp with 1 energy


text:
Low Poly Water Effect
How would I achieve this low poly water effect using cycles?

But the closest I've gotten would be this:

What have you done already, or what got so far?

Are you asking about making the mesh? The material? Both? Do you want the effect animated in some way?

I don't want it animated, but I'm asking about the mesh and material.

@gandalf3 Sorry, forgot to tag

@DuarteFarrajotaRamos Just updated the post.

Modeling-wise your mesh seems to pretty much be there already. Now what you are missing is not so much on the water itself but on the "context" it seems. Add the rocky bottom or ground geometry behind it and and a scene around the water, perhaps work a bit on your lighting and it will probably look quite similar. It's hard t tell from the image alone, but there either seems to be a second layer of water (a second mesh below it) to simulate water depth or there is some volumetric material at work there.

It looks to me like some kind of mix between glossy and transparent shaders.

This setup is rather arbitrary, it's up to you to come up with a combo you like.
The trick is that there seems to be multiple layers of mesh superimposed, allowing objects near the surface to be seen, while nearly completely obscuring the bottom.
One way to go about creating such layers is by first creating a "base mesh". I used a fluid simulation, but for more control you may want to use dyntopo.
Once you have a mesh more or less how you'd like it, duplicate it and add differently seeded displace modifiers, and decimate modifiers with different ratios to get a mix of polygon sizes.

Also note the way the water meshes in your example have been sculpted to give the impression of currents; long poly strips where water is flowing straight, and choppier, evenly distributed triangles for more turbulent regions.
I didn't do this, but you may want to.

Wow, really great answer!  But how did you light this scene?  And also if you don't mind, can you give a download link to this file?

And how did you model the water using a fluid simulation?

@AlexSafayan I've uploaded the .blend. The lighting is from the sky and a sun lamp. As for the base mesh, I set up a simple lowish resolution fluid simulation (100 IIRC), picked a frame I liked, then applied the modifier and manually tweaked the mesh from there.

Hmm... I can't seem to find out how to make the fluid simulation that you made to create the water.  But I was able to create this - http://bit.do/lowpoly with your material.  Could you make a download for the fluid simulation, or just tell me how to set it up?  Sorry!

Nice render! I'd suggest looking for some fluid simulation tutorials (e.g. on blenderguru), or perhaps the manual

You can use a Glass Material as a base and set the IOR (indice of refraction) to 1.39336 which is the value for the water at 20°C.
An important thing is also the environment texture setting as the reflection is important.

On this base, you'll probably need to add turbulences effects. But this may be to take into account differently depending on what you want : static image or animation.

After some searches, I found this "swimming pool" effect combi which fits my needs (water is a small part of a big picture). You can adjust the effect by changing glass shader iOR value (which set very strong on illustration).
My goal is to have 1 plane for each water zone with light reflection AND some roughness... This method reaches both goals so it stays animation friendly until water comes at foreground. In this case, I would add some surface displacement as seen in the question picture.

Notes : 1) Unlike in a real pool, light zones are coming from surface reflecting a sun lamp placed at upper front of the camera.
2) Wave texture can be used too but less convincing than musgrave to my opinion.
Possible improvement : Try to transfert effect to the bottom surface, behind water. Would require to recreate glossy effect for water surface.


text:
How can you smooth out the transition between these two objects so that they appear seamless?

I have two objects. One is the club head which has a subsurf modifier and the other is the shaft which doesn't have any modifiers. Is there a way to smooth out the transition between these two objects so that they appear seamless?

Should they stay as two objects or one? If two try Snapping vertices in edit mode, if one try Remesh Modifier or remodelled from scratch :)

you'll probably need to join them in the same object, cut the two mesh and use bridge tool. I think there's a weld node but it might not be available yet?

The main reason for the sharp transition between the two are the fact that the normals are discontinuous between the two objects at the intersection.  You can soften this transition considerably by creating custom normals for one of the objects using a data transfer modifier.  Target one object with the other, set it to affect custom normals, and transfer from nearest face interpolated (usually).  You need to enable autosmooth in properties/object data/normals in order to use custom normals.
You'll almost certainly want to use a vertex group to limit the effect of the data transfer.
Almost all of that is shown in the image below, which compares the effects of copied custom normals on the left with regular normals on the right.

Normals are vertex data, so the closer you can get the affected vertices to a face of the target object, the closer the match will be.  Sharp transitions can still affect actual shadowing and ambient occlusion.  If you have problems with the join because of these factors, you might consider using a shrinkwrap modifier as well, evaluated before (above) the data transfer modifier.

My final solution was to remodel the club face by extruding its edges up the shaft object and then using snapping to connect vertices to the shaft. This gave me one connected smooth object. Nathans was very helpful also since I had never used the data transfer modifier before and his solution worked well and gave me some insight into how this modifier works.


text:
How to "Reverse Engineer" mesh created out of smooth curves with a missing chunk?
I have a model that needs a little mesh patching which has been imported from a .stl file. It seems like the model started off with a nice curving face made out of triangles, which was then cut through and patched to add features. The goal is to remove those features and bring the model back to its original curved face by adding/removing vertexs where they need to be. Below is a quick example as to what currently needs to be patched.

The selected hole will need to have the already existing sweeping curves reintroduced in order to look as it did before, as seen below.

I've tried to do a few methods in patching over the hole, such as bridging the edge loop, grid fill, and just adding a face over the hole, but it seems like the new faces created looked flat instead of following the contour of the model. grid fill may do the trick, but I may end up dealing with a miss count of vertices on all four sides of the grid layout. I believe shrink wrapping a subdivided plane over the hole worked pretty well, but causes plenty of odd looking geometry. Any thoughts?

The fill region command seems to work pretty well filling in the hole, but it seems like it loses the ability to keep with the contour of the mesh. For a few of the touch ups, I was able to create working grid fills which keeps the curvature in mind when placing new quads. Also, thanks for the heads up on the conversion from tris to quads. Really helps out to see the mesh in a cleaner fashion.

Would you mind posting the .blend for us to examine? I do have one idea, but I want to put it to the test before recommending it.

Yeah of course. You can grab the .blend file here. By the way, this file has a different hole to work with compared to the images shown above. Hopefully that isn't an issue. Also, I was able to find a way to keep with the curve of the model by using a mixture of bezier curves to provide extra vertices the grid fill would need to work correctly, but I am still curious to see what you have in mind to solve the issue. The adjustments I made with the mesh is also included in the .blend file if your curious to see.

You can fill holes in curved surfaces like this either with extruding with snapping set to Vertex or using Mesh:F2 addon.
Using F2
After enabling add-on, select vertex in the corner of the hole and hover mouse cursor over hole (mouse position matters regarding to where face is created if there are several possible ways).
After that press F to fill the face. Continue until finished with other vertices.
Split uneven parts of hole to make it of square / rectangular form. Once it is use Ctrl+F > Grid Fill and choose options to have clean topology.

See more about filling faces with F2 addon: Make quad face from where two edges will meet?
Extruding and snapping
The same could be done with extruding with snapping turned on and set to Vertex as element to snap to. Fill the surface until the hole is rectangular and then use Grid Fill.

For the second example, there is a grid fill tool which can do this in one step.

In this example you could delete faces in corners, then grid fill.

I was wondering if there was some sort of plugin that could accomplish the fill in task. Thanks for the help!


text:
Blender 2.8 - How to bake an ambient occlusion map to a second UV texture on a multi material mesh?
I'm trying to bake an ambient occlusion map onto a second set of UVs onto an object with multiple materials on it (per face) for exporting to a game engine.
I have an object with multiple materials on it. I have materials assigned to each face:

This object also has two uv maps, one for the main textures, and one intended for the AO map lightmap pack unwrap.
I don't actually know if I need a separate material for the AO map, but this is the setup of the AO map material:

In the uv editor, I select the AO UV map, and the AO_Image image I've created, then I click bake:

But then I get multiple messages:
No active image found in material slot (0) for object "Level"
No active image found in material "Material" (1) for object "Level"
No active image found in material "Blue" (2) for object "Level"
Circular dependency for image "brick-pattern-1.png" from object "Level"
Circular dependency for image "grass-tiling.jpg" from object "Level"
No active image found in material "Grass" (5) for object "Level"
Circular dependency for image "AO__Map" from object "Level"
Baking map saved to internal image, save it externally or pack it

And then any materials with image get the lightmap bake, which itself seems garbled for some reason:

Again, the intention is to bake a separate AO map onto a second uv map of a multi-texture object for exporting to a game engine. I'm not sure if this is the correct method. But I'm doing something wrong, because Blender falls over when trying to perform this task and I'm unclear why.

Sorry guys for a mess here, i just voted for reopening. This OP use UV part that is logical extension need when baking multiple materials. This post also use 2.8x screens that looks probably more actual (relevant) answer for new users. Thanks or your opinion.

Add a new Image Texture node (with a new image for bake) inside each material and keep it selected (active).

To bake into a new UVMap, create one under Data Properties > UV Maps and enable Camera icon.

Then in Render Properties > Bake, change Combine pass to Ambient Oclusion. After image texture is baked you can use it as usual.

Looks like a super easy thing to do, good explanation.


text:
How can I assign an action to an armature using Animation Nodes
Animation nodes took a while to get the hang of it, but it is truly amazing.
I've been following the example below, but rather than modify an existing action, I'd like to assign a random action to each of the duplicated armatures. The scene currently has 5 actions (ArmatureAction.000, ArmatureAction.001, ArmatureAction.002 etc.)
I just can't work out how to firstly assign an action to an object using AN, and secondly how to randomly assign one of the 5 actions to each of the armature duplicates.
https://www.youtube.com/watch?v=q9unQC3PTcI&feature=youtu.be

File on Dropbox - 800K

Yes you can do it. But the main problem with your node setup is  that your using the second Object Attribute Output in wrong way. You haven´t passed any value to node. Therefore no paremeter can be assigned.

OK, can you tell me how to do it please? Here is the NodeTree that instances the object, and the armatures and connects them together. But I can't work out the syntax to place a different Action on the NLA track in each of the instances.

Do you mean that I have to put in a New Parameter in the Loop Input node?

Can you share the file and I´ll try to post an arrangement tomorrow?

Excellent, thank you, this has been driving me nuts. :)There's a link now under the image.

@Denaro If this answer is helpful, please consider to vote and select as your answer. :)


text:
How to precisely select a very wide mesh?
I have this very wide but thin tubular mesh (150 cm wide x 150 cm deep x 0.5 mm high), that I want to convert into an outline. It looks kind of like a fishnet thrown on the ground. I want to take just the outline of it, which is all the vertices that are on a given Z coordinate. When I zoom close enough to be able to select the vertices by Z coordinate, I am too close to be able to select a meaningful amount of the mesh (regardless of if I'm using X-ray or not).
Imagine the sample below but repeated 8 times in Y and 15 times in X

Is there a way to select very precisely over multiple screen widths? I've tried using a rectangle mesh (that I can position very precisely) but I'd need to be able to use it to do a sort of "selection knife project" on the "fishnet" mesh which I don't know how to do.
Context
I have this very large 3D mesh that I want to knife project on in a complicated way. In order to do that I have a complicated Nurbs curve that I thickened (I need this precise spacing between each side) and converted to a mesh so that I can transform it to an outline as that makes it possible to knife project with.

There's an adjustable selection operator for this, so it's:

Select a vertex on your net's mid-Z, (active) .
Header > Select > Side of Active  set to 'Aligned Axis' and Z

The threshold may need adjustment to capture all edges of interest, and exclude others. (Progressive selections can be made by tactical H hiding.)

Do you know if there is something about a minimum distance between the vertices? It seems to work but have too large of a step (so it selects everything)

Found it, the threshold is not actually 0, you can reduce it clicking into it. You solved it, thanks a lot for the pointer!

@OlivierDiotte Sorry... I should have illustrated better. Glad it worked for you :) Edited.

@RobinBetts (I cannot comment under deleted answers): No, sorry, I'm just tired and didn't realize while reading the question that the object has much different dimensions than shown in the example.. I wish I knew a way because sometimes it is the only possible way to do it. I just discovered recently that when you drag a selection box and hold space, you can move it (if you accidentally started in the wrong position for example), but you cannot move the view with this.

@GordonBrinkmann  Ahh, thanks! the space-trick I didn't know :) .. I thought I read/heard somewhere this was being dealt with by the devs.. but tricky, for a view-space selection.. you'd have to prevent rotation of the view, I suppose, and that opens a whole can of inconsistency-worms.


text:
How to Select/find all Unweighted Bones on an armature?
I'm working with Blender to create models for use in Unreal engine, and UE shows bones that do not have vertices weighted against them as greyed out. Is there a similar feature in Blender? I want to delete ALL bones that don't have any weights on them, and a way to easily select all of them would be greatly appreciated
Picture from UE:


text:
Rigged mesh intersecting and overlapping during posing process
I hope you're all having a great day!
I'm still very much a beginner when it comes to using Blender, and so far, I've just been playing around with it. I have a question about animating rigging.
Here's the thing: I created this animation using the BlendAr Mocap addon (created by CGTinker). Now, when I run the animation, there are parts of the mesh that intersect and overlap each other.
I want to ask, is there a technique or trick (like collision or rigid body, I'm really clueless about this) that can prevent the armature pose from intersecting with other parts of the mesh? Or maybe there's a free addon that can solve this problem?
Or is it simply not possible yet, and manual animation is the only way?
I would greatly appreciate any guidance from fellow forum members.
Thank you so much.

There is no fully automated method. Select the bones, whose rotations cause problems, identify the axis that needs to be fixed and in the Graph Editor shift/scale the keyframes of that channel. Alternatively you can use layers in the nla editor to add offsets to animation, but that is more advanced


text:
Is there any way to put camera inside the sphere?
I'd like to use the inside of the sphere as the background image.
Is there any way to do that?

Could you explain more clearly what you are trying to achieve and how?

Oh my. I've mistaken. I mean inside the SPHERE. I'd like to use the insides of sphere as space image, so that the objects could be shown like floating around the universe. But I can't see the rendered image.

Ok, now it's more clear... but I still don't get what the problem is. I see a camera already inside the sphere. Did you unwrap the sphere, assigned a material, etc..?

Yes. I did unwrap the image, using uv editor. But the rendered image is blackened, though I've assigned a light in the sphere. Is there anything I'm missing?

Holy crap. I didn't know that... I should find it more. By the way, the question above has solved. I forgot to set the brightness of the light... Anyway thanks for your help guys!!

@KevinKim If you have solved the question you can answer it below, in the question box.

Thanks everybody. I really appreciate all of your help.
In the end I took the method of following instruction
https://www.youtube.com/watch?v=4PZelpbFtDA

Try flipping all the normals toward the inside of the sphere. Then what ever space scene you map to it can be seen from inside it.


text:
Why does performing any translation on parent bone move entire mesh?
I have a 3d model of a  snake thing. The snake thing has bunch of bones in a line. All on the bones are parented to the bone at the front of the line.

I would like for the first bone to only move the head part of the mesh.

You need to setup IK spline to control the head independently of children. Search for some tutorials for IK spline.

Because the parent bone moves all the other bones, and (I'm assuming) those bones are all weight painted to modify the mesh via an Armature modifier.  Is there a particular issue that you have with this setup, or another goal you have for this?


text:
How can I add more god rays coming out of the holes?
I am trying to render my first volumetric lightning logo and there are two light planes inside the logo where the inscriptions "PC", "&i", processor are. So what I want is for these planes to create stronger god rays than they currently do. How can this be achieved?

ADD:
I tried the solution that @icYou sugested. So I imported my .svg file of my logo, converted it to mesh, opened edit, marked all vertices and removed doubles. I then deleted all vertices except the ones who form fonts "PC" and extruded the text. What I get are some weird black lines where only vloumetrics should be... These black lines were visible also in the Blender before rendering. It is kind of weird and I need an advice on this.

Could you provied blend file to: http://blend-exchange.giantcowfilms.com/ It could speed up an answer.

Doing this with volumetrics is slow and hard to control. This is generally done either with the sun rays compositing node or the BI spotlight composited into the cycles render (you can link two scenes' objects and have one render with BI and one with Cycles).

Instead of adding mist to the whole scene you can cheat and just put the rays over your text.

I just extruded the text in z space and gave it a volume scatter and absorbtion material. All you need to do is change the density to have it look stronger.
hope this could work for you.
EDIT :
The problem is with your SVG file.

The "&" symbol and the other complicated part to the logo should only have the outline. You don't need all those lines inside the "&" symbol. So I would clean up the SVG file (edit>select all the vertices you dont need> delete). Make it as clean as possible. Also you need the inverse of SVG file. I would bring it back into Illustrator (or whatever you use) and Inverse the colors. You need the lettering to be extruding not the outline.
Here is a pic where you can tell the clean parts from the weird parts.

If possible go back to illustrator clean up the logo so it is more basic (just for the god rays). When you import it into Blender make sure after you scale it up so you can see it, that you go to OBJECT>APPLY>SCALE. And only after that go to the curves tab and go to the extrusion setting and I put in .10, but adjust to your liking.

This is indeed a nice answer but how would I achieve the fading of the god rays with the distance?

Usually when you are dealing with .SVG files you need to scale them up after importing them. If you dont apply the scale you will get all sorts of weird things happening. If you are trying fade the rays you can always add a light falloff node into the density of your scatter and density nodes.  Also make sure your scatter and absorbtion nodes are pluged into the "volume" input and not the "surface" input on the material output shader.

I scaled up the file and it didn't help. What else can I do?

I would need to see your blend file to know exactly what going on.

Where can I upload and share my file? I prepared a 3D model with an imported SVG which I need to extrude... Can you try it?

You can always set up a free dropbox account and then send me the link .

This is it: https://www.dropbox.com/s/kpu9g3p0i98sup6/logotip.blend?dl=0

Ok I messed with it a little and updated my answer. I dont have time to do all the cleaning that the SVG file needs. But I hope this is enough info to get you pointed in the right direction. Here is the link to the blend file I was testing with. https://www.dropbox.com/s/dr50tj9hx0891gi/logotip.blend?dl=0

authors: Илья Головнин


text:
Object locations don't change in animation
I have a rigged animation object where I want to track the global position of different parts, however their location does not update in frame to frame.
e.g. in this Rat model, I want to track the position of the nose
There are many similar titled posts, I've tried many of their approaches but to no success

Structure
It's hard to show the complete structure, but for example the "Nose" part exists

Object View

Edit View

Code
My current script for checking the position looks like the following (I've tried many variations based on anything I can find online)
It's only purpose is to see if any of the objects change positions. My end goal is to be able to specify specific objects or vertices and find their global position in the frame
import bpy
import numpy as np

from pathlib import Path

# SETUP
#----------------------------------------------------------
output_path = Path("~/Desktop/blender-test").expanduser()
output_path.mkdir(exist_ok=True, parents=True)

# ANIMATION
#----------------------------------------------------------
scene = bpy.context.scene
context = bpy.context

bpy.ops.ptcache.bake_all()
positions = {}
def frame_change_post(scene):
    scene.render.filepath = str(output_path / f"render_{i:04}.png")

    print("Number of objects in the scene:", len(scene.objects))
    for obj in scene.objects:
        if obj.type != 'MESH':
            continue

        object_name = obj.name
        position = np.array(obj.matrix_world.translation)

        if positions.get(object_name) is None:
            positions[object_name] = position

        elif not np.array_equal(positions[object_name], position):
            print("Position changed!", object_name, positions[object_name], '->', position)
            positions[object_name] = position

bpy.app.handlers.frame_change_post.clear()
bpy.app.handlers.frame_change_post.append(frame_change_post)

for i in range(1, 10):
    print(f"Rendering frame {i}")
    scene.frame_set(i)
    context.view_layer.update()

And just in case its relevant, I'm launching the script from the terminal ./blender ~/test.blend --background --python ~/repos/USRA_MouseAnimation/test_movement.py

The mesh you're showing in the outliner is probably a bone shape, which doesn't change its transform.  Your best bet here, IMO, is to create an empty, parent it with vertex(triangle) to three selected vertices in the rat mesh, and then read the position of that empty.

I'll give that a shot, would every mesh be a bone shape though? I'm loop over all meshes to see if any change

No, not every mesh is a bone shape.  But the position you're interested in is probably the result of deformation (armature) rather than transformation (object.)

It worked!!! I would accept this as an answer.


text:
Multiple Textures House Model Export as FBX to Roblox doesn't work
Basically, I am trying to export my house model has multipules texture as a single mesh into roblox.
when I export model as fbx without joining parts into single model its looks ok.
but if I join all parts and make it single mesh the exported model, mesh's texture in roblox appear very bad.

My house model has multiple textures materials for different parts like ground, walls, windows, gates, doors, borders all are separate model and has different texture materials.
Texture Bake option I use are

Render engine Is cycle.
Bake is Diffuse, Only Color.
All unwrapping option including Smart UV Project.

Option so far I have tried

All Texture Materials parts are targeting same single UV MAP single UV Texture png file.
All Texture Materials parts are targeting same single UV MAP Diffent UV Texture png files.
All Texture Materials parts are targeting Different UV MAP and each model generating different png files after then combined all png in to udmi files.
Like in the video

https://www.youtube.com/watch?v=cYMM8nphppk
and also and done many tires but yet failed,

Hello and welcome. While files, images, and external videos or links may be helpful additions they should not be the only way to obtain information about your issue. Don't make understanding your question rely on downloading a file, watching a video or visiting an external site. Use the builtin tools to upload images or gifs, along with thoroughly explaining the problem in written form so it can be indexed and searched for thus helping future visitors with similar issues.


text:
Reading an operator preset, the right way?
What I'm trying to do: import a bunch of fbx files with consistent (non-default) importer settings, that looks like this:

user invokes the importer to bring up its UI;
user sets desired values in the UI, and saves them as a named preset;
user runs a script with directory path, and the preset name as input;
the script reads the preset once, and then calls importer many times
with the same settings to import all needed files from the given directory;

As I see the preset system seems to be intended to be used in the UI only. The only place I found in python files, is presets.py with its ExecutePreset class.
To execute the "script.execute_preset" operator I need to open UI, get the window context, etc. It looks a bit crutchy and unreliable.
Finally, I ended up with 'manual approach':
def get_presets_dir(operator_bl_idname):
    " returns presets directory path for the given operator. "
    return os.path.join(bpy.utils.user_resource('SCRIPTS'),
                        os.path.normpath(r"presets/operator/"),
                        operator_bl_idname)

def read_operator_preset(operator_bl_idname, preset_name, ignore_keys=()):
    " returns a dict with given preset values."
    # find the preset if given
    preset_path = os.path.join(get_presets_dir(operator_bl_idname), preset_name + ".py")
    if os.path.isfile(preset_path):
        # prepare the file content for execution, removing lines not containing setters ("op.xxx = ")
        with open(preset_path, "r") as f:
            text = "".join([s for s in f.readlines() if s.startswith('op.')])
        # execute the script to collect values
        op = SimpleNamespace()
        exec(text)
        return {k : v for k, v in op.__dict__.items() if k not in ignore_keys}
    else:
        return {}

# reading it once
preset_dict = read_operator_preset("import_scene.fbx", fbx_import_preset_name, ("directory", "filepath",))

fbx_filenames = [fname for fname in os.listdir(src_dir) if fname.lower().endswith(".fbx")]
for file_name in fbx_filenames:
    fbx_path = os.path.join(src_dir, file_name)
    # applying many times
    bpy.ops.import_scene.fbx(filepath=fbx_path, **preset_dict)

It also looks like a crutch, and it may break in many ways, but I think it at least will work regardless of the UI (even in a headless session). So, the question is: is there a right way to read a preset not from its operator, but from outside? Is there any API for this?
Using Blender v2.76b; PC; Windows;


text:
How to copy transform orientation to object's rotation?
Is there a simple way to copy a custom transform orientation to an object's rotation vector?
There is a command "Object / Transform / Align to transform orientation", but what I need is kind of "inverted" version of it.
I created an animation to make it clear what exactly I mean.
Now I join one object to another in order to inherit its rotation. And doing so I feel stupid. I'm sure there is a simple way, but I just can't find it.
Please help.

I don't believe there is actually... Your solution might be THE solution.

Bert VdB. do you mean the only solution?

I've contrived some code to do the trick. Please don't laugh on the lame-code - it works. :-) Maybe somebody will find it useful.

If you want to use it, just save the the text below as the "align_to_to_inverted.py" file, and then install it as an add-on. And you will have the "Align to Transform Orientation inverted" command in your Object menu. It's tricky to insert it in the "Object > Transform", so let's let it be there =).
To use it, in the Object mode select the source object and then the target object (if you want to copy source object's rotation), and execute the command. Selction will be reset, but the target object will remain active.
If you want to align to Transform Orientation, select the only target object, and execute the command. Note that you must set some custom transform orientation. Built in orientations, like Global, View, etc, will not do.
# align_to_to_inverted.py
# The script will align active object to selected one (if there is another selected object).
# or it will use current custom Transform Orientation (if any).
# It changes object's rotation values, but leaves its orientation intact.
# (c) LIII A.S. Mechanic Kharkov

bl_info = {
    "name": "Align to Transform Orientation inverted",
    "description": "Operator to set object's rotation as another's or current custom transform orientation.",
    "location": "Object menu",
    "version": (0, 1, 1),
    "blender": (2, 76, 0),
    "support": "COMMUNITY",
    "wiki_url": "https://blender.stackexchange.com/q/110894/23172",
    "warning": "",
    "category": "Object",
    "author" : "Mechanic. Kharkov."
}

import bpy
from mathutils import * # yes, I know

class AlignToTOInverted(bpy.types.Operator):
    """Aligns active object's rotation values only to selected or TO"""
    bl_idname = "object.align_to_to_inverted"
    bl_label = "Align to Transform Orientation inverted"
    bl_options = {'REGISTER', 'UNDO'}  # Enable undo for the operator.

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

    def execute(self, context):

        trg = bpy.context.active_object
        print("trg: %s" %(trg))

        #find source object
        src = None
        for o in bpy.context.selected_objects:
            if o != trg:
                src = o
                break

        if not src:

            #try to find current user Transform Orientation
            #but this will work only in 3DVIEW space.
            mco = None
            try:
                co = bpy.context.space_data.current_orientation
                if co:
                    mco = co.matrix
                    print("Using Ttansform Oientation %s" % (co.name))
                    print("matrix= %s" % (mco))
                else:
                    print("No Ttansform Oientation found")
            except:
                mco = None

            if not mco:
                self.report({'ERROR_INVALID_INPUT'},"No source object selected\nYou have to select two objects, or be in a custom Transform Orientation.")
                return {'CANCELLED'}

            # ger src natrix, and transposed
            msrc = mco
            trs = msrc.transposed()
            q = trs.to_quaternion()

        else:
            # source given as object
            print("Source object: %s" %(src))
            # ger src natrix, and transposed
            msrc = src.matrix_world
            trs = msrc.transposed()
            q = trs.to_quaternion()

        #now we rotate trg back to apply zero rotation
        mtrg = trg.matrix_world.copy().to_3x3()
        mtrg.rotate(q)
        mtrg = mtrg.to_4x4()
        trg.matrix_world *= mtrg
        #deselect all but trg object
        bpy.ops.object.select_all(action='TOGGLE')
        #select trg as active object
        trg.select = True
        bpy.context.scene.objects.active = trg
        #apply this as default rotation
        bpy.ops.object.transform_apply(location=False, rotation=True, scale=False)
        #and now rotate back to src rotation
        q = msrc.to_quaternion()
        mtrg = trg.matrix_world.to_3x3()
        mtrg.rotate(q)
        mtrg = mtrg.to_4x4()
        trg.matrix_world *= mtrg

        return {'FINISHED'}

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

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

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

# This allows you to run the script directly from Blender's Text editor
# to test the add-on without having to install it.
if __name__ == "__main__":
    register()

    # test call
    #bpy.ops.object.align_to_to_inverted()


text:
How best to create random surface variations (BI) in script-generated objects?

This lineup of marble-ish cubes with copper-ish letters affixed is the product of my very first Python script.  I have never written or even read Python prior to a couple of weeks ago, so... many thanks to all those whose code-snippets were shamelessly copied to get this working!  My next challenge is to make the marble-ish cube surface treatment a little more random, less obviously cloned.  I am applying pre-fabricated Material and Texture (Blender Internal) as follows
    #assign materials to cube and letter mesh

    marble_mat = bpy.data.materials.get("Marble")
    copper_mat = bpy.data.materials.get("Copper")

    if letter.data.materials:
        #assign to 1st material slot
        letter.data.materials[0] = copper_mat
    else:
        # no slots
        letter.data.materials.append(copper_mat)

    if cube.data.materials:
       cube.data.materials[0] = marble_mat
    else:
       cube.data.materials.append(marble_mat)

and now I am wondering what would be the smartest way to introduce small variations in the Material/Texture of the cubes.  I'd like slight colour and pattern variations, but have no idea how to go about it;  do I have to create N Materials and/or Textures for N cubes? Or could I decorate each cube as I create it, by subtly and randomly altering the standard Material and Texture and then baking it?

Cycles or Blender Internal?

Apologies, I have just edited to indicate I am using BI.  Still can't get cosy with Cycles, it seems so slow;  maybe I need more expensive hardware :-)

this
https://vimeo.com/40389198
might be what I am looking for... will report back when I have time to check it out.

The answer appears to be...
DRIVERS
Here is a quick manual proof-of-concept using Drivers, as in the tutorial ref'd below and in Comments on the original Question, which I heartily recommend.  My text explanation here will not be nearly so clear and user-friendly as the video, so I suggest anyone who is interested should watch it!

These cubes are copies of one cube (manually created, not scripted) which has random-number drivers (manually created and tweaked via the UI) attached to various properties -- Scale (xyz), Diffuse Colour, Diffuse Intensity, and the geometry of the Marble generated texture.  The result is fairly pleasing, though I would like to know whether/how I can overcome the signature diagonal grain of the generated texture.  In a game landscape these cubes would probably pass OK as "different" from one another, despite the grain issue.
Method:
1) expose some kind of python random function(s) to driver context, as shown in this vimeo tutorial:
https://vimeo.com/40389198
(sample rand function code is provided by the author via a link on this vimeo page, and this is what I used:).
import bpy
import random

def randf(lo, hi):
    return random.uniform(lo, hi)

def randi(lo, hi):
    return random.randint(lo, hi)

def gauss(mean, stdev):
    return random.gauss(mean, stdev)

bpy.app.driver_namespace["randf"] = randf
bpy.app.driver_namespace["randi"] = randi
bpy.app.driver_namespace["gauss"] = gauss

2) With object selected:  in a property editing pane, select an object property such as Scale, RGB value in Material, etc.  Other-click on it (whichever one you don't use for regular selection of objects, focus placement, etc).  When menu comes up, choose "Add Driver" and then select either the whole group or just one property, to be "set manually later".  The slider should turn purple to indicate that it's being driven.
3) Open a Graph Editor and reveal its property editing panel (N).  Choose the Driver tab.  Now you can select your driver (at left) and edit/tweak it in the pane.  I for example would choose Scripted Expression for my randomising drivers, and for the expression enter my randf function which takes 2 args, min and max.  For some properties (material and texture props, so far) you have to set a driver variable.  For others (pos/rot/scale I believe) you can skip it...  I don't know why there is a difference.  If you've done it all correctly, then when you press Update Dependencies, your object should randomly change its shape, position, rotation, colour, whatever the driver is randomising -- in my case, within the bounds set by the 2 args to the rand function.  Anything that causes a Scene Update should trigger this regeneration of the random values, but you can "turn off" the drivers using the "mute buttons" next to their entries in the GE left hand pane, freezing the object's appearance.
4) When you Duplicate this "driven" object, the drivers go with it and the cloned object also has the randomised property.  However, aspects of the original object are by default shared with its dupes.  So for example, material seems to be shared with dupes;  you can spawn a new cube by duplication but it will have the same (random) colour as the original;  they will both change to the identical new value when Update Dependencies is invoked.  To fix this, I selected all the objects (dupes and original), hit U, and picked Materials/Texture.  This apparently prevents sharing.  Each cube now has its own independent material/texture settings and finds its own random colour/texture when the update happens.  You can dupe the dupes and the inheritance continues; the original object can even be deleted without losing any of your hard work.  But whenever you dupe, you have to turn off material sharing if you want randomised material properties.
Conclusion:  Drivers are insanely powerful;  also -- potentially -- insanely fun.  It actually boggles the mind, thinking of all the strange and wonderful ways that properties could be driven by, say, other objects' properties, frame count, external data files, higher math functions... But my immediate practical need was to make random small variations in mass produced objects, and Drivers seem to be the solution of choice.  My next challenge is to create drivers under Python control.  If I succeed, there will be one more photo in this series :-)
Another interesting write-up on Drivers may be found here
http://blendersushi.blogspot.ca/2013/06/python-driving-arrays-like-boss.html
some of it is a bit beyond me right now, but I hope to understand it better in a day or so.

A moderator deleted my original Answer because it didn't meet SE standards (yep, it was a bit lazy), so I rewrote and expanded it, editing everything in sight.  I was unable then to undelete it so I posted this new Answer instead.  If someone wants to delete the old one permanently, that would be grand.  Thanks.


text:
pinning flag to pole: do I need an Empty?
This I fear counts as a Stupid Question (and there are indeed such things) but... I have placed a Cloth object (vertical subdivided plane, Cloth physics) up against a pole (tall skinny cylinder, rigid body, non-dynamic) and then pinned the cloth by the row of vertices adjacent to the pole.  I then selected cloth, then pole, then (Physics tools) Connect, Fixed.  What I expected:  the cloth would be glued to the pole at their relative positions as of Frame 1, attached at its pins, but would flutter freely.  What really happened:  The cloth flutters freely... while slowly sliding down the pole!
Reading some hints and tutorials I see that many recommend parenting the cloth to an Empty and the Empty to a solid object -- pole, whatever.  Is this indeed SOP?  Is a cloth incapable of participating in a RB physics Connection so that there must be an intermediary Parent relationship with a third object?
Also, I thought I had seen demos in which a Cloth object was simply pinned in mid-air by its own vertices, with no other object to constrain it... more experimentation needed...

AOQ:  yes, I can pin the flag in midair.  For some reason on my first attempt, I didn't create the vertex group I thought I had created.  On the 2nd attempt -- I would swear I went through the same steps each time, but there it is -- the vertex group was correctly created and works as a pin, and everything is dandy.
If the flagpole moved, and I wanted the flag to follow it, would the best practise then be to use an Empty between the moving pole and the flapping cloth?


text:
Insert video to sequence editor with python Script
i want to create a button for insert a video to video sequence editor.
i have written a script :
import bpy, os

class insertVideo(bpy.types.Operator):
    bl_idname = "scene.invideo"
    bl_label = "Insert Video"

    def execute(self, context):
        episode_path = "F:\\Dokumen\\Target\\Develop Apps\\addon_blender\\tes"
        bpy.ops.sequencer.movie_strip_add(episode_path)

class MyPanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "My Tools"
    bl_idname = "my.panel"
    bl_space_type = 'SEQUENCE_EDITOR'
    bl_region_type = 'UI'

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

        obj = context.object

        row = layout.row()
        row.label(text="Movie File")
        row = layout.row()
        row.operator("scene.invideo", text="Insert Video")

def register():
    bpy.utils.register_class(MyPanel)
    bpy.utils.register_class(insertVideo)

def unregister():
    bpy.utils.unregister_class(MyPanel)
    bpy.utils.unregister_class(insertVideo)

if __name__ == "__main__":
    register()

In episode_path = "F:\\Dokumen\\Target\\Develop Apps\\addon_blender\\tes"
I have 3 videos :

file1.mov
file2.mov
file3.mov

I hope, when i click this button :

It will insert all videos from episode_path. But, i have a problem. When i click the button, it always show error :

Maybe you can help me, What did i miss?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@cmomoney @sambler Thanks for your answer guys. Finally, i can finish my first addon in blender. I add this in execute function :
def execute(self, context):
        episode_path = bpy.path.abspath("F:\\Dokumen\\Target\\Develop Apps\\addon_blender\\tes")
        episode_list = os.listdir(episode_path)
        episode_sort = sorted(episode_list)
        first_frame=0
        last_frame=0
        for v in [f for f in episode_sort if f.endswith('.mov')]:
            movs = os.path.join(episode_path,v)
            start_frame = last_frame+first_frame
            bpy.ops.sequencer.movie_strip_add(filepath=movs, frame_start=start_frame, channel=1)
            first_frame = bpy.context.scene.sequence_editor.sequences_all[v].frame_start
            last_frame = bpy.context.scene.sequence_editor.sequences_all[v].frame_final_duration
        return{'FINISHED'}

Thanks for your help guys

When invoking an operator in python, there are three positional arguments that are generic to all operators, all other arguments that pass settings specific to the operator must use keyword arguments.
So to call the operator you should use -
bpy.ops.sequencer.movie_strip_add(filepath=video_file)

Note that movie_strip_add will add one video file as a strip, so to add a directory of movies you will want to use a loop.
def execute(self, context):
    episode_path = "/path/to/videos/"
    for v in [f for f in os.listdir(episode_path) if f.endswith('.mov')]:
        bpy.ops.sequencer.movie_strip_add(filepath=os.path.join(episode_path,v))
    return {'FINISHED'}

Wow... it's work!!!! Thankyou sambler. You saved me... Hahaha

Now, i need to set the script. Because, the video always in the frame 0. Thanks for help sambler

You could skip using ops altogether:
new_movie(name, filepath, channel, frame_start)
def execute(self, context):
    #create sequence_editor if none exists
    if not bpy.context.scene.sequence_editor:
        bpy.context.scene.sequence_editor_create()
    episode_path = "F:\\Dokumen\\Target\\Develop Apps\\addon_blender\\tes"
    movs = [os.path.join(path,v) for v in os.listdir(episode_path) if v.endswith('.mov')]
    for i in range(len(movs)):
        bpy.context.scene.sequence_editor.sequences.new_movie(os.path.basename(movs[i]), movs[i], i, 1)

Doing it this way also gives you more control, like name and what channel and frame for placement.

Hi cmomoney, i follow your tips but... uhmmm. this script doesn't work...

Maybe you can explain, why you define variable v in movs variable. Because, it's always error. error : variable v is not define.

So, i modified to this :
for v in [f for f in os.listdir(episode_path) if f.endswith('.mov')]:
movs = os.path.join(episode_path,v)
for i in range(len(movs)):
bpy.context.scene.sequence_editor.sequences.new_movie(os.path.basename(movs[i]), movs[i], i, 1)

Wow, looks messy.. and, i got this error : sequences.new_movie: unable to open movie file

v is the variable for the filename found in the episode path that ends with '.mov'. Its joined together with the path and added to the movs list.

Aaaah.. i see now

your script is work. I think i made a mistake when run your script yesterday. Sorry.. XD


text:
Nondestructively bridge edge loops?
When you add a Solidify modifier to edges that have no faces, it still tries to "solidify" the mesh, but it leaves a gap between them, refusing to fill in the space between with faces.
Is there a way to bridge these edge loops, without applying the solidify modifier?
Here's an image of what I mean. You can see the mesh, and the result of the modifier. I would like to bridge these edges without applying the modifier.

Are you simply wanting to put faces between surrounding edges?  You can select the vertices that surround where you want a face and press F for "fill" if you're in Blender 7.9

In some cases you can do it the other way round, using  Screw through 0 degrees to extrude plain edges to faces, before Solidifying.. but unlikely to suit. Can you give an example case?

Added an image.

I've always wondered how to take advantage of this weird quirk of the solidify modifier but it's really inconsistent so it's hard to say... you can try using a screw modifier set to angle 0 and really low screw value along Z before the solidify, and then at the end of the stack use a weld modifier and increase the value slightly until the solid collapses to faces https://i.sstatic.net/QqjPi.png

We can't do that with a solidify modifier.  But, yes, we can do it, non-destructively, with modifiers, at least in 2.93.6.  It is not the simplest thing in the world, but once done, we can just link modifiers from one object to another to copy it elsewhere.
The first thing we're going to need is a modifier that creates faces.  There aren't a lot of those; let's use the screw modifier:

On those settings, that modifier duplicates the edges, moves the duplicates up 1 unit in local Z, and bridges the loops.
Unfortunately, even though it made faces, it didn't make them where we need them to be.  We'll have to move the vertices it created.  Unfortunately again, we can't easily distinguish the vertices it created from the vertices that were originally there, because a screw modifier doesn't let us assign generated verts to vertex groups like a solidify modifier does (one of my favorite recent modifier improvements!)  But with a little use of geometry nodes, we can distinguish:

What's different between the two sets of edges?  The z position.  We'll store the z position (and everything else) as an attribute with a geometry nodes modifier.  We can compare our old positions to new positions to see if we're the same afterwards, and then displace the original position of our new vertices-- only our new vertices-- in the direction of their normals:

This is bigger, so let's walk through what those nodes are doing.  First, we're recreating our pre-screw position ("oldpos") from our x, y, and z attributes.  Next, we're checking oldpos.z against position.z to see if they're different, and marking the differences with attribute "diff".  Then, we're creating a normal from the old positions (our normals have been changed by our screw modifier), knowing that the normal of faceless vertices in Blender is just the normalized vector from the object origin.  Then we're multiplying that normal by whether or not the vertices are "diff" or not, and adding that to their position.
On my first iteration of this, I was working with vertex groups to store positions, but was pleasantly surprised to see that Blender stored the attributes directly.  Note that this is not a solution for 3.0, which dramatically changes how geometry nodes work.  A solution in 3.0 may or may not be possible.
If we'd rather not just use oldpos to determine our normals-- like, if you don't trust me that that's how Blender calculates the normals-- then we can always store the old normals as attributes, similar to how we store the old position as attributes, and use that to displace instead.
This is just like solidifying a line, with offset 1 and thickness 1.  If we want an offset of -1, we could multiply our displacement vector by -1; if we want a different thickness, we would multiply our displacement vector by that thickness.  Offsets between -1 and 1 are a little more complicated-- we'll also need to adjust the position of verts that have not been changed by the screw modifier-- but it is possible.


text:
How to create a mesh attribute containing an image?
I have a material that mixes two shader nodes together using a mask texture. Pretty simple stuff. However, a difficulty arises when I want to use this material on multiple objects. Either they all have to share the same mask (reducing versatility), or I need to duplicate the material for every object (increasing scene complexity).
Materials can, however, access certain mesh attributes by their names (UV maps, vertex colors, etc.) to achieve results that are different for every object the material is assigned to. For example, using vertex colors as the mask allows the same material to be used on multiple objects while having a unique mask for each. This is useful, but highly dependent on the density of the mesh.
Is there a way to use this same principle for image textures? Creating a mesh attribute of sorts named, for example, "Material_1_Mask" that can, for every mesh datablock, contain a unique image texture; then using that attribute in the material to control the mask on an object-by-object basis?
TL;DR: The question is: can I create a custom mesh attribute that contains an image texture rather than a float or integer or some other value, one that can then be used in a shader?
If not, is there another way to achieve the functionality described above?

Mesh attributes contain vertex, edge, face and loop data, so I think the only way to achieve what you want is to wrap each texture in a separate material and store the material on the mesh:

In order to have a single material, you could make a texture atlas and offset the UV of each object to the positions of the textures in the texture atlas.


text:
32-bit float vs float buffer for bump maps
I'm trying to figure out the various image settings and how they relate to a bump map texture. Creating the image with "32-bit float" certainly helps give smoother results, but it seems like enabling "float buffer" does the same thing.
Is there a difference between these settings? If so, what is it? Which is better suited for use in bump and height maps?
EDIT: The "float buffer" setting is found in the UV image editor's image settings (right under the resolution settings) after creating an image, before saving it. It seems to be automatically enabled when the image is created with "32-bit float" checked, and disabled if it's created with "32-bit float" left unchecked. I think it's just a way to alter the same setting after the image is created, but I'm not certain.

I think OpenEXR will give better result (and of course larger images) but it looks like painting a height doesn't give any good result for the moment, or I'm missing something, I hope someone will be able to answer

The "float buffer" probably keeps track of the data as 32-bit floating point, which is then downsampled to 8 bit integer color for typical saving.  Saving the image shouldn't change the data-- but quitting and restarting Blender should clear the buffer, leading to reloading from just saved image color, rather than the baked/rendered color.

I have always used 32-bit float for anything normal-map-baking-related as well as bump map mixing.
The "buffer" you mention, I cannot find it.
With The "Compositor on viewport" patch, I can think that the "float buffer" is offering a way to view it on the viewport.
Ultimately, you need this into a file, which is why I recommend using the 32-bit float from the image node directly.
(i.e: there's a buffer for Bloom, but ultimately you want it to affect the alpha to view it on your viewport).
I covered buffers briefly a while back:

Added an update to the question specifying the location of the "float buffer" option.


text:
Particle Nodes Documentation (2.90 beta)
I have been experimenting with the new particle nodes experimental feature set in the Blender 2.90 beta, but as there don't seem to be any tutorials out yet I'm having some difficulty getting into them. What few videos that do seem to exist seem to reference certain attributes and such that are not immediately obvious in the node editor, suggesting the presence of documentation or something like it. (I've not been able to find this, however.) Many things seem to work very differently from the other node editors, and new node input/output types abound.
I know the feature is currently a work in progress and incomplete. However, would somebody mind sharing the basics of how to use particle nodes? How does it function? What are the new node types? Preexisting attributes? How does the connection system work? What are events, forces, and the like? Is the functionality between 2.90 and 2.91 currently the same? etc.
Thanks in advance!
(A link to documentation would also be nice, if it exists, though that is somewhat tangential for this question.)

That functionality (enabled in Preferences/Developer Extras then in Experimental enable 'New Particle System') is really a work in progress and has no practical value at the moment. Many of the options in the new particle node editor are labelled 'mockup' indicating they're just placeholders for what is to come. The best you can do for now is watch that space in the upcoming releases and see how it takes shape. It's certainly far too early to be of any practical use and is no doubt subject to drastically change.


text:
Is it possible to copy smooth vertex normal to the vertex Color channel?

Blue normals need to be copied to the vertex color.
I have some low-poly models that need to be flat shaded so I want the vertex normals to be the split normals, but for custom shaders in Unity, I also need the smooth normals that are used for smooth shading. Since the vertex color channel is not used for anything, I basically want to store the smooth normals in the vertex color channel. This way the model can be flat shaded in unity, but I can still use the smooth normals for shaders by accessing the vertex color.
I found a plugin from Philipp Seifried that seemed to be what I was looking for, but it didn't do what I was looking for (https://github.com/Philipp-Seifried/Blender-Normals-To-Vertex-Color/blob/master/normals_to_vertex_colors.py) I don't have any experience with making plugins but from what I can guess the code copies the split normals to the vertex color channel?
Is there a way to do this?

You can use Geometry Nodes for that, with a very simple node tree:

When you apply the Geometry Nodes modifier in the modifier stack, the new color attribute sm_norm will appear.

I'm thinking, you might need to remap the normal from -1...1 to 0..1 range, but I'll wait for OP to eventually report a problem.

This gives me a better result but still not perfect. The remapping to 0 to one range makes sense, would i also need to swizzle the cooridinates for the unity axis?
How could this be done? We are very new to geometry nodes.

@Benni the normals here are in object space, so no swizzling is required at least as long as you don't rotate your object as a part of exporting process... The normals in tangent space would simply be all $<0, 0, 1>$… As for remapping from  $[-1, 1]$ to $[0, 1]$ you could use "Map Range" in Vector mode or just Vector Math: Multiply Add, multiply by $<0.5, 0.5, 0.5>$ and add also $<0.5, 0.5, 0.5>$

Sorry to come back this late. We did the mapping but I still have an issue when I use a outline shader on these objects. The shader moves the vertices out on the normals or in this case the color since that is where the normals are. The problem is all smooth normals in the color channel seem to point in the same direction. Any Ideas?

I solved it kind of. I had to remap the values back to [-1,1] in the shader ...well, obviously. It is still a little bit weird because doing (color * 2 - 1) did not give me a perfect result and some places did not behave correctly for my outline. However doing (color * 2 - 1.5) did give me good results.