[AddOn] bTrace 1.1 - updated 03-21-12

Btrace is now updated to version 1.1 [03-21-12]! The new update includes a new GUI that cleans up the interface a bit, as well as two fun new tools.

Here’s an overview of the various features, sorry for my neurotic mouse cursor. :slight_smile:

A big chage with this version was how GUI is setup, which I’ve found to be much nicer to work with.


The two new tools are Mesh Follow and Color Blender. Mesh Follow creates a curve from that animated path of either Verts/Edges/Faces or object origin. Color Blender adds random color and color animation tools.


Currently Btrace is now part of the Addons_contrib which get included in all graphicall.org build (but not the release yet). So the plugin is updated via the blender SVN located here: https://svn.blender.org/svnroot/bf-extensions/contrib/py/scripts/addons/btrace/

I have also upload a blend file that I’ve used to test the various features (Different scenes for the different scenarios). Download that here: http://www.thewooddesign.com/blender/btrace_testfile.blend

Bug reports are appreciated!

Previous Info
The purpose of this script is to add tools that are similar to C4D Tracer. These type of tools will come in particularly handy for motion graphic artists.

The six main tools (Object Trace, Object Connect, Mesh Follow, Handwriting, Particle Trace, Particle Connect) all share common settings for the most part. Each tool creates a curve as the end result. The settings for the curve created can be setup under the Curves Settings button.

The tools have access to a few other features. All of them have access to the grow curve animation tool which animates the curve radius. As well as the Color Blender tool.

A quick explanation:
Brush Trace: Creates a curve by joining points of a mesh in a continuous manner or by all edges. Options to modulate the curves radius or add distortion to mesh before converting.

Objects Connect: Join selected objects with a curve and add hooks to each node.
Particle Trace: Creates a curve from each particle of a system. Keeping particle amount under 250 will make this run faster.
Particle Connect: Connects each particle of a system with a continuous curve.

Mesh Follow: Creates curve from animated mesh object. Following the path of either the verts, edges or faces, and also the option to follow the object’s center point.

Handwriting Tool: And updated version of the Handwriting tool from liero and Meta-Androcto, creates an animated curve using the grease pencil.
Grow Curve Animation: Animate the radius of a curve over time. Can be run alone on a curve object, or run with the tools above.
F-Curve Noise: Quick link to add a F-Curve modifier to an object.

Each script has a number of different options which can be used to create some very interesting effects. The video above explains eachl, but highly encourage you to play around with them. These are Grow Animation, Color Blender and F-Curve Noise.

A lot of these scripts are based off the work from liero and included with his permission, who I have to give most the credit for the logic behind some of the tools. Liero, you rule and thank you. Also a lot of thanks to Mackraken who gave me a lot of great advice. Meta-Androcto and Atom have also given great feedback and help when needed.

Lastly, any suggestions/bugs/feedback would be very much welcomed. I’m still doing my best to learn python so I can’t guarantee everything works perfect on this. Hope everyone enjoys!

Attachments


Nice job, thanks for putting this up! Only functionality I miss is the option to add a bit of noise to geometry on first script, as this would return different results on each try. Nice addition the add keyframe option on last script, but maybe it should only work if no f-curve available…? Remember to empathize this works on many objects at the same time.
Will give a deeper look at bpy ui code, thanks again.

Great contribution.

Thanks liero and crazycourier for this.

It is a nice script. I am wondering if it could be made more C4D like by running it in a frameChange event instead of the tool box? What makes the tracer so cool, in Cinema 4D, is that the tracers leave trails, then disappear.

I just updated the script at the link in the first post.

@liero,
I added an option to adjust the noise setting on the Brush Trace. The keyframe option is kinda bugging me, I’d rather have it just check to see if a keyframe exists and add one if it doesn’t. I couldn’t really figure out how to make it check if the keyframe exists. Anyone have any ideas of how to do that?

@Atom,
I’d love to figure out how to do that, do you have any example of how I might achieve that? (edit: I just found your Camera Plus Addon, as well as the Parametric Tree addon which give me something to pick apart!). I know Crouch’s motion trail gives the ability to do light streaks. I’ll definitely be going in over my head, but I might look into that a little more.

I changed the GUI on the toolbar, I did have the bevel settings on the same row but I think it just squished them together too much. Any feedback on the GUI would be appreciated.


Things I’m thinking of trying to add:
-F-Curve noise: Logic to check if keyframe exists and add one if it doesn’t. Remove checkbox

-Add spline option to both multi-object trace/particle trace
-Add handle option for particle trace

-Add “growing vines” hook control option (like this:http://www.youtube.com/watch?v=2G1v3C4f1mw). That might be a bit over my head, any advice welcome.

-Look into streak effects (http://bit.ly/gEQAqm)

I’m a complete programming novice, so any hints or tips are much appreciated!

Wow this is superb!!

Nice job for a first script!

I was thinking along the animated hook line as well. Each one of the curves created from each particle would need another 6 point curve to act as a profile for the first curve. Then 2 hooks would be applied to that profile. Hook #1 links to point 2&3 of the profile and Hook #2 links to points 4&5 of the profile. The slope between points 2&3 and 4&5 would represent the shape of the final trail. Then the hooks are animated based upon the life of the particle along with a lag time parameter like C4D has.

Just installed 2.57, doesn’t seem to work for me, anyone else get it working? Probably user error.

@Crazycourier, from a UI perspective, I’d add tildes (I think their called) to each section, chances are you’re not going to use all options at one so it would be nice to collapse the one’s your not using, since it takes up quite a bit of room in the tools palette . I’m working mainly with the multi-object trace right now. It would also be nice to have a dynamic bevel depth.

@Atom, great ideas as always man.

Thanks again Crazycourier and liero.

Just updated the script at the link in the first post. I made each tool have it’s own folding panel. I had already moved the F-curve tool to it’s own section, but I think it does make a bit nicer having each on it’s own.

@blendswap, I just compiled a few minutes ago with Win64 2.57 r36147 and it worked no problems. An object needs to be selected in the 3d view for the tools to show up. Also, I’ve been just opening the script in a text window and running it there(I don’t have it installed as an addon). Which way are you using it? Try running it via the text window and see if you have the same problem.

@Atom, thanks for that! That gives me a great place to start. Also I was looking at your frameChange scripts. On the parametric tree script, there’s the section where code gets written to a new text window and activated on the frameChange. Sorry if this obvious. That code that get’s written is the original functions for the tree script, around the code is your frameChange frame work. Correct?

Also, from a workflow standpoint. Would it be better to tackle this by starting with the functionality of adding the hooks and profile curve. Or should I implement the frameChange framework first, then add the rest of the functionality? I haven’t looked too much into it yet, so I don’t know how difficult it’s going to be. And I’m new at this so I’m somewhat terrified/excited to see if I can figure this out!

Lastly, do the names of each of these make sense? I thought “Multi-object trace” was somewhat un-sexy, but it made sense.

Particle Trace: Creates a curve from each particle of a system. Keeping particle amount under 250 will make this run faster.

Sorry user error, it’s working fine now. Like the folding panels. Again I would like to suggest a dynamic Bevel Depth for the Multi-object trace. Right now if you connect the dots and the size of the trace isn’t right, you then have to change the bevel depth and connect the dots again, which doesn’t correct the first instance, it adds a whole new instance of tracer. If you were not aware of this its quite possible you could have 4-5 instances of tracer before you get the right size. So it would be nice if it was a dynamic edit that modified the current version of tracer instead of creating another one. Just my thoughts. Great stuff.

@blendswap,
I imagine it would be possible to adjust it dynamically. But on the same token, you can also just adjust the bevel depth in the curves panel once it’s created. There’s not really a need to go in and recreate it, the same settings are available to the curve itself in the curve panel once it’s been created (along with bevel object and all the other goodies).

I’m going to try focus on the trying to get Atom’s suggestions working, that might smoke all my brain power for some time!

@superhero, changed that description

@crazycourier: The code that gets written to the new text window is what the driver calls when the frame changes or Blender issues a refresh (sometimes multiple events occur on the same frame - Try dragging the console across the interface).

Correct, it is the main ToolBox generation code. The only thing that needs converted is that the parameters are stored as custom properties inside the object that the frame change addon creates. So pick a new name, instead of mt_frame_change. The frameRefresh relays those properties to the adapted ToolBox version of the code.

Often, when I am developing I run the main frame change code manually by putting a call to frameRefesh at the bottom of the script. Then I can just code as normal pressing ALT-P to test as I go. Once you have that code working, copy it back in to the code section of the AddOn and it should be good to go.

Here is what I have so far for the profile/taper curve.


import bpy
from mathutils import Vector
  
def makeTaperCurve (passedTaperName):
    cu_taper = bpy.data.curves.new("cu_"+passedTaperName,'CURVE')
    cu_taper.dimensions = '2D'
    spline = cu_taper.splines.new('BEZIER')
    spline.bezier_points.add(5)
    taper = bpy.data.objects.new(passedTaperName,cu_taper)
    bpy.data.scenes[0].objects.link(taper)

    #Let's create six points in this curve.
    for n in range(6):
        p = spline.bezier_points[n]
        if n == 0:myLocation = Vector((0.0,0.0,0.0))
        
        # Slope defines shape.
        if n == 1:myLocation = Vector((0.1,0.0,0.0)) # Hook #1 here.
        if n == 2:myLocation = Vector((0.2,1.0,0.0)) # Hook #1 here.
        
        # Slope defines shape.
        if n == 3:myLocation = Vector((0.8,1.0,0.0)) # Hook #2 here.
        if n == 4:myLocation = Vector((0.9,0.0,0.0)) # Hook #2 here.
        
        if n == 5:myLocation = Vector((1.0,0.0,0.0))
        p.co = myLocation
        p.handle_right_type='VECTOR'
        p.handle_left_type='VECTOR'

makeTaperCurve("taper.000")

Here is an example BLEND that demonstrates how I was imagining the trail/tail option might work.
25_ras_tracer_like_1a.blend (429 KB)

amazing. Testing. Enjoying.

Just updated the script in first post with a few fixes. Thanks to liero for that!

  • Undo now works as it should on each of the tools
  • noise option under the brush trace now works as it should. I set the default to 0.00, but you should definitely crank it up to see the effects of it.
  • small UI changed, since the tools are in individual panels now I removed the redundant title with the icon.

@Atom, Awesome man! I’m playing around with your code right now, your example blend was definitely better than the one I was working with. I’m sure I’ll have questions for you soon. I really appreciate your help!

Also, I’ve been looking into how to make bezier options dynamic as per blendswap’s suggestion. Any hints on that? I’m guessing I have to create a function separate from my classes that watches those properties if a curve is currently selected. As it is now, the properties are only checked if the button is pushed. Am I think correctly?

I’m plugging away at this in-between trying to actually get some real work done! Hopefully I can get some more time to play a bit more. Any comments/suggestions/contributions welcome!

thankyou!

works fine for me :slight_smile:

just give an error when I select “apply to copy of object”

:wink:

very cool
thanks!

@MmAaXx,
What error does it give you? What version of blender also (This has only been tested on the latest 2.57 builds).

the error appen just if I’m in editmode

http://img815.imageshack.us/img815/2599/errp.jpg

thankyou! :smiley: