GollyGang / ready

A cross-platform implementation of various reaction-diffusion systems and PDEs.
GNU General Public License v3.0
766 stars 60 forks source link

[REQ]Ive converted the blender script to an Addon #26

Closed schroef closed 3 years ago

schroef commented 5 years ago

I just wanted to show the blender script i found in this repo can easily be converted to an addon. This way we can add more functionality and its easier to use for the user.

See below the screengrab.

obj-sequence-importer-ready

One other option i would like to test, is be able to dynamically adjust the view and hide option. Perhaps i can add an input frame and than use driver to look at this. This way we can adjust the visibility much easier after the sequence has been placed.

timhutton commented 3 years ago

@schroef I don't know much about Blender but we like the idea. Please make a PR if this is something we can include in Ready.

schroef commented 3 years ago

I need to check if i still got code. I believe i had hardware failure just after this. Let me see if i can find it again

schroef commented 3 years ago

I found it but sadly i did not backup the last version i showed here. Im already trying to recreate it. I havent done much Python lately and especially not much 2.8 since a while. Ill think ill manage to figure it out again.

schroef commented 3 years ago

Okay got it working again. I got 1 minor thing i need to fix and ill do a PR then. I did some additional fixes already. Now you can import multiple sequence and they all get their own collection and empty applied. I never worked on that part in 2.79 and now with collections we can manage the scene a bit better. I also thought it was nice to set the end frame of the scene according to the length of the sequence, little helper is handy right :)

Ps dont mind the cube anim, it was a simple test sequence. I need to install the program again. BUt havent downloaded windows version yet. Still getting used to the OS. https://i.ibb.co/bKyH4Pq/20210203-015806.gif

obj-sequence-importer-v003

schroef commented 3 years ago

I got some more ideas to improve this add-on. I noticed when I import mesh from ready it's kinda low quality. I set the decimate export to default 20% but it looks kinda jiggely.

My idea is to add modifier s as we import it. I've tested it already using a subsurf and looks much better.

preview of import without subsurf mod https://i.ibb.co/NShwSpv/no-subsurf-option.gif

preview of import with subsurf mod https://i.ibb.co/94YbkCN/automated-subsurf-option.gif

Another idea is, since these are all separate objects and they are hidden due to the script. I thought of storing a list of the objects. That way I can make the empty sort of a controller. When doing that we could adjust the settings of modifiers using the list to loop over all the objects. This can also be handy to apply a different material. You could of course edit the main material but this gives a bit more freedom.

I've also tackled an issue with lower blender versions. So I now works in bl283 and 2.92

I'll check windows tonight

timhutton commented 3 years ago

I just updated our import_obj_sequence.py script to Blender 2.8.

The jigglies on the surface are perhaps best handled in Ready by changing the grid spacing. Try adding a dx parameter and setting it to 0.7.

schroef commented 3 years ago

I don't know how to use ready honestly but will try that.

Il also check the updated import.py I thought you used default obj importer. You can't change the mesh on import if I'm correct

schroef commented 3 years ago

PS ive added some more feats like setting import start and end frame. Could be useful if you have a very long export but want to shorten it. You could of course narrow animation timeline. I thought it would be nice, because this still allows the user to have multpli imports with different lengths.

Im also thinking of adding a list or imported animations. That way i could use the data to delete them all at once. Much easier to clean the scene of all objects then.

ready-obj-importer-v005

Still need to work out that part i talked earlier about being able to adjust say subsurf on all imported objects at once. That will take me some more time to figure out.

schroef commented 3 years ago

I had already downloaded this addon "stopmotion-obj. Im not sure i should continue on this script making an addon. This addon is more powerful and much easier to use since it uses just a single mesh and replaces the data on the fly.

Do you know of this addon? https://github.com/neverhood311/Stop-motion-OBJs

it also has great feats like playbackspeed, start frame and more. I did tried it a bit and its really nice because your basically are working on a single object.

The only difference i noticed is the playback with that addon is as smooth when subsurf is added. That because it needs to calculate it again and again. Whereas with my approach, it is calculated on import.

timhutton commented 3 years ago

@schroef I've just tried the add-on and yes, it is great. I'll add a comment in our help system. Thanks for letting me know!

schroef commented 3 years ago

So i guess linking or showing info about that addon makes more sense then continuing making this one work right? Kinda wasted time as that one works so smooth and simple

timhutton commented 3 years ago

Yes, agreed. I've deleted our import_obj_sequence.py script.