Cool Add-ons for Blender: Human Generator: bit.ly/3rBjJXy Massive Cars And Vehicles Add-On: bit.ly/3cuWF8N 1100 Textures in Blender: bit.ly/2QEJ7yN Flip Fluids Simulation Addon: bit.ly/2Pbu5QR HDRI Maker Addon: bit.ly/3stHdPR Using these links help fund all the free tutorials.
@ArtPomelo5 жыл бұрын
Yes, more coding tutorials with blender please.
@CryptoAnimated5 жыл бұрын
Hi, If I may, not trying to be critical, but I assume some of the people don't know about programming, and it may help to write clear code, instead of counter = 0, if this is the position of x, just call position_of_x, in this way the code becomes more clear in my opinion. I've changed the first part a bit to show as example The same thing when you subtract -2 from the counters, this may confuse people as well, you can add the position after the loop is done, in this way you don't need to subtract. Nonetheless, thanks for introducing programming in blender for me, I'm a developer and I'm just starting out in blender import bpy number_of_cubes = 2 x_pos = 0 y_pos = 0 z_pos = 0 for i in range(number_of_cubes): y_pos = 0 for j in range(number_of_cubes): z_pos = 0 for k in range(number_of_cubes): bpy.ops.mesh.primitive_cube_add(enter_editmode=False, location=(z_pos, y_pos, x_pos)) z_pos += 2 y_pos+=2 x_pos+=2
@Adinkya4 жыл бұрын
Wow, noice
@swainuk20244 жыл бұрын
thank you :)
@CryptoAnimated4 жыл бұрын
@@swainuk2024 You are welcome, I am posting some content on unity and games if you are interested
@chrislyonm4 жыл бұрын
@@CryptoAnimated This made SO much more sense. Still thankful that he took the time to make this though.
@CryptoAnimated4 жыл бұрын
@@chrislyonm Yeah, I loved the tutorial, I added this just because I saw that people not familliar to programming would suffer a bit
@Napert5 жыл бұрын
Why no asmr tag in the title like wtf
@jaimerojas65784 жыл бұрын
lol so good right?
@IRaul4 жыл бұрын
it sounds like agressive asmr
@Chillerll4 жыл бұрын
@@1islam1 At first, I thought those were time stamps and Allah really loves to add and subtract from numbers in for-loops for some reason
@gizlikullanc48615 жыл бұрын
Instead of using additional variables like counter, counter2 etc. you can use the values of a, b, c. for a in range(1, number + 1): print(a*2) See that the values of a are equal to corresponding values of counter :)
@gizlikullanc48615 жыл бұрын
I believe this is doing the same job: import bpy number = 10 for a in range(number): for b in range(number): for c in range(number): bpy.ops.mesh.primitive_cube_add(size=2, location=(a*2, b*2, c*2))
@Olav3D5 жыл бұрын
Yup. There are many ways to shorten that script, I wanted to make it as understandable as possible as it is a beginner tutorial.
@vain3d9735 жыл бұрын
As a beginner who never uses script, this just reminds me how powerful Blender actually is 🤯... As always, super helpful tutorial Olav3D, thank you!!!
@Roboticdock2 жыл бұрын
Very nice demonstration of “for” loops in 3D modeling! Thanks!
@lpanebr5 жыл бұрын
I love it. The tip to create it modify using blender and copy the code is perfect! Thanks
@DJCronixx5 жыл бұрын
For a more concise way of specifying the nested loops, you can use something like this: list_of_coordinate_tuples = [ (x,y,z) for x in range(0, count_x, size) for y in range(0, count_y, size) for z in range(0, count_z, size) ] Great tutorial btw!
@todlu5 жыл бұрын
So you can nest for loops INSIDE the list comprehension?! how cool is that!
@canopus-lab5 жыл бұрын
I'm still using blender 2.79! But I always watch your tutorials, Thanks !
@JackPillawa5 жыл бұрын
the voice is super relaxing and the Tutorial very good, thanks
@bronzekoala91413 жыл бұрын
The creation of the cubes can be made more then 100x faster by re-using the already existing mesh of a single cube and not using operators in the loop (every bpy.ops call refreshes the scene, making it very slow). We just create one Cube at the start of the script and re-use it's data in the loop. At the end, we just delete the first cube. Like this: import bpy counter = 0 bpy.ops.mesh.primitive_cube_add() # create a "source cube" cube = bpy.context.object for a in range(10): counter +=2 counter2 = 0 for b in range(10): counter2 +=2 counter3=0 for c in range(10): new_cube = bpy.data.objects.new(name="New Light", object_data=cube.data) # create a new Object and lets it use the cubes mesh data bpy.context.view_layer.active_layer_collection.collection.objects.link(new_cube) # add the new object to the viewlayer new_cube.location =(counter3+2, counter2-2, counter-2) counter3+=2 bpy.ops.object.delete(use_global=False, confirm=False) # delete the "source cube" With this changes, the execution time goes down from 15 seconds for a 10x10x10 grid to almost instantaniously on my PC.
@blenderenthusiast5 жыл бұрын
I'm a beginner to blender and this video was like my starting point, THANK YOU!!!
@Adinkya4 жыл бұрын
Gl
@nickhodgskin4 жыл бұрын
Duuuuuuude, I just stumbled across this. Such a good find, thank you!!
@diggie83723 жыл бұрын
This coding tutorial is more suitable for me Please do more tutorial... Thanks a lot for sharing this.
@Mahm00dM0hanad5 жыл бұрын
This is my first time I watch scripting tutorial on blender well done 👍🏻
@guylemay14715 жыл бұрын
Thank you for this most useful tutorial ...I've been waiting for one just like it for awhile now - thank you again!!!
@merwyn20874 жыл бұрын
Your tutorials are just amazing !!! I love wath you do.
@cse077mukulrana3 жыл бұрын
I just subscribe you really amazing I was searching fir stuff like this finally I found your channel 🙃
@sennabullet2 жыл бұрын
Thank you for this incredible tutorial. I learned a ton. Thank you for taking the time to make the video and share your knowledge.
@EvandroMeloz5 жыл бұрын
Great tutorial, Batman.
@melegaunt01x5 жыл бұрын
Excellent Video! Thank you! I subscribed!
@luxraider53844 жыл бұрын
at 4:01 shouldn't you make the counter3+=2 before the cube generation because the cube here doesn't match the coordinate system of the system and we see that the last cube has a weird coordinate of (20,18,18) and therefore it isn't even a cube it's just a rectange with a 20x18x18 parallelepiped
@ghostriley225 жыл бұрын
i would suggest adding denoiser....you can get satisfactory results without needing to bump the samples to large values
@erik....5 жыл бұрын
You can also change the interface scale in Properties so that everything is easier to see in videos. I use scale 1.3 on my 4k screen.
@fmenezes62725 жыл бұрын
thanks for increasing the font size in this tutorial
@copypaste35265 жыл бұрын
import bpy num = 10 step = 2 for i in range(0, num, step): for j in range(0, num, step): for k in range(0, num, step): bpy.ops.mesh.primitive_cube_add(size=2, location=(i, j, k))
@rixyarbrough17025 жыл бұрын
This is an awesome tutorial! I learned a ton, thanks :D
@voxsideres5 жыл бұрын
Why not use the enumerate() function on your for loops? Ex: for counter, a in enumerate(range(0, number): .... I don't know how it affects performance but it prevents having a lot of extra variables in your global scope. Great tutorial!
@chainonsmanquants16305 жыл бұрын
really good tutorials out there ! Thanks a lot !
@JohnSmith-rn3vl5 жыл бұрын
Loving this.... definitely interested in more programming tutorials .
@JacobTekiela5 жыл бұрын
would be super if you made the text size even bigger or zoomed in
@xXSniperProgamerXxHdxxLPXxXx5 жыл бұрын
And why should this script be faster than the array modifier?
@Olav3D5 жыл бұрын
Once you have the script written you can make changes to the simulation much faster. Using array modifiers you will have to start over to make adjustments to the number of objects on each axis due to origin points, physics and the applied modifiers.
@nelsonsubervi-hernandez81975 жыл бұрын
Hello, thanks for your tutorials but for sake of my eyesight I kindly ask you to increase the font size to between 16px or 18px thanks you very much.
@Olav3D5 жыл бұрын
I agree, the font size is increased in later tutorials.
@JaaoPonte5 жыл бұрын
This tutorial is just amazing! So simple and so instructive
@ricopin5 жыл бұрын
Thanks! I wanted to play around with scripting in blender, so this gave me some important pointers!
@massivetree79375 жыл бұрын
Running some of these scripts are taking quite a while to execute in the final release of 2.8. Generating the initial cube array of 1000 cubes takes just under a minute to generate which seems very slow for a scene consisting of only 6,000 faces.
@Olav3D5 жыл бұрын
What takes time is adding the physics actually.
@massivetree79375 жыл бұрын
@@Olav3Dwell in the case I'm referring to was just adding the array of cubes. I was just surprised, figured it would be faster.
@simulify87265 жыл бұрын
Please do a tutorial on quick character creation
@iammanishverma3 жыл бұрын
Very well explained!!
@JannisAdmek5 жыл бұрын
is a great coding tutorial for sure but I think an array modifier is still faster :)
@Olav3D5 жыл бұрын
Jannis Adamek That’s why my channel has both ;)
@ldandco2 жыл бұрын
Cool videos, subscribed
@celestialbody98075 жыл бұрын
Nice work ! I loved this tutorial, thanks for it ! 😄
@Myrslokstok5 жыл бұрын
Awesome 😃 this kind of thing makes me happy. You should allso do one video with an imported object of irregular shape.
@rfpcs15 жыл бұрын
Why didn't you use EEVEE?
@4.0.44 жыл бұрын
Isn't there a way to set the same settings for all objects without python? Since generating all of them could be done with the array modifier, for instance.
@Olav3D4 жыл бұрын
This is to learn to use python in Blender, of course you can do it with a modifier ect.
@saucedplanet59685 жыл бұрын
Great tutorial!
@ravenxrgaming46724 жыл бұрын
Can I use blender for rover simulations
@yashwantsahu40695 жыл бұрын
Sir i want to make video in physics in which we use light rays simulation
@4shC3 жыл бұрын
i am so unlucky for not finding this sooner... Great tutorial btw
@thehulk68664 жыл бұрын
How much time it takes to render this animation ??
@clown7862 жыл бұрын
Can I download an old version of Blender and use Python on it?
@machbauer1325 жыл бұрын
Why not switching immediately to the "Scripting"-Tab? ;) But what makes me wonder too, why does it take so much computational power to generate 1000 cubes??
@종신-l3i5 жыл бұрын
thanks for video. and i have a little problem. my ground moves down with the cubes at same time... so my question is, how I could make my ground stay..?
@muzikermammoth39954 жыл бұрын
hi there, i tried replacing the 2m blocks with 0.2m meter block of mass 0.2, but the blocks just shoot out like an explosion instead of falling. Why does it do that?
@muzikermammoth39954 жыл бұрын
Turns out the convex hull detection for the objects means objects that are originally intersecting get pushed outwards because they're considered to be colliding
@keluargamabar4 жыл бұрын
From blender, Could the simulation convert to become desktop based or Web based app?
@cmulation54603 жыл бұрын
There is no Steps per second parameter in Blender 2.9, there is Substeps per frame instead. I set Substeps Per Frame to 1 and baked, otherwise it takes an enormously long time and cubes move away too far and too fast.
@rahul_siloniya5 жыл бұрын
Which gpu are you using
@ItsHxwi4 жыл бұрын
How often do animators code
@chasenwang45974 жыл бұрын
My render view is completely dark grey. I don't know what to do...
@serra_edoardo2 жыл бұрын
Awesome tutorial! Just a question, is Blender physics simulation realistic? Meaning that it yealds the same results that an experiment in real life would. Thank you a lot
@chasenwang45974 жыл бұрын
What GPU do you have?
@mayadah5 жыл бұрын
Hi, I have a problem with the animation, that is, the plane and the cube move with each other and the cube does not fall on the plane
@ManfredPichler5 жыл бұрын
Make sure you set the rigid body on the plane to passive, otherwise the plane will have gravity and start falling the moment you play the simulation.
@mayadah5 жыл бұрын
@@ManfredPichler thank you
@alpha_6t95 жыл бұрын
why is the final structure asymmetric? (since all the cubes are identical, the object that is falling has to be completely symmetric. if so, why do the cubes on one side, the side we are observing, fall off while the ones on the other sides don't?) (good tutorial btw)
@Olav3D5 жыл бұрын
My first thought: as “steps per second” increases the level of asymmetry will decrease as the accuracy of the baked simulation increases. Good question!
@alpha_6t95 жыл бұрын
@@Olav3D I was thinking in the direction of numerical inaccuracies in binary representation of numbers
@mathyoooo25 жыл бұрын
@@alpha_6t9 I was also thinking of floating point errors
@artaway66475 жыл бұрын
cool tutorial. But idk why blender always freeze when I press ctrl+c to copy the cube object from the info window.
@maicomcoelholopes90325 жыл бұрын
Olav, poderia me ajudar?estou criando um Addon(tentando) mas estou com dificuldade de vincular parte do script com um botão(nesse caso UI menu) e como posso executar vários comandos com apenas um botão? exemplo: com um clique mover objeto a determinada coordenada e aplicar um modificador como o solidify com apenas um botão?
@aumhren34804 жыл бұрын
04:44 - this code crashes blender (2.91.0), anyway thx for sharing
@3d-illusions5 жыл бұрын
Cool, thanks. I was wondering though, how could we multithread this on the cpu, or run it in parallel on the gpu using something like numba?
@ElectroGamesYT5 жыл бұрын
Cool tutorial, can u make more tutorials on python I need to learn
@Mountainside1012 жыл бұрын
Is anybody having trouble with the code showing error, it won’t execute in the first section of the code
@indranupaperproducts41864 жыл бұрын
is it common that when script starts running,then the software stops responding for a long time??well my pc has only 2gb ram with no graphics card in it
@cipherxen25 жыл бұрын
What added the randomness to the physics model? No cubes would have fallen out in a perfect model.
@Olav3D5 жыл бұрын
I think “steps per second” plays a part.
@cipherxen25 жыл бұрын
@@Olav3D If one cube is exactly above another cube, their collision cannot make them move horizontally. But as shown in video, the middle cubes move horizontally after collision. If the cubes are perfectly aligned above one another, they would have stayed in place.
@cipherxen25 жыл бұрын
I've created my own physics simulator, in which I've to add some slight randomness in position to them behave like in this video.
@martinbassoli88765 жыл бұрын
Hi!, How I can apply this script to an object I already create it , like a tree that falls into a house and the roof of the house breaks . I wanna know that because it would be great to add it to my scene.
@sippy_cups5 жыл бұрын
Is there a github with the code from your videos?
@arnavjha73752 жыл бұрын
In my case , cubes are moving up in air and are stick to each other . Just reverse of of actual output I was expecting .
@varunahlawat9013 Жыл бұрын
Could even the sound be simulated? Technically it should be possible I think...
@jisankumar34204 жыл бұрын
I can't see number row 5 plss write for me
5 жыл бұрын
Well done,thanks!
@samnomas27394 жыл бұрын
I feel like I’m being seduced. The information is winning me over, not gonna lie
@allthingslegal12945 жыл бұрын
Hey man, new subscriber. Just wanted to ask which laptop you use for rendering and animation. Thanks
@phadadev23074 жыл бұрын
Thank you so much. :) :) :)
@Martin-ll7jc5 жыл бұрын
Thank you, much appreciated
@sohaibahmad90305 жыл бұрын
Can anybody tell is it compulsory to use coding on blender?
@simongunkel74575 жыл бұрын
What do you want to use blender for? For most use cases you won't need to code anything, but for some specific things you might want to do so. Think of the ability to use the python API as a bonus - not neccessary for most tasks, but an option to expand functionality even further.
@sohaibahmad90305 жыл бұрын
@@simongunkel7457 for animation. Ok i got that, thanks.
@themightybeast47164 жыл бұрын
i realy love what you do but can you do a video how to make the Minecraft realistic physics simulation. and i subed
@prateekthakur18484 жыл бұрын
I hear that voice and I sub.
@Vinironin4 жыл бұрын
my plane is not fix lol, how do i fix it?
@Vinironin4 жыл бұрын
ok now all the boxes are passing through the plane
@sams_3d_stuff3 жыл бұрын
uhuh, thank you so much!
@AngelAgudoGuerrero5 жыл бұрын
Yes! Great tuto!
@sansdomicileconnu5 жыл бұрын
thanks for this tuto
@MrRoach-ii4pz5 жыл бұрын
Great tutorials! Thanks!
@sm1le0hd5 жыл бұрын
U can use python in blender?! How many modules does this Swiss knife have?
@Olav3D5 жыл бұрын
Blender has so many uses!
@rachittrivedi63225 жыл бұрын
Nice one...
@vishalsingh-cz8jq5 жыл бұрын
awesome!!
@ismailhaider4 жыл бұрын
can we make web based 3D capacity planning using python ? i dont know they make this. here is the sample sunbirddcim.com/screen-shots/3d-visualization
@WhiteBossGamerYT5 жыл бұрын
nice bro
@ehehjehehe56735 жыл бұрын
I will continue using modifiers
@Olav3D5 жыл бұрын
Haha, I have a tutorial for that too ;)
@vynguyenchi96724 жыл бұрын
Great!
@ArbitraryOnslaught5 жыл бұрын
I thought png was larger file then jpg? also great tutorial!
@jascrandom98555 жыл бұрын
It is, but its lossless.
@lucaslambert89705 жыл бұрын
Blender froze when i ran the script.. :( Let me reduce number of cubes... :p)
@lello73852 жыл бұрын
you just create the cubes in python and add the physics then you run it from blender not from python.