text:
Why does my my door have odd circular lighting effect on it?
All of my other meshes have normal lighting on then but when it comes to my shower door it creates this odd circular effect that I just can't seem to remove.

The door is just a cube, however when I duplicate the single front face of the cube as shown here the lighting looks normal. When I extend the face to make a cube it adds that circular effect.

I haven't applied any materials to any of these objects yet so I'm not quite sure what is going on here.

Probably you have inverted normals on this object, but I'm not sure as this looks like render from Blender Internal and I don't know it at all.

Do you accidentally have a phong shader attached to doors?

What is a phong shader?

I have tried recalculating the normals but it is the same

I'm sorry I'm a little new to this. I tried creating a cube with the exact dimensions and it turned out fine. I've discovered that the lighting behaves in this way if you changed the shading here to 'Smooth' as opposed to 'flat'.


text:
Scaling an object from point A to point C with python
I have three objects in scene A, B, and C. I need object B to stagger between objects A and C. How would it be possible to do this in python? blender game engine'.

Basically you determine the start point and the end point. Then you calculate the distance between the two points and scale the object according to this distance.
Unfortunately you did not mention where your start and your end point are supposed to be. For simplification I assume the origins of objects A and C.
import bge

scene = bge.logic.getCurrentScene()
objectA = scene.objects["A"]
objectB = scene.objects["B"]
objectC = scene.objects["C"]

startPoint = objectA.worldPosition
endPoint = objectC.worldPosition

distance = (endPoint-startPoint).length

Here you know the parameters you need. To make it simpler you can place the origin of object B at one of the caps and ensure it has a length of 1.0 along the axis to stretch along (I assume it is Y). With that assumptions you can

place object B at the start point
point to the endpoint
apply the scale

in code it can look like this
AXIS_Y = 1
objectB.worldPosition =  startPoint
objectB.alignAxisToVect(endPoint-startPoint, AXIS_Y)
objectB.localScale.y = distance

 results in
When you do not want to move the origin of object B, you need to compensate that in your formula. Assuming the origin is exactly at the center of axis Y:
objectB.worldPosition =  startPoint + (endPoint-startPoint)/2

I do not want to go into detail when the origin is not at the center. I do not think it is worth the effort at this stage.
Remark:
As mentioned earlier the above description uses the center of A and C as start and end point. You might supposed to use the surface of the meshes. In this case you need to determine these two points differently (e.g. via ray measure). But this is a different topic.

Wow, that surprised me. That's exactly what I was looking for. Good part I had already done, I was just missing to stagger the object to destination C. That healed my doubt, thanks for everything!
Sorry for bad English, it's my second language.

Thank you for your feedback - it is nice to be able to help you

source: Stack Exchange

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

sort: votes


text:
Transition between 2 terrain texture
I have terrain (floating island) with 2 textures on it. Bottom (stone) and top (grass)

As you can see on picture there is not transition from stone to grass so my question is how i can make it. Here is my node setting:

I have looked at this question but it doesn't solve my problem.
I have tried with WaveTexture and ColorRamp but this is result i get with node settings:

I have ALMOST got effect i wanted but still it is not good enough because if i have transition on not flat surface i do not know how to do it.

@cegaton Please look at edit

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


text:
How to move multiple vertices like subdivide?
What I want to do is to move multiple vertices(upper picture) along the edges and all the other vertices appropriately like subdivide create new vertices(lower pictures). I hope I can move all the vertices along the lines at once where subdivide create vertices if you select more "Number of Cuts" in Subdivide submenu.
In short,
I want to Move vertices along the line between inner and outter vertices(upper picture) like subdivde creates vertices along the line. Lower picture is a sample of "subdivde" between inner and outter vertices

P.S.:curved shape

This isn't clear. The vertices on the inner arc are connected to 2 or 3 radial edges each .. which edges do you want the vertices to move along? Or do you just want to scale the inner arc outwards all together, until it lies where the subdivision line is, in the second illustration?

Yes, Robin. inner arc vertices are connected to 2 or 3 edges each. But when I use subdivide, they know exactly which line to use, because I select the outter arc vertices. I want to know if I can move all the inner arc vertices along the lines between inner and outter arc vertices just like subdivide knows which lines to create there new vertices at once.

If you get such an unexpected result, make sure you apply the scale of your object in object mode. Also, I am not sure how well offset edges work with tris, so try it with quad geometry.

Thank you dimitarsp. it works perfectly after I scaled up and down again back to original. using "Follow Face" option checked.

Cheers, and happy to help. If you are happy with the answer below, you should mark your question as answered.

To move vertices precisely along edge normals, you can use an addon called Offset edges.
Installation
Once you download the addon, go to user preferences, install addon from file, and select the downloaded file. Then make sure to tick the chckemark button to enable the addon, and save user preferences.

Usage
Once you have it loaded, in edit mode, in the left-hand toolbar, there is a new sub-tab called offset edges. There are three commands - offset, extrude, and move. In your case, you would select the move command, after which you can specify the width.

A sidenote - it's best to model in quads whenever you can in order to be able to subdivide your geometry efficiently with loop cuts.


text:
How to make the instances scale to follow the base curve tangent?
So I have this horizontal curve where I'm instancing spirals from. I grab the tangent of the curve and scale the instances oriented from that vector but it doesn't work as expected. How to procede so the scaling in X and Y occur perpendicularly to the curve's splines? Thx!

PS: The tangent from the 'curve to points' node is the original curve's tangent right?

maybe uneven scale is the issue. Try to apply scale

no, it's all good already

Can you share the file then?

Not sure what you're after here.  The tangent of the curve is just a direction.  It may be a vector, but it's a normalized vector; its length is always 1.  It represents the direction that a curve is travelling, and that's not a concept where magnitude means anything.  Separating components isn't really meaningful either; you're getting a portion of the vector based on your object axes.  Do you want instead to rotate them to match the tangent?

Crantisz: I can't share this one file, but I can assemble this nodes.  Nathan: I have an array of circular shapes and I don't want to scale them from Z axis, This is already going as expected, whats not right is this strange behaviour of the spirals squeezing. Is there a way of performing this squeeze perpedicularly to the curve tangent?

Please make a sketch of what you want. It seems you don't understand how scaling works in Blender, and that what you're really after is aligning first, and then scaling. Potentially, you may want to realize instances and then deform the 'spirals' (they look like circles to me)

Hello Markus! Indeed, I don't know how scaling works apparently. I've been struggling with a lot of stuff lately trying to make a cool asset, tryng to juice  some intelligence out. The reason why they seem circles is because they are seen from above in isometric view to better illustrate my problem. I'm will try realizing the instances.

The instancing is with 0 rotation (not aligned to the curve). The scaling is aligned to the curve. Each instance will be stretched in a different direction with respect to its own geometry. Maybe you want to align the instances to the curve, first?

Oh I get it! What was getting in the way was that 'Curve to Points' node, I just replaced to 'Resample Curve' so I didn't lose the info from the original curve - this somehow was screwing up the tangent information. Thanks for your time guys! Peace out! =)

This is how you scale along a custom axis in Blender:

Transform Geometry nodes use matrix transformations (in all cases except when only Translating = moving), and this is the typical matrix shenanigans (just like rotating around a custom pivot points means moving so the pivot point is in the origin, rotating, and moving back). Just keep in mind since you don't have the super-convenient "Reverse" option known from the Vector Rotate node, if you rotate on more than one axis, you need to manually reverse the rotation order from $xyz$ to $zyx$:

In your case you want to rotate multiple things, so You can't use the Transform node, but you can use equivalent instance nodes:

The result, as well as a comparison with UV spheres:

Aligning scale to tangent
I think you might be after this:

Um, wicked! I obtained a non-deformed result up there but the thing is that the won't align properly. Has it to do with that? My impression is that I'm not capturing precisely the tanget's perpendicular vector.

@AAAYerus I forgot to ping you to see the edit, so, see the edit and if it's what you want.

The best result I achieved so far has been this one, but as you can see it's still not aligning perfectly to the perpendicular. As you can see, I grabbed the perpendicular of the base curve's tangent, the spirals are kind of aligning to it but badly. Anything I can do to improve?


text:
How can I find the angle between curve segments?
I'm trying to figure out how to do it, I only neeed the angle from the X-Y axis between one segment and the next one. I checked out some other similar questions, but none of the ones I found were about curve segments.

When I ask to chat GPT it gives me this formula, and I interpret it like that. The problem is the results don't seem accurate at all. But I feel that would be the way to go. The only thing in this example is that I haven't considered only the X-Y axis.

Do you need the signed or unsigned angle here, and is your curve in 2D or 3D?

You can use the Offset Point in Curve node to sample the position of the points +1 / -1 from the current point, then getting the vectors to each using subtraction.
We can then flatten the vectors to only be on the XY plane my multiplying with a vector of (1, 1, 0) which removes the Z component.
Finally we can calculate the angle between two arbitrary vectors using the final group of nodes. This final group will work on any vectors in any direction to each other, but because we first flattened the Z component then we are only getting the angle on the plane.

The final angle calculation does use the same formula that ChatGPT gave you, but if we normalize the vectors we can omit the denominator because it is just 1.

Oh that's it, thanks very much! And I noticed that apparently I was using the wrong node, there is an 'arcsine' and an 'arccosine'...


text:
How to make Geonodes understand that an index sequence is a selection?
I've done some fancy math to achieve a specific index sequence and I want Blender to understand that this sequence is a selection of indices. When I input them to a compare node, only the indices that have the same number get selected. That's not what I want, I want the the index sequence itself to be the selector of the indices, like a boolean of indices.
So if my sequence is '0,2,4,8,16...' I want a boolean of these values in this format: 'TFTFTFFFTFFFFFFFT...' Is it possible?

Well, use a Repeat Zone looping on your indices to output either T or F ? It's hard to be more precise without having details on your setup.

You should rephrase your question to show the problem you're trying to solve, not describing the exact solution you've found and asking us how to make that work. The latter is often an XY Problem in disguise. Not to mention just describing a bunch of math and booleans via text is confusing for the reader.

The idea is to extrude only some parts of a geometry, but as the indices are so particular, I can't come up with any modulo, which would do for the selection, rather I'm forging a new index sequence, but I don't know if there is a way to make this sequence to be a selection. In this case, the selection sequence has to be '0,8,12,20,24,32,36,...' If there is a way to performe a modulo operation of such sequence than I  would love to hear that, please.

This sequence is the same for every case I'll need in the future.

When you want to go in a slightly different way, making a boolean list and specifying for all values if they are selected, arbitrarily, I have a roadsign to various approaches here: Geometry node angled line creation

$0, 2, 4, 8, 16...$ looks like a sequence of powers of $2$, without $1$:

Imgur mirror (SE image hosting has problems)
Mentioned in comments $0, 8, 12, 20, 24, 32, 36...$ looks like two sequences of multiples of 12, one offset by 8:
0,    12,     24,     36...
   8,     20,     32

Imgur mirror
But I get it, sometimes you just need arbitrary sequence...

Imgur mirror
And if you really want to parse a string because you want to provide an easy to use interface, then you need to use the tools available to parse it:

Imgur mirror
Notice how there needs to be a comma at the end of the string, as it tells the stack machine to output a number as a point. You can just add a comma to an input though... Of course for a professional usage you might want to check the string for errors and report that, also support spaces (just remove them or replace with commas and remove double commas to support space separation...) etc.

Wow, it totally worked, but how?? Analysing the two fractions they did completely different results... the 'not equal' math should trigger for every index, how is this possible? And how did you come up with the idea? Teach me please! Amazing!

@AAAYerus what you're missing is the implicit coercion of float to boolean. Explaining my methods of analysis and problem solving would take more space than comments allow.

Freaking genius. I keep struggling to understand all this context and attribute caputre/transfer stuff and then this....

@DanielMöller I also struggled a lot understanding geonodes, this is why I wrote some posts thoroughly going through how the node tree evaluates, that I wish existed when I started: What Does Capture Attribute Add to Geometry even then still you can "translate" from A (nodes) to B (effect), but when you know B (desired effect), it's hard to translate it to A, without experience you need to just run through various As in your head until you realize "yep, that's the one that translates to B" :D

Yeah, I figured that out recently. Basically the last node that receives the geometry input is the king, it's like a reverse hierarchy. Everything that comes before have to adapt to the next node's index sequence. So when u capture a previous node's attribute it's because it has the logic a following node needs. It's basically stealing.


text:
Rotate instances after being realized
I have a question which is similar to this one
but with a slightly different setup. I'll attach a file to show what my setup looks like.
After I realize the instances I lose that rotation I had applied for the Instance on Points node. How to regain it afterwards? The ideal is the poles to do that which is shown in the image, that they follow the underlying curve's flow.
Thanks in advance!

EDIT: Solution mal-function

Edit 2: can't reproduce solution 3

Solution 3: "rotating after" realizing
Since the other proposed solutions don't seem to work:

Solution 1: simplest, doesn't rotate "after" realize.
Solution 2: might behave different in different Blender versions

This solution uses named attributes instead.

Solution file:

There are two objects, one with each solution presented below.

Old solution 1
Anything against making the meshes before instancing?

Old solution 2
If you really need to set it after (I see no reason, but you might have more complex cases), you need to set the center of the rotation.

I just did that and nothing, the poles remain as they are. Question: how are you capturing more than one attribute in the same Capture node? Is it new in 4.2? i'm using 4.1, could that be the issue?
And yes, I have to realize them to further mess with it.

But you can realize "later" (there is a realize node in my solution). To be honest, solution 1 is the best, super easy, and it should work perfectly. There is probably something you missed in the solution. I took your file and put the mesh before the instance, just that. Didn't change rotation or anything.

To capture more attributes, just connect mode attributes to the empty slots.

Added a solution file

The solution is presenting itself to me like the image I added in the question.

@AAAYerus, did you open the file? There are TWO working solutions there.

Yes, that is the second one. Realizing the instances is something that must be done. I've been dodging it for a long time, now I don't have how to escape anymore.

But both solutions ARE realizing instances. (Which is not necessary in the first, but you can do it anyway)

Let us continue this discussion in chat.


text:
Sampled curve only consider one spline (workaround)
I created a grid with an underlying curve and the "poles" are splines instanced on the curve points, poining up, the base curve gets duplicated n times and they are placed along the instanced splines forming "rails". It all works well, but the problem I face is that: when I split the underlying curve into two splines, the rails don't follow along the two underlying splines, they get like portrayed in the image2. They get sort of revoled along the poles back and forth a few times. Is there a workaround so the splitting gets reflected in the rails as expected?

Any brainstrom would be appreciated guys!

Fixed! It was only a question of capturing the index from the original curve.


text:
Is there a way to make each icon in this render a hologram?
I made this texture out of an image of icons with transparency, and I was wondering if there is a way to have all the icons on the outer sphere point to the inner sphere with little hologram stems?  I'm assuming compositor nodes but I can't figure out how to get them to diverge to the inner sphere.
EDIT: this is not a duplicate of How to create a hologram projection with light rays? My question relates to making the stem of the hologram without a mesh (i.e. cone), but rather compositor based.
This is the render:

This is the node setup:

Basically trying to get non-mesh based way of achieving this:

Possible duplicate of How to create a hologram projection with light rays?

Yep I've used that article before.  The problem is they are mesh based.  You need a cone for the stem of the hologram.  I'm wondering if there is a pure compositor-based way to connect the icon material since they are not separate icons but just a sphere with transparency.


text:
How to light liquid on fire?
I'm trying to simulate liquid being lit on fire, but only the fluid works when I simulate both domains (the fire domain is on the second layer).  I tried to find a tutorial for this, but wasn't able to.  I've attached the .blend.
Thanks!

the .blend doesn't seem to have linked properly. Try baking the fluid to a mesh and then use that as the fire emitter. Otherwise you are trying to simulate from a simulation which doesn't work.

Sorry it took a while to load the .blend.  I do intend to use the mesh as an emitter but I want the match to be on fire first before it touches the fluid.

You will need to have two separate emitters

The issue is more why the match won't light on fire at all.  I could use the fluid as an emitter as well but I really need the match to light first.

Actually I figured it out.  I just had to remove the smoke modifier in the physics panel and reset all the values again.  Not sure why that helped.  And yes, definitely the fluid works as an emitter! :)

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


text:
How to sear or burn edges?
I've tried to make the edges of these shards burn with lots of different node setups, but I just can't get the gradient to work.  The goal is to get a real time burn effect during a fire simulation, that emulates a surface slowly turning black from the outer edges...as if it were embers in a fire or a lit match that becomes black eventually.  Thanks!
I've attached the .blend

I'm not sure I understand what you mean... Can you be more specific with what you mean by "sear/burn"? And possibly post some node setups?

Seems somewhat presumptuous to give such a vague question and expect a specific response, even posting your blend file as if we should just do the work for you.

Have you tried pointiness (geometry node in inputs nodes) ?

@LetTheWritersWrite I wasn't trying to be presumptuous or expecting someone to "do the work for me".  If you saw my node setup, you would see that I've been trying to make this work.  Anyway, if you want clarification just ask for it in a constructive manner.

@ScottMilner, sorry what I meant was the outer edges around the shards to slowly become black and close in toward the centre of the shard, like a match that gradually become charred and black the longer it burns.  Hopefully that helped to clarify.  I've posted the node setup.

@lemon no I haven't heard of the geometry node or the pointless feature...I will check it out!  Thanks

You didn't have that node setup image and no I wasn't going to open a blend file from a stranger without knowing more details.

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


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

Possible duplicate of make object A a parent of object B via Python ?

I 've looked at this but i don 't know how to set it up for my script.In a loop way

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

Would probably be negligible in terms of performance in this case, but good to know empties can be created this way!

can I chat with you somewhere? I have some questions...

The problem is that you assumed the bpy.ops.object.empty_add operator returns a reference to the empty object it just created. But like most blender operators, it simply returned its status, in our case {'FINISHED'} - which means it was successful.
So, you need a different method to find the latest empty created. Since new empty objects are created with the name "Empty", plus an automatic number (after the first empty), we can simply search for the newest Empty's name (which is also the largest in string comparisons).
import bpy

track = bpy.context.selected_objects
em = []

for i in track:
     # Set location directly when creating the empty, no need to set the cursor first
    bpy.ops.object.empty_add(type='CUBE', radius=0.15, location = i.location )
    newName = max( [ e.name for e in bpy.data.objects if e.type == 'EMPTY' ] )
    new = bpy.data.objects[ newName ]

    em.append(new)

    # Set parent and keep original cube's transformation
    bpy.ops.object.select_all( action = 'DESELECT' )
    i.select   = True
    new.select = True
    bpy.context.scene.objects.active = new
    bpy.ops.object.parent_set( keep_transform = True )

In addition to the main issue specified above, I also changed the way the parent is set, and the way you set the empty's location.

Thanks for the ansewr but it 's giving me this:

exec(compile(bpy.data.texts['Text.002'].as_string(), 'Text.002', 'exec'))
Traceback (most recent call last):
File "<blender_console>", line 1, in
File "Text.002", line 13, in
TypeError: bpy_struct: item.attr = val: Object.parent expected a Object type, not list
Am i doing some thing wrong?

Yup, had a small bug in the last line, fixed it

@TimoleonG Had to make another small change to avoid additional transformation of the cubes by their parents, now works as expected.

Thanks you realy for answering my question! I was doing the tests on cubes and it worked.The problem is that i have animation on the trackers(I track the markers reconstruct them and then I did constraints to F-curves) when I run the script it parents all the trackerss to the center of them.I don 't know if I can sent you the blender file from this page. Sorry for not being clear. I can understand if you lost your interest in this question.

@TimoleonG, upload your blend file here: http://blend-exchange.giantcowfilms.com/    And update your question and add this link.  Would also be useful if you explained what you hope to achieve by parenting empties to the trackers, other solutions might be out there.

I 'm doing facial motion capture.I want the trakers-empties to align to the bones of the face of the pitchipoly human, before i constant the bones location to the trackers-empties(copy location). I thought that this solution is simple, but the trackers-empties where to many so I thought to make a script.Do you think it will be beter to make a new question?Maybe a question for how to link traker bones.Or just update and explane this better?


text:
Camera Solve Focal Length Automatically Set To 24
Im wondering why when I go to solve the camera in a tracked scene it defaults to being set to having a focal length of 24. If I have the focal length above or below 24 before doing the solve it sets it back to 24, but I would like it to stay at the focal length I have set before the camera solve.

Even if I have refine set to nothing I still run into the issue of the focal length being set to 24 regardless of what camera settings there may be before doing the camera solve.

Motion tracking Solver does not automatically applies the settings of the Solved camera into your scene's camera unless you press Setup Tracking Scene (Movie Clip Editor Window, in the Solve Tab).

Blender's default camera has 24mm so I guess you are not using this feature. If not, you may apply the Camera Solver Constraint manually and then change the Camera properties too.


text:
Running into context error
Im trying to get this tracking script for running in the background working. It was working perfectly in the background until I got to the filter tracks portion. Here is the script:
import bpy

for area in bpy.context.screen.areas:
    if area.type == 'CLIP_EDITOR':
        override = bpy.context.copy()
        override['area'] = area
        bpy.ops.clip.detect_features(override, threshold = 0.05, min_distance = 25)
        print('Markers Detected')
        bpy.ops.clip.track_markers(override, sequence=True)
        print('Tracked Forward')
        bpy.ops.clip.track_markers(override, sequence=True, backwards=True)
        print('Tracked Backwards')
        totalFrames = bpy.context.scene.frame_end = bpy.context.scene.frame_start
        bpy.ops.clip.clean_tracks(override, frames=(totalFrames + 1), error=0.5, action='DELETE_TRACK')
        #Can get to here fine, error occurs when doing this filter track function
        bpy.ops.clip.filter_tracks(override['area'], track_threshold=5)
        bpy.ops.wm.save_as_mainfile(filepath="/Applications/blender2.76" + "test.blend")
        break

Does anyone know how I could fix this?

This is currently what the errors are looking like now for this.

Related: http://blender.stackexchange.com/questions/6101/poll-failed-context-incorrect-example-bpy-ops-view3d-background-image-add/6105#6105

Change:
bpy.ops.clip.filter_tracks(override['area'], track_threshold=5)

To:
bpy.ops.clip.filter_tracks(track_threshold=5)

And see if that works.
I'm not that familiar with what you are doing, however the reason I believe that you need to take out the extra argument is because of inspecting the auto-complete of the function when I enter it in directly at the console (it just seems like there is a problem with passing more than the threshold value - See Below):

After looking into this a little further, try just commenting this line out.
From the Manual it is meant to smooth out spikes in the track, the problem with this (this context) is: you just deleted the "spike" in your previous line of code, so there is no track to even deal with.
Or
Maybe you just need to check and see if the previous statement deleted the track. Then set a variable to indicate if the track was deleted, then you can make a decision to filter it or not based on that.

I think the override still belongs to match what was used in previous ops. But it should be override not override['area'].

Just made an edit to the post to show the errors I get from terminal. I appreciate your guys help, will keep working at this but if you have any more ideas that would be greatly appreciated.


text:
Some of hair particles are black (Cycles render)
I have an issue. I have Particle system and I try to render feathers with Cycle render but some of the feathers are displayed black. Feathers are just a texture on plane. In Eevee render it looks good but in Cycles when there are many of feathers on one spot some of them become black.

You need to increase the Max Bounces value for Transparent bounces under Light Paths in the Cycles Render Properties. Here is another duplicate of this question with a visualization of the effect: https://blender.stackexchange.com/q/253028/107598

Thank you, yup it's bounces for transparency.


text:
Trying to make curves follow points
This vertical lines are instanced lines and I'm trying to make horizontal lines that go from one point to the other of same index (since the lines are instanced, points with same height have same index), in other words: to make a fence. How to make the horizontal lines to follow the trail? The ideal would be to create curves with multiple points based on other points positions, but without such feature, I'm trying to instance lines to follow the curve shape. Any ideas?

OBS: these bottom horizontal lines (original object) are belzier with vector handle type.
OBS2: yes, I could only duplicate the bottom line, but that would'nt be ideal to my workflow I think.

I mean this: in this example there are 4 points, but they are currently in the same position and they travel along the first stack only with the 'sample curve' node factor. I wished that the four points were distributed to the four stacks and they were guided with the 'sample curve' node factor. Is there a way to do that? Then the points would be the position source for the horizontal line, in other words to build the horizontal stacks of the fence with custom height. An also, in the future be able to put many horizontal lines with different positions.

pls at least provide node tree - or even better: blend file. thx

"yes, I could only duplicate the bottom line, but that would'nt be ideal to my workflow I think." - why? Since this looks like a simple geometry, could you maybe manually create the input, and the output, to make it clearer what the geonodes setup is intended to do? As far as I understand now, you want to spawn vertical lines on points of a horizontal line, and then you want to also connect tops of these vertical lines (and since they're vertical, you really can simply duplicate the bottom and move it up).

It's difficult to tell right now because the project is in early stage, but I think I'll need to do that later on for a different purpose where I won't have this bottom line.

Oh I figured it out!

It was right before my nose! There will be more stuff to think about later on, like how to make more horizontal lines and sync the factor with a delay on each line. I wonder if the loop nodes are going to help in this sense when Blender 4.0 launches? Would be incredible!
Thanks for the help it really made the difference!

Given a starting curve (can be mesh, can be bare points, though vertices/points have to be in proper order) you can spawn instances of a vertical curve on them (what you have so far), but then you can realize those instances, delete everything but their ends, duplicate the starting curve (this time I assume it's a curve or mesh edges, but you could just spawn a new curve and resample to have the correct number of points), and set point positions to just prepared geometry in one-to-one relation (sample by index).

You could do it without deleting geometry, by calculating the index to sample (current index multiplied by the number of points in the vertical curve), or you could even do it without realizing instances like so:

The latter option, however, doesn't take care of eventual rotations and scale of the instances. You could still use vector rotate, and mix to take care of that, it wouldn't be hard, but since you don't hit some performance issues, I'd say if you want rotations, then simply use the first solution, and keep the node tree simple.

The result is great but, I wonder, is that a way to make the curve to travel along the stacks with a factor? that would be great! I think perhaps with a sample curve or a spline parameter would do somehow?

@AAAYerus I don't know what you mean by "traveling along the stacks with a factor".


text:
Is it possible to make multiple splines to be sampled in a 'sample curve' node?

Summarizing: I have a spline on the ground that is instancing other vertical splines ('poles'), then I'm copying the ground spline and sampling each point to a different pole driven by a factor. This factor decides where the created spline's points will be along the poles.
My question is: Is there how to create several ground curves and put each of them in a different factor.
In case it doesn't or it's too complicated, will that be possible when the 'repeat zone' launches in Blender 4.0?

Welcome. Please use a title that matches the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue in such way that anyone searching for a similar problem may easily find it. Use the [edit] link above, remove anything superfluous, avoid words like "this","issue with" or "question about". Remember, your title is the first thing potential visitors will see, answers you get depend heavily on how inviting it is. See "What is the problem of asking “How do I do this?"

Sorry.... sure!

I did it! It something like that. Still have to fine tune it. I did something similar with a blind a while ago, had to remember the path and adapt a bit. It's not quite there yet, but it's good to see it working! Thanks for your time, I really appreciate it!

There: better yet! Thats exactly what I wanted, only missing a map range or something like that to put the 'bottom' and 'top value' always between 0-1.

X problem: yes, that's what Curve index is for:

Y problem: you can loft the pole-curves to 'fill' it with another geometry, if that another geometry has already correct topology. Here calculating that topology is trivial, it's a simple grid. You can delete vertical lines of that grid, which won't affect horizontal edges and vertex indices. You could just spawn a horizontal curve and use duplicate elements node to accomplish the same with less nodes, but I wanted to show how you can wrap anything around those poles. The pole-curves can also be modified prior…

Sample Curve workflow
Back to the X problem if you really need to do it this way, I tried to rationalize it by using bezier curves with auto handles:

Thanks! But, the reason why I want the 'sample curve' is to slide the horizontal bars in a different rate each, based on their index number, so e.g. if there is 10 bars the last one dislocates 1/10th in relation to the 1st one (or the top most one) through the pole's lenght.

@AAAYerus either move the points of poles, based on some algorithm, e.g. use a map range, from min 0, from max 1, pass z coordinate as value, and modify to min and to max based on fields… Or when you sample the curve in the option #2, code in some logic (I don't know, e.g. pass the factor of current curve to math: sine), and use that as the sampled factor instead.

That's exactly what I'm asking. =p I need a way of almost precisely position it with a syncronized distribution, almost like a curtain but vertically.

Will we be able to do this by 'repeat zone'?

@AAAYerus here's an example on how you'd apply a sine to the heights of the wires: https://i.imgur.com/tKrlEvX.png https://i.imgur.com/HdWomn4.png


text:
Best approach to recreate following insets
I have been unable to find a good method to recreate this pen cap. The solution that comes to mind is using a plane with sub-division and using shrink wrap to project it onto the dome>solidify>bool. This is clearly a bad way to do this if there is a better way please share it. Thanks in advance
Here is the image of the object

Current result

Hello, we can't see any image

sorry, now its visible

You could begin with a plane and draw the same shape:

Then give it an Array modifier (with a Count of 4) and a Simple Deform (Bend mode, 360°):

Move the horizontal edges in order to reduce the top:

Inset the shape and move it inwards:

Très élégant ..:)

Merci  ;)  et bravo pour l'usage des accents !

Thanks a lot for taking your time to recreate it. This make a lot of sense, didn't knew about simple deform. Thanks Again


text:
Why is my bevel modifier only working on some edges?
I want all my hard edges to be buttery smooth, but this object is just 1 object, and yet the bevel is applied in a weird way:

Is there a way I can "fuse" this object more so that it all acts as one and this bevel works properly?
Updated with Wireframe:

Updated with wireframe and no bevel modifier:

A wireframe would help more.

Could you please share your file? https://blend-exchange.com/

@HaskellMcRavin Added wireframe!

@moonboots I'm sorry it's a proprietary client file I can't share

can't you share just the small part with the problem?

I can't tell what the geometry is like without the the bevel.

@HaskellMcRavin Added another wireframe

@a_good_swan then we can't help sorry. we can only guess the problem & solution. i'll make a guess, go into solid mode and tick Face Orientation under the Overlays. is it all blue? if not then select all with A and press Shift+N to recalculate normals. then also do A then M > Merge By Distance


text:
Getting this weird halo in my reflection
Im getting this weird halo in my reflection when rendering. Does anyone have any suggestions to help with the node setup I have going on here for reflections to help get rid of this.

It was recommended to me that I have my mix shader at 0.5, but if I do that this happens I imagine due to the environment lighting:

So I guess where I am at now is is there a way to get the reflection of only the object which I have on a separate render layer, and not get the reflection of the environment lighting.

maybe you could try using 'multiple importance samples' for your lights as for the node setup I suggest you put the mix value to 0.5 (0 is original image, 1 is second image only)

Made an update to the original question.

Activate the Clamp Checkbox in your Mix node. This should solve the problem.

Could you also say why it solves the problem? Your answer helps solving this particular problem but it would be good to know why it solves it for future problems.

Yes ofc. Sorry that I didn't give an explanation, but I was concerned it might look confusing while some might overlook the actual solution.
As we all know, digital colors are represented by the three values R, G and B where the minimum is 0 and the maximum is 255.
If you mix two images, these values has to be somehow processed. "Somehow" means, you can actually choose how. There are different ways. Some are based on pure mathematical algorithms (add, multiply, substract e.g.), while others are discribed by their visual behaviour (soften, harden etc.). They are called "blend-modes".

However - as we can only have 256 values for each channel, it can happen, that some opperation can't be done precisely as there are no float numbers. To solve this problem some programs are using values from 0 to 1 instead. Where 1 stands for 100% (256). All other values will be floats (0.x) then.
But if you now add lets say two valules of 0.6 each, it becomes 1.2, which can not be represented by the normal RGB values.

So what the program then does, is up to the user. If you need the color-behaviour (surface-color), you can do two things: either just cut everhing above 1 or recalc all the other values, to make it right percentage-wise.
None of the results will be the correct result of the actual operation (addition), but both prevent you from getting strange behaviour - just like the halos mentioned in this thread.
But if you wanna use the value lets say for microdisplacement, values above 1.0 can come handy! Therefore you have the option to choose either to "clamp" or ... not. :-D

If my explanation sounds complicated or wrong - its just because of the explanation itself. Im not good in this. But I hope it helps anyways.

You should put that in your answer!


text:
Can't do subtraction with Boolean modifier
I'm trying to get my hands into Blender after months using Sketchup and facing the limitations of that last one (subtracting shapes is limited to PRO and even in pro, it is still quite limited).
I first tried to export a collada file but then I read that maybe my objects are not plain.
So I did what I usually do when I check my stl files for 3d printing, I repaired them, and then re-exported them through collada and Imported then into Blender.
Unfortunately, I still can't do the subtraction.
Surely somebody here will tell me what's wrong? Maybe the whole approach?
I attached the blend file (2.6 version) so some charitable person could have a quick look and spare me light years of trial and error?
https://drive.google.com/file/d/0ByBlKzf_FnbIaEdKaUhrZk11Nlk/view?usp=sharing
Resolved. Thanks to @Mr Zak for his help! (See second comment)

Welcome to Blender.SE Laurent!  Could you please add some more information as to what you are doing that is not working, maybe some screenshots or a .blend?  Thanks!

Removing double vertices from both spiral and cone (in Edit mode select all and W > Remove Doubles) should make the boolean to work just nicely.

Hi @PGmath, I did, check the link to google drive, it let you download the .blend file. Adding a screenshot right now!

@LaurentChenet Sorry, I didn't even notice that (facepalm)!  The screenshots will be helpful, thanks.

OMG @Mr Zak, you did it. I tried your instructions, I did edit both, w, remove doubles, keep saying that it Cannot execute. The screenshot I added was after the recommended changes. Did you do anything else than that?

@PGmath, added now :-)

@Mr Zak, never mind, I guess I have to admit I'm a nOOb in blender :-) I forgot to select all before removing the doubles :-))). Thanks a lot!

just for the record: light years is a distance measure, not time

@gustavofritsch, I agree, I was talking about the total distance my mouse cursor would have traveled before I'd figured this one out on my own. Sorry for the confusion :-)

@Laurent Chenet touché.

Your mesh has to be non-manifold. I had troubles with this as well. Removing doubles it typically a good way to start achieving non-manifoldness. There are enough tutorials out there and somewhere in the documentation there's a hint, that your volume has to be non-manifold for the boolean stuff to work properly.


text:
How to use the Rigify building blocks for non-human rigs?
The Rigify documentation says that

It is based around a building-blocks approach, where you build complete rigs out of smaller rig parts (e.g. arms, legs, spines, fingers...). The rig parts are currently few in number, but as more rig parts are added to Rigify it should become more and more capable of rigging a large variety of characters and creatures.

Based on this description I assume that it should be possible to create arbitrary (non-human) rigs with Rigify. However, all the Rigify tutorials I found start with the creation of the human meta-rig from the add menu, and no additional bone is added to it. I see that in Edit mode I can "add a sample" from a list of items, but I don't understand how to use it. For example how could I rig a spider with Rigify?
EDIT I found a BlenRig vs Rigify thread on blenderartists.org where everybody agreed that Rigify (as opposed to BlenRig) should be able to handle non-human characters. (But they didn't say how exactly...)

"Rigify is a general purpose template based system and it will let you create custom rigs for any character without really needing to know the mechanisms behind the rig. (...) On the other hand, BlenRig has a more limited use, cause it is (for now) intended for humanoid characters. So, any other rigging procedure would have to be made manually. In other words, if your character has 4 arms, you will have to duplicate BlenRig's arms in Edit mode manually, there is no "add arm" button."
"Rigify is intended to be/become a very general solution for creating the armature and controls of any character via a building-block/template paradigm."

EDIT 2 To clarify, my basic question is: how should I use the "Add sample" button (which appears in Edit Mode in the "Rigify Buttons" panel, see the screenshot bellow) that adds a rig building block? Am I not supposed to use it? (that would be weird). If I am supposed to use it, what are the rules for building a meta-rig? Can I build a meta-rig from scratch or should I always start with one of the two meta-rigs (Human and Pitchipoy Human)? Can I combine Human and Pitchipoy Human building blocks in one meta-rig or are these incompatible?

Create an armature and enter its edit mode. Delete the bone to start fresh.
You can build a custom metarig from "samples" that you can add in. Later this metarig is used to generate the rigify rig.

To know what samples to use for your use case try them out and see what they do.
Each sample will be added in the scene origin. Position the samples like you want, align them to your character. Parent them to form the metarig. You can create the human metarig that you can add as a whole from samples or you can create your own metarig (one with 4 arms for example). There are also animal parts available.
You can mix them how ever you like.
You can also add your own bones and make them 'Rigify-able'. In Pose mode select a bone and inside Rigify Type tab in bone properties you can change the parameters:

You can change on which armature layers will Rigify generate bones and customize other settings. This can be changed on the sample metarigs and on the individual samples as well.
You can see what the options do in the addon documentation (Advanced usage section).
Then generate the Rigify rig from your metarig.

When should I use the "basic.copy", "basic.copy_chain", "pitchipoy.super_copy" samples?

I don't think they are ordinary bones just named adequately. If I create a "spine" building block from scratch, it creates three connected bones called hips, spine, ribs, and a new rig can be generated from this meta-rig. However, if in a different scene I create three connected bones manually, and call them hips, spine, ribs, then Rigify generates only the root control.

From the README it seems to me that the magic is not in the name, but in some hidden "rigify type" attribute (hidden because as far as I can see, one cannot edit or see it in the GUI), which is added to "the root-most bone" of each bone chain.

@WannaKnow Yes you are correct. There is also a custom property added on the bone. You can see it in the pose mode under bone Custom Properties. I correct the answer. It is not hidden from the UI though, there is a nice access from Rigify Type tab inside Bone Properties panel.

About having to use existent blocks: your mistaken. See, while rigify only hands you types specic for human rigs, these types are fairly small and universal. Also the 'hidden' property is actually to be found in posemode, in the property-panel under the tab 'bone' in the panel on the very bottom.
You can use any bone structure you like and add select the type for the rootmost bone, as long as you fullfill at least the requirements for the rigify-type. after creating your meta-rig you can save it to a textblock by pressing the button 'Encode Metarig to Python' in the toolshelve, under tools at the very bottom (in the panel 'Rigify Dev Tools'). The produced textblock you then would save as .py in the folder 'metarigs' in the folder 'rigify' in your addons. Close blender, open blender, disable and re-enable rigify and your custom metarig is on.
Now about your spider: Sadly adding a new rigify-type is only possible with python. While im developing a sub-addon, that gives rigify the ability to encode your rig to a rigify-type, here is a simple workaround:
The leg of a spider mainly consists of 3 Bones and a small appendix. You could use a biped arm as base, and ignore the appendix or create it manually after generating the mesh. OR you could use a spine, add a bone and define its controlles. (there is a panel in the bones-tap wich lets you enter integers, seperated by comma+space. Only those bones will get a controll-handle.)
I'm currently developing a sub-addon, that shall later give the ability to auto-encode existent rigs to rigify-types (and a s-load of other stuff). I'll try to inform you once that feature is stable.

As mentioned on the addons page rigify is built using a building blocks approach, allowing different rigs and rig components to be added to the system.
So far only two biped rigs have been added to this system.
If you look through the files for the rigify addon you will find some fairly detailed information in the README and looking through the scripts used to create the existing rigs you should find more info on how the rigs are built. You may also notice that the pitchipoy rig includes support for a tenticle and paw.
Note that the rigs are completely generated using python scripts, they are not pre-generated armatures saved in a blend file.
You may also want to experiment with the existing rigs, they might be more flexible than you may think. While removing bones currently breaks the generate step, you can duplicate existing bones and get multiple parts in the final rig (and delete extra bones from the final generated rig).

Thank you! Your answer was useful (upvoted), but it didn't answer my basic question (how to use the "Add sample") button which appears in Edit Mode in the "Rigify Buttons" panel. I will edit my question again to explain better.

You can add pieces to existing or new rigs. It would appear to be incomplete though as some work some don't. I don't see issues with mixing pieces from each rig.

I could be wrong, but as I understand it, the Rigify addon is made specifically for rigging humanoid characters. To rig a spider you'd be better off building the rig from scratch. The idea i guess would be that you could copy eight arms and delete the spinal column and get something that works, but I think that the rigify documentation is talking about say, a humanoid creature with four arms. The benefits of Rigify are that you get a bunch of complex controllers to more easily control your mesh, and i think that the controllers might be more of a hinderance than a help if you managed to properly edit the human meta-rig. I hope this helps, if you need help building a rig from scratch, I recommend using methods shown in David Ward's tutorials on youtube.

Thank you, but I think Rigify should handle non-humans. I edited my question to explain why.

@WannaKnow of course Rigify could handle non-humans. But it can't now. It is a template rigging system and has no templates for other than human parts now. To add a new template and script the UI controls and everything is a more work than to create the rig from scratch.

@Jerryno I realise that I can use only the existing building blocks, the question is how should I use them. I edited the question again to clarify.


text:
Particle system emitting upside down
I am doing a Blender tutorial from Blender Guru on How to Build a City (https://www.youtube.com/watch?v=XCEN0qQOsIA) and I'm around the 30 minute mark where you insert your buildings as a group particle system. Many problems arised once I did so, for starters the buildings were emitting the wrong side of the plane (through the bottom), I fixed this. The buildings were also still overlapping even after I unchecked random, I fixed that as well. Now there's only one problem I can't seem to fix. The particle system of the buildings is emitting the proper way (upwards out of the plane), but they are still upside down (on themselves). Picture down below (first picture shows the top, where the entrance is, the second pic shows the roof with all the addded details on the plane that I'm emitting my particles from):

I've tried messing around with the majority of the particle settings but an't seem tto figure it out, the closest thing I could get was under the rotation tab and messing with the phase, but thiss turns the particles around the plane, not on itself. Any help would be appreciated! Thanks!

make sure you have the correct orientation drop down. Rotation>Initial Orientation> Global Z (or any that may work) You may also need to correct your initial group, you may have inverted them incorrectly. Go back to your group of buildings and rotate them correctly, You may need to apply scale (CTRL+A)

Yes I tried all of the orientations. Object Y is the only one that gives the closest result. I made sure that my building group was also properly rotated on it's own layer. I will try the scaling.

if you want to attach your blend file, I can take a look and try to figure it out

http://blend-exchange.giantcowfilms.com/

Here you go! Hopefully it worked! It's my first time using this website! Thanks for the help!

It somes down to both object origin and its orientation along global axes. For emitting with particle system orient instance along +Y axis, then Velocity/Hair or Normal orientation in particle system settings is enough. Or use default orientation of the object and then Object X, Y or Z in the Particle system > Rotation settings

Ok I took a look at your file, You had to fix the rotation of two things.

Change the rotation for the particles to Global Z
Go back to your other layer and rotate the group as shown in the image
You had the pivot point at the top of all your buildings, So Blender assumes this is where the building should start. You need to select each building in edit mode, then select the bottom face, hit Shift + S and choose move cursor to selected. Hit tab to go back to object mode and on the left tool bar change pivot point to 3D cursor.

You need to do this to every building in the group.

Or you can just use the fixed blend file.

Thank you so much! I tried messing around with the buildings in their own layer but never thought of the pivot point. I didn't think my Object Y rotation was a problem since that's what the guy in the tutorial selected. I rather try to learn it on my own so I'll do all your steps, thanks!

Glad I could help, Feel free to accept the answer so it can help others in the future.


text:
Getting error - You should have active texture to use multires baker
I have been struggling to find the actual problem, I have modelled and sculpt Dinosaur and have applied multiresolution modifier and want to bake Normal map. But whenever I try to Bake, it's giving me error that "You should have active texture to use multires baker".

Solution already tried :

Checked if any hidden vertices or mesh. I have selected everything and unwrapped it. I went to edit mode -> Alt+H (Unhide every thing), Press A to select all vertices -> M -> Merge by distance and Ensured that everything is selected -> Press U for unwrap

Open UV Editor, create new texture as 4096 x 4096 named it - Normal, Click OK

Open Shader Editor, create new material, drag 'Normal' (texture above) to shader editor

Ensure that, object (in edit mode) in viewport is selected, Node (Normal) in shader editor is selected, all vertices are selected, Click on Bake (Bake from multires is checked)
Giving error - You should have active texture to use multires baker
Blend File - Download (expiry 7 days)

Does anything in this post help? https://blender.stackexchange.com/questions/94396/unable-to-fix-error-message-you-should-have-an-active-texture-to-use-multires-b?rq=1

There is something wrong with the material. It has an Image Texture node (that should be not connected while baking) and it's selected. But baking completely fails, no matter if it's a Bake From Multires or a normal bake. Blender claims there is no image texture ...huh? Fix: create a new material. Add an Image Texture node, select the image Normal-Map, and select the node to make it active. Finally, press Bake and everything works. (tested with Blender 4.0, I have no idea what's wrong with your material.)

@Blunder - I have already tried by removing and connection between Normal Map (Image Texture) with BSDF and ensure that It is selected before pressing the bake button.  Even I have made another material and texture, nothing happening.. any one pl help

Hi. I've tried on another computer (Blender 4.0.2). It's the same. Looks like the material is corrupt. Even if I delete all nodes and create a new single Image Texture node I get that error. If I just create a new material, add that single node then it works. I have no idea why. -- I would change the Color Space to Non-Color else you get a weird pattern for the flat areas in the normal map. Also the scale is y:1.00044 (=non-uniform). I've applied it and UV unwrapped the model again to make better use of the texture space.

Here is the compressed file including the baked normal map (4k, RGB, Non-Color): https://easyupload.io/wj7lut (expires in 7 days). Let us know if the bake works with that material. Hope that helps.


text:
How did I set up this particle system?
Using Blender 2.93.
A while ago, I made a paper mache dancer inspired by the Major Lazer Light it Up music video. I'm trying to refamiliarize myself with how I set this up and I can't figure it out how I referenced the bouncy mache particles.

It says rendered as path in the particle settings, but I don't see anywhere where I might have instanced the object into the particle system. The only way I see to instance the particle around the dancer is by rendering as object, but somehow I got it to work as path and it looks way better this way.
I even thought maybe it was something to do with an earlier Blender version and tried 2.83.
Can someone help me figure out HOW I figured out how to do this so many months ago?
Blend File
https://pasteall.org/blend/dab14583f83344789834725da3b55895

Figured it out. I didn't instance a plane over the object as particle system. I changed the hair shape of the particle system to look like a bunch of planes. Solution in the picture. Will only show in Cycles.

Do you want to add a screenshot to clarify your solution?


text:
Float/Integer overload?
Attached is a Geometry nodes timer in days, hours, mins, seconds. The clock is... nothing special. It takes the days, hours, minutes seconds input, evaluates everything into seconds, adds the frame time, then re-composes the time into a dynamic string.

If you enter 192 days in the Group input and run the animation, the clock turns over as you'd expect.
If you enter 193 days or over, things get weird.
The maximum value of seconds is 31 million - easily handled by floats or integers. But the value doesn't increment regularly if days exceed 193 or so.
Any help?

just a first test, when I enter 0d 0h 1m 55s at frame 0 then the result is 0d 1h 1m 55s. This is +1 hour and doesn't seem right.

Ugh. Thanks. Fortunately, that should be a Math node error I can fix. The anomalous animation numbers going past 193-4 days... I don't understand that bit.

Remove the floor math node in the days part

Geometry Nodes floats are implemented as IEEE 754 float32(). This means the mantissa part has 23 bits. Mantissa encodes a value between 1 and 2. This means that $\text{mantissa}^{exponent}$ can use an exponent of 23 (it's not a coincidence it's the same number as the number of bits of mantissa¹) to encode the smallest value $8388608.0$:

01001011000000000000000000000000
and the biggest value $16777215.0$:

01001011011111111111111111111111
Then for the next number you need to increase the exponent and start at mantissa = 0 (implied +1):

01001011100000000000000000000000
Problem is, at this point you can't increase the number by 1 again, because you ran out of the float precision: the smallest possible change to mantissa is ${1\over2^{23}} = 0.00000011920928955078125$:
$$1 × 2^{24} = 1 × 16 777 216$$
$$1.00000011920928955078125 × 2^{24} = 16777218$$
For the above screenshots I used a great tool to play with floats32:
 h-schmidt.net: IEEE-754 Floating Point Converter
Here's a Q&A about C#, but it implements the same IEEE 754 standard as C/C++ used by Blender:
 Why does a float variable stop incrementing at 16777216 in C#?
Geometry Nodes context
The problem in regards to geonodes comes down to the fact there are no nodes for mathematical operations on integers. So whenever you do stuff like modulo, you need to connect an integer to a float socket, which converts the variable and loses precision in the process. I ran into this problem here:
 How can I re-sort the points/indexes of an object in geometry nodes?
If you read into the comments you will see how Quellenform, upon testing, discovered the setup starts failing at large geometries, and I later discovered it starts failing after exactly $4096$ vertices: that's because I square my geometry there, and $4096^2 = 16777216$, Once you exceed that number, doing divmod to get the row/column of a squared geometry starts failing. In my case the solution was easy, nowadays when I square geometries I do it like so:

In your case it's not immediately obvious what the algorithm should be, except that you shouldn't add all the days, hours, minutes, seconds together to then modulo them; you want to avoid big numbers, so if you e.g. want to be able to input a number of days with a fraction part (I imagine that's why the socket types are floats), then take the fraction part, multiply by the 24 and add to hours, then take the fraction part of that, multiply by 60 and add to minutes etc.
¹ - the logic is, the right-most bit of mantissa means either $0$ or $1\over 2^{23}$ to be added to fractions described by other bits (the exponent in each fraction is the number of the bit). So ${1\over 2^{23}} × 2^{23} = {2^{23}\over 2^{23}} = 1$. So for any float, once the exponent is equal to the number of (explicit) bits in mantissa, the minimum step becomes exactly $1$:
>>> import numpy as np
>>> np.nextafter(np.float16(2**10), np.float16(inf))
1025.0

>>> np.nextafter(np.float32(2**23), np.float32(inf))
8388609.0

>>> nextafter(2**52, inf)
4503599627370497.0

(the mantissa in float16 has 10 explicit bits, and in float64 used by Python has 52 explicit bits)
For some interesting bugs in integer domain, related to the fact underlying implementation uses floats32, see this:
Geometry Nodes: How to Read Last Digit of a Big Integer?

I was hoping it wasn't going to be a binary space problem :(
I could avoid big numbers completely and turn my nice, easy-to-read Math nodes into a bunch of complicated Compare/Switch node conditionals, to cater for the 60s/60m/24h/365d rollovers to zero. That's not fun. But thanks, Markus :)

A more careful read of your explanation raises another question around Modulo arithmetic. How does connecting an int to a float input 'lose precision'? I can see that practice gaining decimal precision for the operation, but not losing its pre-decimal magnitude. Is precision loss always the case, or are you talking about the magnitude of the int and float number spaces?

@OroNZ both integer and float use 32 bits of memory. It would be silly if a float could express all possible integers, and then on top of that some non-integers :D If you draw a histogram with the bucket width of 1, the line describing how many numbers can be stored for an integer will be a horizontal line from -2147483648 to +2147483647. If you draw a float, it will by a logarithmic distribution, with a very high peak of [0..1) buckets of height $(2^7-1)×2^{23}+1$, then in range [1..2) the height will be $2^{23}$, two buckets in [2..4) will share $2^{23}$, so ${2^{23}\over2}=2^{22}$ each etc.

Eventually the ranges will spread there's more buckets to share a range than the numbers in that range, and at that point only every 2nd bucket gets a single number (and then only every 4th bucket etc.)

Thanks again, Markus :) I've modified my clock. hh:mm:ss are still worked out the same way, but days are no longer converted into secs - a Compare-Switch pair increments days if hours goes over 23.

@OroNZ I think it might be an interesting question in and of itself how to code a clock with (YM)DHMS offsets.

Indeed :) After your input, I started down the path of "OK, so, what would be the most efficient node clock I could make that required the least number of calculations?" :) But... I just need something that works for a 5 minute animation. I avoided weeks and months for the same reason I avoided years - months are uneven, weeks don't divide evenly into a solar year at the 'second' level, and years leaping every 4th and 100th... I don't care how cool the node tree looks, The Gregorian Calendar is uuuuuug-LY.


text:
how to 'reset' the units so measures match reality?
I am very new to blender and I took a 2d floorpan and converted it to a 3d model using archimesh.
I have now completed it (amazing, in itself!) but realised my measures are wrong (ie. if a room is 3.69m long in reality, when I measure it with the measure tool, it measures 2.85m in my 3d).
I guess I should have 'stretched' the floorpan at the beginning to make it match the blender units.
Is there a way to 'reset' the units, for example by telling blender that that wall is 3.69m and therefore all the other measure have to be proportionally adjusted?

Just scale everything together at once until the measurements match then ctrl+a > Apply scale.

You can scale objects in Blender by selecting them and hitting s. If you had some objects that are not scaled correctly and knew that they were 2.85m in some dimension in your scene but need to be 3.69m, then 3.69/2.85=1.294736... so thats the scale value you need to make the objects bigger. You can hit s and type the number while in scaling operation, you can also paste it with ctrl+v.
If you have some 3d model of a house or part of it with correct wall thickness, but wrong room dimensions, then if you scale it, wall thickness is going to be wrong, so you would obviously need to move/remodel walls with correct room dimensions.

yes I was hoping to avoid having to resize everything manually. If I scale up the entire model, everything will grow (walls, doors, etc...). maybe what I'll do when I place furniture is to decrease their size by the same proportion (1.294736..) so at least it 'fits' in the room.

That's one really bad idea. If you want to make interior visualisation, or plan your interior design in 3d that's just not how things are done. You must have everything in real size. You cannot plan things with wrong dimensions and even if it's only for practice visualising interior design, it simply looks wrong with wrong sizes. Everything must be correct size in this area. Other way you are simply wasting your time. Don't waste your time, just redo it right...


text:
Model not printable // Solidify doesn't work properly
I made my first 3d model which I'd like to print, but I am experiencing issues with the solidifying part.My model looks like this: When I import it to FlashPrint (The slicer I use), it looks like this:  As you can see, something is wrong with some parts of the model and it appears glitchy. It doesn't give me a warning when I import the model.It still looks fine, but as soon as I slice it, the glitchy parts are completely ignored and removed. This looks like this: If anyone could help me to make my model printable, that would be great. I am not entirely sure how to include the .blend file to this post, but let's hope it worked and it's attached somewhere.Thanks in advance!

Your mesh looks like this ...

Face Orientation mismatch
not a single mesh (three parts)
overlapping faces

The easiest would be to start from scratch:

Add torus, sphere (like 64 sides), delete half
Select loops on torus and sphere with (Alt+Shift+click), search for Bridge Edge Loop. Like this also middle part will be red (continues inner side).

Add Solidify > Even Thickness. Top edge jumps up, apply modifier and fix it manually (by adding one edge loop and reposition.

Thanks! May I ask how you split the three parts like this? Did you select all the vertices of the individual parts and move/split them or is there some kind if shortcut for that?

Select vertex and press Ctrl+L (Select Linked) ... :)

I have also Q :) how did you twist partly the topology of sphere and bottom part?

Simple and honest answer: I don't know either :')
It's my first time working with Blender, and I am having quite some trouble with it…

OK so few tips ... see edit.


text:
Blender 3.4 with AMD GPU 22 drivers
Is there any way to render with Radeon RX 6000 series graphic card with Blender 3.4 under linux? After 2 days of trying diferent kernel/amdgpu driver combinations finally it seem that driver is installed.
Vendor: AMD
    Version: 22.3.0
    Accelerated: yes

However, Blender still does not display the graphic card in the preferences window even though the driver version (22.3) is higher than required (22.1)
Kernel: 5.15.0-57-generic Ubuntu 20.4 LTS
AMD driver: 22.40 for Ubuntu 20.4 LTS
Is this an AMD driver or Blender fault? What else can i do to make it work?

Partially solved that way:
1.install Ubuntu 20.4.1 LTS
2.install AMD GPU driver installer from AMD site (it was 22.40 for me)
3.install all updates and upgrade your Ubuntu with system upgrade tool
4.sudo amdgpu-install --usecase=graphics,opencl --vulkan=amdvlk --opencl=legacy (it can show missing .bin files but dont care)
5.sudo apt-get update
6.sudo apt-get upgrade
7.reboot
8.sudo apt-get install mesa-utils
9.sudo amdgpu-install -y (and reboot if needed)
10.sudo ./blender

Card should be visible in Blender properties tab then.
It is working but running with '''sudo''' it is not OK :)

Are you sure you want to run Blender with sudo privileges? Or is that the only way that the GPU is properly recognized in Blender? If so, then you should take a closer look at the permissions. ...or am I missing something here?

No, it is the only way it worked so far. Tried to add user to "render" and "video" groups with sudo usermod -a -G $GROUP $USERNAME but with no luck.


text:
Copy Bevel modifier to selected gives undesired result
I tried to copy the bevel modifier to the selected wheels as you can see in the first picture, but when I do this something strange happens - which you can see in the second picture.
When I don't try to copy the modifier but just add modifier to the wheels itself, nothing happens - no bevel at all.
What is going wrong?
Here is the file:

Hello could you please share your file? https://blend-exchange.com/

Added the file!

It's because you have overlapping faces and it seems to mess up with the Geometry > Miter Outer > Arc setting. Merge by distance to fix it. I don't know what Arc is for but it looks like once you've merged the vertices it works.

Great that worked!


text:
How can I run a python script before anything else?
I have a python script that defines all the scenes, and other scripts import it. Since scenes are added after the scripts, I get a load of errors telling me that the scenes are not defined on startup. This is because the scripts are executed, but the scenes are not yet added nor defined. In fact, I get about 4 errors before the scenes are defined. I have a python script that I want to run before anything else. It adds and defines all the scenes. Is there anyway to execute a script before anything else is executed? Thanks.

While Micheal_Z's answer is directly answering your question I think your description shows you have a different issue.

You can't run anything before the first scene is loaded.
You can't process logic on a scene that is not loaded (yet).

What is your "script" (you import it , so it is a module) doing?
From your explanation I guess it contains the names of scenes you want to load. This makes sense as the BGE does not provide names of loadable scenes (just of loaded scenes).
You do not really need that, as you know beforehand what scenes to load (and when). Typically you would do this with a scene actuator (one for each scene).
When you do it dynamically with Python, you need these names. I guess this is your current situation.
I suggest to implement a scene loader that loads the scenes in one or several steps.
To solve your processing errors I suggest to avoid trying to access scenes that are not loaded yet. Either by checking if the scene exist of by running the logic AFTER the scenes where loaded.
Binding Logic to scene
This is very simple ... place the logic into the according scene. It will never run without the scene as it is tightly couple to the scene. Btw. it makes sense to bundle the logic of a scene to exactly that scene.
Existence checking
The checking (if you really want to decouple scenes from their logic) is simple too. Do a check if the scene (still/already) exist:
if sceneExist("Scene"):

or
    scene = getScene("Scene")
    if scene:
(Yes, you need to implement sceneExists()/getScene() by yourself)
I hope it helps.

I was thinking about putting all my logic that uses other scenes than the main scene in a separate scene. This way, none of it would load until then. I am still worried that this would cause problems in the main scene. Thanks for the answer though.

There is a checkbox in the Python controller which seems to be suitable for your needs. It's tooltip says "Mark controller for execution before all non-marked controllers (good for startup scripts)". See screenshot:

Since you did not mention that you already tried this - you may want to check this option on the controller carrying your scene-defining script.


text:
How to make a loading bar work with a process - not time?
I have a loading bar with 100 frames. Most of what I can find for making a loading bar is what I've done (100 frame animation) and works with time. In other words, the loading bars load up independent of loading up objects and the scene. I am trying to create a loading bar that progresses as objects, properties, and parts of the scene are loaded. How can I have my 100-frame animation progress through the animation as parts of the scene are loaded? I am looking for a python script that could load up these parts and progress the loading bar. Thanks!
To make this a little quicker to answer: I am fine if you create the .py script with only as little as 2 frames as I will know how to add the rest  - a 100 frame python script would be absurd to ask for an answer.

Scene loading
When a scene gets loaded the game will only do that and not refresh anything. The current (game) render will persist until the loading is completed.
Therefore your request will not do anything. You can't animate the render during loading.
LibLoad scene loading
You can load scene data from an external .blend file with LibLoad. The data will be merged into the current scene.
Synchronously
Per default it works like normal scene loading by showing the last render image until the load is complete = no animation.
Asynchronously
With the parameter async=True you can run the load over several frames.
The call provides you with a bge.types.KX_LibLoadStatus. From that you can read the current status of the load operation.
example [the code is untested]:
import bge

INTERNAL_PROPERTY_STATUS = "_internal.status"

def load(controller):
   '''Starts loading operation, stores the status in a property.'''
   status = bge.logic.LibLoad("demo.blend", "SCENE", async=False)
   controller.owner[INTERNAL_PROPERTY_STATUS] = status

def progressToValue(controller):
   '''Sets the value attribute of the first actuator to the progress from status.'''
   status = controller.owner.get(INTERNAL_PROPERTY_STATUS)
   if status == None:
      return

   actuator = controller.actuators[0]
   actuator.value = "'{}'".format(status.progress)
   controller.activate(actuator)

Be aware progress is a value from 0.0 to 0.1. You might want to scale it to your needs before using it.
Remark: I do not know if the progress shows more than 0.0 and 1.0 yet.


text:
How to define an object in another layer?
I have a second scene and using scene2.objects["obj"] isn't working. The object is is another layer, and I cannot figure out how to define it. I've defined "scene2," and there is no problem with that. How do I define objects in different layers?

Layers are properties of the object see this snippet:
import bpy

# create layers vector with only one layer enabled
def layers(l):
    all = [False]*20
    all[l]=True
    return all

o = bpy.data.objects["Cube"]
# set object to layer 2 only (layers from 0..19)
o.layers = layers(2)

# lookup scene by name
scene = bpy.data.scenes["Scene2"]
# link object to scene
scene.objects.link(o)


text:
Why are objects rotation rotated a little bit when they are set to 0?
I have a simple python script that tells me an objects rotation (a property reads the rotation). I have a static object with its rotation set to (0, 0, 0); however, when I load up the scene, the property reads a long decimal with a value very slightly higher than 0. This shows that the object has very little rotation. Is there a way to fix this other than changing the objects rotation with a script? In other words, keep the rotation at 0 at scene start? Thanks!

All terms of the orientation matrix are expressed in float values (floating point numbers). These numbers have a specific precision. This means when you calculate with them you get very small, but existing deviations from the "ideal" number.
This is especially noticeable around zero. Therefore you might print something like -0.0. This seams illogical but it means you have a number that is smaller than the precision of the formatter.
Unfortunately you did not include any further details such as what term you are reading and what the value is or what your code is.
My own investigation shows me:
<Matrix 3x3 ( 1.0000, 0.0000, 0.0000)
            ( 0.0000, 1.0000, 0.0000)
            (-0.0000, 0.0000, 1.0000)>

The [2][0] value is indeed -0, but it has no further consequences. You will not notice that in your scene.

Thanks for the answer, and, what if I'm getting 0.0006?

In that case I would like to see your demo file.

Ah. I just noticed its parent is dynamic. However, the parent is directly above the ground, and is not affected by anything other than  gravity. Do you think gravity would of caused the small rotation? Its always the same thing.

Gravity is a force (0,0,-9.8). It can result in linear and angular velocity -> changes to location and orientation especially when colliding with other objects (e.g. with the ground).

Ah. I thought it was something else as it always rotates to the same extent. Thanks ;)


text:
Have console redo a function until desired outcome?
I've found a way to define my scenes correctly as some scenes are inactive at the very start of the game engine and cannot be found. However, since the code can't find the scene at the very start, it prints an error only once. On the next run of the script, no errors are printed as the scene is found. Is there a way I can have a script re-execute a block of code until the desired outcome comes? In other words, keep redoing the function (find scene), and keep re-executing itself without continuing with the rest of the script and only continue once the scene is found? And is there a way I can have the console not print the error using this idea?

I'm not sure what exactly you are expecting.
The BGE loads and starts with exactly one scene (the current scene in Blender). It simply has no other scenes.
To add other scenes (Background or overlay) you either use the Scene Actuator or the BGE API. (I guess you know that already).
This operation will be performed after the current frame. In your case between frame 1 and frame 2.
Therefore you will never be able to find any other scene at frame 1. They are simply not loaded yet.
They are loaded within the next frame. In your situation in frame 2.
There are several options to deal with that situation:
Self-managed scenes
Each scene performs operations on currently existing scenes after being loaded.

The current scene is always the new one. Make sure not to look for other scenes, that do not exist yet.
Check for a scene after is was loaded
You know when you added the scene, check within the next frame.

The current scene is the scene that added the other. The new scene is a different one.
Notify objects
Send a message notifying that the scenes changed.

This way any object that is interested (regardless in what scene it resides) will be notified and can act accordingly.

The scene the listener is living in can be, but does not need to be the new scene.
There can be any number of listeners.
I hope it helps
Edit:
now I see it is related to question 44362. I think
the above suggestions should help you with your problem (which is a strong dependency from one scene to the other [not really a good design as you see])


text:
How can I create an image of my UV unwrap
I've created a model, and I'm preparing to texture it. I've marked all the seams, unwrapped it and moved it around to my desires. I am ready to create an image for my model. Usually, I would see people creating the texture, then align the UV unwrap to the image (of the texture). In my case, I only have the unwrap. I do not have an image file (a texture). I am looking to create an image file of my UV unwrap which I can use to place a texture on. Maybe have the islands in white, and the rest in black? I am not sure how to approach such an idea. How can I create an image of my UV unwrap; an image that separates the islands in a different color in a way where I can texture it? Thanks.

You can use the 'Export UV Layout' option. It will export your UV islands to the .png file e.g. Then you can overlay the texture on it in gimp or a photoshop. See how to do it here: http://blender.stackexchange.com/questions/16384/extracting-a-uv-layout

Related: http://blender.stackexchange.com/questions/16384/extracting-a-uv-layout

At the bottom of the "UV Image Editor" window, open the "UVs" menu and click "Export UV Layout."
You will then get a "Save as" menu where you can specify where to save a PNG file. You can also change it to a different resolution or image type with the options in the lower left.
The default exported PNG image will have a grey outline of the UV map filled in with transparent white. The rest of the image is also transparent so you can put it over top another image in a photo editor like GIMP and still see the image underneath.
Good luck.


text:
How to set the edge length for STL export?
I am trying to reduce the size of a very large STL file, that as of now includes way too much detail. In Blender is there an option to set the minimum and maximum edge length of the exported STL file, so that I could just set a larger minimum edge length than the current one?
If this option does not work is there another option that allows me to easily remove detail from an STL file or smooth surfaces of a geometry? I attached a cutout of the geometry. I am only interested in the macroscopic geometry not in the surface texture.

Something like this? The remesh modifier is another option.

Hi sambler, thanks for your comment! Right now my PC is working hard in my attempt to use the Decimate Modifier. If after lunch this was not successful I will look into your suggestions.

Hi @sambler right now I am still waiting for feedback from Blender after entering a 0.1 in the Collapse option of the Decimate modifier. Unfortunately it also looks like the modifier is not working in parallel, but only running on one thread. I can't tell if the calculation will take another hour, another day or another week.


text:
Blender 2.79 crashes on Startup
System: Windows 10
Graphics card: Nvidia GTX 1030
Hi! I'm currently facing an issue where whenever I launch blender (version 2.79) the program immediately crashes. Since this has started happening I have re-installed all relevant drivers and have uninstalled an re-installed the program multiple times. I have even gone back to older versions of blender; interestingly blender 2.78 would launch but would crash whenever I entered "cycles" mode (leading me to believe this is an issue with my graphics card.
For more information this has only started happening since I installed this graphics card a couple of days ago; also, here is the debug log of Blender from the cmd line:

Thanks for any help you guys can provide!
*****UPDATE*****
The one of the newest official nightly builds of Blender (blender-2.79-46dceef-win64.zip) seems to be working on my machine perfectly; although I would still like to figure out why the official build refuses to open.

That fail line at the top looks like an audio interface issue. Your audio interface is set to 48000Hz and Blender is trying to startup with 44100Hz. Try setting your audio interface to 44100Hz. Don't know if it will stop the crash, but at least that issue will be solved.
By what you are describing and the access violation error tho it sounds like you got a faulty RAM chip.
Remove RAM chips one at a time until the crash stops then you will know which RAM stick is bad.
AND if you haven't, download and update your graphic card drivers from the manufacturers website. You said you reinstalled drivers, but maybe you are installing old drivers from a CD or letting windows handle it. Get the most up to date drivers straight from the source.
If none of that works you could try creating a new windows user account, log in as the new user and install blender. Incase of your user profile being jacked up.

I don't think any of those suggestions are useful in this case... The audio freq is not a problem, search for previous questions...


text:
Request - Cable Cloth
I need to achieve this result
a cloth simulation of elastic sheath for tubes, cables, wire like this:

there is a sample video for c4d and other software
https://www.youtube.com/watch?v=VXi57AAWu4M
https://lesterbanks.com/2017/07/modeling-cloth-cover-cables-c4d/
thanks a lot

Possible duplicate of How to model braided nylon sleeve

I want model it with cloth simulation for realistic result over the overall shape based on the inside tubes or cables

What is stopping you?

The fabric is not elastic and falls like a curtain around the cables, I do not get the enveloping effect of the sheath on the cable as in the sample photos

Welcome to bse @Enrico.  Suggest editing more info into question to clarify. esp. what you have tried so far.  In particular cloth settings like pinning.


text:
Mouse picking algorithms in Blender
I'm interested in implementing some sort of 3D modeling tool. And I need a good mouse picking algorithms for various primitive types: vertices, edges, faces. Blender has most comfortable way for selecting vertices that I've ecountered. Software that I have used: 3ds Max, Blender, Maya, Houdini, ProBuilder tool for Unity3D.
What I'm talking about: I don't need pick a point pixel-perfectly, just clicked somewhere in a mesh, and closest one will be selected.
I want to know what exactly algorithms related to selection are used in modern versions of Blender 3D Software.
Some free papers, articles will be good as references.

Blender is Open Source - why not just look into its source to find it out?


text:
How to use antialiasing with bgl drawn elements?
When using a draw_handler to draw bgl elements to a screen as with GL_POLYGON or GL_LINE_LOOP, are there any bgl flags which can be enabled to invoke antialiasing or will this always require a much more complicated solution?
I'm aware of GL_POLYGON_SMOOTH, GL_POLYGON_SMOOTH_HINT, GL_LINE_SMOOTH, and GL_LINE_SMOOTH_HINT but enabling them before or after using GL_POLYGON or GL_LINE_LOOP doesn't have any affect. Has anyone personally accomplished antialiasing using bgl in Blender Python? If so, could you please show me how?
import bpy,bgl,blf

def draw_callback_px(self, context):

    #Can anything go here to invoke antialiasing?
    bgl.glEnable(bgl.GL_POLYGON_SMOOTH)
    bgl.glEnable(bgl.GL_POLYGON_SMOOTH_HINT)

    bgl.glBegin(bgl.GL_POLYGON)

    #Should flags go here?
    for x, y in self.mouse_path:
        bgl.glVertex2i(x, y)

    #How about here?
    bgl.glEnd()

#How about an antialiasing function involving
#multi-sampling, bgl texture (or some other)
#functions etc.. Anyone know how to do this?

class ModalDrawOperator(bpy.types.Operator):
    bl_idname = "object.modal_operator"
    bl_label = "Simple Modal Operator"

    def modal(self, context, event):
        context.area.tag_redraw()

        if event.type == 'MOUSEMOVE':
            self.mouse_path.append((event.mouse_region_x, event.mouse_region_y))

        if event.type in ['LEFTMOUSE','RIGHTMOUSE','ESC']:
            context.space_data.draw_handler_remove(self._handle, 'WINDOW')
            return {'FINISHED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        self.mouse_path = []

        args = (self, context)
        self._handle = context.space_data.draw_handler_add(
        draw_callback_px, args, 'WINDOW', 'POST_PIXEL')

        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

bpy.utils.register_class(ModalDrawOperator)
bpy.ops.object.modal_operator('INVOKE_DEFAULT')

Turns out any kind of smoothing you want to use with GL_POLYGON_SMOOTH, GL_LINE_SMOOTH etc. (antialiasing simple shapes) requires GL_BLEND also be enabled.
I discovered that if you're using GL_POLYGON with GL_POLYGON_SMOOTH enabled, you get weird breaks in your mesh shapes. For this reason it's best to leave GL_POLYGON_SMOOTH off, then surround the shape created with GL_POLYGON with a line from GL_POLYGON_LOOP and then enable GL_LINE_SMOOTH. This gives the appearance of antialiasing around the shape without the weird breaks (demo in code below).
import bpy,bgl

def draw_callback_px(self, context):

    #Set color to white.
    bgl.glColor4f(1, 1, 1, 1)

    #Using polygon smoothing alone creates
    #lines through shape... better to leave
    #off and just smooth outer line.
    #bgl.glEnable(bgl.GL_POLYGON_SMOOTH)

    #GL_BLEND must be enabled for any
    #smoothing to work.
    bgl.glEnable(bgl.GL_BLEND)
    bgl.glEnable(bgl.GL_LINE_SMOOTH)

    #Can't just stack GL_POLYGON
    #and GL_LINE_LOOP
    bgl.glBegin(bgl.GL_POLYGON)
    for x, y in self.mouse_path:
        bgl.glVertex2f(x, y)
    bgl.glEnd()

    bgl.glBegin(bgl.GL_LINE_LOOP)
    for x, y in self.mouse_path:
        bgl.glVertex2f(x, y)
    bgl.glEnd()

    bgl.glDisable(bgl.GL_BLEND)
    bgl.glDisable(bgl.GL_LINE_SMOOTH)
    #bgl.glDisable(bgl.GL_POLYGON_SMOOTH)

class ModalDrawOperator(bpy.types.Operator):
    bl_idname = "object.modal_operator"
    bl_label = "Simple Modal Operator"

    def modal(self, context, event):
        context.area.tag_redraw()

        if event.type == 'LEFTMOUSE':
            self.mouse_path.append(
            (event.mouse_region_x, event.mouse_region_y))

        if event.type in ['RIGHTMOUSE','ESC']:
            context.space_data.draw_handler_remove(self._handle, 'WINDOW')
            return {'FINISHED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        self.mouse_path = []

        args = (self, context)
        self._handle = context.space_data.draw_handler_add(
        draw_callback_px, args, 'WINDOW', 'POST_PIXEL')

        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

bpy.utils.register_class(ModalDrawOperator)
bpy.ops.object.modal_operator('INVOKE_DEFAULT')

Does this code work also in 2.8? I don't seem to get any drawing with mouse clicks.


text:
Is it possible to set bpy.data.filepath without saving the file?
I have some code which requires opening and closing blend files. The code has to save a temporary copy of the open file before opening other files and doing stuff to them. After the code is finished it reloads the temporary save of the original file.
The problem is, if the user goes to save their file (after the code has been carried out) it will save to the temporary location, of course they could change the save location manually but that would insert an unnecessary amount of entropy into this process.
I could also simply save the open file before the code was run, but I would like to avoid forcing that on the user. All that's holding me back is not being able to change the file's internal save location after all is finished.
If I could write to bpy.data.filepath (rather than only read it) problem would be solved. Anyone know of a way to set this value without actually saving the file with: bpy.ops.wm.save_as_mainfile() ?
As it stands I've developed a complicated method of working around this, but involves renaming and copying files. If I have to use it I will but hoping someone might know a slimmer solution here.
Also I'm aware there is a similar thread "Clear saved filepath" but I was hoping to explore this further. I just want to know is there something I'm missing with setting the blend file's save path.
EXPLANATION OF HOW IT'S DIFFERENT FROM "CLEAR SAVED FILEPATH":
Let's see, that thread doesn't solve the problem. The end.

Possible duplicate of Clear saved filepath

The bpy.data.filepath property reflects the current blendfile's location, which is why it is read only.
Not sure I understand your problem fully, but here's a suggestion:
You can save the file implicitly (without asking the user to provide a save path), and decide yourself on an arbitrary temporary path for your save. By providing the bpy.ops.wm.save_as_mainfile() operator a filepath parameter, you can save directly to any path you desire.
bpy.ops.wm.save_as_mainfile( filepath = MYPATH )

You can later load that file implicitly again, with the opposite operator:
bpy.ops.wm.open_mainfile( filepath = MYPATH )

This way, you don't need to care what the value of bpy.data.filepath is.

Thanks for your response. If you save a file, then open it up, then delete the actual file while Blender is still running, then run print(bpy.data.filepath) in the console, it will return the path location from the file as though nothing happened. This means the value isn't being checked, but stored within the file

Sorry pressed enter to soon: Anyway.. This means the value is being stored within the file. The problem is I don't want the user's file to be force saved. So if I can save it as a temp file, run operations, then load that temp file and set its save location as the original file, then if after that point the user should choose to save, it will be as if nothing changed for the user.

So, to make sure I understand. The main issue you're worried about is what the default save path will be when the user opts to manually save the file?

Correct, if they're working from an already saved file, they should be able to save without entering in a new location after every time the operator is run (or be forced to have their progress automatically saved when the operator is run). I've already figured out a bulky way of doing this but it would be so much cleaner if I could just set the internal save path.

Alright, so in that case I'd save another copy of the blendfile at the default path you want your user to save at using the save_as_mainfile operator, then delete that file (say using os.remove). Simple two step solution instead of copying, renaming and deleting.

While I think that clear filepath is the same problem, another approach is to provide your own save operator as shown in Add Prefix to filename
To expand a bit more on creating your own save operator, you could also create a new save operator that hides the original by setting bl_idname = "wm.save_as_mainfile" for your operator. Your newer operator will hide the original save operator when you register it and the original will be available when your operator is unregistered. You will need to be sure to duplicate the properties and parameters of the original so that existing scripts don't break.
Disclaimer I don't think this is a good idea and expect it will be frowned on by many, also I haven't tested this past knowing that a duplicate bl_idname will cause the newly registered operator to be used before the old one.

Thanks for your response, I agree though I don't think this is a good solution but I like when people are willing to go as far as it takes to accomplish what they set out to do.