Open automataIA opened 4 years ago
Is creating a separate variable for mesh a necessity? If not, then you can directly access the object's data using obj.data
(which returns the mesh). Otherwise, you can get the current mesh info by using BMesh (https://docs.blender.org/api/current/bmesh.html).
Before the end of the script, you can push changes to the currently active object (in the context). The "Custom Python Script" node allows you to run a single line code or a script (Text Box input) while providing sockets for "In" and "Out" where the object reference can be passed.
Maybe I can provide you with an alternate approach if you can let me know the use case. Most of the times, you'd want to operate on the geometry directly, without copying its data.
Example : im creating a concrete frame( beam, column are solid). I need to create a wall between this beam and column. Then i need all information from this 2 elements(like coordinates and orientation), for resend this variables information in a another sorcar page. Becaouse i need 1 sorcar page for 1 element( wall, beam etc...)
There a couple of nodes that can help you with transfer of information form one nodetree to another: "Get Variable" and "Set Variable" nodes
Use "Set Variable" node in a nodetree and pass the created object in as value:
Then use the "Get Variable" node to get that object reference and either access it directly, or get its information like this:
It will save some performance by not duplicating the mesh to a variable.
A node that take info from model(volume, name, surface, coordinates) and save in a python variable. Then use this variable in a python script and resend the output info to sorcar