6 top tips for Xfrog users
Read our tips for a smarter, more reliable workflow in Xfrog, the vegetation-generation application that was given away for free in issue 134 of 3D World magazine.
Recreating natural patterns like branches or the petals of a flower can be a difficult task. Xfrog
for Maya, included on the disc in issue 134 of 3D World magazine, which can be found here, offers a powerful way to simplify it. But because of its flexible,
open approach, the software does not offer a single push-button solution to each task.
New users sometimes struggle with Xfrog because the workflow is different to polygonal or NURBS modelling. Don’t worry: as you become familiar with the software, many approaches to problems will soon make perfect sense. These tips are designed to help you through some of those common problems.
Note: all the work you do on Xfrog objects should be done inside the Xfrog visor: especially if you want to add or delete anything in an Xfrog hierarchy. The left column of the visor shows the content of the scene, similar to the Outliner. The middle column shows Xfrog-related objects only. The right column displays the resulting polySurfaces. If you want to delete or free a component, use the relevant button inside the visor.
Most of these tips work in version 4 of the software, the version included on the disc in issue 134 of 3D World. However, we have also covered some of the new features of Xfrog 5, which can be found on Xfrog Inc’s website. (Version 5 was also used for the following screenshots).
01 Understand branch controls
One of the most common questions asked by new users is, “Where has the top of my tree gone?” Let’s examine why.
Xfrog offers two different types of connections: a multiple link (a parent branch will create many child branches) and a simple link (a single branch component is set on top of another: for example, a bud at the end of a stalk).
Load the Xfrog plug-in, and create two branch components. Name them BranchParent and BranchChild_on_top. Select BranchChild_on_top. [Ctrl]-select BranchParent and press the Head button in the Xfrog4Maya Control Center.
The child branch is assigned as the Head object and should be visible on top of its parent – but it is not. So where the top of our tree? The answer is simple: our BranchChild_on-top object hasn’t been grown yet. In the next tip, we’ll fix that.
02 Adjust growth curves
Select the parent object you created in Tip 01. Click the little plus sign next to the Node Growth parameter. Click again to open the Node Growth control curve. Examine the Point Parameters Visualization: the curve starts with a value of 50% at the left and goes down to 0% at the right. This means that children at the base of the parent receive a growth factor of about 50%, whereas children at the top – like our BranchChild_on_top object – receive none.
Fix this by dragging the rightmost control point on the curve upwards. But growth isn’t the only parameter passed from parent to child objects, so open the Thickness control curve.
Again, the rightmost control point is set to 0%. Drag it up to give the upper child objects thickness.
The top of your tree should now appear.
03 Take control of nodes
You may find that no matter what you do, your trees always look barren at the top. It isn’t aliens stealing the leaves: it’s the way the growth parameters are passed from parent to child objects. Most of the time, you use a Node Growth curve with lower values at the tip. The children make use of a similar curve, so the effect is multiplied down the hierarchy until there are no leaves (or even branches) at the tip.
To fix this, you need to work on Node Density. Think of this as a correction factor. If you don’t get enough child objects because of a Node Growth curve, use roughly the inverse curve for Node Density to counteract the effect.
04 Use the power of expressions
All Xfrog parameters controlled by curves have an expression field. The default expression is id(x) which means the control curve is used directly. Add a Branch component, go to the Thickness parameter and click the red plus icon to create a control curve. Click a second time to open the curve.
Enter sin(u*6.28) into the Expression field. View the result. Now replace the equation with x or id(x). Add control points to the curve to create a shape you like. Replace the equation again with x+sin(u*6.28*10)*0.2.
You are now driving the overall shape from the control curve and adding a sine curve on top.
05 Go further with expressions
In Tip 04, an interesting part of the final equation was u. Think of it as a gradient, returning values between 0 (the base of the branch) and 1 (the top). Two other helpful functions are i, the iteration number (the first child returns i=0, the second i=1, and so on) and n, the total number of children.
Create a Branch component and an Xfrog CurveNurbs. Open the hierarchy of the Branch object and delete the default curve – we want to use the CurveNurbs instead. Select the CurveNurbs object. [Ctrl]-select the Branch and go to the Family settings. Click the red plus icon for the Path Shape parameter. The CurveNurbs is now used to create the path for the branch.
Add a Phyllotaxis component to the scene. Select the Branch, [Ctrl]-select the Phyllotaxis and click the Child button in the Xfrog visor. You should get a spiky shape. Now select the CurveNurbs, click the red plus icon of X-Rotation, click a second time to open the curve and add i/n to the Expression field. The spikes in the upper area will still be straight, but towards the base they should turn upwards. This is because the curvature is controlled by the value of i, which increases as you travel upwards.
Division by n normalises the output. If you want to strengthen the effect, multiply by the control curve: enter the expression x*i/n. Raise at least one of the control points to see the result (above).
06 Create complex variations
Xfrog 4 and higher include the Variation object. If you use a Phyllotaxis to distribute petals, for example, the Variation object could be used to distribute more than one different petal type.
Xfrog 5 offers a new feature: Xfrog HD, which enables you to gain access to a specific child object or group of children. Press the red plus icon of Generate alternate. You just created an alternate control curve. Offset specifies which of the children use the alternate curve; Alternate contains the link to the additional curve. Enter the iteration number of the desired child into Offset, or a enter a comma-separated list (shown above).
Posted on Tuesday, December 28th, 2010 at 9:00 am under Guides, Tutorials. You can subscribe to comments. You can leave a comment, or trackback from your own site.
Tags: 3D World, free 3D software, free software, generation, top tips, tutorial, vegetation, Xfrog















