kinda sucks that there isn't a "formatGraph" function, setting x/y coordinates for nodes feels tedious
@CGPython
3 ай бұрын
You can use something like this gist.github.com/CGArtPython/1d72f786b924bd517a9a4b92c1a004e0 This code aligns using the 'node_arrange' add-on in Blender.
@SunshinePosseCrew
3 ай бұрын
Thanks for the videos! I would highly recommend writing a better from-to node link helper method where you can specify the from-to types in the function call. Here's what I wrote below: # def link_nodes_by_socket_type(node_tree, from_node, from_node_type, to_node, to_node_type): node_tree.links.new(from_node.outputs[from_node_type], to_node.inputs[to_node_type]) # With this, you can easily link the nodes in one line without updating from-to vars each time :-) # link_nodes_by_socket_type(node_tree, from_node = split_edges_node, from_node_type = "Mesh", to_node = separate_geometry_node, to_node_type = "Geometry") #
@Besvy-zx3rz
Ай бұрын
Its so troublesome to create geometry nodes,what are advantages in using blender python compare to geometry nodes editor
@CGPython
Ай бұрын
Great question! With Python, you can create extensions/add-ons for geometry node editing. This video was more about showing how to work with nodes. I do agree that it is quicker to do things with the node editor.
@dolmenbretagne9060
Жыл бұрын
It's awesome ! I had started a little but now I understand the lack of knowledge that I had! Thank you very much we must continue to do this kind of tutorial!!!!!
@CGPython
Жыл бұрын
I'm happy that this helped. 😀 What did you need more understanding in?
@dolmenbretagne9060
Жыл бұрын
@@CGPython For now I'm trying to understand your tutorial. I do lots of tests! it's really super ! There are so many things in the work that you bring us that for the moment I "digest"! Thank you again for everything and I will keep you informed of my discoveries! A+
@havinthiranv
2 ай бұрын
can you make Blender python geo node tutorial for wrapping a object please, something like wrap master. I am trying to learn proceduralism in blender
@CGPython
2 ай бұрын
Do you know if wrap master uses any Python? I would guess that it is a pure Geo Nodes node network without any Python.
@havinthiranv
2 ай бұрын
@@CGPython Is it possible to teach us creating a custom geo nodes with or without python, something like wrap master. pleasee
@nicolassuarez2933
3 ай бұрын
Outstanding! Do you know how to export it as .gltf with materials to? Thanks!
@CGPython
3 ай бұрын
The easiest way would be in the modifiers panel, where you will need to apply all the modifiers (including the Geo Nodes modifier). You will get a final mesh that you will be able to export as a .gltf. There might be a way to do this without needing to apply.
@nicolassuarez2933
3 ай бұрын
@@CGPython I solved with a to newbie code... :) import bpy bpy.context.active_object bpy.ops.export_scene.fbx(filepath='C:/Users/camis/Downloads/base_model.fbx', check_existing=True, filter_glob='*.fbx') bpy.ops.import_scene.fbx(filepath='C:/Users/camis/Downloads/base_model.fbx', filter_glob='*.fbx') bpy.ops.export_scene.gltf(filepath='C:/Users/camis/Downloads/final_model.glb', export_format='GLB')
@aaayerus
3 ай бұрын
Hey CG Pyhton, plz make a video about importing and controlling the inputs of an already created geometry nodes file, making use of a custom n-menu panel.
@abiuniverse
3 ай бұрын
How to add geometry node on a mesh created from json data in the python script
@CGPython
3 ай бұрын
So you are trying to load some data from a JSON file and create a geometry node network?
@abiuniverse
3 ай бұрын
@@CGPython yes, I am actually loading from a csv file but idea is the same. Its a volume data (4D) so using geometry nodes to create a volume with a custom density profile. Or do other things on it. I think the problem is that after creating the vertices the newly created object is not active and adding geo nodes without selecting any object is not working.
Жыл бұрын
Fantastic!
@CGPython
Жыл бұрын
Many thanks! ❤️
@Pooriel
10 ай бұрын
Thanks for this awesome tutorial. I have a problem with creating links between nodes. linking geometry (green dots) input/outputs works as intended but it doesn't work when I create a link between two attribute (diamonds) input/outputs. I checked the DATA API and saw that the links were actually created but they were kinda disabled (Is_Hidden is enabled and cannot be disabled).
@CGPython
10 ай бұрын
Can you share what Blender version you are using and what nodes / what attributes you are trying to connect? You can try to do what I did in this video (link with timestamp) and list all the inputs kzitem.info/news/bejne/u22qvJl_anZodo4 You might need to use a "hidden" name for the socket.
@avinashkaushik7181
Жыл бұрын
fantastic,,,,can you please make a video on python rigging
@CGPython
Жыл бұрын
Thank you! 😊 That is a great idea!
@TPSNS
Жыл бұрын
thank you for the tutorial I only have one question how do you use Vim commands in blender
@CGPython
Жыл бұрын
You are welcome! I don't use Vim commands in Blender. I usually use VSCode for my script development needs Here is how to set it up kzitem.info/news/bejne/24Zm2WWfcneJmII
@VitalyBanny
Жыл бұрын
Nice lesson! Thanks! Is there a way to pan and zoom view of geometry node editor with python?
@CGPython
Жыл бұрын
I'm not sure about panning, but we might be able to `frame all` or `frame selected` I have tried to `frame all,` but I'm not getting it to work
@AliMohammadi-v8g
Жыл бұрын
Hi sir, can you create a tutorial about matrix snapping for fk/ik snapp?
@CGPython
Жыл бұрын
Thank you! I'll add this to the list of requests 📖
@stefankarlssonse6026
10 ай бұрын
started looking for the version of Blender. Didnt find in description text or in the first 5 min of the video, so didnt continue.
@CGPython
10 ай бұрын
I think this was 3.4 or 3.5
@stefankarlssonse6026
10 ай бұрын
@@CGPython Thanks for making good content in general. :) Make it even better by including the version of Blender you are using. This is particularly important for things like geometry nodes and the python API.
@CGPython
10 ай бұрын
Yeah, that is a good point. Thanks
@stefanguiton
Жыл бұрын
Great video!
@CGPython
Жыл бұрын
Thanks!
@ashlynmccann6394
Жыл бұрын
Thank you for the great tutorial! I used this as a foundation for some geo nodes I am using in an add on. However, I keep getting this error: {AttributeError: 'geo_nodes' object has no attribute 'node' } on the line where I define my out_node as group output. I am using Blender 3.5. Do you have any advice on solving this error? I am relatively new to blender and python
@CGPython
Жыл бұрын
Glad it was useful! It is hard to say without seeing you code Can you add your code spinet here?
@ashlynmccann6394
Жыл бұрын
@@CGPython Hi Thank you for your response! I actually fixed the original problem but now I have a new problem :,), I put the problem I am facing and code in a google doc here: docs.google.com/document/d/1ZlRFXkbgwDnMKPEQoGwd7YHh3zQBk6OoK3-bWW41lTQ/edit?usp=sharing essentially, I do not know why a couple of my nodes are not linking. I will also be posting on stack exchange, but any advice you have would be so appreciated! Thank you!
@ashlynmccann6394
Жыл бұрын
I wanted to reply with an update, I got the code to work! My issue was certain nodes have more "hidden" sockets than what is displayed so cannot connect them by the label of the socket (I was getting this with sockets labeled "Value", so instead, you can index it with [0], [1], etc. I just did trial and error playing with the indexing numbers until it worked but I am sure there is a more sophisticated way to do this, anyways, thanks for the tutorial! it was super helpful!
@CGPython
Жыл бұрын
Ah yeah! I explain how you can link the nodes in a better way here (time stamp) kzitem.info/news/bejne/yaKQxZd8jJ6SgKg
@PeterKonijnenbelt
9 ай бұрын
I am using Blenders Geometry Nodes to create models (not using python). When I have created a model using geometry nodes I would like to export all the coördinates from the vertices as processed in the Group Output. Is there a way to obtain the data using python (as is presented in the Spreadsheet)?
@PeterKonijnenbelt
9 ай бұрын
Never mind I found the answer online: import bpy import bmesh depsgraph = bpy.context.evaluated_depsgraph_get() obj = bpy.data.objects['Cube'] bm = bmesh.new() bm.from_object( obj, depsgraph ) bm.verts.ensure_lookup_table() print( "----" ) for v in bm.verts: print( v.co ) bm.free() This seems to work. I just could not find it ... but as soon as I asked the question ..... weird how that works.
@PeterKonijnenbelt
9 ай бұрын
In addition I am looking to retrieve al the starting and ending vertices per edge. For this I have created the following code: ______________________________________________________________________________________________________________________ import bpy import bmesh import numpy as np # get a reference to the active object mesh_obj = bpy.context.active_object # create a new bmesh object bm = bmesh.new() # initialize the bmesh object using the mesh data bm.from_mesh(mesh_obj.data) #Extract all vertex coords and package for export vertices = np.empty((0,3),int) for v in bm.verts: vertex = np.array([v.co.x, v.co.y, v.co.z]) vertices = np.append(vertices,[vertex], axis=0) edges = np.empty((0,2),int) for e in bm.edges: edge = np.array(e.verts) edges = np.append(edges,[edge], axis=0) print(vertices) print(edges) bm.free ___________________________________________________________________________________________________________________ The result however is: ___________________________________________________________________________________________________________________ [[ 1. 1. 1.] [ 1. 1. -1.] [ 1. -1. 1.] [ 1. -1. -1.] [-1. 1. 1.] [-1. 1. -1.] [-1. -1. 1.] [-1. -1. -1.]] [[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]] ________________________________________________________________________________________________________________ Why are the results of the indices not just the index number but {BMVert(@@@@) ? How can I obtain just the index numbers?
@here2race
6 ай бұрын
@@PeterKonijnenbelt It's not weird, it's well know thing :) en.wikipedia.org/wiki/Rubber_duck_debugging
@surtvalheim
9 ай бұрын
Do you know how create a new modifier ? using class MyModifier(bpy.types.Modifier) do not add the modifer in the add modifier list, even with MyModifier registered in the script as usual.
@CGPython
8 ай бұрын
The Blender devs have described creating modifiers via Python as an anti-feature wiki.blender.org/wiki/Reference/AntiFeatures Basically Python is too slow to perform the operation most modifiers would do. It is still possible to write a modifier, but you will need to use C++/C.
@surtvalheim
8 ай бұрын
@@CGPython In C++ as a plugin or will everyone have download my own version of Blender every update ?
Пікірлер: 54