text:
How to run a modal operator for/in several 3D Views (video of problem included)
When i invoke a modal operator (it highlights faces under the mouse cursor via raycast and bgl) from the tool shelf, it is running in/for the 3D View, the tool shelf is in but not in other 3D Views displaying the same content.
I need to invoke the modal operator again from the others 3D Views toolshelfs to get the desired effect. Is there a way to invoke it for all 3D Views at once?
Because it is not easy to explain i made a short video (30 sec) to show the problem:
https://youtu.be/ogTSyeIRbNA
edit: i cannot mark as duplicate but the question was kinda answered here already(it was hard to find for me without the hint from batFINGER):
How can I disable Right Click at my UI
Getting the active region
RegionView3D from Region object and vice versa

My guess without seeing any code is try this ie get your mouse coordinates from the screen and use that to calculate where you are in the region of another area.

I thought that pushed me in the right direction and i found this, too: https://blender.stackexchange.com/questions/19744/getting-the-active-region but i still cannot get it to work. I will add some code to my question.

And this one Thought I'd done something similar recently.  Get your area and region from the screen.

Ok,  will look into it tomorrow and report back

@batFINGER It works. Took me a while to figure it out because i forgot to use context.area.tag_redraw() on all view_3d and not just the context one.


text:
How to debug (more or less) random segfaults?
I ran into a wall with my add on development. (I am still a beginner with python and programming and add on development, so please be lenient).
I am running a modal operator to do some changes on the selected object (via raycast i get the face index under mouse cursor and on mouse click the mesh content gets deleted and new content, depending on the face index, will be generated).
Sometimes this works, sometimes it segfaults.
It segfaults more often when in texture display mode, less often in material display mode and even less often in solid display mode.
The crash happens after the new mesh content is created but before the modal operator checks for new events. (In the script itself nothing should happen inbetween).
So i used pdb.set_trace() to set a breakpoint right after the content creation and step through everything that happens after that. There is actually a lot of stuff going on (mostly (re)drawing the Ui afais ... it takes ages to step through everything).
Sadly it never crashes when stepping through it so i still do not know when (and why) exactly the crash happens and now i am lost, having no idea how to find the error.

Edit 1:
I striped down the code a bit. As it is still quite big and a certain material is needed, so, here a blend file:
http://www.codexofdreams.com/VA_Studio.blend
To produce the Error open the file (tested with Blender 2.79 and 2.79a) run the script, find the VA tab in the tool shelf, click the button in it and then click on the object. At least for me it sometimes works (The Part of the mesh under the cursor vanishes) but mostly it segfaults.

Edit 2:
I startet Blender with --debug until now but stumbled across --debug-all. It gives a bit more information on what is going on and i might have found the culprit: Before the EXCEPTION_ACCESS_VIOLATION there was no clue with only --debug, but now with --debug-all right before the crash it says:
WM_operator_last_properties_init: loading previous properties for 'VIEW3D_OT_select'
I am not 100% sure what it means but since i use left mouseclick in the modal operator as event to call the function that changes the mesh (delete all geometry and puts new in) and also to select objects in the scene there seems to be clash of those two maybe. At least when i use a keyboard key to call the function it does not crash (hopefully it remains like this).
Now i have to look if i can find a way to overwrite the mouse click selection while modal is running (prefered... if i cannot find it out on my own i might do a new question) or if i need to use keyboard instead. So this is now at least half solved.

Extremely difficult to debug code sans code

WIll post the code this weekend, no time to strip it down to the problem before.

Recommend you only raycast on a click event.  Had a quick look and can confirm it crashes for me  on linux.  After the first or  a number of "Negative naterial index!" warnings in the console.   I believe it has something to do with  your generated mesh data.

In the not stripped down version the raycast is also running for the bgl highlighting (it works fine). The generated geometry should also be fine. In the not sriped down versions i do different operations with it without running into problems (using the same code building it): https://youtu.be/yOqmrxiJpDQ?t=53 ). I will to call the raycast function on click and use this results for the geometry change and using the modal running one only for bgl highlighting... will report back if it makes a difference.

@batFINGER Using Raycast on click works  better (less segfaults in solid display view, no segfaults in textured display view) but still... Btw.:I also noticed with Blender in debug mode even without my script running, blender throws OpenGL errors to the concole when in texture display mode... i wonder if that somehow interferes with the addon. Have seen this on two systems. Error message is: K:\BlenderGit\blender\source\blender\windowmanager\intern\wm_event_system.c:2575: ``wm_event_do_handlers'' -> GL Error (0x0502 - GL_INVALID_OPERATION): Invalid Operation (should i make a bug report?)

Send a bug report. The error message is supposed to be harmless. So search goes on. Close to give up on that :/

Could also put in a mesh.validate(verbose=True)  VIEW3D_OT_selectis the bpy.type ofbpy.ops.view3d.select(...) OT is "Operator Type"  The window manager WM has an operators collection.bpy.context.window_manager.operators`

You can build a debug build Blender yourself, and enable ASAN to get much better insight into what is going wrong, what memory is read/written, and by which code.

source: Stack Exchange

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

sort: votes


text:
Calling modal operator from prop update function ---> wrong context (how to change context for modal operator)
I have a modal operator to get the face index under mouse position from raycast (close to the "operator_modal_view3d_raycast.py" template).
class VaSelect(bpy.types.Operator):
    bl_idname = "wm.add_va"
    bl_label = "add va"

    def modal(self, context, event):

        if bpy.context.scene.VA_Mode != "VaEditMode":
            return {'CANCELLED'}

        else:
            get_face_index(context, event)
            return {'PASS_THROUGH'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        wm = context.window_manager
        wm.modal_handler_add(self)
        return {'RUNNING_MODAL'}

If i use a panel button to start it, it works fine and as intended.
When i try to invoke it from an EnumProperty update function:
def va_mode_update(self, context):
    if bpy.context.scene.VA_Mode == 'VaEditMode':
        bpy.ops.wm.add_va('INVOKE_DEFAULT')

i get this error message:
[...]
File "C:\Program Files\Blender3D\2.79\scripts\modules\bpy_extras\view3d_utils.py", line 46, in region_2d_to_vector_3d
    viewinv = rv3d.view_matrix.inverted()
AttributeError: 'NoneType' object has no attribute 'view_matrix'

Edit: What i found out so far:
When i start from Panel Button bpy.context.region.type is WINDOW but when i start from update function, it is TOOLS. So, as long as i cannot change the context while modal is running it will not work, right? (And.. i cannot.. or can i?)
Edit2:
it seems to be possible:
https://docs.blender.org/api/2.79/bpy.ops.html#execution-context
Edit3:
I used override method (in the raycast_function) to feed the raycast with the correct context:
update function
    override = {'region': "", 'rv3d': ""}
    for window in bpy.context.window_manager.windows:
        screen = window.screen

        for area in screen.areas:
            if area.type == 'VIEW_3D':
                for region in area.regions:
                    if region.type == 'WINDOW':
                        override['region'] = region
                for rv3d in area.spaces:
                    if hasattr(rv3d, 'region_3d'):
                        override['rv3d'] = rv3d.region_3d

    # get the context arguments
    scene = bpy.context.scene
    region = override['region']
    rv3d = override['rv3d']
    coord = event.mouse_region_x, event.mouse_region_y

It works now... somehow. Unfortunately the mouse cursor is offset. -.-
edit4:
When i use override as intended (at least i think i do, most likely i do something wrong, i am a very beginner :/):
class VaHighlight(bpy.types.Operator):
    bl_idname = "wm.add_va"
    bl_label = "Add Va"

    #override context to be able to call the operator from a enum property update function
    override = bpy.context.copy()
    for window in bpy.context.window_manager.windows:
        screen = window.screen

        for area in screen.areas:
            if area.type == 'VIEW_3D':
                for region in area.regions:
                    if region.type == 'WINDOW':
                        override['region'] = region

    def modal(self, override, event):

        if bpy.context.scene.VA_Mode != "VaEditMode":
            return {'CANCELLED'}

        else:
            get_face_index(override, event)
            return {'PASS_THROUGH'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        wm = bpy.context.window_manager
        wm.modal_handler_add(self)
        return {'RUNNING_MODAL'}

def get_face_index(context, event):

    # get the context arguments
    scene = context.scene
    region = context.region
    [...]

the function does still not use the overwritten context but bpy.context (that is why i did it the way i did and move it into the function. This way it worked... except the offset. But that should be the same even if i get the override stuff working as intended.
Sure there is no attribute rv3d in bpy.context, but here i just pass the right context to the variable "rv3d" using the key rv3d of the dic named override ...)
area.regions[-1] does work but the region is not the (main) problem, it is rv3d = context.region_data. Took me beginner a good part of the day to find the "solution" i have atm.

You override context and pass that dictionary to an operator.  There is no context attribute rv3d. This is why when you have an operator method like def modal(self, context, event):  in its code, use area = context.area  and NOT area = bpy.context.area  This way if we override context override["area"] = some_3d_view_area and pass it to the op bpy.ops.some.operator(override) it will use the overridden context elements.

If the enum is in the TOOLS region, the hassle is prob in the operator code that uses region = context.region,   get  the WINDOW region  from the context.area instead by looking at its type like above (or its generally area.regions[-1] in my experience).  There should IMO be no need to override context in this case.

@batFINGER I answered as edit of my question, it is too long for comment.

Ok . area = context.area ... region = area.regions[-1] .... r3dv = area.spaces.active.region_3d  You are not using override as intended.  You make a dictionary with context members and pass it as first argument to the operator. Use the context argument in operator methods.  Dont use bpy.context or your overriden context members wont work.  Eg you would have an override["region_data"] member not a r3vd.  Check out override = context.copy() in the console.

@batFINGER That works to replace the whole override stuff, thx :) (i feel dumb that it took me so long to find a verbose ugly solution when it is so easy and short sigh). Sadly the problem with the offset remains. No cursor offset when using a panel button, but (quite large) cursor offset when using the enum prop update function.

Add a link to your code and will have a look.

Start by removing bpy.context and use the context passed, which will be the override you are sending to it. Same with your update function, use the context parameter. And in edit four - the class variable override isn't going to help, move that into the modal or it's own method.

@batFINGER can i send you the .blend privat somehow? (there s no bpy.context in the raycast function)

@batFINGER https://pastebin.com/mAXukMiQ thx for your effort. P.S.: To see the effect of highligting move thhe mouse over the object. To see it with the offset you need to be around 200px left of the object.

Try bpy.ops.wm.add_voxel('INVOKE_REGION_WIN') in your update method.

@batFINGER :D That works. Thank you very much :)

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


text:
How to use loops.foreach_set and polygons.foreach_set to add faces to a mesh
I have problems getting my head around it:
I have two arrays:
verts = np.array([1, 1, 0,
                  2, 1, 0,
                  3, 1, 0,
                  1, 2, 0,
                  2, 2, 0,
                  3, 2, 0,
                  1, 3, 0,
                  2, 3, 0,
                  3, 3, 0])

faces = np.array([0, 1, 4, 3,
                  1, 2, 5, 4,
                  3, 4, 7, 6,
                  4, 5, 8, 7])

The mesh (me) is prepared with the 9 verts from array "verts" in it already. Now i want to add the faces but the explanations i found were scarce at best.
So, how do i add faces using (an explanation would be great):
    me.loops.add() #should be 4 loops per (4-sided) face, right?
    me.loops.foreach_set("vertex_index",) #no idea...

    me.polygons.add(faces.size / 4) #4 Faces in this case
    me.polygons.foreach_set("loop_start",) #no idea...
    me.polygons.foreach_set("loop_total",) #not sure... number of loops per face in a list: [4, 4, 4, 4] in this case?
    #me.polygons.foreach_set("vertices", ) #needed at all? List of vert coordinates if they were no verts in mesh already?

I would be very happy if anybody could shed some light on it for me.
EDIT
After some investigation of "from_pydata" code in "bpy_types.py" as suggested by batFINGER i am a bit further but still not fully able to create the correct mesh.
I now have most of it right i think but because i have shared vertices for some of the loops and edges i am now pretty sure I need to use:
me.loops.foreach_set("vertex_index", vert_idx)

i thought i would need to add two verts per loop (start and end), so:
vert_idx = (0, 1,
            1, 4,
            4, 3,
            3, 0,
            1, 2,
            2, 5,
            5, 4,
            4, 1,
            3, 4,
            4, 7,
            7, 6,
            6, 3,
            4, 5,
            5, 8,
            8, 7,
            7, 4)

or "faces" but both leads to a crash, like everything else i tried.

Related  You really want to use Mesh.from_pydata(...) or a bmesh approach.  Consider foreach get and set more a way to get or set property data to / from a flat list, rather than as a way to create meshes.

"You really want to use Mesh.from_pydata(...)"  I do not.

Fair enough, change "you really want to use" to "I strongly suggest using"

Sounds better ;)... i need as much speed as possible creating large meshes (data created with numpy) and "foreach_set" method should be much faster (but i will not find out if i cannot get it running) ...

The code for from_pydata is in bpy_types.py as mentioned here

Looked into it, thx, that should help to maybe figure it out.

Got it, what was missing was not:
me.loops.foreach_set("vertex_index", vert_idx)

but correct:
me.polygons.foreach_set("vertices", ...

i tried it before and it crashed all the time because i forgot to ravel() the numpy array i used.


text:
Shadows flickering in Blender 4.2 and 4.3 eevee
Shadows flicker in the eevee-next video renderings. I made a simple test scene to demonstrate the issue. Blend file and example videos attached to this post. Basically a sun light lights through a transparent material (a glass panel) into the scene. To make it more noticeable I added multiple sun lights to create overlapping shadows that flicker as camera pans, the shadows flicker.
Here's a video rendered in 3.6, no flickering. All good:
https://streamable.com/tv14jb
Here's the same scene rendered in 4.3 beta. Result is similar in 4.2. Notice the flickering shadows that are easy to see at the end. Shadows typically flicker when the camera moves:
https://streamable.com/3y59nm
Blend file:

Anyone has any guesses on this one? What causes the shadows to flicker in the second video (4.2). Issue is not present in the first video (3.6)

I was facing the same issue Using 4.3.1
https://streamable.com/9riarj
What solved the problem for me was increasing que shadow memory usage:

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


text:
Rigid Body Physics with keyframed movements
I'm creating a simple short video and have text that moves from one location to another and goes through a stack of blocks along the way. The text moves correctly but won't knock over the block as it should. The stack of blocks is 5x5 and stacked vertically. The blocks are dynamic and convex hulls and the text is dynamic and convex. I'm very confused as to why the physics aren't working. Any ideas?
Update: The problem has been solved. For some reason the blocks were checked as animated and I just didn't notice.

Text objects by default are bezier curves, and bezier curves can't for the most part be used in physics simulations directly, as far as I know. You mus convert (a copy of it) to a mesh object to be usable in rigid body simulations.

I have already converted the text into a mesh and solidified it and for some reason it just passes through still


text:
How to delete vertices that are “behind”?
I have an object at (0, 41, 0). I want to delete the back half so the object looks the same from the camera at (0, 0, 0), but will cost less to 3D print.
Perhaps I need to select and then delete vertices that are “behind”? But I do not know if this is the best approach, or how to do it.
I am happy to do this in Python, but I do not know where to start from. Any suggestions?
The Blend file is available here:

Here are three views (top, right, front) of an example object:

Would you agree with a solution based on GeometryNodes ? If so, Could you provide your Blender file using https://blend-exchange.com/ ?

Hi. Please don't post essential information like links, file downloads or additional details in the comments section where it can be easily missed. Instead edit them into your original post with the [Edit] button above. Comments are transitory by nature, are hard to index or search for, and may be erased at any moment.

@StefLAncien
Yes to Geometry Nodes. I have included a link to the Blend file in the original post.
Thanks.

Option 1
Static solution, easy, jagged edges.

In edit mode, from the angle you want to look (you can look from the camera view by pressing numpad 0 or clicking the little camera on the right side of the 3d view)
Turn "OFF" x-ray and wireframe. Keep solid mode
Make a big rectangle with the mouse to select (the back will not be selected)
Invert the selection (ctrl+i or menu "Select"->"Invert")
Delete

Option 2 - Geometry nodes with some smoothing
I was able to make a geometry nodes setup that smoothens the selection a little, but it's not perfect. This kind of smoothing sounds complicated. Improvint it requires some new ideas.

Main nodes

Stores the visibility attributes based on the camera position
Separates the visible faces
Those faces that are near the visitble faces and have one point sticking out not connected to a visible face are changed to make this point go between the two neighbor points, removing the sharp corner of this face

Store visibility
Here the magic happens

For each point of the geometry, raycasts this point towards the camera (a small offset is added so the point doesn't hit itself)
If there is a hit, this point is behind and is invisible
Stores the "Visible" points
Then evaluates the visible points on face domain (some faces get partial visibility values)
Turns the partial visibility values into whole values (we want to keep the partially visible faces)
Goes back to the point domain and store the value as "NearPoint" (these points would be enough if you don't try to smoothen, the nodes could end here in this case),
For smoothing, we go again from "NearPoint" to the face domain (this interpolates the values so the neighbor faces become partially visible) and store the "NearFaces" (these faces are adjacent to the partially visible faces)

A value of 1 means the face is visible or partially visible
A value of 0.75 means one point of the face is not connected to any partially visible face
A value of 0.5 means two points and 0.25 three points.

File

Thank you. @DanielMöller That works, but the selection is very rough and jaggedly at the thresholds between front and back. Are there any settings I can adjust? If not, this is where I am hoping Geometry Nodes or Python might fine-tune the selection.

@PaulStGeorge , updated with a geometry node option that does a partial smoothing. (Covering all smoothing cases is more complicated than my time allows)

Wow, that does it. It should be an add-on. I have two questions, but they might answer each other. Q1. What is Epsilon? Q2. It would be great to have a numerical threshold (between visible and invisible) one could adjust -- so the borders at the top and bottom of the volume slide towards or away from the camera (wax and wane). I am guessing this is your Epsilon, is it? If so, could it be an input for the ‘Greater Than’ node and called ‘Threshold’? This last suggestion is just for transparency and understanding, and if you are going to publish your masterpiece.
@DanielMöller

Epsilon is a small tolerance. Since we are dealing with computer math (float values), exact numbers rarely exist, there is always a little error and we need to take that into consideration. Specifically in the raycast source position, I used epsilon to start the ray just a little away from the object (otherwise it results in 100% hits)

Example: when we want to compare something with zero, it's safer to check not if it's equal zero, but between ±epsilon

@PaulStGeorge, it's not simple to have this threshold. It's a new idea. For checking things, leave the camera view and look around. Use Viewer nodes to check the values.

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


text:
Why am I getting dependency-cycle reports when I add Rigid Body > Compound Parent?
I have reduced the problem down to the Minimal (not ) Working Example. Here I have a cube mesh. I have eight smaller cubes (one at each corner of the larger cube). That’s it.
There are only three steps:
1/
I add Active Rigid Body to each of the small cubes. Collision Shape = ‘Box’. No Collision Margin.
2/
I parent the eight small cubes to the larger cube. The small cubes are the children. The larger cube is the parent. I used Parent (Keep Transform).
I usually do this all in Python but to isolate the problem, I have done steps one and two in the GUI.
3/
With the large cube selected and active, I use the following code to add the Collision Shape = ‘Compound Parent’ to the large cube.
I tried, script1.py
import bpy
bpy.ops.rigidbody.objects_add(type='ACTIVE')
bpy.ops.rigidbody.shape_change(type='COMPOUND')

I also tried, script2.py
import bpy
bpy.ops.rigidbody.objects_add(type='ACTIVE')
bpy.context.object.rigid_body.collision_shape = 'COMPOUND'

There are only two lines! But they throw up nine (not eight) “Dependency cycle detected” reports.
Why? What should I change?
Here is the simple Blend file BEFORE I run the Python code.
https://pasteall.org/blend/b0b4a0de72ab4a95820a441336d2abfd


text:
Is there a way to name an object without referring to Context?
I want to do something, save the blend file, then open it again. Then repeat a number of times.
The first time, everything works. The second time, I get this error
    for obj in bpy.context.selected_objects:
AttributeError: 'Context' object has no attribute 'selected_objects'

Is there a way to either put Blender into the correct mode without using Context, or a way to name an object without referring to Context?
import bpy

filename = Path to file

for q in range(4):

    bpy.ops.mesh.primitive_cube_add(size=0.5, enter_editmode=False, align='WORLD', location=(0, 0, q), scale=(1, 1, 1)) # do some stuff

    for obj in bpy.context.selected_objects: # name the object
        obj.name = "monica"

    bpy.ops.wm.save_as_mainfile(filepath=filename) # save the file
    bpy.ops.wm.open_mainfile(filepath=filename) # open the file

Edit, to better explain what I am trying to do:
The line adding four objects named "monica" is just a place holder for what I am really doing. I wanted to reduce a much larger project to the minimum non-working example, and was sloppy with that bit. The problem with Context is in the previous line.
I sort of got around the context problem with
selected_objects = [o for o in bpy.data.objects if o.select_get()]
    selected_objects[0].name = 'foo'

But this workaround isn’t enough as I am using Context for other reasons, such as 3D cursor location, and so on.
Why am I re-opening after save? My project includes many many objects and slows to a glacial speed very early on. I wanted to add a number of objects, free up some memory by saving the Blend file and then starting again.
I have used something like this for each type of data block (in the right order of dependency) and this might be enough.
for block in bpy.data.meshes:
        if block.users == 0:
            bpy.data.meshes.remove(block)

I do not know whether I am achieving anything more by the crude save and open method but I wanted to try.
I do not get the Context problem if I save a progressive sequence of files, adding to the number of objects in each. But I am having problems with quit.
Blender crashes if I try to use this:
bpy.ops.wm.quit_blender()

Context is lost when opening a file. Test by adding print(context.copy()) What is the result desired  re opening same file after saving? And frankly what are you trying to do here, will never end up with 4 objects named "monica" in same file????

You are right. I have edited my question to better explain what I am trying to do.

Perhaps the issue is code  we don't see here, which if unnecessarily operator-centric will have bad performance https://blender.stackexchange.com/questions/7358/python-performance-with-blender-operators.  Can add an object via the api new_data = bpy.data.objects.new(name, data) or copy via ob_copy = ob.copy()  IMO constantly saving as above is undesirable.   Weigh up whether this is an XY Problem  that may be better evaluated by looking at why it is getting slow.

I think you are right. Now I have tried to ask the right question here: https://blender.stackexchange.com/questions/223074/to-improve-runtime-which-operators-to-avoid


text:
Is it possible to convert a procedural texture into actual geometry?
As we now have volumetrics in cycles, it's possible to render procedural textures in 3D.
For example, you can render a cube:

Like this:

However, is it possible to generate an actual mesh based on the intensity of a procedural texture?
I tried to do something like this:

Simulate particle system being affected by procedural texture
Convert particle system to vertices
Mesh using the convex hull modifier

But I failed because:

I couldn't get the particles to group convincingly based on the intensity of a texture
The result was concave, so the convex hull operator was not useful.

How can I generate a mesh in this way?

Particle is a nice idea to do this, and it is possible to control the volumetric density by procedual texture:

Demo file

Edit:
As MarcClinton mentioned in comment, a nice addon called MSMesher can be a relatively nice solution:

The result looks similar to metaballs, which means, to generate a sharper shape, further remeshing would be considered.

Now I just need some way to mesh them.. metaballs?

Metaball is fine, just sort of overkill.

The MSMesher Addon might do this for you. Here is a thread on BA.org http://blenderartists.org/forum/showthread.php?284678-MSMesher
The authors username is MohamedSakr and there is a video link for Vimeo titled MSMesher Introduction

@MarcClintDion Ah, I think this is what the OP want. MSMesher seems nice here, although it seems hard to make a sharp-enough result. But we can try using Remesh after that. I think it's less overkill than metaball.

Well, since you bring it up.  I do remember seeing all quads and they appeared evenly spaced and are well oriented along all three axis.  It looks ideal for Loop Cuts(Ctrl-R). The one big thing I noticed is that all traffic on this thread stopped several months ago.  Maybe someone else will have to take up the maintenance.

Looks promising! :) I always did want a way to mesh particles for SPH fluid sims..


text:
Relative reference to object property in material driver?
Is it possible to get a value such as the dimensions (object.dimensions) of an object in the material node editor, without referencing a specific object?
In other words, I want to get the dimensions of whatever object is using the material. How can I do this?

A driver is the only way I can think to access the object dimensions from a material.
Using a simple material example -

Add a driver to the field in a value node. Either right-click and select Add Driver or press D while the cursor is over the field. Setup the driver as -

Driver settings are shown in the properties panel of the Graph Editor when Drivers is selected in the header. This then mixes between the two diffuse nodes based on the dimension[0] value.

Note that auto-run python scripts needs to be enabled for drivers to work.
Obviously that is also rather rigid to the dimensions of one object. The Expr: of the driver can be any valid python, not sure of the path but there should be a way to go from the node with the driver to the parent object to choose the dimension value, which would be a more flexible way to use one material on multiple objects. I haven't had any luck accessing active_object in a driver.

Thanks, that's what I was afraid of. I want to be able to access the dimensions of the object with the material, hopefully without having to create drivers for each object..

Might there be a Python expression that could determine the current object referring to the material (instead of var)?

@Chuck No, but JerryNo has come up with a way around this - see his answer here.

Perhaps it's easier than you think.

Add INPUT->ATTRIBUTE in the shader editor.
Switch Type to OBJECT.
Insert Name YOUR CUSTOM PROPERTY


text:
Is there any advantage to using child particles with object particles?
Child particles can help give the appearance of many particles without slowing things down too much, which is especially useful when the particles will be combed or simulated.
But what about when using an object or group for a particle system which is not going to be combed or simulated? Are there any advantages to using child particles in this case?

Probably not; It wouldn't make sense...

There is very little advantage. Child Particles make copies of existing particles to reduce the computational power needed. When using objects as the display type for the particles, it is displaying a (translated) copy of that object at each and every particle. As far as render time goes, this will make no difference. When first setting up the particle system, using child particles will let you simulate the particles faster - but once you have the system set how you want it, it does not make much of a difference in render time.
Best way to answer this is to test it:
The following data was gathered from a test scene with a particle system on a simple plane, and using default (non-manifold) Suzannes as the display object. All children were identical:
Suzannes:   Actual Particles:   Children Particles: Total Render Time:
10,000          10,000              0                   00:28.19
10,000          1,000               10                  00:17.02
10,000          100                 100                 00:21.85

Clearly, it takes the longest for Blender to render the 10,000 separate particles, as it must calculate all 10,000. child particles are less intensive, but only up to a point. When you get too many child particles, there begins to be no computational gain between calculating extra particles, and calculating a large number of duplicate particles. This is why one can expect the best performance by using some child particles (but not going overkill).

Hm.. should not. Does it not for sure though? (have you tested it?)

what about memory usage?

Result with 1.000.000 suzannes:
1.000.000 actual particles: 2692 MB -
10.000 actual particles and 100 children: 1439 MB -
100 actual particles and 10.000 children: 1414 MB

children set to simple or interpolated?

interpolated, since it better resembles the result with only actual particles


text:
Particle trails in Cycles?
Is there a way to render trails behind particles in cycles?
I tried using hair particles with Use force field weights for growing enabled and a turbulence force-field, however the trails become unstable after a point:

Is there another way to do this?

I'd leave a better reply, but it's so late right now. In the meantime, I think I remember this video showed how to do that:
http://www.youtube.com/watch?v=v6SZp77VNqM

@ThomBlairIII It looks like that tutorial is for BI.. Also it doesn't seem to be quite what I'm looking for. I want to make something like this, but in cycles.

Isn't the instability caused by the turbulance force field? It is Turbulance after all...

@someonewithpc AFAIK it shouldn't. There are no dynamics and the field is not animated.. The hair strands should just grow in the pattern of the turbulence. It does at first, but then it gets unstable. Here's a .blend if you want to play around with it.. http://www.pasteall.org/blend/30752

Can't at the moment,  I'm on my tablet

You cannot do this with blender/cycles particles itself but you can use BTrace addon to create animated curves from traced particles:

The addon is still under development but it works very nicely.


text:
How to make the file manager default to sorting by modification date?
I often want to find files which I've modified recently, so I'd like to set the file manager to sort by modification date automatically.
Is this possible?

This is an addon for overriding the default display settings of the File Browser.
Currently you can:

Override the 'Sort Method', the 'Display Type' and the 'Display Size'
'Enable' or 'Disable' the overriding directly in the Panel (so you don't need to disable the Add-on each time)
Set the 'Sort Method' of the File Browser for 'All Operators' or a 'certain operator' like Open Blend,  Open Image, Recover Blend etc.
'Customize' and 'Reset' the override settings via Add-on Preferences

Click to enlarge
Once the Add-on is installed and enabled, the default 'sorting method' is set to Modification Date, the 'display type' is Thumbnail and the 'display size' is set to Tiny, but you can change that and save the User Preferences to keep your settings for other sessions.
filebrowser-display-override.py
# ##### BEGIN GPL LICENSE BLOCK #####
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####

bl_info = {
    "name" : "File Browser Display Override",
    "author" : "chebhou, poor",
    "version" : (1, 1, 0),
    "blender" : (2, 78, 0),
    "location" : "File Browser",
    "description" : "Override File Browser Display Settings",
    "warning" : "",
    "wiki_url" : "",
    "tracker_url" : "",
    "category" : "User Interface"
}

import bpy
from bpy.props import (BoolProperty,
                       EnumProperty,
                       PointerProperty,
                       )
from bpy.types import (Panel,
                       Operator,
                       AddonPreferences,
                       PropertyGroup,
                       )

class OverrideFileBrowserSettingsPreferences(AddonPreferences):
    """Add-on Preferences"""

    bl_idname = __name__

    enable_panel = EnumProperty(
        name="Enable Panel per Operator",
        description="Enable Override Panel for certain Operators",
        items=(('ALL', "All Operators", "Always override the Settings", "RESTRICT_SELECT_OFF", 0),
               ('IMAGE_OT_open', "Open Image Operator", "When Opening an Image (Image Editor)", "IMAGE_DATA", 1),
               ('WM_OT_open_mainfile', "Open Blend Operator", "When Opening a Blend", "FILE_FOLDER", 2),
               ('WM_OT_recover_auto_save', "Recover Operator", "When Recovering a Blend", "RECOVER_LAST", 3),
               ('WM_OT_link', "Link Operator", "When Linking a Blend", "LINK_BLEND", 4),
               ('WM_OT_append', "Append Operator", "When Appending a Blend", "APPEND_BLEND", 5)),
        default='ALL'
        )

    enable_sort = BoolProperty(
        name="Sort Method",
        description="Enable Sort Method Override",
        default=True
        )

    enable_type = BoolProperty(
        name="Display Type",
        description="Enable Display Type Override",
        default=True
        )

    enable_size = BoolProperty(
        name="Display Size",
        description="Enable Display Size Override",
        default=True
        )

    def draw(self, context):
        layout = self.layout
        row = layout.row(align=True)
        row.prop(self, "enable_panel")
        row = layout.row(align=True)
        row.prop(self, "enable_sort", toggle=True)
        row.prop(self, "enable_type", toggle=True)
        row.prop(self, "enable_size", toggle=True)
        layout.operator("filebrowser_display_override.reset_preferences",
            icon='FILE_REFRESH')

class ResetOverrideFileBrowserSettings(Operator):
    """Reset Add-on Preferences"""

    bl_idname = "filebrowser_display_override.reset_preferences"
    bl_label = "Reset Preferences"
    bl_options = {"INTERNAL"}

    def execute(self, context):
        scn = context.scene
        prefs = context.user_preferences.addons[__name__].preferences
        prefs.property_unset("enable_panel")
        prefs.property_unset("enable_sort")
        prefs.property_unset("enable_type")
        prefs.property_unset("enable_size")
        bpy.ops.wm.save_userpref() # Save
        return {'FINISHED'}

class OverrideFileBrowserSettingsProperties(PropertyGroup):
    """Add-on Properties"""

    override = bpy.props.BoolProperty(
        name="Override Display Settings",
        default=True
        )

    display_type = bpy.props.EnumProperty(
        name="Display Mode",
        items=(('LIST_SHORT', 'Short List', 'Display Short List', 'SHORTDISPLAY', 0),
               ('LIST_LONG', 'Long List', 'Display Short List', 'LONGDISPLAY', 1),
               ('THUMBNAIL', 'Thumbnails', 'Display Thumbnails', 'IMGDISPLAY', 2)),
        default='THUMBNAIL'
        )

    sort_method = bpy.props.EnumProperty(
        name="Sort Method",
        items=(('FILE_SORT_ALPHA', "Name", 'Sort by Name', 'SORTALPHA', 0),
               ('FILE_SORT_EXTENSION', "Extension", 'Sort by Name Extension', 'SORTBYEXT', 1),
               ('FILE_SORT_TIME', "Date", 'Sort by Date', 'SORTTIME', 2),
               ('FILE_SORT_SIZE', "Size", 'Sort by Size', 'SORTSIZE', 3)),
        default='FILE_SORT_TIME'
        )

    display_size = bpy.props.EnumProperty(
        name="Display Size",
        items=(('TINY', "Tiny", 'Tiny Items', 0),
               ('SMALL', "Small", 'Small Items', 1),
               ('NORMAL', "Normal", 'Normal Items', 2),
               ('LARGE', "Large", 'Large Items', 3)),
        default='TINY'
        )

class OverrideFileBrowserSettingsPanel(Panel):
    """Add-on Panel"""

    bl_idname = "FILEBROWSER_PT_settings_override"
    bl_label = "File Browser Display Settings"
    bl_space_type = "FILE_BROWSER"
    bl_region_type = 'TOOL_PROPS'

    @classmethod
    def poll(cls, context):
        prefs = context.user_preferences.addons[__name__].preferences
        if context.space_data.active_operator is not None:
            return context.space_data.active_operator.bl_idname == prefs.enable_panel or \
                prefs.enable_panel == 'ALL'
        else:
            return context.area.type == 'FILE_BROWSER'

    def draw(self, context):
            scn = context.scene
            browser = context.space_data
            props = scn.filebrowser_display_override
            prefs = context.user_preferences.addons[__name__].preferences

            layout = self.layout
            row = layout.row()
            row.prop(props, "override")

            if prefs.enable_sort:
                layout.row().prop(props, "sort_method", text="Sort by")
                if props.override:
                    if browser.params.sort_method != props.sort_method:
                        context.space_data.params.sort_method = props.sort_method

            if prefs.enable_type:
                layout.row().prop(props, "display_type", text="Display")
                if props.override:
                    if browser.params.display_type != props.display_type:
                        context.space_data.params.display_type = props.display_type

            if prefs.enable_size:
                layout.row().prop(props, "display_size", text="Size")
                if props.override:
                    if browser.params.display_size != props.display_size:
                        context.space_data.params.display_size = props.display_size

def register():
    bpy.utils.register_module(__name__)
    bpy.types.Scene.filebrowser_display_override = PointerProperty(
        type=OverrideFileBrowserSettingsProperties)

def unregister():
    del bpy.types.Scene.filebrowser_display_override
    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()

Gist: https://gist.github.com/p2or/59b2795f011f2f024f5e781d1a33a5da

@Chebhou Sorry, somehow I missed this.. (never saw it in my notifications :/) Trying out now :)

I get bpy.utils.register_module(): failed to registering class <class 'filesort.FILEBROWSER_PT_settings'> Traceback (most recent call last):   File "/usr/share/blender/2.74/scripts/modules/bpy/utils.py", line 607, in register_module     register_class(cls) RuntimeError: Error: Region not found in space type when enabling the addon. Nothing appears to happen.

@Chebhou I don't know why, changing the space (http://www.blender.org/api/blender_python_api_2_74_release/bpy.types.Panel.html?highlight=bl_space_type#bpy.types.Panel.bl_space_type) type to TOOLS and adding a new Category works in 2.74. Please try if it works for you too.

@poor it is working now on 2.74 and window 64   : ), sorry i 'm in a rush right now I'll be back

@poor  we can change it to TOOL_PROPS to get it back where it was, i think it will be easier to reach

@gandalf3 it's working now on 2.74 , it was some api change

Thanks, it's working now :) A bit of a shame that separate buttons are needed, but I guess there's no other way without going into the C source.. I'll accept when the bounty is up, just because you never know ;)

Wonder if this commit might be of help

I know this was made 2 years ago, but it's still very relevant addon. The only problem is, it's stopped working. Can someone fix the code?

@poor if you ever have time to fix this it would be great , by now I barley know what it is. sorry for the trouble

Ok, I'll try to fix it tomorrow @Chebhou.

@Chebhou Done. I tried a lot to improve it like adding the menu to the header: https://i.sstatic.net/QVgpC.jpg, reading the properties dynamically from the rna or setup a load_post handler but at the end I couldn't get it to update properly so I left it on the panel...

@poor Thank you , and sorry again for the trouble , don't worry about the improvements I'll try to look in it too.

I have this working for me in 2.78, and from my standpoint it conveys another advantage: When in use, it allows me to import image sequences in reverse order by sorting on date, and in numeric sorting on name. One less (minor) step in VSE to reverse strip direction. Thanks very much!

how do i save this addon's settings? saving User Preferences didn't do it, so i changed defaults in the addon file and reinstalled it.

Unfortunately, as of Blender 2.8 this no longer appears to work due to massive API changes.

@Bas see this https://gist.github.com/AugustoMoura/cf7ebf3269c8fdf016733f6cb9d8a3cc

@Chebhou If I install that version Blender just gives me this message: Modules Installed () from '%USERPROFILE%\Downloads\blender-filebrowser-display-override-2.py' into '%USERPROFILE%\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons' but no add-on is actually added to the add-ons menu...

@Chebhou never mind, got it working now. Apparently there was a problem with line endings... as usual. Thanks!

...although installing it does not seem to do anything. Huh.

This isn't a complete answer but I dump here what I've found out so far. Perhaps someone else can extend on this.
The tooltip displays:

But the screen "Default-nonnormal" cannot be accessed:
>>> D.screens["Default-nonnormal"].params.sort_method="FILE_SORT_TIME"
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
KeyError: 'bpy_prop_collection[key]: key "Default-nonnormal" not found'

The buttons are defined in scripts\startup\bl_ui\space_filebrowser.py
The relevant parts of the draw function show that the parameters are retrieved from context.space_data.params I couldn't find anything in the python code,
   def draw(self, context):
        ...
        st = context.space_data
        ...
        params = st.params

        # can be None when save/reload with a file selector open
        if params:
            layout.prop(params, "display_type", expand=True, text="")
            layout.prop(params, "sort_method", expand=True, text="")

Dumping the params (Using Is it possible to dump an Objects Properties and Methods?)
obj.__doc__ = None
obj.__module__ = bpy.types
obj.__slots__ = ()
obj.bl_rna = <bpy_struct, Struct("FileSelectParams")>
obj.directory = C:\somepath
obj.display_type = FILE_SHORTDISPLAY
obj.filename = driver_curve.blend
obj.filter_glob =
obj.rna_type = <bpy_struct, Struct("FileSelectParams")>
obj.show_hidden = False
obj.sort_method = FILE_SORT_TIME
obj.title = Open Blender File
obj.use_filter = True
obj.use_filter_backup = False
obj.use_filter_blender = True
obj.use_filter_folder = True
obj.use_filter_font = False
obj.use_filter_image = False
obj.use_filter_movie = False
obj.use_filter_script = False
obj.use_filter_sound = False
obj.use_filter_text = False

Adding
params.sort_method = FILE_SORT_TIME

at line 55:
    if params:
        params.sort_method = FILE_SORT_TIME
        layout.prop(params, "display_type", expand=True, text="")

sets the sort_method in a brutal unchangeable way.
Trying from C source
The definitions are in
blender-2.73\source\blender\makesrna\intern\rna_space.c
static void rna_def_fileselect_params(BlenderRNA *brna)
{
    StructRNA *srna;
    PropertyRNA *prop;

    static EnumPropertyItem file_sort_items[] = {
        {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_SORTALPHA, "Sort alphabetically",
                          "Sort the file list alphabetically"},
        {FILE_SORT_EXTENSION, "FILE_SORT_EXTENSION", ICON_SORTBYEXT, "Sort by extension",
                              "Sort the file list by extension"},
        {FILE_SORT_TIME, "FILE_SORT_TIME", ICON_SORTTIME, "Sort by time", "Sort files by modification time"},
        {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Sort by size", "Sort files by size"},
        {0, NULL, 0, NULL, NULL}
    };

But this doesn't work (also dump prints a completely different object):
print( bpy.types.FileSelectParams.sort_method )

AttributeError: type object 'FileSelectParams' has no attribute 'sort_method'

Clicking "sort files by modification time" works for me. I'm using 2.72

@VinceScalia Yes, it works interactively, but gandlaf3 want to set it as the default sort order.

The only way it will work is at startup when you save your default Start-Up-File with file editor open and set to sort by date. This will only work when you just opened Blender though.
Anytime you click file_open button anywhere this resets to by date. Since the file open manager is generated dynamically from your current screen layout and has no callback it could be done only by some intrusive persistent script. Changing the space_filebrowser.py 55th line as Stacker suggested is a better option imho.
Custom addon file manager designed properly would also solve this, but it would work only through key-shortcut, because replacing present blender buttons with custom ones can only be done again by editing the source python files(:()

Hm.. This is way more tricky than I ever initially imagined :/ I would think the default is defined somewhere (in the C source?) and it's just a matter of changing it. Which sounds a bit easier than re-implementing a custom file browser.. The question is where, if at all.. (and assuming there is no other practical alternative)

@gandalf3 Well in the C source anything can be done to fix it, but to get it into trunk will take more time than making addon (maybe not if some dev would be kind enough:) and I don't think you want to maintain your own build of blender.. But you are right the correct way to go is to make patch for the C code and have it validate into trunk. The file manager should remember the last setting at least..


text:
Is there a way to re-bake only the end part of an existing bake?
I'm trying to do some physics based animation, and of course the longer the animation gets, the longer it takes to bake.
However, I don't need to keep recalculating the first parts of the animation, as they stay the same.
Is there a way re-bake the part of a simulation after a specified frame, without re-baking the whole thing?
Currently I'm using rigid body and cloth physics.


text:
How to deform a mesh based on bone rotation?
Is it possible to set up a rig in such a way that a soft, rubbery part of the mesh can be "deflected" based on the rotation of a bone?
For example, I have a mesh like this:

And I'd like to rig it so that when the cylinder part is rotated, it deflects the rubbery torus like this (roughly):

Unfortunately I can't just weight the torus to the arm bone, as that doesn't deflect the torus so much as rotate it:

Note that the cylinder should be able to rotate in all directions and deflect the rubber "gasket" accordingly (as depicted in the second screenshot).
Is this possible to do with a rig?

Im guessing you would need to IK rig the torus with about 5 bones , and make it so that the cyclinders bone effects the torus bones , but thats just a theory.

Your example is tricky because the ring forms a loop to rig, which is difficult for it to work omnidirectional and also stretch.
Normally for sliding stuff like handbags on shoulder etc. you would just IK rig it and give the control a Floor constraint to emulate the collision. But this would be too difficult here.
Instead I suggest placing reasonable amount of bones into the rubber ring and building the same amount of rigid-body collision meshes for it making together the ring. They need to collide with the shaft and be connected with rigid-body joints. When you parent the bones to the pieces it should give the most realistic results.
You could also try to rig the torus with a star of bones radiating from the torus center to edges and script a custom driver for them that will move the bones away from the shaft.


text:
Eeevee and Cycles animation/image are only rendered gray
I have rendered the animation in eevee and cycles but the rendered video (output) is only a gray background please help soon it works fine in workplace render this:
EDIT: A workaround? if i copy all my objects to an another file (created new blender file) then rendered it works but that still does not tell me why this is happening.
my prefences:
file here for your ref:https://drive.google.com/file/d/1-NUUK_sybn7VVQ2-wfU0V8vS7tcxV9U2/view?usp=drivesdk file link

How to include file?

Show us your background setup

how to i am new

please share your file (remove all the useless objects and pack the images): https://blend-exchange.com/

Does this answer your question? When rendering an image the output is grey

I don't know where to get to that screen

I have Tried that Emir but that is not the problem

The collection containing your models is disabled for rendering:

Hence, all objects contained inside, including your bird and the green cube, were just not being rendered, leading to only your scene world's gray color to be visible.
Enable the collection's rendering and it will work normally.

Unrelated note: if you put a green cube behind your bird in order to key out the green for transparency in a later use, that's unnecessary.
Enable transparency in Properties Editor → Render tab → Film panel. Then in your file output, make sure you use a file format that supports RGBA colors like EXR or TGA.

I did not see that wow I was so stupid thank you

In the Output Properties tab, there is a dropdown called Post Processing.
Enabling the Compositor checkbox might solve your problem.

Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

I have checked that thank you for telling the comment above was the answer but still
thank you very much and have a great day


text:
How do you smooth a circle made from an array of rectangles?
I'm having difficulty turning an array of rectangular shapes into a circle. For simplicity's sake I've just used a rectangle in the below images.

I've tried sub-dividing the shape and applying the smooth modifier. Then tweaking various parameters in those modifiers. I also tried applying the array as well as moving the modifiers order in the stack.
I've tried using an addon called LoopTools, this either looked the same or the shape was vastly warped.

The basic rectangle shape.

The basic rectangle shape in an array.

The basic rectangle shape with lots of sub-divisions.

The sub-divided rectangle shape with the array applied and the smooth modifier added.

The sub-divided rectangle shape with the array applied and the smooth modifier added, but from above.

=== UPDATE ===
Good suggestions. I've now tried just an array with the simple deform modifier but the result looks almost identical.
Bottom Circle is the original array with an empty.
Top Circle is the array with the simple deform.

I need to make my rectangular array more circular like the below image. Which is just a squashed cylinder.

It's not the subdivision itself that yields more continuous normals. It's that the subdivision allows the geometry to be deformed. Choose a deforming modifier, such as Jachym's suggestion

Array + empty won't work, since the rectangles won't join cleanly in the first place.
You can use Array Modifier and Simple Deform Modifier > Bend to get a smooth circle.

another method could be using the screw modifier ;)

oh for sure :). perhaps even more practical


text:
Geometry nodes - Scale using specific Vertices
I'm currently using a "Curve Circle" node and an "Instance on Points" Node to create a ring shape. However I can't seem to join up the outer vertices. I tried using a "Merge by Distance" node however that causes other problems due to the distance of the vertices.
What I'd like to be able to do is scale the objects at specific vertices so that they are close enough to use the "Merge by Distance" node.
I suspect that I need to make use of Vertex groups but once I've created my selection of vertices into a group I have no idea how to use them in geometry nodes to achieve my goal.

For clarity I'm trying to perform the below action procedurally using Geometry Nodes.

A merge by distance (or weld) would work for what you're showing.  Is it possible that this image is only a demonstration of the problem on something more complex?  I'd recommend showing your actual problem if it is, as that can impact the solutions.  In general, I'd suggest checking out https://blender.stackexchange.com/questions/251929/how-to-implement-radius-in-a-geo-nodes-curve-modifier so you can actually curve your instances around the curve rather than merging verts, but I can imagine that the real, actual problem matters.

I'd also like to take a look at your Geometry nodes set up if you could include a screenshot, or a link to your .blend file?

Oops, wrong link.  Try https://blender.stackexchange.com/questions/245282/how-to-bend-geometry-with-geometry-nodes/245553?noredirect=1#comment428782_245553 .

if you have a circular array of elements, you could scale them by the distance to the center point like this:

and if you don't want to scale it on z you can use this:

This is brilliant. Thank you so much for the solution and the clear images. I've done some testing and I think that this will slot in nicely with all the other logic.

Thank you and you are welcome‼‼

I needed something slightly different, but this answer finally cracked open my problem. Thank you!

I would do it like that. You can also use the index.


text:
Is visibility inverted between objects and modifiers?
I copy and pasted a driver from a modifier's visibility buttons to an objects visibility buttons, but the resulting visibility is opposite for the object. As in, a driver value of 1 for the modifier results in visibility being true, and for the curve object the same driver value of 1 results in visibility being false. Is this intentional behavior, or is there something I am missing? It doesn't seem to be documented but maybe I missed it. The driver is working, moving the bone to get a driver value of 0 toggles both.

"Component" here is a little vague-- looks like you mean a modifier, but there are a lot of potential things you could mean, and each could be something different.  The driver properties for object visibility don't agree with object visibility text, however.  Outputting "true" to object visibility hides objects.  I always figured this was more of an interface issue, where the text/checkmark is backwards, too smart for its own good.

Fixed it, I meant modifier.

Seems like the underlying variable is inverted. For modifiers its .show_viewport and for objects its .hide_viewport. Weird.


text:
Hidden armature meshes and physics objects are still processed for a visible armature, is there a workaround?
My animation playback is less than 2fps in a certain blend file. I've tried opening it with addons disabled, which brings it from <1fps to <2fps.
A have a Rigify rigged character in a scene. I have disabled everything in the scene, through both collections and the viewport visibility toggle. The only thing visible is the generated rigify armature, with no keyframes on it.
Files that playback at 25fps: Keyframed default cube, Rain, Snow, and a freshly generated Rigify rig.
UPD1: Narrowed it down to deleting the collections with physics objects in them. Any workaround to this? How can I disable physics objects correctly?
UPD2: Narrowed down further to deleting the armature modifier on two meshes, and disabling the collisions on everything. These are in disabled and hidden collections. Why are they still being processed?
UPD3: The two meshes were very dense, and had a decimate modifer before the armature on the stack, applying those along with hitting the eye button on the collisions also fixed it.
UPD4: So it seems like hidden armature modifiers and parented physics objects are all still processed on the related visible armature. That sucks, any workarounds to this?

Not ideal like hiding should be, but I was able to get the fps back up to 25fps by simplifying and combining the collision meshes and applying decimation modifiers on the hidden meshes. Just reduced the total amount of vertices and objects being skinned to the rig. I'd expect adding a large set of clothing collections to have the same problem that wouldn't be able to be solved the same way though.


text:
Edges won't join / UV unwrap issue Blender 2.8
Started unwrapping my model, and ran into a couple issues. I think i found problem, but could use some help fixing it.
The unwrap is extremely warped in various spots of the mesh. While attempting to troubleshoot the issue I found edges are not properly connected to each other in between extrusions(you'll see what I mean when opening the file). I attempted to join those edges with no luck. It seems there is something I'm missing. Problem area is marked in blue circle.

Unwrapping is not as simple as you'd like it to be. Using software like Substance Painter allows me to be lazy and just UV-Smart Unwrap the entire model at once. To do it properly however takes a long time. I suggest watching some tutorials at first. You are not doing anything wrong and there really isn't a way to answer your question. https://www.youtube.com/watch?v=MckPa3qbu9A

You may find that you get better results when UV unwrapping your model if you use the Conformal method.

Thanks. Still learning 2.8. I remember an add-on being required for results like this, right?


text:
Advise on UV unwrapping
I'm making a building for Unreal engine. This building has many small parts, and when merging all the UVs i noticed how small certain UV's get. In substance painter, these small UV's become a problem. What is your suggestion for something like this?
I would rather not break it up into multiple objects, and have to piece the building together in Unreal... but is that the best route for complex objects?

This last image is the problem I've been getting with the smaller UV'd objects.

There are several things going on here.
In general, to unwrap for lightmaps, the recommendation is not to make very big meshes, meaning meshes with many individual parts like your building. The only way to get decent lighting in such a scenario is to make huge lightmaps (ie 2048x2048 or even higher). Your build times in Unreal, as well as in-game memory use, will suffer.
A second thing to keep note of, is that you should always try to unwrap keeping as many parts together as possible. You seem to have created seams on all edges - this is a terrible idea for lightmaps: In the game engine, there needs to be a gap between every island (to make sure no light leaks from one island to the other). That gap will will shrink when you use higher resolution lightmaps, but it will create bad results:

you will see a seam on the surface where the edge is
with many individual islands, there will be much unused space in between the islands
with many individual islands, often they don't fit on the lightmap unless you make it very high resolution

A third thing, looking at your unwrapped image, is that it seems not everything is unwrapping properly. But it's difficult to see with so many elements on one object. Are you unwrapping with U->Unwrap?
What I would try first in this case is to unwrap with U->Smart UV Project, and set the 'island margin' to 0.5. This often gets decent results, if you're not unwrapping rounded objects (since it splits the faces based on the angle they share).
When I would consider splitting the object into smaller parts. How many, depends a lot on your scenario: will you create this house 100 times in one map? Or only once? If you're splitting the object, try to do so along the separation of materials. Separate out the roof and the road, for example. This way you don't create additional draw calls as a result of your split (the engine doesn't have to look up the roof material twice etc).
When preparing for painting, accurate unwrapping gets more important. You might have to spend time manually unwrapping the whole thing, to keep as many parts together as possible. The biggest difference with the lightmap scenario above, is that lightmaps don't suffer from seams on sharp angles, while for painting you might want to keep individual parts together - but the only way to do that I know is manually selecting edges and creating seams. Anyhow, for a complicated mesh such as yours, accurate unwrapping becomes one of the biggest headaches.
Good luck!

The size of the UVs are only an issue if the pixels represented by them are too low in number to be usable. If the bulk of your UV Map is like this, yet you get a good result with a relatively medium sized image texture like 2k or 4k, then it isn't a problem. If you try and still have problems, you then might try other methods of unwrapping the UVs based on length etc.

Check new image for problem i've had in substance painter

Can you make a copy of the object and use Smart UV Project to get a more compact layout and try in SP again? I am thinking that you just need to balance the size of the faces.


text:
Have object with texture, import and there is no texture on object
I'm trying to do some Minecraft animation, so I get some textures and rigs and did this.
Picture no.1 obj with texture

But when I import that object I´ve got this
Picture no.2 imported picture without texture
I'm little bit newbie and I want to join to Blender community.

Both links point to the same image

OH no, i see.
Will Edit, but shortly - IT gets that model but it looks white (without texture (imagine these Wings but only White)).
Its .obj file

Oh sorry for that Duarte. Right picture is -  https://imgur.com/Ft3cvVk <-


text:
Bad render quality
I have one animation project where i use Cycles Render. After rendering i wasnt happy with results (Image 2) What is problem and what is solution?
(Samp - rend 256. prev 2; Using GPU; Tiles 256 256)

HOW TO SOLVE THIS PROBLEM -
There are two ways how to solve it. First - MCprep addon, this addon is needed if you want import your minecraft world into blender with textures. If you import them you need click on prep material [link]
 (https://i.sstatic.net/TyQaV.jpg - red line - in which software was obj. from save created and blue line is the solve.) OR you can click on material and change from linear to closest [link] (https://i.sstatic.net/CAhiO.jpg)

Hi. Please don't write 'solved' in the title. If an answer solves your question you can 'accept' it. See: https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work

There's not enough info to be sure, but I think your problem is that lighting does not match the "Minecraft" look. My suggestion is : change the material of your objects to emmision.
There also seems to be some bluring of the textures which should be fixed if you render. Hope this helps a little.

Okay, problem was in MCprep i didnt Prep materials, so if you have same problem, go to MCprep, choose your world exporter and click on Prep Materials. But anyway, thanks Cos Dim :)

Can you clarify what is "MCprep" and "world exporter"? Some screenshots, description?

Hi @Mr Zak , there are two ways how to solve it. First - MCprep addon, this addon is needed if you want import your minecraft world into blender with textures. If you import them you need click on prep material [link]
(https://imgur.com/u8Xh0MA - red line - in which software was obj. from save created and blue line is the solve.) OR you can click on material and change from linear to closest [link] (https://imgur.com/107pOVY)


text:
Shining light through model in Blender 2.79, Cycles
How can I make this kind of light?
Try to imagine plastic bottle of milk with light bulb inside of it, exact same thing (Like on picture)

Use principled shader. Go to TRANSMISSION set it to 1. Now it will look like crystal. Use roughness transmission to get it as you like. You can drive the effect using a mask or a texture with white vignetting effect on the sides and totally black on the middle so that light gets restrainted on the sides but passes clearly on the middle.


text:
Need help with lighting and materials

Recently started using blender, so I am relatively new. I have also watched few blender tutorials and became interested in low poly.
The first picture in the collage is a low poly render I found online while looking for ideas and decided to make my own little low poly forest scene (second picture).
Obviously, I am having troubles with the lighting of my scene, and, the materials for the grass/land, the mountains in the back, and the water.
The grass in my render looks very fake and does not go well with the trees and water. The same goes for the mountains. As for the water, I wish to make it look similar to the water in the first render. I have used color ramps for all the materials. (For water, it is a combination of blue and green, yet there is mostly blue).
I would greatly appreciate it if someone helps me out. This has been bothering me for a few days now, and I really wish to learn advanced concepts from blender.
Edit: Added pictures for the new render and the materials for Mountains, Land and Water.

Howdy Eat the Carrot, welcome to bse. Suggest being more specific.  For example "how do I set up this water material".  (or background, or lighting can be new qs)  What renderer you are using.   Add a screenshot of your material setup or a blend file.  etc etc.

I think you're going in the right direction:
The upper image has:

better composition and general concept
much more details (that make water reflections much more interesting)
better focal point (the animal and the tree in the water)
some mist effect for fake volumetric lighting (I think it's been used the z-pass to fade far objects to white)
a gradient for the sky
A vignette effect (darker borders, post prod or compositor effect)

This is the change you can obtain by only implementing a vignette and some curve adjustements in post production:

So, keep on modelling, add details, work on the general idea, the composition, the art, without worrying too much about materials and lighintg, that will be easier when the goals of the image will be better definied.

josh sanfelici, thank you for replying honey. Is the volumetric lighting the same option available under the World properties? Also, any idea as to why the water in my render picks only blue when rendering (I have also used a greenish shade in the material of the water).

Hi, as BatFINGER said, for this specific questions you should upload your file or, at least, show your materials windows. By now I don't even know if you're using BI or cycles, I cannot guess anything.

josh sanfelici, I attached the materials for the Mountains, Land and Water. Also, I modified my previous scene a bit.

OK, the main problem is that the random node output gives a single value, which is different for every instance of the object: if you have one piece of water only, it will generate a single color, with no variations. if you want some variations between green and blue use a color mix RGB node, and drive its FAC input with a texture (maybe start with a Wave procedural one). Enable the Node Wrangler addon and Shift Ctrl left click on a node to check its outputs. If you use an image texture set the texture coordinates to generated or unwrap the mesh.

josh sanfelici, thank you dear buns. I will try it out (:


text:
Mesh not moving with armature
I have a simple character with a rig, hands and feet are "rayman style".
I don't want my mesh to be deformed so I have unchecked "deform" on all bones and IK bones.
When I parent with "armature deform - with automatic weights" the result is that it will not attach to the mesh.
I will provide the Blender file.

Can anyone guide me on how to do this without deforming the body?
Update #1: If I add "deform" on lower legs and lower arms, the armature will work as expected, but the feet and hands will be twisted in start position.

Update #2: weight painting both upper and lower legs (painting only the feet cubes red) and ticking deform on these will cause the feet to align correctly in start position, but will distort/shrink the mesh when moving the feet IK handle, see when knee bends in 2nd image (the desired result is to not deform anything).

Hi. Please add images to illustrate your problem. While blend files are welcomed, they should be supplementary to good question content. In an ideal situation the question will have enough information that we don't have to download a file.

Hi. Thank you for pointing out the importance of images, however I don't believe every type of request can be solved with an accurately stated question, it can most of the time though (ideally). This is more of an issue I don't really know what to do with, and one with more insight in rigging might have to open blender to see what's really going on or what settings might be causing the problem.

So I found a solution to the problem.
I don't know much about the mechanics behind rigging a model, but I made a test where I splitted the whole mesh (body, hands, feet) into separate objects.
I then parented each object cube (hands/feet cubes) with the lowerArm/Leg bone using "set parent - bone" and weight painted the cubes all red with lowerArm/leg selected, then ticked "deform". (as opposed to earlier tests with "set parent - with automatic weights")
This gets the cubes to be aligned correctly in "pose position" and without distorting or shrinking the cubes when moving the IK handles.

Your object is not weight painted. Blender needs to know which vertices are influenced by which bone. This is done by painting weights
Basically you can do that two ways:
1 - Parent your mesh to your armature with automatic weights. You may have to tweak things as explained in point 2 though
2 - select a bone of your armature and go to weight paint mode to paint (red) the vertices influenced by that bone. Repeat for each bone.
Also make sure "deform" is ticked as shown on the picture, without which your bones will have no influence on your mesh.

That didn't seem to be the issue altough I thought so myself, I actually I did weight paint with the lower legs in the original file. I checked deformed on the the lower legs and tried again but I dont want the legs/feet to twist, I have updated the answer with a picture to resemble this.

I'm not sure what the problem is. I weight painted the legs in your example, ticked deform and everything is straight.

I did what you did, weight painted both upper and lower legs and the leg cube straights out, but try moving the feet IK handle, see update#2. weird.


text:
FBX export group instances to unity issue
I have issues with exporting a group of meshes into unity.
I want to build a room in blender where the walls (img #1) are constructed separately and can be used as group instances in a new layer or scene (img #2).
All parts of a wall is parented under an empty. And so is the final room with the wall instances.
Problems occur when importing to unity, I select the walls (the group instances) in the room layer and tick "selected objects" and export.
Unity will import the three instances but with default position/rotation (img #3).
Also, when looking in the unity outliner, something seems off with the parent/child relations (img #4)
The goal is to export the room as is, like img #2.
Blender file:

Issue solved, I simply forgot the possibility of grouping the final wall pieces and create another group, this way I can just add a room instance to the scene and select that upon fbx export and unity will import this as one unit.
result:
marking this as the best answer

You could try removing that empty object, in blender you use empty objects to avoid those z-axis issues between blender and unity. Also when exporting to FBX you could set what is your up-axis
EDITED:
From your shared file I exported one by one to FBX and them imported into Unity, without that axis issue, try that, BTW don't forget to set your forward and up axis... If it doesn't work let's go chat

Removing it produces the same result in unity, sadly. The axes are also set to match unity. It seems the issue is not a global axis problem, the transform of each instance gets lost, don't know whether the "issue" is with blender or unity.

Could you share your model?

Sure, see edited post, thanks for looking into this.

thanks for testing, perhaps I wasn't clear with my question but I'm afraid my goal is to be able to create a room made up of the wall instances, THEN export the full room as a finished asset into unity. I need to accomplish this without using joins to keep the possibility of re-editing the walls/rooms in a nice way.

I understood that way too, there is two possible ways, one is what you did, separated wall, ceiling, window, doors, and so on, so you should export them one by one, by doing this should be easy to create any kind of room. second way is make your room in one mesh and I think yo exported your model in this way that why you have those issues...

way 1, exporting separate pieces and build a room in unity is what I'm trying to avoid. way 2, I don't see how exporting it as one mesh will be satisfactory since you need to duplicate all pieces and then join them to a room and then export, every time you need to make a change.

Why you want to avoid way 1? I think that fit best for your case

As you mention, one way is to compose rooms in unity (or even parts of walls) but the desire is to produce a finished room asset for unity. This may very well be a matter of preference or needs, but before I fall back to an alternative strategy I'd like to investigate how to accomplish this as in the original question. Thank you for taking your time though.


text:
To improve runtime, which operators to avoid?
To improve runtimes, I am trying to avoid using operators that lead to scene updates.
See here for the background:
Python performance with Blender operators
Why avoid bpy.ops?
Finding vertices in a Vertex Group using Blender's Python API
When I know more, I will find a low-level way to avoid the use of the relevant operators.
Do I need to avoid all uses of bpy.ops... or is it only operators that add something new to the scene?
Are there any operators to avoid that are not bpy.ops...
Are there other ways to avoid scene updates, such as using bmesh, other libraries, or explicitly stopping the updates? I would then just have the one scene update when I need it.
Can I avoid scene updates by hiding objects from view? I do not need to see objects being used in Rigid Body physics for collision detection, but perhaps the physics world needs a scene update in every frame!

From experience I can tell that using operators is not necessarily "slow", that's a general misconception and not always true, just depends on the case. Have a look into the source and/or measure the execution time per operator. AFAIK there is no direct way to avoid scene updates if the operator updates the scene... Notice that C is not the slowest language in the world, some operators are written in python and it's pretty hard to beat their execution time. Suggest add more details and what you'd like to do, there are quite a few operators to test.

The saying about premature optimization being bad might apply here. Instead of spending a lot of effort to avoid all operators or figuring out in advance which ones are "slow", you might have a better time using just them where convenient and then making low-level replacements for some of them if and only if (1) your script starts to actually have performance issues and (2) profiling traces those issues to operators that are feasible for you to replace with faster code.


text:
Rigid Body Physics (Collisions)
I am using Rigid Body Physics in Blender 2.83 to have some cubes fall into a bowl. It should be quite simple, but as you can see the result is grossly over-dramatic.
What am I doing wrong, or not doing?
Thanks,
Paul

cant really get whats wrong , can i get a pic of a larger frame covering the place where the cubes are coming from , if you have sandwiched the closely , they will collide with each other and then scatter apart

Hi,
I have added a picture of the cubes before they drop. There is air between each cube.
This might be a bug with Physics Properties > Collisions > Shape > Mesh
in Blender 2.83. The Physics works for Shape > Box, etc. just not for Mesh. When I set it up exactly the same in Blender 2.79 it all works as one would expect. I will try 2.9 to see if the bug has been sorted.
Unless you know any work-arounds????

Can you post a picture of your cube physics settings? Also, how are you generating the extra cubes?

@PaulStGeorge look at the sensitivyty and check collision margins , and set it to 0.01

Yes. I had Scene Properties > Unit System set to Metric. So, even though I was using a small number for the Margin the distance was too big.
Changing the Unit System to None did the job. I could then, as suggested, put small numbers in Margin settings and in Settings > Mass. Now it works!!
Thanks!!!

This is happening because the margin of the the cubes are too big , you need to shorten it by going to sensitivity > check collision margin and enter numbers like 0.01


text:
EMPTY won't hook to lattice properly Blender API
I am trying to hook my EMPTY to my lattice through the Blender API so when I move my EMPTY the lattice is deformed. As it is now when I run the code it shows that my EMPTY is connected to the center of the lattice which is not what I want.
If I were to do it through the 3D viewport I would add my lattice and add my EMPTY. Then I would first select the EMPTY followed by the lattice. Enter edit mode and select all vertices of the lattice. Then CTRL H and hook to selected object.
collection = bpy.context.collection
lattice = bpy.data.lattices.new("Lattice")
lattice_ob = bpy.data.objects.new("Lattice", lattice)
lattice_ob.scale = (224, 352, 224)
lattice_ob.location = (112, 176, 112)
lattice_ob.data.points_u = 5
lattice_ob.data.points_v = 5
lattice_ob.data.points_w = 5

bpy.data.collections['Collection'].objects.link(lattice_ob)
bpy.context.view_layer.objects.active = lattice_ob
lattice_ob.select_set(True)
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.lattice.select_all(action = 'SELECT')
bpy.ops.object.mode_set(mode='OBJECT')

for i in range(len(DIR7pointlist)):
    df = np.genfromtxt(os.path.join(DIR7point, DIR7pointlist[i]), delimiter=',')
    for j in range(len(df)):
        xx, yy, zz = df[j]
        r = 5
        bpy.ops.object.empty_add(type = 'SPHERE', radius = r, location = (xx, yy, zz))
    break

bpy.ops.object.select_all(action = 'DESELECT')

for ob in collection.objects:
    if ob.type == "EMPTY":
        bpy.context.view_layer.objects.active = lattice_ob
        lattice_ob.select_set(True)
        ob.select_set(True)
        bpy.ops.object.mode_set(mode='EDIT')

        hookmod = lattice_ob.modifiers.new("Hook", 'HOOK')
        hookmod.falloff_radius = 1
        hookmod.falloff_type = 'SMOOTH'
        hookmod.object = ob
        bpy.ops.object.mode_set(mode='OBJECT')

How to hook a vertex of a curve to a certain object?
modifier.vertex_indices_set( range(index_from, index_to) )


text:
Is there a way to export the uv layout png without aliased black lines?
Is there anyway for uv export images not to have this aliasing feature? Like be able to get solid black lines only.
https://i.sstatic.net/dOWw0.jpg

Export it in svg format.

In the UV exporter window you can choose svg format instead of png in the left side panel.


text:
Mesh Deform dependency cycle and collision for blender 4.2+
i need ideas hot to fix mesh deform dependency cycle that dont works with collision.
What we want to achieve: character with jiggle physics and character's cloth being sim on top of that.
The Setup:
Character with armature with mesh deform modifier. Another mesh with cloth sim to simulate jiggle physics which is the target for mesh deform. Cloth over character.
How i always did it and had no problems:
I bake mesh with jiggle physics. Then turn on COLLISION on a character and then sim cloth over it.
But the things was working before 4.2 cames out and i simply cant sim cloth over character because as i turn ON COLLISION my mesh deform modifier automatically stop working so i cant sim cloth over character because it would not being affected by mesh deform.
I posted bug on blender forums but the devs said gtfo its not a bug fix dependency cycle.
i googled, checked console and it really has it. But i have totally dont understand how can i fix it. If i turn off any modifier nothing would work as planned.
On blender from 2.79 to 4.11 everything worked fine even with dependency cycle, yet on 4.2+ mesh deform modifier instantly falls in "cannot get mesh from cage object" error as i turn on collision on character.
Can any1 help fix this in blender 4.2+?
link below with blend file, where "icosphere" represent character, "deformer" is the jiggle physics and the cloth is the cloth that must collide with deformed mesh.
U can open it with older version than 4.2 and check that everything is working fine.
blend file, ~13mb
40 sec youtube video to observe the problem

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


text:
Is there a way to preserve unfilled areas in stabilized footage?
I've tracked a video, and the stabilization looks okay. However it's very shaky, so a lot of the video needs to be cropped off.
Is there a way to keep the pixels from previous frames to fill these gaps?
In other words, make the video behave as a kind of "brush" which is controlled by the camera movement?

@cegaton That more or less like what I was thinking. All the would-be-black-areas would instead be filled with the pixels from the last frame to have covered that area. Is there any way to do this automatically?

Isn't it better to crop out the stable video and scale the result to render resolution? Have a look at TrackMatchBlend video on 2point stabalisation if you have blender cloud access or you can find a copy on youtube.

@sambler The problem in my case is that results in way too much video being cropped off..

Nice question. Just an idea: You could try to extend your video to a panorama with microsoft ice and stabilize it afterwards.

You may consider to load and save / overwrite source image for the calculation for each NEXT frame:
You can make some blank files with the same name with the target output filename, and put them in the render output folder BEFORE rendering. For example, you have an image sequence of 500 frames, then you should put at least 500 image files with the same name (whatever they are, even blank) into the render output foler. then add them into VSE, put into a channel below the current sequence, set the Blend mode of the current sequence to Alpha Over. and one frame ahead, then render. The output images will overwrite the existing ones, and luckily the calculation for the next frame will always load from disc (not from buffer or memory). Like this:

Before:

After:

NOTE: You have to realize that the offset between two adjacent frames is often more than 1 pixel (unless the camera moves extremely slow), so, as I tested, this idea usually isn't perfect, but works.


text:
Why does it take so much longer to track uncached frames?
I'm attempting to track a slightly longish shot, and I don't want to fill up all my ram.
I can play the animation with ⎇ AltA and blender caches and displays uncached frames in near real-time (~35 fps with 60fps footage). Blender will track cached frames faster than real-time.
Yet when trying track uncached frames, blender takes longer than 10 seconds per frame! Often as long as 15 seconds.
What is going on here? Why does tracking uncached frames take far longer than the time needed to both cache and track separately?

@cegaton h264 I believe. I can understand it going a little slower when caching as it's tracking (cache time + track time + a little overhead would be perfectly acceptable). But it's going far slower..

In other words: It's tracking very fast (the trackers are quite small). It's caching very fast (30 fps). However when doing both at once it goes many many times slower (>10spf).

@cegaton Hm.. But since it's doing so well at caching separately, why would that cause issues for the tracking?


text:
Baking fluid sim to shape keys
I've made a fluid simulation and it's working exactly how I want. I would like to save the simulation as a shape key-based animation, mostly so I can do another fluid simulation that interacts with the result of the first. I have the fluid cache backed up, so I can keep it separate from the second sim.

It is not possible to convert a fluid simulation to shape keys. The fluid sim is in essence creating a new mesh every frame. Even though it looks like it is a mesh changing a tiny bit from frame to frame, it is not. Shape keys blend between two meshes that have the same vertex count, also they need to have the same vertex order, but they will technically still work even if the order is messed up. Since the vertex count from frame to frame changes you cannot convert a baked fluid simulation to shape keys.
Also you should simulate the two together as a single simulation because the results of one sim being simulated with interaction to another after the one is already simulated is not going to look very realistic anyway.

Thanks for that. The first sim is an item melting and the second is the acid being sprayed on it, so for this project the two at once wouldn't suffice. That's ok. I'll try some other effects.

Shape keys do require the mesh's topology do be constant.

@BenJaguarMarshall It may be possible to fake it, see this post: http://blender.stackexchange.com/q/5328/599


text:
Bake script works individually, but crashes in loop
I am trying to write a script to bake all of my physics in the correct order. The commands work if I issue them to each cache individually, but if I try to bake them all in a loop, I get a Error: EXCEPTION_ACCESS_VIOLATION
The script is as follows:
import
 bpy
from bpy import data as D, context as C

for objName in ('StickManDefender', 'Blood1', 'Blood2'):
    obj = D.objects[objName]
    print(obj.name)
    for mod in obj.modifiers:
        if mod.type == 'DYNAMIC_PAINT':
            ctx = C.copy()
            for surf in mod.canvas_settings.canvas_surfaces:
                print(surf.surface_format)
                if surf.surface_format == 'IMAGE':
                    ctx['object'] = obj
                    bpy.ops.dpaint.bake(ctx)
                    break
                elif surf.surface_format == 'VERTEX':
                    ctx['active_object'] = obj
                    ctx['object'] = obj
                    ctx['point_cache'] = surf.point_cache
                    print('Free Bake')
                    bpy.ops.ptcache.free_bake(ctx)
                    print('Bake')
                    bpy.ops.ptcache.bake(ctx, bake=True)

The output is:
StickManDefender
IMAGE
Blood1
VERTEX
Free Bake
Bake
DynamicPaint: Preparing UV surface of 256x256 pixels and 16576 tris.
Error: EXCEPTION_ACCESS_VIOLATION

If I limit the run of the script to only 1 of the objects, no problems. As soon as I try to bake multiple in a loop, crash. I've tried using concurrent.futures.ThreadPoolExecutor to run each iteration on a separate thread and wait for the result before continuing the loop and I've tried running the whole thing on another thread, but no dice. I've also tried calling C.scene.update() between iterations, but that doesn't help either. Is there something else I need to do to make this work?

As an aside, I've worked around this by putting a numeric property on an object as an iteration counter and running the script multiple times. I'd prefer a single run.


text:
I need help removing a layer of mesh going through my complex tunnel
I started using blender this summer, and I got a mesh with these weird bridges where it should be hollow. This is supposed to be a hollow tunnel, but as you can see in the pictures below there is a layer of mesh in the middle of the tunnel following the path. I'm thanful for any suggestions or tips on how to get rid of the mesh passing the middle! This is all rendered from a point cloud, and I haven't used any modifiers yet.

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

do you have modifiers on the object ? You generated the mesh in some way, we can't help you if you don't tell us how

yes okay it's a point cloud scanned by a drone :). My guess is that this problem in the mesh is where the drone flew through the tunnel, because under it the normals are also flipped the other way around.


text:
How To Reset Location Without Resetting Pivot Point
I'm trying to reset the location of my object without resetting the pivot point.
I know you can do CTRL+A to reset the location, but that also resets the pivot point to 0,0,0
How can I move around my objcect anywhere I want and set that location to 0,0,0 while keeping the pivot point where it is? (because as you can see in the image, the location isn't at 0,0,0)
Thanks
My goal with this is to make it so the fence sits perfeclty on the cube (which is at 0,0,0) as shown here (I need the pivot point to be at the bottom left so that I can rotate the fence around that point) :

Alt+G will set it to world origin.

@Harry McKenzie yeah, but I want to make it so the origin isn't at (0,0,0) but at (0,0,1) for example, so that when I move it to world position of (0,0,2) the object's position will be (0,0,1) relative to it's origin

Reset the origin to 0, 0, 0, then in edit mode move everything up one unit

But that would result in the pivot point being at (0,0,0)

If the origin is already where you want it, just select All in Edit mode and move it where you want. The origin will stay in the same place.

Yes, the origin will stay in the same world space, but since I want the object to rotate around the pivot point I assigned this isn't an ideal solution.

The main thing you will have to come to terms with while using Blender is the difference between  Object and Mesh.
Object is word that means a bundle of a ton of Blender data-blocks all packaged around an origin as the 0 point for it's Local transforms.

If I enter edit mode, delete everything and then back into object mode, you can see that I still have that object in the outliner. The "Object" data-block still exists, it just has a mesh (AKA Object Data) with 0 vertices.

When you press Alt+G all that does is clear the object origin and set it back to 0,0,0 in World Space.
Whenever you Tab into edit mode you'll notice in the outliner that the object data block has an edit mode icon next to it and the Mesh Data Block lights up. That means you are only editing the data itself, not the object and it's origin.
Moving the vertices within the Mesh/Object-data datablock while in edit mode, the Object datablock remains untouched.

So if you want to set the object origin to be 0,0,0 and then manipulate the geometry without messing up the origin, you just need to be sure you are only working in edit mode.
If you mess it up then just use Shift+S > Cursor to World Origin, and then Object> Origin to Cursor to set that there, that or Ctrl+A > Apply Location.

While editing you rarely use the object origin as a pivot for transforms. Thats what the 3D Cursor is for. You push . to change the pivot point.

I like to be really careful not mixing "reset" and "apply" together. To "reset" something means to roll it back to where it was. In the case of location, it means moving the origin back to its 0:0:0 coordinates - which corresponds to the world center when not parented to something elsewhere. Applying means to change the origin of the object and put it at the world center, while keeping the object's content wherever it is.

Shoot lemme edit that.

This is so well put together! Thank you so much!

Not sure what your trying to do but the answers above are all correct.
0,0,0, is a fixed position. You cannot make any other position location 0,0,0, for anything.
Right of 0,0,0, is X1,2,3 etc. Left is X-1,-2,-3,Towards you is Y-1,-2,-3, n away from you is Y1,2,3. You can position things by grid units like 10 units X n -Y units 3 or you can just eyeball it.
If you are are doing some kind of animation or taking different shots and moving things from one point to another to pivot on the cube. I suggest you place "Empty" as a marker where you want the fence to be 1st then another "Empty" position on the top of the cube where you want to pivot at. Put your fence where you want its to be, Shift S to put the cursor at the fence's Origin at the bottom left as you wanted n add a "Empty" to the "Cursor". Do the same for all the other locations. Now you can move around for different shots and the cube will be at all the right positions you want. Just move "Cursor" to "Empty" n then Fence to "Cursor". Can do the same with Key Framing positions too but not know what you are trying to do, This is the best I can come up with.

Make sure you are answering the question the OP is asking, and that you are sure that your answer can solve their specific issue before posting. Answer shouldn't be guesses.