[AddOn] Blendgraph 2.7 UPDATED (on hiatus)

@Gimble: Thanks for pointing that out. It is not you, it is the current code.

In the AddOn version of Meshfoot I was explicitly setting all the faces to smooth for each mesh after import. This can be time consuming in a frame change loop but hey, this version of Meshfoot was not built for speed.

I have added that feature back into the Meshfoot node, pull down a new version of Blendgraph from post #1. Now all imported objects will be auto-smoothed. Not the best solution, but it is most common that you want your imported objects smoothed. It will certainly help out on fluid simulations as well.

Hi Atom

Thanks for the fast update.
I tried a quick test and it seems to be working.
Although on comparison, the imported .obj look a little different (maybe a result due to the translation?)
Here’s the imported result on the left and the original fluid simulation on the right:

http://users.xplornet.com/~gimble/compare_fluid_obj.jpg

The main reason that I was using this, was to splice 2 fluid simulations together, so it didn’t look too good with the first part faceted and the second half smooth. Although the final result wasn’t quite what I wanted due to the technique I was using, so it’s back to Plan A.

I’m sure I’ll be using this again soon, so thanks for the help.

Glad it worked for you. I do see the difference in the image you reference. Perhaps the exporter itself is changing the mesh slightly?

You know you can have two or more fluid sims playback in the same scene. You can only bake from one domain at a time. Once you have a cache baked create a new domain and have it read from that cache. You can even offset cache playbacks to stagger or delay fluid sims after the fact.

The technique is described in this video.

I have updated Blendgraph with a new node. Pull down the latest from post#1.

The Regular Solids node. This is the same exact code that runs in the Blender Tool panel. But having the code run in a node allows you to animate the parameters. You will find it under the Generators menu of the Blendgraph node tree.

Attachments


I have updated Blendgraph with a new node. Pull down the latest from post#1.

The ANT Landscape node. This is the same exact code that runs in the Blender Tool panel. But having the code run in a node allows you to animate the parameters. You will find it under the Generators menu of the Blendgraph node tree.

Attachments


Hi Atom

Yes, it’s kind of strange, I’m not 100% sure what would be causing the difference.
Perhaps in the conversion, the edges are flipped or maybe the normals are inverted.
I’ll have to re-check the blend file to see.

I am aware of the multi-domain technique. In fact, I wrote a short tutorial on it:

http://users.xplornet.com/~gimble/blender/tutorials/fluid/multi_domain/fluid_multi_domain.htm

I’ll have to check out Edi’s approach. Quickly skimming over it, it seems edi is keeping things
organized in scenes which would be a much more refined/elegant method than my simple
method of adding a placeholder mesh object, defining it as a fluid domain,
and then re-assigning the baked fluid cache’s output directory; although I like to use it to
make quick comparisons on various tweaks.

The reason I was using .obj, was that I needed to do some manual editing to remove a
minor isolated wayward splash that was ruining an otherwise decent fluid simulation result.
It’s a good technique to make some minor fixes, but definitely too labor intensive to
“repair” an excessively splashy fluid simulation.

Thanks again for the script (It keeps getting better all the time) and your help. :slight_smile:

Hello, this is an amazing project for motion effects…congrats for bringing it so far.
I just updated an old script from Bassam Kurdali, and thought, you might want to convert some parts from it to your nodes…
it’s here:
http://www.blenderartists.org/forum/showthread.php?330821-updated-Typewriter-script

my ideas:
textfile node, with optional separator argument, and index argument - this way you can have many subtitles in one text file.(a function in the script )
string length node, which can animate length of the string (just out=in[:newlength])
randomize text node with a width parameter.(see the function in the script)

Hi All.

typewriter addon is pretty cool actually.
That would be nice to also have it inside blendgraph.

I take that oportunity to raise one issue (if i tested it right) with blendgraph that does not appear in typewriter:
character spacing: for proportional fonts: letters are not at the right place.
It works like a charm for fixed width fonts, but this is quite restrictive.

thanks,
Benoit.

Well actually thinking about it, it is pretty easy to do the typewritter anim with blendgraph simply by animating a simple character that scales from 0 to 1 in one frame.
the random part might not be possible.
but still there is the character spacing issue.

I have updated Blendgraph with a new node. Pull down the latest from post#1.

The Sphere node. I would like to thank Guy Lateur for providing the non-cube version of the sphere generation code. This node also gives you the option to generate a sphere from a cube mesh with a subsurf modifier added to the object. I have also started adding a Scene input socket and a Name output socket to each generator so you can force a generator to make objects in a specific scene if you like. You will find it under the Generators menu of the Blendgraph node tree.

Attachments


I have updated Blendgraph with a new node. Pull down the latest from post#1.

The File To List node. This node allows you to read in the contents of a text file and display it in a list. This is a first draft at what pildanovak mentioned above, in post #70. There is no delimiter support at this time. Each line of the file is considered an item in the list. You will find it under the Import menu of the Blendgraph node tree.

The file read code inside bg_node_file_to_list.py is quite simple so even newbies should be able to modify this node to handle their custom parsing needs. Modify the line item before you store it in the collection[-1].value.


            if os.path.isfile(self.source_file):
                lines = [line.strip() for line in open(self.source_file, 'r')]
                for item in lines:
                    collection.add()
                    l = len(collection)
                    collection[-1].name= ("%s-%i" % ("Line",l))
                    collection[-1].value = item
                self.outputs["List"].index = 0

In Blendgraph terms the collection, populated by the code above, is the output value of the File To List node. It can be connected directly to system list node.

Attachments


I have updated Blendgraph with a new node. Pull down the latest from post#1.

The Delimit To List node. This node allows you to split a string into a list. So you can take a line from a CSV based file and extract a field. There are a few preset delimiters that you can choose from such as ,-_~ feel free to add more if you have specialized data to read. You will find it under the Words menu of the Blendgraph node tree.

Here you can see Blendgraph extracting the Star Color Index from the HYG Star Database. Leveraging both the File To List and Delimit To List nodes together. The Integer nodes act as selectors in this limited CSV database emulator.

Attachments


Pull down the latest version of the Blendgraph AddOn from post#1.

Sure, the way I see that working is as an alternate layout method for the object repeater. I have placed your code into the Blendgraph bg_node_object_repeater.py. Instead of using a count in the panel, however the node just uses the count from an attached particle system. Instead of using a circle shape, the object repeater can use any mesh that resides in a Group. In the image below I placed a single blue Cylinder in a group.

I included your Circle.py and Math.py into the Blendrgraph AddOn to make this work. I also added some code from GeneratorCircles.py directly into the bg_node_object_repeater.py. So feel free to poke around in that module to see if I got everything right…

Attachments

27_bg_circle_generation.blend (183 KB)


Atom could you provide some example files for your addon?
Fine progress anyway!

Ok I viewed the video on the first post in this thread. First question.
What is missle strike.
Second question.
Atom why when you post a new thread do you assume that everyone that will read it already knows what your plugin does and what it is about?

Blender beginer. Some video tutorials or examples please. Don`t understand how it works

Thanks for the code update, I have dropped your newer code into my Blendgraph folder and it works fine.

Question: could I (eventually) define my own (input/output) types?

Yes but types are limited unless you use String as a universal (which I think Sverchok is doing). Basically whatever bpy.props offers.

Would it be possible to have the node in a ‘not-automatically-updating’ state

Sure, just don’t put the update code in the update event. Instead place it in an operator and display the operator in the draw method.

input: 1 mesh; output: 1 modified mesh. Or, again: input: 1 myMesh; output: 1 other myMesh.

You might want to think of the mesh input as a name of the mesh. This simplifies things. You can use the existing String Node as your input. Another way might be to populate an Enum property with object names. Then there is no input required, only selection from within the node itself.

This is kind of how the Group Or Scene node works. A list gets populated and displayed in the draw method.


    def list_update(self, context):
        if self.ignore_update == False:
            if self.is_updating == False:
                self.update()
    
    def list_populate(self, context):
        result = []
        if context != None:
            result.append(("NONE", "None","none"))
            for grp in bpy.data.groups:
                result.append((grp.name, grp.name, grp.name))
        return result

    group_list = bpy.props.EnumProperty(items=list_populate, update=list_update)

Forget about it RoN43. It seems that Atom like so many blender coders is only interested and discussing how an addon works and how he coded it and how to make the code better. he skipped right over your and my comment/question and gave a long answer to a technical question.

Wrong shaba, if you read the first post you will find a link to the development thread where a lot is explained. And the first thing I explain is that Blendgraph is a name that I am repurposing for the 2.6+ series and has nothing to do with Blendgraph 2.49 which is a non-node based system.

If you check my Vimeo site you will see that is is full of Blender tutorials so I am sorry I don’t have a personalized tutorial for ron43 or shaba posted yet. More tutorials are on the way.

@Shaba & Ron:
Did either of you watch the first tutorial in post #1?
Where are you getting stuck?

Pull down the latest version of the Blendgraph AddOn from post#1.

I’m not too sure about what exactly bpy.props has to offer, neither.

Basic types, check out the API docs.

Do you mean I should turn my object into a string and back

No, the way I do it is to only pass the name of an object then inside the node grab that name and reference it as needed internally.

I may have found a suitable project to get my feet wet into implementing a blendgraph node: a cylindrical version of the ‘Add Mesh -> Extra Objects -> Z Math Surface’ addon

I agree, these kinds of Tool based scripts are ideal for conversion to a Blendgraph node. I went ahead and converted the tool to a node as it stands. Feel free to inspect the code to see how it was done. I actually did a screen record of the entire process to show my workflow for converting an existing tool into a Blendgraph node but it is 51 minutes long. I may try to post it later if you are interested in the process but I am out of HD upload credit on Vimeo for this week so it will have to wait.

This node has very little testing and may crash out if the formula is invalid.

The code can be found in bg_node_z_function_polar_surface.py

Attachments