-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blender Integration #1
Comments
I suggest to have an addon inside this repo, since that's more convenient than manually synchronizing two repos. I guess both the simulator and the blender interface will evolve quickly, so keeping them together will help to make them consistent with each other. That's just my personal opinion - please feel free to propose yours :-) On my end, Blender integration/users will be the top priority. I would also make the API reusable for other purposes, to get more people/contributors involved. Regarding your question: It's just a temporary name - if you have a better proposal I'm happy to change it in the future. |
3D simulation working: https://youtu.be/XAwL_QLP7uQ |
https://github.com/PavelBlend/blender-taichi-elements-concept result = []
result.append(input_1)
result.append(input_2)
...
result.append(input_n) Merge node must combine lists into one list. Which is equivalent to the following python code: result = []
result.extend(input_1) # type(input_1) = list
result.extend(input_2)
...
result_extend(input_n) Here is an example of using these nodes: Do you have any ideas how to change this system of nodes? Or maybe change the parameter names and node names? And one more question: Do you have any experience with blender? |
Looks cool! I think the current nodes are pretty good and, if it makes sense, maybe we should start trying to have a basic simulation node graph running, so that we can learn more about how exactly the simulation node system work in Blender and how the simulator should be designed to fit this interface. I'll try to play with your addon - could you point me to a tutorial or a few hints to have that running in my local Blender 2.81a? :-) I only have one small suggestion now: is "make list" a better name for "set"? In the future, I think the node graph can be more customizable. For example, users can specify varying stiffness/viscosity using textures. We can even let the users specify material constitutive models using a sub node graph (just like BRDF graphs in rendering), and have that JIT-compiled into a component of the simulator, to allow more flexibility. To be honest I don't have much experience with Blender. I followed a few Blender toturials 3 years ago, and implemented a Blender addon for my old renderer, however it's been a while and what I have done with Blender is quite basic. The node system in Blender is quite new to me. I've been using nodes in Houdini. My experiences are more in building high-performance simulators and compiler, and I think that's exactly why we should work together to combine our expertise in both high-performance simulator building and Blender development :-) |
I installed the addon and saw this info in the Blender logging window:
Trying to figure out how to open up a window and play with the nodes... |
For some reason, I couldn't find the
One possibility is that when installing, the zip file of the addon doesn't have the correct format... |
You need to manually copy the folder Since the zip archive with github contains a gitignore file, which interferes with the normal installation. |
awesome! it works now. |
I can now prepare a blend scene so that you can clearly see which nodes can be connected to each other. |
Here is the scene.
well. I will change this name. |
I really like the scalability and composability of this design. I guess the next step is to
|
Actually I discussed with Ton Roosendaal and Brecht Van Lommel a year ago, on the potential integration of If we get stuck on making the node system work, maybe we can restart the conversation and ask them for help, if you would like to. |
I don’t know this at the moment. Now I’ll start to figure it out. There are ready-made node systems: You can look at how the implementation of the node tree in these add-ons is implemented. And I created a Simulate button on a Simulation node. If you click on this button, the text |
I think that you can collect information from all nodes and create a dict based on this information. I'll try to do that. Having a list of all parameters, you can create instances of classes (for example, the Emitter class with parameters, time of appearance, source object, position...). After that, you can pass the Emitter class to the simulator. |
I wrote code that collects information from the node tree. The simulation class is created here: If you click the Simulate button on the Simulation node, then information about the simulation classes is printed to the console. Classes are described here: |
Awesome! I'm starting to integrate the simulator to the addon now. |
Apart from Blender, I think it will be helpful to release taichi_elements as a PyPI package, so that more people can get involved and contribute, e.g. those doing research in mechanical engineering who needs an MPM simulator. I also propose to merge two repos. The pros are:
All your previous commits in |
Yes, everything suits me. But I found a problem in the node system. Extra classes are created if the node is used simultaneously in several relationships. You do not need to create a class for the node if this class already exists. I also noticed that the DiskCache class is not being created. After merging the branches with the master branch, I will delete my repository in order not to mislead users. |
Sounds good. I have updated the master branch.
Yeah, I have also been slightly confused by this: Is the node graph a tree or a directed acyclic graph? I thought it should be the latter yet a tree is exposed now. Now I can read the gravity, resolution, material settings and can add a cube. I'll show you a demo in a minute :-) |
Integrated a basic simulator: https://youtu.be/3kUp0GtOfEg (I don't know where to write the particles, so I wrote the images to the GUI...) |
Blender file with commit 4532d1f |
There are problems with particles in the blender. The particle system has errors. Here is the bugreport: I think so far it’s not necessary to create particles, but to create a mesh that has only vertices. |
Creating a mesh sounds good, as long as we can manipulate (e.g. render) the simulated particles. |
I made it possible to import simulation particles as an object mesh: This is a temporary solution. In the future, you can add a particle system. When it will become more stable. And I noticed that the scale of the particles is different from the scale of the original objects. With what it can be connected? update: I made the following bundles of nodes equal: I saw in the code that you added a check for the number of gravities: or another example: |
Looks cool!! The scale issue is due to a redundant normalization I did here to make it fix Taichi's GUI system (with coordinates from 0 to 1): https://github.com/taichi-dev/elements/blob/fix-node-tree/operators.py#L67 I'll remove that. I think the node simplification is great! For beginners often they only have one force or one emitter, in that case removing the I'll implement the gravity stacking mechanism. Also, we may consider support nodes that locally appls gravity: e.g. that "local gravity" happens only within cube.03. |
Oh, now I understand why the existence of the "Hubs". Do you think it is necessary to also have a "global gravity" connected to the MPM solver that works for all hubs? |
I think you can do without global gravity. Perhaps in the future you can do this if it seems convenient. Now you can create one common hub. |
OK, sounds good! |
I forgot to say: |
Yeah, I figured that out. I'll temporarily use a box as the bounding domain. Ultimately we may want to make the simulation domain unbounded (i.e. grow as simulation goes on). #3 |
It may be to change the name of the addon blender from Or is it all left as is? |
Actually I'm planning to rename the repo from |
@PavelBlend Btw how do you visualize the |
I create a particle system, and indicate the positions of the particles this way: Line 122 in 3c70ca1
This code is run every time the value of the current frame changes: Line 144 in 3c70ca1
|
Are you guys aware of the the Simulation nodes proposal by Jaques Lucke at the Blender institute? https://devtalk.blender.org/t/unified-simulation-system-proposal/11394 |
Everything is the same thing, in different states. So my suggestion would be to separate it into 5 main states:
|
Hello, @yuanming-hu |
Hi @PavelBlend - I think it would be a great idea to push this project to a minimal working condition so that people from the Blender community can help. I guess the most tricky step in implementing #5 is to convert a Blender geometry into a 3D voxelized grid/3D texture, so that Taichi can simply read from a 3D bumpy array and seed particles on the voxels that are within the geometry. I have been spawned by the development of Taichi itself for too long - sorry about that. The good news is that now Taichi is more stable and capable than before. These improvements have made |
I think you can close this issue. Since we integrated the simulator into a blender. The simulator works in a blender and this was the goal of this issue. I think that it is possible to create new issues as necessary, rather than writing to this general issue. |
Continuing discussion (https://github.com/yuanming-hu/taichi/issues/299)
@PavelBlend said:
"You are planning to add a blender addon to this repository?:
https://github.com/taichi-dev/elements
Or will a separate repository be created for the blender addon?
I looked at my list of nodes and realized that there are a lot of them and at this stage of development it is too early to discuss all the nodes.
I will try later to reduce the number of nodes in the list to an acceptable number and publish this list.
And I had questions:
why was the repository named elements? Do you plan to rename it in the future?"
The text was updated successfully, but these errors were encountered: