text:
What are these Dark Faces on Mesh?
I was in edit mode on a sculpt & ran into an issue where many faces turned dark. Only happens in Sculpting mode. Object, Edit, & Render mode are all fine. It doesn't seem like a normals issue, since I have back faces off.
The issue disappears & resolves itself on it's own if I enable Dynamic Topology & draw (warning that it discarded data).
Things I checked:

Normals are all correct. Flipping the affected faces makes it worse, & Recalculate Outside changes nothing.
Merge vertices by distance made no noticeable change.
I have not created any materials. I'm only in shading view.
Masking is already off (Alt M I think).
Object Data > Geometry Data shows I dont have custom split data. Toggling it on & off does nothing.

I'm not satisfied forgetting about it, since it took me like a day to resolve by accident.
Was this a bug? or some "feature" to sculpting mode that got cleared when I used Dyntopo?
Blender: 2.90.0
--

Update: So we've loaded it up in Blender 2.8 and the dark faces didn't appear. We think it is just a bug in 2.90.0.


text:
How can i create these worn edges?
I've been trying to create worn edges following this tutorial: https://www.youtube.com/watch?v=lYseMQDkPAI&t=375s&ab_channel=thesparkofart,
but can't seem to achieve same results. This node setup doesn't "capture" all the edges, and certainly not the ones i'd like it to. In the top pictures it only work on concave edges, but on the bottom it kind of goes for the convex ones but in a strange manner - it either only select on of the edges of each face (like either bottom or top one - not both) or it also marks the faces itself. That's the main issue.
Another problem is with the mudgrave texture, wich, when multiplied with these edge-nodes, plasters texutre spots all over the model - not on the edges like in tutorial.
Final photo is result of this method: https://www.youtube.com/watch?v=JMMy-xqrwdw&feature=youtu.be&t=156&ab_channel=LifeKILLED
If that matters i have bevel modifier on that model - but disableing it doesn't help.

It looks like your mesh is really low-poly, the pointiness node is really limited when your mesh density is low. You might want to try this technique instead https://youtu.be/JMMy-xqrwdw?t=156 (bevel + normal dot product)

@Gorgious Wow. Of Course! That's ingenious.

It seems like a better method overall but produces same effect. It only applies to some edges of each face, not all of them - will add photo in the question

source: Stack Exchange

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

sort: votes


text:
rig character collection append problem
I downloaded a free rigged character and appended it to my blender file.

it looks like this. on the right panel, some of the objects are active. however, the collection called 'BoneShapes' is not active. when I try to append this file to another file, I want to copy the collection just like the original one. do you guys know how to do this?
and I appended the character like this,

it shows everything, including objects which were hidden on the original file.
but its bones work well in the first loading place where all the objects are gathered.
I can rotate or move all the legs and arms, Just like the creator made it.
as below

but I change the location of the character to the background scene like this, to remove all the messy things that are still there on the first loading spot.

suddenly, I can't move or rotate the right arm like below.
even the movement I applied at first loading spot was disappeared.
(on the third picture I upload, the character are stretching his both arms, but whenever I move the character his right arm has no movement at all)

by the way the area of the object I chose to move is like this.

I wanna know how to move the right arm when I move the character location.
it would be sooo grateful to somebody who knows this to tell me:)
the character I use is from  this link (on the description)
https://www.youtube.com/watch?v=2yn5I9B0Im4
rigs pictures(edit version)

your wrote " the collection called 'BoneShapes' is not active" -- try clicking on the empty square next to the BoneShapes collection to enable it.  You should then be able to expaned it and select.  Similar if you need to select the Head object: click on the grayed out screen (on its right) to be able to enable it in viewport, to select it if you need.

you wrote "suddenly, I can't move or rotate the right arm" -- did you move the rig or the mesh... looks like you didn't move the rig as that you be what you need to relocate and the mesh should follow.   As with posing, you want to operate on the rig.

thanks for your comment! but what I'm curious about is that the original file has the collection called 'BoneShapes' and it's kinda linked to the upper collection, but the creator hides it cuz it looks messy I guess. so when I append the character file to another file all the hierarchy that the creator made on the collection box became disappeared. so I wanna keep the same hierarchy that the original file has on the collection box when I append that file to another file...! do you know how to do this?

and how can I know that rigs are on the right spot...? cuz I turned to the edit mode and compared the character in the different locations, but it looks the same to me haha... (I added the edit version of captures) It's my first time playing with rigs. by the way, thanks a lot for your quick response!!

my first comment (above) was how to enable and view your BoneShapes collection, and you could Append that Collection as you import if for some reason these become useful or your pose/animations somehow depend on them (IK?).   I also get quite a lot of baggage and disabled Collections when I use the DAZ import tools and am still learning myself.

I discovered I learn blender quicker by sometimes spending time answering questions so it's actually a good time investment in education -- like being part of a lab team in school.

totally agree!! thank you for letting me know about the 'appending the collection'. my collection section seems organized better than before! thanks a lot! btw the problem of that I can move the right arm is solved! I've learned that I should change the location of the rigged character in pose mode (not obect mode), by clicking the base of the character :) have a great day!

someone once said: "this stuff should be easier!"

What you need to do is locate where all these extra boneshapes are and ⇧ Shift +  Left Click  the eye button to hide.
Like this:
Before:

After ⇧ Shift +  Left Click eye icon:

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


text:
Render Result doesn't match camera view
I'm new to blender and am having issues rendering my final image. I have already used ctrl + alt +numpad0 to get the right camera position and angle. But when I hit F12, the render result does not match the camera view.. I have tried several things and my render results just keeps coming up as completely different. I don't think I have any key frames, and everything should be on the right layer? I just wish to render a still frame, no animation.

UPDATE: Render finished and the output is still completely different from my viewport and camera.

Even using viewport render does not work
Blender file is here

Hi. The second image (render output) shows only 8 tiles. It's hard to tell if the view of the render really matches the camera's view or if there are objects missing/not rendered. The estimated time of over 8 hours for the whole image is very long for the simple looking shading. You can reduce the number of samples (see Sampling -> Render on the first image) from 128 to 4 to do a quick check of what is actually rendered.

Hi, update includes final render. I have even tried to use the viewport render and the output is just that grey image.

Your objects scale and clipping start and end are all off. But that didn't help. I did get a render that matched if you just apply the cloth and subdivision surface. Even leaving everything else alone.

Hi, I thought I did apply them. i have tried selecting and unselecting my cloth and subdivision surfaces, but that causes the cloth to fall our of place.

Sorry, yes nevermind, I see. Thank you!

The "real" cause of the issue, is the subdivision modifier:

As the subdivision levels does not match in viewport and render, the cloth cash is not valid when rendering.
Turn the *render subdivision levels" to 1 and that will be ok.


text:
Material which is not rendered but interacts with light
It's hard to explain this. The way I'm visualising it is by thinking of an invisible object which reflects light.

Let's say we this cube here with one face of it being lit up with a blue spotlight.
Now, let's treat the patch of blue light on the face of the cube as another discrete object (I understand it's physically impossible but bear with me).
I want to be able to keep that patch of blue light while making the cube disappear.
What I visualize in my head is a patch of blue light hovering.
My ultimate goal is to capture lighting information.
I hope this makes a little more sense.

Which render engine are you targeting? [Cycles, Internal ... ]

This is pretty vague and contradicting. Could you post some reference images?

Cycles and it's hard to get a reference for this. I'll try and explain more in an edit.

Perhaps it would help if you could elaborate on why you want this/what you want to use this information for? You might be able to capture the lighting information you want by using render passes.

I want to see if I can overlay it on an image and make synthetic lights.

Sounds like you are describing a Shadow Catcher

I think what you desire may be able to be achieved with the direct lighting pass and some compositing, I'll see what I can do

In the object properties tab of the properties window, there is a section titled "Cycles Settings". If you uncheck the box "camera" under "Ray Visibility", that object will disappear from the render but still reflect light and cast shadows.

This wasn't what I wanted but thanks anyway.

@dixiepig Creating the setup described in the image of the question. Toggling the Camera visibility makes the cube and its reflection(of the light) invisible to the camera(including render).

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


text:
material error exporting model as .3ds used in opengl
edit: I'm going to leave my original question in tact below this edit, but I can summarise now that the problem is losing datat when re-exporting a 3ds, I'm missing a whole material amongst other things. Does blender have a known export error?
I can take a 3ds model someone else has supplied me and it will load into opengl and opengl es with no problem. If I load that 3ds into blender and export as .3ds without changing anything I will get a material error when it gets displayed.
The error seems to be when drawing the same model multiple times, some instances of the model at random will either be completely white or completely black. The error will remain consistent for as long as the program lasts, next time the program loads then different models will have the error, there is no pattern to it.
Here is how the error looks if i load the same model in multiple times
https://imageshack.com/i/exJ6njx7p
If I load the same model and draw it multiple times, each instance will be all white, and will make other objects white, as though pure white light were eminating from it.

It's definitely a material export error, I just loaded the original models materials into the re-exported models materials at run time in code and the error was gone.

one of the issues was there is no specular exponent or shininess chunk in the 3ds file. this was what was causing all objects around to appear blindingly white as the program was defaulting to junk values, way above 1.0. This explains the random factor as the junk values would have varied.

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


text:
Blender use texture on cube side

I am here in blender trying to Paint this selected side with the texture i made. I am completely new to this. Can someone explain to me how to do this ? I want to color to be saved with the .fbx, not separately or anything complicated. Just paint this side with this texture. Please guide me.
I have selected texture003 on the left panel. What else i am supposed to do ? I am lost here.

I am no specialist for exporting other formats (like .fbx), but in general it's like this:
To add a texture only to the side you will need a second material.
Click the material tab and click + to add a new material.
Then click + New.
Get into Edit-Mode and select the face you want to apply the material to.
With it selected click Assign under the materials.
This will assign the new Material only to that specific face.
Keep the new material selected in the material tab.
Then click the texture tab and add your texture to it by clicking + New, selecting Image or Movie(should be default) and sroll down to Image and Open your Image Texture.
Positioning of the texture can be performed by the options below the Image part.

I don't have an image texture. I have a colored texture with blend mode i made in the texture tab as you can see in my screenshot, texture003, how do i assign that on my selected side of the cube ?

Oh I see, you don't meen to set a image. But still this should the same - try the steps described in my answer.

The material now has a textured that comes with it, right ? i can see it in preview. then i click assign, and i see a grey color, what is happening ? http://i.imgur.com/HI5cuDz.png

Correct. Try a test-render, it shound be visible. If it is bad positioned on the face, try selecting the face in Edit Mode and press U to unwrap. Then select the UV Map in the Mapping part of the texture tab, to make your texture follow the UV-Map.

if you look at the screenshot in the comments and in the question, i have done exactly what you described, and the color of the side doesn't change when i click assign, i want to paint my side with a blend color. do you have any other simpler method ?

Is there no blend tool (gradient color tool) in the materials tab ?

As far as I know, there is only this texture method. If there are questions left, please look for videos online describing color gradients on materials / textures in blender, that should be much easier to follow.


text:
Dynamically adding sliders to a layout in 2.93?
I had need of a URDF visuzlizer on some Windows machines heavily controlled by our IT, so I used the portable zip Blender and made some custom scripts to view and manipulate the URDF. This worked great in 2.90, but now in 2.93 the sliders that I was adding dynamically don't show up any more.
I believe my problem is in one of three places.

Where I dynamically create the class: (Edit to add suggestions by @batFINGER)

        # Dynamically create the same class
        JointControllerProperties = type(
            # Class name
            "JointControllerProperties",

            # Base class
            (bpy.types.PropertyGroup, ), {
                "__annotations__": robot.annotations
            },
        )
        URDF_PT_JointControllerPanel.set_joint_names(robot.joint_names)
        bpy.utils.register_class(JointControllerProperties)
        bpy.types.Scene.joint_tool = PointerProperty(type=JointControllerProperties)
        bpy.utils.register_class(URDF_PT_JointControllerPanel)

where I'm adding the annotations for the slider:

    def GenerateJointAnnotations(self):
        # Generate annotations for dynamically creating the joint sliders.
        # Form should be (dictionary of tuples):
        # annotations: {
        #   'joint0': (
        #        FloatProperty, {
        #            'name': 'j0',
        #            'description': 'desc',
        #            'default': 0,
        #            'min': joint_min,
        #            'max': joint_max,
        #            'update': float_callback}),
        #    <repeated for each joint>
        self.annotations = {}
        for joint in blender_joints:
            if blender_joints[joint]['type'] == 'fixed':
                print('INFO: Fixed joint. Skipping ', joint)
                continue

            self.joint_names.append(joint)
            self.annotations[joint] = (FloatProperty,
            {
                'name': joint,
                'description': joint,
                'default': 0,
                'min': blender_joints[joint]['limit'][0],
                'max': blender_joints[joint]['limit'][1],
                'update': float_callback
            })
        return

Where I'm drawing the widget

    def draw(self, context):
        layout = self.layout
        layout.label(text = 'joint angles')
        scene = context.scene
        joint_tool = scene.joint_tool

        if (len(URDF_PT_JointControllerPanel.joint_names) > 0):
            for joint in URDF_PT_JointControllerPanel.joint_names:
                layout.prop(joint_tool, joint)

        layout.separator()

Error with @batFINGER's suggestion:
rna_uiItemR: property not found: JointControllerProperties.SY
/home/andy/.config/blender/2.93/scripts/addons/blender_urdf_visualization/joint_controller.py:28

I'm guessing my dictionary is no longer correct either, but can't find an example of what this should look like.
Any help would be appreciated... I don't know the blender API well enough to find out where I'm going wrong.
EDIT:
Chagnes thanks to @batFINGER's comments and answer can be seen here.

Hello, does it throw an error in the console ? View > System Console

no, I launch from command line on Ubuntu but don't get anything but the info msgs I print out... I was under the assumption any error msgs would also print out there. Is that not true?

Suspect it is same issue as https://blender.stackexchange.com/questions/239407/python-operator-worked-until-2-93-now-throws-not-propertydeferred-error  Prob requires setting dictionary to __annotations__ of the property group

Thanks @batFINGER, I think that's got me going in the right direction... now I'm at least getting some error msgs in the console: rna_uiItemR: property not found: JointControllerProperties.SY joint_controller.py:28

Set the __annotations__ dictionary
Further to comment

Suspect it is same issue as
Python Operator worked until 2.93, now throws " not _PropertyDeferred" error
Prob requires setting dictionary to annotations of the property
group

Wrote, before, pasted after edit to question, anyway shows on the right track.
Test example.
import bpy

from bpy.types import PropertyGroup
from bpy.props import FloatProperty, PointerProperty
context = bpy.context

annos = {f"float{i}" : FloatProperty(default=i) for i in range(10)}

Foo = type("Foo",
        (PropertyGroup,),
        {"__annotations__" : annos}
        )

bpy.utils.register_class(Foo)
bpy.types.Scene.foo = PointerProperty(type=Foo)

Python console
>>> bpy.app.version
(2, 93, 0)

>>> C.scene.foo.float9
9.0

Which after checking is pretty much the example outlined in 2.93 release notes from (probable duplicate) link posted
See the difference to
        self.annotations[joint] = (FloatProperty,
        {
            'name': joint,
            'description': joint,
            'default': 0,
            'min': blender_joints[joint]['limit'][0],
            'max': blender_joints[joint]['limit'][1],
            'update': float_callback
        })

in that you are setting akin to a partial function  (FooProperty, propsdict)
instead of to FooProperty(**propsdict)  to wire up the groups  properties as demonstrated above.

Thanks! working perfectly again.


text:
One render picture and two questions (I think both are related to the glass material)
I'm making a room and I have two questions after I saw the render.

The sliding door panel behind the window is very dark.
The lower left edges of the table have some light under the glass top that looks strange. I'm guessing it might be from the bevel of the edge and the glass material?

Any idea how to solve both? Many thanks.
ps. The chair is the bonus material from Blender Guru's architecture academy. I didn't make that.

-------Update--------
So I saw that my IOR setting for glass is also wrong, I've adjusted it in the following render.
I decided to try two different camera angles just to see if it makes any difference.
The 1st and 3rd image are the original 2D window pointed out by @gandalf3 . The 2nd and 4th image are the adjusted 3D window created with a cube.
I saw the difference, of course, caused by the IOR. The 3D windows seem to affect slightly how the panel looked behind the glass. Is there any other way I should test to see if this is even abnormal? Many thanks.

Could you post a .blend file, it is hard to figure out what is wrong

The Light Path node is your issue, mute the final Mix Shader by selecting it and pressing M

I didn't know you can mute the node! Thanks. Although it didn't seem to change the result or I just didn't know how to properly mute it. A red line crossed out the node? Anyway, the file is here https://www.dropbox.com/s/pkd0otiyicgnlor/FrenchDoorHouse15-03-10.blend?dl=0

Thanks for the file. Muting the node was just a hunch, we'll have to look deeper to figure out what is going on

The lights under the table seem perfectly reasonable to me, they are caused by total internal reflection of light coming through the window and sliding door. As for the darkening, I'm not completely sure I'm looking at the right thing.. However I have noticed that your windows are two dimensional (no thickness) and are connected to the door frames. This might cause some issues, in addition to the extra mix shader.

Thanks @gandalf3. I've made the adjustment to the windows. Please see the renders in the post (I don't know how to post pictures in the comments). Changing the windows into 3D definitely explained why I was looking at strange distortion when the IOR is 1.44. But now I'm not sure whether the darkened panel is abnormal or not. Any suggestion what else I can try to test?


text:
Update viewport after toggle of cycles shadows for all objects
I wrote this little script to toggle the visibility of the shadows of all objects.
It works quite well, but at the end of the script, I'd like to update the viewport. I tried the "hack" with the redraw_timer, but actually I don't want to use it, because it's not recommended and mainly because it doesn't work with the blender version 2.78c. ;-)
import bpy

for ob in bpy.data.objects:
    try:
        ob.cycles_visibility.shadow ^= 1
    except:
        print ("No shadows: ", ob.name)

# Did not work:
# bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)

bpy.context.window.screen = bpy.data.screens["Scripting"]
bpy.context.window.screen = bpy.data.screens["Default"]

So I just switched to another screen layout and back to default.
That works. However, I guess there are more elegant ways to do this.
Thanks brockmann, thanks @all
Here's the updated and tested version:
import bpy

for ob in bpy.data.objects:
    try:
        ob.cycles_visibility.shadow ^= 1
    except:
        print ("No shadows: ", ob.name)

bpy.context.scene.update_tag()

I think bpy.context.scene.update_tag() is the right way to do it.

^= 1 actually toggles?  That's something new I've just learned for Python.

@TeaCrab - Technically it is a bitwise exclusive or. Python uses ^ as a shortcut to it's xor() function.

As @brockmann suggests you should be able to use ob.update_tag() in the loop and finish with scene.update() but I don't see a refresh. I have used scene.frame_set(scene.frame_current) to force a refresh.

@sambler   Thanks for the explanation. :D

@brockmann Hi, please I have deleted by mistake (Accepting a duplicate) your suggestion to my question here. Could you please give it to me again ? I've found no other way to contact you.

not working for me after changing the world light map resolution using:
bpy.data.scenes[scene_name].world.cycles.sample_map_resolution = 4096


text:
Adding edge loops based on selected edges
I am trying to create edge loops based on a selection. The best way to explain is through the video I am following for learning topology.
https://youtu.be/CpSAG85Rsk0?t=1461
(It is linked at the relevant time in the video)
This shows how it is done in 3DS MAX, which is what I normally use, but I'm trying to learn blender. How can this be done in blender?
Also how can one create two edge loops, and slide them apart, like the pinch function in 3ds max which is also shown in the video, he places them a bit further apart.
EDIT: Here is a gif of what I want to do. After I subdivide, I want to be able to slide the edges apart from each other (like I am doing) but where they follow the mesh' topology.

In the video first he selects ring of edges and then subdivides them. In Blender this is possible by selecting ring of edges (Ctrl+Alt+LMB) and then pressing W > Subdivide. Loopcuts are added with Ctrl+R but they won't take selection into account rather than topology flow. To change placing of the edge loops look through options of the Loopcut and Slide on the Last Operator panel on the Toolshelf or F6 just after executing command but they won't be absolutely the same as in max.

Related - https://blender.stackexchange.com/questions/75195/edge-connect-like-in-3dsmax and https://blender.stackexchange.com/questions/6415/can-i-subdivide-vertices-in-a-single-direction

The subdivisions are neat, that is halfway what I was looking for. But I am unable to slide the edges like he does in the video, is there any way to do that, so that all edges are moved equal amounts?

Yes, but that doesn't slide both edge loops independently away from each other, it slides them together.

The way to get scaling when object is not oriented along global axes is to scale along local or normal axes, like https://blender.stackexchange.com/questions/18576/how-to-scale-along-the-local-axis-of-an-object

You might not like this answer, because I am using face selection instead of Edge Selection, but I do believe that the end result is what you are after, so I'm adding this to your realm of possibilities into achieving your desired end result.

In face select mode, I achieved this by holding Alt and right clicking the bottom edge of the face loop, then for successive loop selections adding the Shift key to add more loops.
Next I used the I key to do a face inset, and then I just moved my mouse in and out until I had the desired result, however, you can enter a numeric value instead for the amount of inset.

Yes, this is a perfectly valid solution! Although it requires me to do some parts individually it works like a charm. Thank you very much! That being said I hope blender one day get's the same "pinching" functionality as 3DS MAX has, as it really is essential for some situations like this.

Unfortunately, this still doesn't work for the slanted faces as far as I can tell.

@bertmoog your point is related to a topology methodology and discipline. If you look at the model I have posted as a demonstration, it would work perfectly, the loops would just go around horizontally.

I attempted this before I commented and I couldn't make it work.  Your gif only shows the horizontal sections.  I would love to know how to make this work for the diagonal sections because that's the whole issue.

As you've already shown, the only solution to create edge loops from a selection is Subdivide.
But for the second part, you can scale the edge loops using the Normal Transform Orientation:

Thank you for this. I like the idea and it should work. My problem though is that I would like to be able to do that for several different edge loops on different part of the model at the same time. I should mention that I want to do this so that I can add "supporting edges" for my subdivision smoothing of the model. Here is a gif of what I mean.

Yes, I know, that would be really nice.  If you're doing this just to round the corners, you can always select the corner edges (inside and outside) and do Ctrl+B.

@MathiasRødeEsmann it's possible to scale multiple edge loops although a bit not directly. Once added several loop pairs select them and switch selection mode to Vertex; faces in between will be selected. Then change Pivot to Individual Origins and scale.

Sadly, this doesn't work for me either as it causes some unwanted bending as seen here.

@Mr. Zak - Will that scale properly when not scaling on an axis?

@bertmoog not for multiple edge loops afaik, maybe a bug or limitation

It looks like you're wanting a loop cut in blender! This can be done with CTRL+R, selecting the loop direction with the cursor and scrolling to select the number of cuts. Now, when you click, you can move the mouse or input a number for the loop to be offset from the center of the mesh. Here's what it looks like in use:
I'm not sure what the pinch function does, can you describe or provide a screenshot of it in use so I can find a similar function in Blender?

Could you crop screenshots only to relevant area? It would help focusing especially for those who aren't really experienced. Small correction is that shortcut for the loopsut is Ctrl+R.

Thanks, but this is not what I'm asking for. I know how to do loop cuts with CTRL+R, but I want to be able to make several loop cuts on the model in different places at the same time, and then slide them all at the same time. Look at the video, that Is what i'm looking for.

Sorry I meant to correct that shortcut but I forgot. This was at least the closest thing I could find to what I saw in the video. I'm not familiar 3DS Max, so it was a bit hard to follow what he was doing. Sorry I couldn't help

Loop cut and slide (CTRL + R), and with the loop selected scale to 0 on the relevant axis by pressing S, then axis (X, Y, or Z) then 0. This will make your loop flat on that axis.


text:
i wanted to make horizontal gradient text color?
I was trying to make horizontal gradient text. And I made needed nodes, but nodes didn't color of the text.

Change the Gradient Texture Node to Linear.
Edit:
After that use the Z rotation in the Mapping Node to get a vertical or horizontal gradient.

I can't make it horizontal with Gradient Texture Node being linear.

Can you post your blend file then? Because it works for me

Here   http://pasteall.org/blend/index.php?id=47094

The file works when set to Linear, I just tested:
http://pasteall.org/blend/index.php?id=47097

It works but i stil can't find right coordinats to it be horizontal. blue on top and white on the bottom.

Just se the Z rotation in the mapping node to 90 or 270

Finally worked it out with 270 and reversing ColorRamp.


text:
3D Earth using curve to mesh
I'm trying to make a globe model for earth using fairly accurate projections. I've been able to convert the SVG into mesh, then into a sphere using this guide with Simple Deforms. However, since the vertices are only on the outline, when I deform the shape, it turns out like this monstrosity.

Is there a good way to easily add some curvature so this? Thanks!

Have you tried a remesh modifier (before extruding and even deforming to a sphere) ?

@ChameleonScales I have not. I'm only a few weeks into using blender. I'll look into it!

@ChameleonScales If I try to remesh before extruding the mesh it gets destroyed.

@ChameleonScales Nevermind, I can just extrude then remesh, remove the extra vertical subdivisions and then deform sphereically. So far so good, thanks!

After I followed the instruction on how to deform a curve to a sphere, but before you apply the deforms, simply convert the curve to a mesh then use a remesh modifier. Then when you deform you get this, with a nice curve all the way around. Thanks to @ChameleonScales for the help!


text:
Blender Python Scripting Screen Layout Closes on Execution in Windows OS
G'day,
I'm using Blender 2.78 64 bit in Windows 7.
I'm trying to use the Scripting Screen layout to run, debug and edit python scripts.
When I press the Run Script button in Blender, the screen layout reverts to the default layout which closes the Scripting Window and the Python Interactive Console. Then to rerun the script I need to reopen the Scripting layout and import the python code back into the Scripting window (very frustrating).
Is there any way to stop Blender from reverting back to the default layout when python scripts are run?
Or, is there a way to make the Scripting screen layout the default layout?
I have seen some suggestions about including input() or raw_input() at the end of the code to prevent the python console from closing. This solution has not worked, raw_input() causes Blender to hang (python console is 3.5.2). Surely there must be a better solution than using raw_input() to pause completion of the script in any case.
Any suggestions would be greatly appreciated.
Thanks.

Does it do this for other Python scripts or just that one?

The described behaviour suggests you are switching context within the script, meaning the current view (like TextEditor, ) gets switched to a 3d view because you have a line like  bpy.context.area.type = 'VIEW_3D'. -- at the end you could switch back to TEXT_EDITOR.

Try minimising your script to the least amount of code that still shows this issue. Then share that with us.

Thanks very much for the responses. Zeffii is correct, I had used the following code to delete all objects, but it was also resetting the view. Removing the below code resolves the issue. Thanks again.
def reset_blend():
    bpy.ops.wm.read_factory_settings()

    for scene in bpy.data.scenes:
        for obj in scene.objects:
            scene.objects.unlink(obj)

    for bpy_data_iter in (
            bpy.data.objects,
            bpy.data.meshes,
            bpy.data.lamps,
            bpy.data.cameras,
            ):
        for id_data in bpy_data_iter:
            bpy_data_iter.remove(id_data)

reset_blend()

that's not the solution I would go for, but whatever works for you is OK.


text:
Clean topology with holes in a mesh with bevel modifier?
So this question today is not just how to make a hole, but I'd like to know what's the correct way of making a number of holes on a mesh having a clean topology.
I have seen numerous tutorials with lots of methods how to make a hole, and the topology result is nice and clean but it's demonstrated on a single cube. (I know if I add a subdivision modifier ill get better looking circular holes on my mesh).
But for this purpose I added a bevel modifier so the edges on these models are more natural and smooth. One problem I'm getting is, when I make holes in the mesh, the bevel seems to be affected. The edges become less smooth and become sharp. And on some of the mesh in the example, depending on the method I use, the mesh looks unclean, the holes need more loop cuts to clean up. In order to preserve the bevel on one model in the example, I added the bevel modifier and then stared making holes on the mesh so I can keep the smooth edges.
So what method would be appropriate to have smooth edges on a model, but also be able to make holes which would leave a cleaner topology.
Thank you.

This is my way of making holes. It's probably not the best one, but looks good enough for me.
1) We subdivide a plane one time to many, and select 4 quads for each hole.

2) We do inset. (I)

3) We use Mesh: LoopTools add-on (just enable it) using Cicrcle tool.
(in edit mode right click and then LoopTools->Circle)

4) Inset one more time. (I)

5) Extrude downwards. (E)

6) Add Subdivision Surface modifier

7) Smooth shading (subdivided 2 times)

8) Render Eevee

To make hole sharper you can make more insets, and extrude down several times to put loop-cuts in all holes.

If you don't want to use an add-on in step 3 of @Filip Franik's answer then enable vertex snapping, move the 3d cursor to the centre point, change the Transform Pivot Point to 3D Cursor, select the four vertices and scale down. It's more of an approximation but you can always adjust until it looks good.

The whole question was about a workflow that allows making many holes at the same time. For a single hole all you need to use is Shift+Alt+S to start "To Sphere" tool. It will allow you to change the 2D square to a 2D circle without touching the 3D Cursor. (This is also a very good tool to change a subdivided cube into a sphere for better topology!) https://docs.blender.org/manual/en/latest/modeling/meshes/editing/transform/to_sphere.html

I had no idea about that shortcut, thanks!


text:
Isolate object with / numpad key Blender 2.8
When I hide a mesh by pressing Numpad /, I isolate the object, but the reference image gets hidden. For some reason my image disappears.
In version 2.7 of Blender I have seen, that the isolate works well with reference images on orthographic mode.
Maybe somewhere in preferences I can find this feature?
Or it is available only in the old version of Blender?

The / key is generating a Local (isolated) view of only the selected object, while that in a sense hides other objects, it is more like a isolation chamber rather then hiding all else and then later making things visible again (in the outliner you will see that the other objects are not being hidden).
In Blender 2.7, using Background images managed in the Properties panel opened with N, found at the bottom, it was possible to have the references still visible in Local mode, as those were not managed as objects, but bound to the view.
Blender 2.8+ deals with Background images now by using empties to hold the pictures. That makes them objects, which in turn if not selected will be locked out when you have another object selected and go in Local mode by pressing /.
Solution:
Keeping the background images visible is possible by simply selecting the images, or their corresponding empties, as well as the object you want to go in Local mode with. All selected objects will be taken in Local mode and the images will stay visible.

Thank you very much for reply.But i have separate collection for references background images.I turn off selection for entire collection in order to protect my self from accidentally select and move image. I think it will be kinda annoying each time select image and object to isolate bouth of them.In 2.7 it was so handy when background image stay visible in isolated mode.


text:
ModuleNotFoundError: No module named 'bpy'
I am attempting to use blender from the command line including bpy functions using https://pypi.org/project/bpy/
I have completed a pip installation and have had no errors or warnings, however when I try to run a script I get ModuleNotFoundError: No module named 'bpy'. I had this working on a previous machine but have not been able to get this working on my current machine (Im assuming im missing a step).
I have downgraded to python 3.7.6 and pip version 20.2.4, I was able to install bpy version - 2.82.1 by pip install bpy (I followed an answer from https://stackoverflow.com/questions/63178840/cannot-install-package-bpy-using-pip).
I then also followed the advice of https://github.com/TylerGubala/blenderpy/issues/13, which is an issue I recognized from the last time I tried to get this working.
I am using windows (as I did on the previous install which worked). Im wondering if im missing something in path or similar. I have checked and my conda environment (base environment) lists bpy as an installed package, yet it cant be found.
Any advice is greatly appreciated.
EDIT: I have checked and my bpy install (2.82) is in the location where the python.exe is for the environment (base) im using (so maybe not a path issue?)

After multiple hours of searching, the issue was due to the python interpreter not being automatically changed when activating a different environments within visual studio code.
The bpy module must use python 3.7.6 (for my version anyway) otherwise the module is not found.


text:
How to remove material and faces that are textured by it?
I have a huge mesh with many-many textures and vertices. I would like to remove a material and all the faces using it (from the mesh). How can I do this?

In EDIT MODE

Select one face having assigned the material to remove.
Select -> Similar (Shift-G) -> Material
X

Python:
bpy.ops.mesh.select_similar(type='MATERIAL', threshold=0.01)

Note: The operator has a few option you see in the left panel left:


text:
Can armature/bones be edited without edit mode?
I was looking after some information about armature and bones, so I can continue my importer script. I found some nice info here; no BMesh, and simple enough for my needs as beginner, so just perfect. But while looking at the code I saw that it uses "edit mode" (line 120), what I wanted to avoid.
So my question is: can I programmatically add/manipulate bones, without edit mode? Is there any better way then in this code?
I also tried to use the "bones" collection, but I could not append/new/add items into them.

Learn more about armature by reading Rigify addon scripts. I recommend init.py and generate.py for starter.
Also, as @Adhi mentioned, you must be in edit mode to add or remove bones.

I have to say the "edit mode" requirement annoys me.  I have a philosophy that all operations should be possible in python without using anything from bpy.ops or fiddling with the editor state.  In practice, developers have limited time and some operations are just unreasonable (like unlinking an object from the scene while the user is in edit mode).  Still, I think those principles are a good goal.

No, The armature must be in Edit mode for us to be allowed to add or remove bones. We can switch into and out of it, using bpy.ops.object.mode_set. An idiom I use a couple of times in my addon, is to store initial mode in a variable (prev_mode), then restore it when I'm finished:
prev_mode = armature.mode # save

bpy.ops.object.mode_set(mode='EDIT')
for bone in context.selected_bones:
    # do anything in edit mode
    hook_name = PRF_HOOK + bone.name
    hook = armature.data.edit_bones.new(hook_name)

bpy.ops.object.mode_set(mode='POSE')
for bone in context.selected_pose_bones:
    # do anything in pose mode
    hook = armature.pose.bones[PRF_HOOK + bone_name]
    ct_constraint = hook.constraints.new('COPY_TRANSFORMS')

bpy.ops.object.mode_set(mode=prev_mode) # restore

This way, we can access any editing mode, any number of times, without the user even notice when the script is finished.

This snippet: https://wiki.blender.org/index.php/Dev:Py/Scripts/Cookbook/Code_snippets/Armatures seems to favour bpy.ops.object.editmode_toggle(). Maybe it's something new, or maybe it's not a good idea in case it's already edit mode? In any case I haven't tested it.


text:
How to cut an edge at specific point?
I have an object representing a room. I want to cut a door on it. I planed to use knife tool, because I do not know any better for this - any other (or "proper") idea would be good too BTW. I want to move X units from the corner on the bottom edge and make a cut from there (green dot) to the top. How can I do this?

I would simply use loop cut and position it about at the right place, then select the cut. After that, go to the right-hand-side panel in the 3D view. (Aka. Properties, hit N to open.) Scroll around (it's somewhere up, I don't exactly remember where). You should find three numeric inputs for the x, y and z of the selection. There you can enter the exact value you want. Pro tip: For any numeric input in blender, you can use basic mathemathical operators in them.

Use the knife tool or loop cuts to build your mesh, and then here is a trick to move a vertex or edge to a precise position relative to the corner:

select the vertex or edge you want to move
move it all the way to the corner, validate
move it back (for example with GX), enter the distance on the keyboard.

There is no direct way, sadly, afaik. One different way is to cut anywhere on the edge, and then move the vertices where you need precisely (in your image, along the x axis). Or you could also just create a vertex in the middle of the edge (by subdividing) then move it on x axis and then cut with the knife tool using snapping, to that precisely positioned vertex.
Note, you can also position a vertex on the edge by using "vertex slide" SHIFTV, and see its precise position on the edge in the viewport activating, in the properies panel (press N) mesh display > edge info > length


text:
How to optimize old meshes?
I am working with a very old mesh; actually it is a terrain. I selected a part of it, where the surface of water is. You may think it does not look too good and you may be right as well.

The surface is like two surfaces on the same plain, so when it comes to render, it looks like this (I highlighted the area of overlap):

I used disolve faces on this, where this texture was used, but as you may see, it is still two surfaces:

Sure I could remove faces easier now, but I thought there may be a better way for this. I want to:

merge the surface into one, preserving the UVs OR
delete one surface (problem here: bigger parts, what I would love to keep are
sometimes hiding the scattered surface, and I can not select that, to
delete) OR
optimize this magically, to "just make it work"

You can use the Decimate modifier to optimize the mesh and it should preserve UVs.

Select your object in Object mode

Add Modifier Decimate

In the modifier settings, select Planar and set a low angle limit (1 degree is enough if your mesh is truly flat).

Apply the modifier when you're done. Check the face count to see how many polygons you have now.

Note: The Decimate modifier affects the whole object

Thank you, but this did not work for me: I separated the "water surface" as a new object (with P, selected), then applied decimate modifier with settings on picture (and tried other settings as well), but all I got a lot of holes in the surface, what I did not wanted.

If I see it right, you have a flat area wich you want to optimize.
The easiest way to optimize this region is to delete the faces(I know the UVs get lost, you have to generate it for these faces again).Select the surrounding Edges.Then you can use the GridFill tool, wich you can access via the Spacebar menu.(Type in GridFill)
Tweak the values until it looks good.

Thank you, I would use this, but losing UV-s is not good for me. I need the original look.

Note: GridFill is accessible through CTRL + F menü as well.


text:
How to set UV coordinates for a mesh in Blender 2.8x with script?
It's 1am, and I googled every outdated site on the net, I give up.
In 2.79 I had a code:
mesh = bpy.data.meshes.new(mesh_nev)
mesh.uv_textures.new()
...
mesh.uv_textures[0].data[i].image = meshhez_tartozo_texturak[textúraindex]
...
mesh.uv_layers[0].data[o * 3].uv = (u,v)

what is no longer working for me in 2.81 and I find no good info on the net how I can do this right now. Can someone please help me out?
Thank you!

That code worked in 2.79?
Please when posting code in future make sure you leave in all relevant lines. eg in question what is o, i, u, v
Very little difference between this answer and the following, real toss up between answering and closing as duplicate, which I'll leave for others. Quicker to answer and hence confirm in 2.82.
Get/Set coordinates for UV vertices using Python
Add uv_layer to mesh, add uv-coords, with python
Add a new layer (same). Notice if a new layer is added, but there is an existing layer, it will not be index 0. Will be the last, or easier keep the reference returned.
>>> me.uv_layers.new(
new()
UVLoopLayers.new(name="UVMap", do_init=True)
Add a UV map layer to Mesh

get or set the active layer, it can be None a gotcha in answers to links above.
>>> me.uv_layers.active
bpy.data.meshes['Cube'].uv_layers["UVMap"]

>>> me.uv_layers.active = None

Silly example adds random UV (a scribbly mess) to each UV

import bpy
from random import random
context = bpy.context

ob = context.object
me = ob.data
uvlayer = me.uv_layers.new() # default naem and do_init

me.uv_layers.active = uvlayer

for face in me.polygons:
    for vert_idx, loop_idx in zip(face.vertices, face.loop_indices):
        uvlayer.data[loop_idx].uv = (random(), random()) # ie UV coord for each face with vert  me.vertices[vert_idx]


text:
How to make cloth animation with bones?
I would like to have cloth animation made in Blender and use it in Unity. I thought I will use the cloth modifier, then save the .blender file, import in unity and that's it. Nope. Only the actual frame gets loaded. So I thought I will try different aproach, but my skills in blender are not sufficient and I found no good information on the net so far - so I decided to ask experts :P.
Let's say, I have a plane and I want a flag animation with that. I break it down into like 20x20 pieces, and I make it to have like 20x20 bones as well pointing from pole towards to the end of the flag. I want to have blender to animate the bones like the cloth animator would do. How can I do this with this existing armature?

Something, like this: https://www.youtube.com/watch?v=xY55vbLeUZc

Five years too late, but: 1. Thank you for the video provided, it gave me a starting idea for what I aim to do
2. The tutorial below is very good for starting rigging an object (the concepts are applied to a character body, but you can just as well apply them to a plane) https://cgi.tutsplus.com/tutorials/building-a-basic-low-poly-character-rig-in-blender--cg-16955


text:
How can I manage to bake this out?
So the objective is to get it to look like this:

Blend file http://pasteall.org/blend/34831
I'm using cycles render for the material and I want to bake it out so it looks like it does in the render above. The black material bakes out fine with combined as a setting; however, the metal material will not seem to bake out properly no matter the setting.
Thanks in advance.

This is because the glossy metal material will appear different from different camera angles. So it's impossible to bake it to a single static image and have it look like it should from any given camera angle.
There was a patch which allowed for glossy materials to be baked as if they were being viewed from a single pre-defined point, however it was removed from master shortly after it was added.

Ahg, that's unfortunate. The game that I'm making this for doesn't allow materials. It only allows the use of a texture. Guess I have to go back to the old method and just make it in an image editor.
I don't suppose you know how to get an effect like it quickly? ^^;


text:
Why object looks pink color in texture paint when i reopen file?
I had complete the paint on the object in Texture paint mode, after some time I had reopen that file, an object converted to pink color,why its happening like that.give me suggestion...

can you upload your file? It seems that your file lost the path of the texture (If the texture is an image).

pink in texture view is a missing texture


text:
no video in video sequence window
I've been playing around with blender today, and now suddenly, I'm no lenger able to get a preview window of the sequence editor.
It just shows a black screen.
I have a videotrack so there should(?) be some output.
edit: Suddenly realized there is no audio either.

Related: http://blender.stackexchange.com/q/44720/2843

On the right to the preview window, you have set a proxy size to 50%. But if you don't build a proxy file, the preview can't show you a video.
So either set the Preview render to No proxy, full render, or with you video strip selected, scroll down the strip properties until you reach Proxy/Timecode and make your desired settings. Finally, to build the proxy files, have your strip selected and go to Strip -> Rebuild Proxy and Timecode indices and you're good to go.


text:
Blender Shader in OpenGL/GLSL
Is it possible to extract the Blender Shader and use them in OpenGL as vertex/fragment shaders (GLSL)?

Yes you can if you use an addon, see  the BlenderArtists page here. That page doesn't have the correct download link but you can get it here.
From memory, this addon generates rather long and possibly unoptimised GLSL fragment code.

this is outdated, I would like to know if there is something recent working for this question

Proof of concept: compiling material nodes into GLSL shaders:
https://github.com/Bentschi/Blender-GLSL-translator
Also see: https://developer.blender.org/F151259


text:
how to make armature that acts the same across multiple objects
I mede this modle in blender and when I wanted to rig it the armature didnot move all of the objects that its assigned to the same, some moved more and some less.
my question is, how can you make so the armature moves all the objects equaly.

I attached the .blend file.
https://drive.google.com/open?id=0B9PdIZgT3LGYajB5b3lXSWVpMW8

Could you provide your .blend file on blend-exchange.giantcowfilms.com to be able to help you?

i added the .blend file in the post


text:
How to get the physics engine to wraps a string around the moving part of a motor constraint?
I'm trying to simulate the physics of a string that wraps around a motor spool when the motor turns. The body of the motor and the shaft+spool defines a motor constraint, so a velocity can be applied to animate the spool.
I modeled the string using this tutorial : https://www.youtube.com/watch?v=4ANT5vf5H-Y&t=310s
This is how the scene looks like at keyframe 0

And after a few frames, the string doesn't wraps around the spool but goes through instead, there is no collision:

And if I set the string to soft body, then it does this:

Is there a way to achieve a nice winding of the string around the spool ? (even wrapping a few turns so having the string to collide against itself the 2nd turn)
Thanks :)!
EDIT
Following AdamTM suggestion, I made a string from a curve path, and hook the end vertice to the spool, and add Soft Body physics with the following parameters:

As we see, when I play the animation, the string seems to curve around the spool, but for some reason, the hook point doesn't stay in place, it does some weird animation and the length has also shrunk a lot.
I've done another test from scratch with a bigger scale, and the result is much better. In this case the string falls from above and nicely wraps around the shaft as it turns :

I think the physics parameters has to be very well tune to work at smaller scale.
I couldn't attach the soft body end to the shaft, so I tried with a cloth simulation :

I defined a vertex group with end vertices, and hooked it to an empty (ctrl+H), added the pinning option to the vertex group in the cloth parameters, then made a shaft middle vertex as parent of the empty.
As we see on the picture the cloth wraps around the shaft and is well attached to it. But somehow the animation doesn't look quite right, not as nice as when using a bezier path with a soft body.
Any idea how to get the nice wrap of the previous string, with the pin point of the cloth simulation ?
Alternatively, using the Molecular add-on seems quite promising : https://www.youtube.com/watch?v=XSPwM8Yv6YE
Here is the blender project file :

I'm not sure its possible to do this properly as the physics are defined in your method by the empties. I would try using a curve instead with softbody physics.
My concern still would be that there will be no friction coming from the curve to give you that wrap-around you are looking for, but you would have to try.

@AdamTM I've tried your idea, it's better, but I'm still having some weird physics effects. Any idea how to improve and fix the length of the string ?

If you have any modifiers on the spool, try to apply them. Additionally increase the amounts of control points on the string. Alternatively post your blend so we can see whats going wrong.

@AdamTM thanks! I've tried at bigger scale with more subdivision and it wraps nicely, with self-colision. I'll see now how I can attach it.

@AdamTM I've updated my post. Is it possible to send the blender file with drag and drop like pictures or does it have to be an online link ?

You would need to attach it via https://blend-exchange.giantcowfilms.com/

@AdamTM, I've attached the blender project file at the end of the post. If you can have a look that would be great, thanks!

The simplest way to simulate rope or string is using a Soft Body simulation on a row of vertices and add thickness with Skin and Subdivision Surface modifiers. You can use the Soft Body Goal to pin one end to the spindle - similar to your example.
Looking at your Blend file it appears that there is a problem with your parenting of the 'hook' point - it appears to pass through the surface of the spindle and this could be interfering with your simulation (as it will drag the 'string' through the surface rather than resting on it.
The accuracy of the simulation is determined by the number of vertices in the soft body mesh (more vertices will give a better simulation but will take longer to calculate) and the Soft Body Solver settings (in particular the number of 'steps' and the 'Error Limit').
Start by creating the 'string' of vertices. The simplest way of achieving this is to create a Path (Add/Curve/Path) and convert it to a mesh (Object/Convert To/Mesh from Curve). Create a Plane for it to fall on, with Collision enabled in the Physics properties.

Rotate the string by a slight amount so that the vertices don't falls exactly onto each other (or it will unnaturally balance each vertex onto the next), then add Soft Body in the Physics properties. Disable the Soft Body Goal and run the simulation.

To make the string interact with itself, enable the Soft Body Self Collision.

Adjust the Collision settings until you get the desired effect (eg, increase the Size for a thicker string).
Add a Skin modifier and a Subdivision Surface modifier to give the string some thickness, setting the vertex Mean Radius X and Y when in Edit mode to control the thickness of the Skin modifier.

It's important to note here that the 'collision' is not with the actual skinned 'rope' - rather it is with the 'core' of vertices that runs through the middle. The self-collision (rope with rope) is controlled within the Soft Body Self Collision settings but the collision with the 'floor' surface is controlled by the Collision set on that surface (the 'Outer' Soft Body and Cloth property). This means that this method is only applicable to circular soft body objects and that all soft body objects must have the same radius (ie, you can't have two ropes of differing thicknesses).
All that now remains is to pin the rope onto the spindle and this is achieved using the Soft Body Goal and to explain this fully we need to understand how the Soft Body simulation works.
The Soft Body simulation moves the soft body vertices independently of the 'actual' mesh position. This means that the Soft Body vertices can move away from where the mesh vertices that 'spawned' them actually reside. Each soft body vertex has forces applied to it based on a number of factors (such as the distance to its neighbors, proximity to surfaces, etc.) and the simulation engine determines its new location for each frame by resolving these forces - as if springs were pushing and pulling in different directions. One such 'spring' is the Goal - a spring connecting the soft body vertex with the position of the actual object mesh vertex. With the goal enabled the soft body vertex is constantly pulled towards that location. By hooking the vertex to another location this allows us to drag the associated soft body vertex to that location - which can then be pinned to, say, a rotating spindle. The strength and presence of these 'goal' springs can be controlled by a Vertex Group.
In the example blend file I notice that the Empty used to pin the rope to the spindle is parented to a Vertex, not the parent object. As vertices do not convey any rotation data (they are simply a point in space), this means that the movement of the empty does not properly follow the expected motion around the spindle - it starts outside the spindle but crosses to inside as it travels around. Because it passes inside the spindle mesh this will interfere with the collision and causes unexpected issues with the soft body passing through the spindle. To resolve this, change the Parent Relation from 'Vertex' to 'Object' or '3 Vertices' and re-position the empty back to its start location (both these options include rotational data and so will keep the hook point relative to the outer surface of the rotating spindle). The hook point should now correctly move around the outside of the spindle.
To hook a vertex of the soft body simulation requires the following further steps.

Select the soft body mesh and go into Edit mode (Tab). Select the vertex to act as the hook, create a new Vertex Group, assign that vertex to the Vertex Group.

In Object mode, select the Empty to use as the hook. Hold Shift and click the soft body to select it (you should now have both the empty and the soft body mesh selected). Go into Edit mode (Tab) and select the vertex to hook and press Ctrl+H to bring up the Hook menu, select 'Hook to Selected Object'. And back to Object mode (Tab).

In the Soft Body, enable the Goal settings and set the Vertex Group to the Vertex Group created in the first step.

Check the order of the Modifiers on the Soft Body object - the Hook modifier must be above the Soft Body modifiers for the Soft Body Goal to take account of it's hooked location.

Rotating the spindle should now drag the soft body vertex around the spindle. Assuming the Spindle has been given suitable Collision properties the rope should lay on its surface and wrap around, colliding with itself (due to the Self Collision) as it accumulates on the spindle.
If the simulation is not accurate then there are a number properties that can be adjusted to help. It's a good idea to always adjust a single property at a time, evaluating the result before adjusting anything else (otherwise you won't know what had the effect). This also means that if you change something that makes the simulation worse it's easy to take a step back to try something else.

If the Soft Body rope is too angular as it wraps around, subdivide the mesh further to provide more vertices.
If the rope between vertices are passing through the spindle or the rope passes into itself, enabled Collision Edge in the Soft Body Edges settings.
If the simulation is erratic, adjust the Soft Body Solver settings (one at a time). eg, decrease the Error Limit, increase Max Step, increase Min Step - these settings can significantly affect calculation times for the simulation. It's not uncommon to adjust these settings by a factor of 10 or more to improve the simulation. eg, Error limit 0.01 or even 0.005 or lower, Max Step 3000 or more, Min Step 100 or more. The trick is to increase them enough to improve the simulation while still keeping the calculation time within acceptable limits.

In addition to this it may help to adjust the Soft Body settings to improve stability. Again, adjust one thing at a time - by small amounts initially try progressively larger amounts if necessary.
Soft Body Goal - can increase 'Default' somewhat to make the goal 'spring' stronger (so it's tied more firmly to the goal), adjust Stiffness and/or Damping to prevent 'bouncing' around the goal.
Soft Body Edges - increase the Push and Pull springs to make them less flexible (so there's less stretch). Damping can slow down 'bouncing', Bending will make the rope less flexible. Enable 'Edge' collision for better collision detection (make edges collide rather than just vertices) - this can cause the simulation to take considerably longer to calculate.
Another thing to note is the Collision physics Soft Body settings. For small objects or fast moving vertices these become very important.

Note the Soft Body and Cloth settings - Outer and Inner - it's important to understand what they mean. For the Soft Body simulation, Blender calculates the new location of each vertex on each 'Step' of the animation. If the new location is within a surface then Blender will apply a repulsive force along the surface normal to repel that vertex. The 'Outer' setting controls how far off the surface the repulsive force starts to have an effect. The 'Inner' setting controls how far below the surface the repulsive force has an effect. For a vertex collision to take place it must 'hit' these collision zones otherwise it will pass straight through (if it's moving too fast, for example) - so larger zones usually produce a better simulation. However, it's also important that zones do not overlap. In the case of a small object like a spindle you should ensure that the Inner collision zone is not too deep as it can cause unexpected behaviour (see below).
Finally, fine tune the Self Collision, the Spindle Collision Outer, and the Skin radii to adjust the thickness of the 'rope' and its interaction with the surface.
Using your Blend as a start point I produced the following animation (after creating a fresh rope as detailed above and changing the parenting of the hook point to 'object') :

This was using the following Soft Body settings :

Spindle collision :

Spindle hook point parenting :

Note that I reduced the 'Inner' setting of the collision of the spindle - since the spindle is only 0.21 blender units in diameter, the default collision properties of 0.2 results in the collision zones from the front and back faces to overlap to that the opposite side 'inner' ends just 0.01 units below the upper surface. This means that if the 'rope' intersects with the spindle by by more 0.01 then it will be considered further below the opposite surface that it is below the upper surface and is dragged through the spindle. Reducing the Inner to 0.1 removes the overlap, giving a better simulation.
In addition, a stretchy and/or heavy soft body simulation will store up a lot more energy as it falls which can drag the upper vertices further through the spindle, further compounding the collision issue. This can be reduced by either decreasing the Mass of the soft body (in the main 'Soft Body' properties) or increasing the Soft Body Edges Pull/Push Springs closer to 1.0.
Blend file attached.

One of the best answers ever.

@Rich Sedman : Thank you very much for taking the time to write this great detailed answer and tutorial ! This is exactly the result I was searching for, and it helps a lot to understand the mechanisms and parameters.

@Cyril_J You’re welcome - glad to be able to help. I really enjoyed investigating this issue and learned a lot about soft body and collision along the way.

Absolutely. This is great. Can't believe I'm only the third upvote. @RichSedman I'm curious about how you research some of the real nitty gritty stuff...e.g. what practical effect a particular soft-body setting has. Any go-to sources that might not be that well known? Or is it pretty much the usual suspects (e.g. Blender manual and this site plus trial-and-error)? Cheers.

Thanks @BLayer. It's mostly just a case of trial and error and lots of perseverence - to build up the knowledge and techniques bit by bit  - although sometimes dipping into the source code helps (eg, https://git.blender.org/).

@RichSedman Would you consider converting this to a blog post and expanding on it? What if the rope was rubbery and pinned at the other end?

@Karric I'm not sure what I could add without making it a complete tutorial in all aspects of Soft Body - which would require a lot of work.Is there a particular problem you're trying to address? If so, you could ask a new question - and link it here if necessary and I can try and help. Also, take a look at some of my related posts : https://blender.stackexchange.com/a/98438/29586, https://blender.stackexchange.com/a/83096/29586, https://blender.stackexchange.com/a/120299/29586

@RichSedman - While those links are informative, my scenario does not use a rope. See my post here: https://blender.stackexchange.com/questions/126815/stretch-traffy-around-a-corner?noredirect=1#comment220016_126815

@RichSedman: Really great and well explained answer!! +1


text:
Blur differences between camera move vs object move?
I'm planning for a larger animation.
And in this animation there will be a lot of camera travel.
Now I wonder what's best. Should I move the static scene and the objects or the camera? Does it differ for motion blur?

If handled properly, moving the objects in the scene will produce exactly the same motion blur as moving the camera.
However, it requires that you move objects at rates that depend on how far they are from the camera, so as to preserver parallax.
If you have one object moving in a more or less straight path, more or less parallel to the focal plane, you can get away with this fairly easily -- It's a technique that animators have used since the early days of Cel based animation.
The more objects you have to move, the more you have to adjust.


text:
Box rigging with empty groups does not work
I'm trying to create an animation of folding a box. I have a model of unfolded box and armature. But when set parent with empty groups, there are vertex groups for only two bones of twelve. There are no doubles on model. Model is in one mesh.
When I make my own vertex groups for every bone (with bone names), it does not work too.
What am I doing wrong?

Sounds like you got this working, but in future, check for "deform" property on bones.  Groups won't be made for non-deforming bones.

Try using automatic weights instead. That will create the groups for you.

Automatic weights made smooth edges when bend a bone and I need sharp folds. Thats why I used Empty groups. I just solved my problem. I created new armature and it is working properly now :)

@Katka Can we see?


text:
Pie Menus with custom positions
Normally when you make your own pie menu the position of the buttons, whether they are on the east, west or whatever position is defined by the order you call them in the draw function.
import bpy
from bpy.types import Menu, Operator

addon_keymaps = []

class MT_3DCursor(Menu):
    # bl_label is displayed at the center of the pie menu
    bl_label = '3D Cursor Actions'
    bl_idname = 'MT_3DCursor'

    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()
        # Here should be every function for the pie menu
        # Order the lines in different order for different pie order
        # Pie order: west, east, south, north, north-west, north-east, south-west, south-east
        pie.operator('view3d.snap_cursor_to_selected', icon = 'EVENT_A')
        pie.operator('view3d.snap_cursor_to_selected', icon = 'EVENT_B')
        pie.operator('view3d.snap_cursor_to_selected', icon = 'EVENT_C')
        pie.operator('view3d.snap_cursor_to_selected', icon = 'EVENT_D')
        pie.operator('view3d.snap_cursor_to_selected', icon = 'EVENT_E')
        pie.operator('view3d.snap_cursor_to_selected', icon = 'EVENT_F')
        pie.operator('view3d.snap_cursor_to_selected', icon = 'EVENT_G')
        pie.operator('view3d.snap_cursor_to_selected', icon = 'EVENT_H')

class OT_snapCursorToSelected(Operator):
    #needs to be lower case and underscores as word separation
    bl_idname = 'view3d.snap_cursor_to_selected'
    bl_label = 'Snap Cursor to Selected'
    bl_description = 'Snap the 3D Cursor to middle of selected item(s)'

    def execute(self, context):
        # the commands of the functions you want to use
        bpy.ops.view3d.snap_cursor_to_selected()
        return {'FINISHED'}

classes = (MT_3DCursor,
           OT_snapCursorToSelected,
           )

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

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

if __name__ == '__main__':
    register()
    bpy.ops.wm.call_menu_pie(name = 'MT_3DCursor')

But I saw someone having a pie menu having a button only at the north and south position, so you can somehow say where the button should be positioned.
The standard order is like this, west, east, south, north, north-west, north-east, south-west, south-east:

Pie menus are arranged in the order West, East, South, North, Northwest, Northeast Southwest Southeast; as you said. If you have more than 8 entries, the cycle repeats, causing entries to lie on top of each other.
To skip an entry, insert a separator() layout element.  Since you want North and South with two item, something like this fragment works:
    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()

        pie.separator() # Skip West position
        pie.separator() # Skip East position
        pie.operator("my.align", text="World", icon = "WORLD").alignment = "WORLD"
        pie.operator("my.align", text="View", icon = "VIEW3D").alignment = "VIEW"

This gives an example menu of

Note that the numeric shortcuts remain the same.  North is still '8' and South is still '2'.  That's because the match the numpad layout.

Great tip, that the number shortcuts matches the numpad layout!


text:
How can I effectively import and texture a large height mapped terrain mesh?
I am looking for advice on how to handle a large terrain mesh that I am importing from an existing file format through a custom add-on I am writing. Currently, I import heights from a height map file and generate vertices, edges and faces to create a single grid plane mesh. Here is an example of how it looks:

I have a total of 202,800 vertices and the dimension of my mesh is 520x390. Each 5x5 vertices (4x4 faces) represents 1 "tile" in the original file format and contains a pair of blended 256x256 textures. It's at this point that I am unsure how to best proceed because the dimensions of my mesh give me a fairly high number of "tiles" -- 8112. So here is my question:

Should I add 8112 materials to the mesh to texture each group of faces that represent a tile? OR
Should I break my mesh into 8112 objects, each representing a tile? OR
Is there a completely better way to handle this that I am missing?

Thanks for taking a look.
EDIT Adding some more information as recommended by Duarte
The terrain comes from an old 3D game and right now my only objective is to be able to render the terrain with textures in blender and manipulate the content. I don't really have a preference for which render engine to use (is one better than the other? I am an entry-level blender user).
More technically, for each 4x4 face I want to:

Blend 3 textures (256x256)
Apply the new texture to those faces
Render the mesh with all faces textured

EDIT2
After sleeping on it and taking a new look at the problem I realized that I could trim the number of "tiles" from 8112 to 224. This was due to the fact that not each tile is unique and some of the textures are duplicated ("tiled"). I added 224 default materials to the mesh and memory usage was not too bad (707mb - untextured). Going to experiment with this and will report back if it turns out to be a good solution for me.

What is the purpose of this terrain? Rendering? Game Engine? What render engine will you be using? Have you considered procedural textures? Please edit your question and provide more details about what you are trying to achieve.

@cegaton The subdivision/multires modifiers do look interesting. I could see it being a good optimization, as long as I could generate the virtual geometry from a script. However, I'm still left with the question of how do I texture each "patch" of my grid without blowing up my blender.

Oh just duplicate, decimate, create a normalmap from high to low, and you put one mat.

Thanks @Yvain but I have 3 textures per tile with a total of 47 textures and 224 unique combinations.

What I did several times is have one material with only stencils applying to the whole mesh, 2 or three différents, maybe more, this of it as if you are making up the ground from the bottom -> top, the first texture would be a tileable rocky one, then a stencil is used for masking and let the next texture appear, so you go from rock to dirt then grass (whatever you want) in a smooth manner, only reling on a few big textures (the stencils), the rest of them should be tileable, about the object itself; you should join them, and merge vertex. Then unwrap > paint stencils > apply the mat

I have since found a good solution for my problem. What I've done is break up the mesh into individual "chunks" and then applied a material to each to texture it. I discovered that Blender can handle that many objects and my perception otherwise was due to the script functions I was using. Here is some pseudo code for what worked for me with good performance (10-15 seconds to create 8112 5x5 objects with 25 faces each):
for chunk in chunks:
    mesh = bpy.data.meshes.new(str(chunk.name))
    mesh.from_pydata(chunk.vertices, chunk.edges, chunk.faces)

    obj = bpy.data.objects.new(obj+str(chunk.name), mesh)
    obj.location = (chunk.offset.x, chunk.offset.y, 0

    bpy.context.scene.objects.link(obj)

The key was to not use any operations in bpy.ops but to instead create and link the mesh/obj/scene for better performance. See here to understand details Python performance with Blender operators.

It is usually a win to avoid bpy.ops.


text:
Difficult to phrase blender problem with a rig using the tangent function
What I want to happen, when I move the target bone, is for the Child bone to move only on the X and Y axis, NOT THE Z.

I figured I would use the rotational values of the constrained bone as drivers for the child bone, to correct the movement using the Z axis, I also figured it would use the "tan" function from the driver editor. Unfortunately, my knowledge ends there.

I animated the target bone, so I could see the motion path of the child bone, and this is where I ended up. I have no idea where to go from here, but basically, I want this line to be straight, for this axis, and the Y axis.
Here is the blend file.
https://drive.google.com/file/d/1fh9SK0OHeR6Qq2rDzDpFR4UErDs6W3_Z/view?usp=sharing
Any help would be appreciated!

can you show us the animation per link how it should look like?

i assume you know that you can set just x/y value for the child of constraint?

It's a bit hard to understand the question. "... is for the Child bone to move only on the X and Y axis, NOT THE Z." - this is the bone's axes that you mean here, not the global axes? What should happen when the Target_Bones goes back again (in a circle)? So [1]: https://i.sstatic.net/Fx4iR.jpg or so
[2]: https://i.sstatic.net/NCUS5.jpg?

I got it to work, without any math thankfully. To elaborate, this was meant to be an eye rig, on a flat surface, so I wanted the pupil to stick to the surface.

I used a  "stretch to" constraint on the 2 long green bones to point toward the purple master bone, and added a driver for the "original length" property of the constraint, to add the position of the master bone so that the stretch bone would always point towards the master bone, but not stretch out further than intended, and stick to a flat plane.


text:
Cloth simulation acting wonky in render. Correct in viewport
I've baked a cloth simulation and parented it to another object. The animation looks right in the viewport but when I render it, it jumps to the right on the X axis and then gradually floats to the left.
Animation starts at frame 118. The initial jump changes based on what frame i start the bake on: closer to 0 means further to the right.
Here's the viewport render to show what the animation is supposed to look like.
https://gfycat.com/victoriousoldfashionedhydatidtapeworm
Any ideas how to solve it?

it's a webm though. I'm not sure if it's supported. Also you don't need to see it to underdstand the question. edit: It's not supported.

It would be nice to see what it is doing in the final render. However, normally when something like this happens, either you have a subdivision surface modifier on the object with cloth and you have settings set differently on the view port than the render. This would apply into the same concept as other modifiers that you could have on the object with cloth simulation. It does not sound like subsurface. But, works the same depending on the mod. Obviously, something that is checked on for render in your scene and is set different to view port is affecting your final results.

The object has only a Vertex Weight Proximity and Cloth Modifier on the stack. I even tried deleting the Force Fields after baking,  and disabling all Field Weights with no success. Also it seems whenever i hit render the result is different even for the same frame and without doing any changes. Any ideas what could cause the randomness? I found a workaround which is a pain in the butt. Rendering each frame individually and saving it gives me the results I want. I had a similar problem on another project but I thought it was just animation-nodes related, this one however doesnt use ani-nodes.

Are you rendering images in a stack? That could solve the issue if what you said is a work around. It is far more sensible to do that anyways because rendering in batch as a movie file bugs every so often. Rendering with images and then compiling them into a sequencer with Blender or Davinci, etc. is what every studio does. I would recommend it if that is the fix that you found.

You should also check that you are baking with a disk cache, otherwise your animation data for the bake will not be stored for a render. That is also what it could be.

I render it as a PNG sequence. And I also tried to use the Disk cache, but it doesn't change the weird behavior.

Well, what I would do at this point is to clear everything that has to do with the cloth simulation back out and bring it back in and set it back up from a new import and keep a careful eye on everything that you are doing.


text:
To connect vertices?

I chose Vertex and tried to add a line by pressing F button. But if i connecting to another location,i creating a line that's out of the edge, just like in the picture. I thought my methods were wrong, but no one could fix them.
add I've added pictures, and I want to correct the fact that the lines in the middle don't apply at all.

Please update your question to be more specific about what you are trying to accomplish and what steps you have taken so far. What are you trying to do with the 2 vertices? Also, please try to update your English grammar so that it is easier to understand what you are saying.
That being said, try using the Fill function with 3 or more vertices connected (F on the keyboard).

i try to do make lines but the line is not be not precisely connected to the faces

To create a single edge you need to merge two of the vertices together using the Merge menu  ( keyboard shortcut Alt M ) . See the screenshot below :

Editing the above image because looking more closely there is no vertex at that position A.
New image below:

i'm sorry i think My question was very bad i updated question please check again thanks you

Its still not quite clear what you are trying to do sal. If you are very new to Blender then i would suggest you start your model again and this time make sure your model is using only Quads or triangles. Quads are faces made with only 4 vertices and tris are faces faces with only 3 vertices. When you get to the problem stop. take some scree, shots and also post the .blend file so we can take a look and better understand what you are trying to do :) Use the following link to upload your .blend file .

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

I'm not quite sure what you are doing here, but it looks like you are trying to divide that n-gon up.
The knife tool is k, with it active click the first vertex, then the next.  This should result in the polygon being split along the resulting edge in the way you expect.

I'm sorry for being so rude to ask.I tried to connect to each other by choosing a vertex, and if I check it on the edge, it's not properly connected between the sides.I thought it was my way or my way of doing it wrong, but no way could fix it or do it.

Its still not quite clear what you are trying to do sal.


text:
How do I do I unwrap from a point of view?
How do I unwrap this object from my point of view, so that is perfectly aligned with the mesh behind it?
As you can tell in the following image, I tried my best to position it myself, but took a long time to get it how it looks. Any tricks or tips?
Thanks for your time.

///
Edit: I was told I missed some details so here some more
https://i.gyazo.com/45f9298ce16cfe784d6f30ebdf7e1df2.png
You See this tiny cube that out of line with the mesh behind it we will call the mesh behind it mesh1 and the tiny cube that out of line mesh2
///
So I want mesh2 uvmap to be aline with mesh1 uv map perfectly without affecting mesh1 uvmap I hope this make since
thank you for your time once again

Hello :). What exactly are you trying to accomplish? It is not really clear. And why are you not happy with your result?

Could you please also rephrase the question? That'll increase your chance of getting help...

cant you press 7 to go into top ortho and then when uv unwrapping go ''project from view'' with the meshes on top of each other

Hello and welcome. Please use a descriptive title, also describe what you are trying to achieve

Okay I'm sorry If I didn't say something correctly I'm a bit of a newbie blender I will update my question

You can try this:

Select your objects and go to edit mode
Select all faces of the both objects and switch to Top view
From the menu select UV -> Project From View
Switch to object mode and create a material for one of the objects
Add your texture to the material
Make sure you create a Texture Coordinate node and connect the UV slot to the Vector slot of your image texture.
Apply the same material to the other object.

Edit:
This was added to the question:
"I don't want to affect the plane UV map"
In this case you can use the Data Transfer modifier on your Cube to transfer the UVs form the Plane to the Cube (I used a Torus instead, it's a bit more visible)

Position the Cube somewhere above the Plane
Use Data Transfer modifier on the Cube
In the modifier settings as the Source select your Plane
Check Face Corner Data with Nearest Face Interpolated settings
Click on UVs
You might need to click Generate Data Layers

For the Data Transfer modifier to work properly you will need more edges/subdivision on your Plane.
If you don't apply the modifier you can move your Cube and the UV data will adapt to the new position.

I don't want to affect the plane UV map though that's the problem

I see. I adapted my answer. This way you can preserve the plane UV's, but the plane should have better tessellation, otherwise it won't transfer the UV's properly.

Thank you very much this should help


text:
Objects forced out of container using rigid body physics
I am using the rock generator add-on and dropping rocks into a container (consisting of 4 reshaped cubes) - see attached picture.
The rocks are dropped from a random height into the container and I want to look at the stacking of the rocks.
When the rocks fall into the container, the initial rocks settle, but as more rocks are added the rocks begin to  move more erratically upon collision with other rocks, If I leave the simulation long enough most of the rocks are flung out of the container, leaving just the base layer of rocks.
I had previously set my rocks to 'convex hull' for the rigid body simulation and this prevented this effect, but introduced inaccuracies, I have now changed this to 'mesh' which gives the current problem.
I have found various bits of information online but nothing has resolved my issue.
I am using split impulse and the steps per second and solver iterations should be satisfactory.
The container consists of 4 cubes each 10cm thick which make up the walls of the container and the base. Each cube is passive in the rigid body simulation .
The rocks are on the mm range in diameter (which is small but wasnt an issue when using convex hull), I am using a collision margin of zero (rocks must be able to touch), I am applying 0.9 linear and angular damping and have tried using deactivation below a given linear and angular velocity, but with no success.
I have tried changing multiple aspects of my scene and objects, and currently have the following parameters for my active objects (rocks):

Collison Shape = Mesh

Mesh Source=Deform

Use Deform=On

Scaling is applied

Origin set to Center of Mass

Deactivation =On (but having no effect)

Collision Margin = 0.001

Linear Damping Factor = Rotation Damping Factor =0.5

Scene Parameters:

Split Impulse=On

Steps per Second=1000 (changed since I replied to a comment below (no effect on issue))

Solver Iterations=1000 (changed since I replied to a comment below (no effect on issue))

Here is the python code used to generate the attached blend file.
import bpy
import random
import time
import cProfile, pstats,io
from datetime import datetime
from pathlib import Path
import math

Xmax=0.5
Ymax=0.2
Zmax=0.4

V=Xmax*Ymax*Zmax
maxframe=800

def container_genration(Xmax,Ymax,Zmax):

    bpy.ops.mesh.primitive_cube_add(size=1, enter_editmode=False, align='WORLD', location=(Xmax/2, Ymax/2, -(Zmax/10)), scale=(1, 1, 1))
    bpy.data.objects["Cube"].scale[0]=Xmax*1.2
    bpy.data.objects["Cube"].scale[1]=Ymax*1.2
    bpy.data.objects["Cube"].scale[2]=(1/10)
    bpy.ops.rigidbody.object_add()
    bpy.context.object.rigid_body.type = 'PASSIVE'
    bpy.data.scenes["Scene"].rigidbody_world.steps_per_second=800
    bpy.data.scenes["Scene"].rigidbody_world.solver_iterations=800
    bpy.data.scenes["Scene"].rigidbody_world.use_split_impulse

    bpy.data.scenes["Scene"].rigidbody_world.point_cache.frame_start = 1
    bpy.data.scenes["Scene"].rigidbody_world.point_cache.frame_end = maxframe+100

    bpy.ops.mesh.primitive_cube_add(size=0.6, enter_editmode=False, align='WORLD', location=(0-0.03, Ymax/2, Zmax*(1/2)), scale=(1, 1, 1))
    bpy.data.objects["Cube.001"].scale[0]=(Zmax*5/3)
    bpy.data.objects["Cube.001"].scale[1]=(Ymax*(20/6))
    bpy.data.objects["Cube.001"].scale[2]=(0.6/6)
    bpy.context.object.rotation_euler[0] = 0
    bpy.context.object.rotation_euler[1] = 1.570796
    bpy.context.object.rotation_euler[2] = 0
    bpy.ops.rigidbody.object_add()
    bpy.context.object.rigid_body.type = 'PASSIVE'

    bpy.ops.mesh.primitive_cube_add(size=0.6, enter_editmode=False, align='WORLD', location=(Xmax+0.03, Ymax/2, Zmax*(1/2)), scale=(1, 1, 1))
    bpy.data.objects["Cube.002"].scale[0]=(Zmax*5/3)
    bpy.data.objects["Cube.002"].scale[1]=(Ymax*(20/6))
    bpy.data.objects["Cube.002"].scale[2]=(0.6/6)
    bpy.context.object.rotation_euler[0] = 0
    bpy.context.object.rotation_euler[1] = 1.570796
    bpy.context.object.rotation_euler[2] = 0
    bpy.ops.rigidbody.object_add()
    bpy.context.object.rigid_body.type = 'PASSIVE'

    bpy.ops.mesh.primitive_cube_add(size=1.2, enter_editmode=False, align='WORLD', location=(Xmax/2, 0-0.03, Zmax*(1/2)), scale=(1, 1, 1))
    bpy.data.objects["Cube.003"].scale[0]=(Zmax*5/6)
    bpy.data.objects["Cube.003"].scale[1]=(Xmax)
    bpy.data.objects["Cube.003"].scale[2]=(0.3/6)
    bpy.context.object.rotation_euler[0] = 1.570796
    bpy.context.object.rotation_euler[1] = 1.570796
    bpy.context.object.rotation_euler[2] = 0
    bpy.ops.rigidbody.object_add()
    bpy.context.object.rigid_body.type = 'PASSIVE'

    bpy.ops.mesh.primitive_cube_add(size=1.2, enter_editmode=False, align='WORLD', location=(Xmax/2, Ymax+0.03, Zmax/2), scale=(1, 1, 1))
    bpy.data.objects["Cube.004"].scale[0]=Zmax*5/6
    bpy.data.objects["Cube.004"].scale[1]=(Xmax)
    bpy.data.objects["Cube.004"].scale[2]=(0.3/6)
    bpy.context.object.rotation_euler[0] = 1.570796
    bpy.context.object.rotation_euler[1] = 1.570796
    bpy.context.object.rotation_euler[2] = 0
    bpy.ops.rigidbody.object_add()
    bpy.context.object.rigid_body.type = 'PASSIVE'

    container_genration(Xmax,Ymax,Zmax)

### rock generation ###
def zlocations(noparticles):
    zcords=[]
    for i in range(int(noparticles)):
        zcords.append(0.2+(0.065*i))
    return zcords

def rockgenerator(particles,minsize,maxsize,zcords,Xmax,Ymax,dampingfactor=0.8,angular_damping=0.8):
    for i in range(particles):
        bpy.ops.mesh.add_mesh_rock(scale_X=(minsize, maxsize), skew_X=0, scale_Y=(minsize, maxsize), skew_Y=0, scale_Z=(minsize, maxsize), skew_Z=0, use_scale_dis=True, scale_fac=(1.2, 1.2, 1.2))
        bpy.ops.rigidbody.object_add()
        bpy.context.object.rigid_body.collision_shape = 'MESH'
        bpy.context.object.rigid_body.collision_margin=0
        bpy.context.object.rigid_body.linear_damping=dampingfactor
#        bpy.context.object.rigid_body.angular_damping = angular_damping
        bpy.context.object.rotation_euler[0] = random.uniform(0,6.265732)
        bpy.context.object.rotation_euler[1] = random.uniform(0,6.265732)
        bpy.context.object.rotation_euler[2] = random.uniform(0,6.265732)
        bpy.context.object.location[0] = random.uniform(0.05,(Xmax-0.05))
        bpy.context.object.location[1] = random.uniform(0.05,(Ymax-0.05))
        zloc=random.choice(zcords)
        bpy.context.object.location[2] = float(zloc)
        zcords.remove(zloc)
    return zcords

nop60=int(round(810*V))

noparticles=nop60
zcords=zlocations(noparticles)
zcords=rockgenerator(nop60,0.05,0.06,zcords,Xmax,Ymax,0.98,0.98)

print("Baking Physics")
override = {'scene': bpy.context.scene,
            'point_cache': bpy.context.scene.rigidbody_world.point_cache}
bpy.context.scene.frame_current = maxframe
bpy.ops.ptcache.bake(override, bake=False)

UPDATE: Ive added the blend file in case this is more helpful, Ive also updated the python script to the script used for the last blend. Any help is greatly appreciated. The blend and python example contain less rocks than the original image.

What is the timestep, by chance?

400 time steps per second, 400 solver iterations

maybe share your file so that those who know rigid body can help you? https://blend-exchange.giantcowfilms.com/

Adding Python File Example now, thanks

rigidbody simulations in blender usually suck unless you increase your time steps and solver iterations by a bunch

Just tried going to 5000 for both time steps and iterations, with no improvements, does a change from convex hull to mesh collision type usually require a steep increase in time steps and iterations, not sure how much higher to try.

@MattC1990 I think that the solution is actually simpler than that. You want to stack the objects, or first stabilize things?

@Timaroberts im a little new to blender, can you elaborate on your comment a little, i want the objects to stack like they would if you dropped pebbles in a box, so kind of both

Your container is simply too small. Blender has a hard time with extreme scales in simulations, so increase the size of the container. Also, the rocks, should be convex hull to stabilize the simulation.

To fix things I did the following:
Parented the container parts together to scale uniformly. See the gif below for an illustration:

Next, as the simulation is still unstable, the rocks need to be changed to convex hull. To do this in one go, change one, and select the rest and then reselect the convex hull and then choose Object>Rigid Body>Copy From From Active
Here is the result, hopefully this gets you going in the right direction:

Thank you, the original purpose of the change from convex hull to mesh, was because the rocks wernt actually touching (despite setting collision margin to zero). Ill attempt your solution now, but do you think a larger container with a mesh collision could work, or do you know any other way to get the rocks to touch ?

@MattC1990 friction on the rock objects can be adjusted. Read the manual entry on surface response...

Thank you for your help

welcome, good luck with your project :)