BarrelShape3D Macro

User avatar
AndrewHazelden
Fusionator
Posts: 1001
Joined: Fri Apr 03, 2015 3:20 pm
Location: West Dover, Nova Scotia, Canada
Been thanked: 93 times
Contact:

BarrelShape3D Macro

#1

Post by AndrewHazelden » Fri Jan 12, 2018 4:17 pm

Overview

BarrelShape3D is Fusion macro based remake of the classic Lightwave "Eagle in a Barrel" geometry (minus the eagle of course which should be connected to the EagleSceneInput input). In Lightwave this model was also known as "idiot.p" and it served a function similar to the Utah teapot model that existed in other 3D packages.

The BarrelShape3D macro is packaged as a GroupOperator which means you can expand the group and tinker with the internal nodes that are used to procedurally create the barrel geometry. You will have to unlock the nodes that you want to customize inside the GroupOperator.
BarrelShape3D-Macro-Wireframe.png
Download
BarrelShape3D.setting
BarrelShape3D.comp
Installation

The "BarrelShape3D.setting" file is the macro. You should place it in your Fusion user prefs Macros:/ folder.

You can then access the macro in Fusion using the Tools > Macro > BarrelShape3D menu item, or the Select Tool window using the "Shift+Space" hotkey.

Example Comp

The "BarrelShape3D.comp" example comp creates a 4x4 grid of barrels. Their position is randomized slightly using the jitter control on the Duplicate3D nodes.
BarrelShape3D-Example-Comp.png
BarrelShape3D-Node-Flow.png
Node Connections

The macro node has two material inputs labelled "BandsMaterialInput", and "PlankMaterialInput". This lets you texture your barrel geometry.

The macro node has a 3D data input connection labelled "EagleSceneInput" that lets you add mesh and other 3D scene data to the BarrelShape3D node. This would allow you to import your own bird of prey model and have it parented inside of the barrel. When you rotate and move the barrel the EagleSceneInput model will be transformed at the same time.

The BarrelShape3D node has a single 3D Data output called "output" that can be connected to Fusion's 3D nodes.

Controls

You can translate the barrel in 3D using the X Offset, Y Offset, and Z Offset sliders.

The Rotation Order control allows you to change the axis priories when a rotation effect is applied. This can help reduce the issue of gimbal lock.

The barrel model is rotated using the X Rotation, Y Rotation, and Z Rotation sliders.

The Scale control allows you to apply a uniform scaling to the model.
BarrelShape3D-Controls.png
You do not have the required permissions to view the files attached to this post.

User avatar
Midgardsormr
Fusionista
Posts: 745
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 76 times
Contact:

Re: BarrelShape3D Macro

#2

Post by Midgardsormr » Fri Jan 12, 2018 6:19 pm

OMG, you're actually doing that!? Hilarious!

User avatar
SecondMan
Site Admin
Posts: 2707
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 104 times
Contact:

Re: BarrelShape3D Macro

#3

Post by SecondMan » Fri Jan 12, 2018 6:56 pm

But where is the eagle? :)

User avatar
theotheo
Fusionista
Posts: 250
Joined: Thu Aug 07, 2014 8:35 am
Been thanked: 50 times

Re: BarrelShape3D Macro

#4

Post by theotheo » Sat Jan 13, 2018 2:06 am

This is truly an example on how Fusion is the industry leader! Taking novel concepts and modernizing it for production! Thanks Andrew!

PS. I HOPE THIS BECOMES A NATIVE TOOL IN Fusion 11!

User avatar
AndrewHazelden
Fusionator
Posts: 1001
Joined: Fri Apr 03, 2015 3:20 pm
Location: West Dover, Nova Scotia, Canada
Been thanked: 93 times
Contact:

EagleSceneInput Support Added

#5

Post by AndrewHazelden » Sat Jan 13, 2018 4:35 am

SecondMan wrote:
Fri Jan 12, 2018 6:56 pm
But where is the eagle? :)
I added a new EagleSceneInput connection to the BarrelShape3D macro. This essential feature is available if you download the updated version of the macro. ;)

The EagleSceneInput input allows a bird of prey model to be connected as 3D Data which is then parented to the Barrel mesh object. When you transform the BarrelShape3D using the built-in Offset, Rotate, and Scale controls your eagle mesh will come along for the ride.
EagleSceneInput Connection.png
You do not have the required permissions to view the files attached to this post.

User avatar
SirEdric
Fusionator
Posts: 1056
Joined: Tue Aug 05, 2014 10:04 am
Been thanked: 84 times
Contact:

Re: BarrelShape3D Macro

#6

Post by SirEdric » Sat Jan 13, 2018 6:27 am

Ha! This looks like fun!
A BarrelMacro Contest...:-)

Not *really* a macro, but you can control many aspects from the BarrelMain User-Tab.
Barrel.png

Have Phun.

Eric.
You do not have the required permissions to view the files attached to this post.

User avatar
AndrewHazelden
Fusionator
Posts: 1001
Joined: Fri Apr 03, 2015 3:20 pm
Location: West Dover, Nova Scotia, Canada
Been thanked: 93 times
Contact:

BarrelShape3D Parametric Modelling Breakdown

#7

Post by AndrewHazelden » Sat Jan 13, 2018 6:43 am

Step by Step Modeling Explanation

Here is a step by step breakdown of the parametric modeling stages used to create the BarrelShape3D mesh.

Step 1. PlankShape3D
1-PlankShape3D1.png
A Shape3D node named "PlankShape3D" is used to create the initial wooden board shape. This is done using the "Cube" shape with a Width of 0.85, a Height of 4.5, and a Depth of 0.1. The subdivision settings are set to Subdivision Width 2, Subdivision Height, 7, Subdivision Depth 1.

The X Offset is translated -1.2. The Y Rotation is set to 90.

The material is set to a brown color by setting the Diffuse Color to Red 0.48, Green 0.4, Blue 0.27. The Specular Intensity is set to 0.

Step 2. TopBender3D
2-TopBender3D.png
A Bender3D node named "TopBender3D" is connected to the "PlankShape3D" node. The TopBender3D node is set to a Bender Type of "Taper". This node is used to make the top of the plank pointy. The Amount is set to 1.317. The Axis is set to Y. The Center is set to 0.162. The Range Min setting is changed to 0.78.

Step 3. BottomBender3D
3-BottomBender3D.png
A Bender3D node named "BottomBender3D" is connected to the "TopBender3D" node. The BottomBender3D node is set to a Bender Type of "Taper". This node is used to make the botom of the plank pointy.

The Amount is set to -1.317 using the expression "TopBender3D.Amount*-1".

Note: In an expression a positive value can be flipped into a negative value by multiplying the number by minus 1. That is what the '*-1" part of the Amount expression does.

The Axis is set to Y. The Center is set to 0.838 using the expression "1-TopBender3D.Center". The Range Max setting is changed to 0.22 using the expression "1-TopBender3D.RangeMin".

Step 4. TopCurveBender
4-TopCurveBender.png
A Bender3D node named "TopCurveBender" is connected to the "BottomBender3D" node. The TopCurveBender node is set to a Bender Type of "Bend". This node is going to be used to curve the top of the plank inwards. This will allow all of the plank boards to meet at the top when we duplicate them later on in step 8.

The Amount is set to 0.376. The Axis is set to Y. The Angle is set to 90. The Center is set to 1.1. The Range Min setting is changed to 0.6.

This curve bending approach also has the side effect of shifting the rotational placement of the mesh in the scene.

Step 5. TopRotateLevelTransform3D
5-TopRotateLevelTransform3D.png
A Transform3D node named "TopRotateLevelTransform3D" is connected to the "TopCurveBender" node. The Transform3D node is used to rotate the plank back to a vertical aligned orientation. The Bend setting in a TopCurveBender node had the side effect of shifted the orientation of the board and we have just moved it back into place.

This rotation correction is done with a Z Rotation of -58.9. An X Offset of -0.443 is used to re-center the placement of the board, too.

Step 6. BotomCurveBender3D
6-BotomCurveBender3D.png
A Bender3D node named "BotomCurveBender3D" is connected to the "TopRotateLevelTransform3D" node. The BotomCurveBender3D node is set to a Bender Type of "Bend". This node is going to be used to curve the bottom of the plank inwards. This will allow all of the plank boards to meet at the bottom when we duplicate them later on in step 8.

The Amount is set to -0.376 using the expression "TopCurveBender.Amount*-1". The Axis is set to Y. The Angle is set to -90 using the expression "TopCurveBender.Angle*-1". The Center is set to 1. The Range Max setting is changed to 0.4 using the expression "1-TopCurveBender.RangeMin".

This curve bending approach also has the side effect of shifting the rotational placement of the mesh in the scene.

Step 7. ShiftOriginTransform3D
7-ShiftOriginTransform3D.png
A Transform3D node named "ShiftOriginTransform3D" is connected to the "BotomCurveBender3D" node. The Transform3D node is used to rotate the plank back to a vertical aligned orientation.

This rotation correction is done with a Z Rotation of -1.8. An X Offset of -1.724, and a Y Offset of -0.337 is used to re-center the placement of the board, too.

Step 8. PlankDuplicate3D
8-PlankDuplicate3D.png
A Duplicate3D node named "PlankDuplicate3D" is connected to the "ShiftOriginTransform3D" node. The Duplicate3D node is used to create and place the 10 radially copied plank boards in a circular layout that forms the shape of the wooden barrel.

First Copy is set to 0. Last Copy is set to 10.

Y Rotation is set to 36.

The combination of the Last Copy and Y Rotation settings in the Duplicate3D node results in 10 boards being added to the scene with an additional 36° of rotation added to each board as they are duplicated.

If you look at the top and bottom parts of the duplicated planks you will finally see why the tops and bottoms of the boards needed to be tapered and pointy. Each of the curved boards neatly come together and meet at the top and bottom edges of the barrel and the planks are positioned without any overlapping and intersected geometry.

Step 9. TopBandShape3D
9-TopBandShape3D.png
A Shape3D node named "TopBandShape3D" is used to create the initial upper metal circular band shape that will wrap around the barrel to bind the planks in place. This is done using the "Torus" shape with a Radius of 1.75, a Section of 0.04. The subdivision settings are set to Subdivision Level (Base) 10, Subdivision Level (Height) 8.

The Y Offset is translated to 0.675. The Y Rotation is set to 17.3.

The Scale Lock X/Y/Z checkbox is unchecked to allow for non-uniform scaling. The Y Scale is set to 5.

The material is set to a light grey color by setting the Diffuse Color to Red 0.89, Green 0.89, Blue 0.89. The Specular Intensity is set to 0.

TopBandBender3D
10-TopBandBender3D.png
Step 10. A Bender3D node named "TopBandBender3D" is used taper the upper metal circular band shape so it contours along the side wall of the the barrel to bind the top part of the planks in place. This node is connected to TopBandShape3D.

The TopBandBender3D node is set to a Bender Type of "Taper". This node is used to make the top of the metal band curve inwards. The Amount is set to 0.025. The Axis is set to Y. The Center is set to 0.5.

Step 11. BandDuplicate3D
11-BandDuplicate3D.png
A Duplicate3D node named "BandDuplicate3D" is used to create the initial lower metal circular band shape that will wrap around the barrel to help bind the planks in place. This node is connected to the TopBandShape3D node.

First Copy is set to 1. Last Copy is set to 2.

Y Offset is set to -1.87.

Step 12. BottomBandBender3D
12-BottomBandBender3D.png
A Bender3D node named "BottomBandBender3D" is used taper the lower metal circular band shape so it contours along the side wall of the the barrel to bind the lower part of the planks in place. This node is connected to BandDuplicate3D.

The BottomBandBender3D node is set to a Bender Type of "Taper". This node is used to make the bottom of the metal band curve inwards.

The Amount is set to -0.025 using the expression "TopBandBender3D.Amount*-1". The Axis is set to Y. The Center is set to 1.

The Range Max setting is changed to 1 using the expression "1-TopBandBender3D.RangeMin".

Step 13. BandMerge3D
13-BandMerge3D.png
A Merge3D node named "BandMerge3D" is used to combine the two metal bands and the duplicated planks into one model.

The PlankDuplicate3D node is connected to the BandMerge3D.SceneInput1 connection.

The BottomBandBender3D node is connected to the BandMerge3D.SceneInput2 connection.

The TopBandBender3D node is connected to the BandMerge3D.SceneInput3 connection.

Step 14. OriginTransform3D
14-OriginTransform3D.png
Inside the BarrelShape3D macro an addition pair of Translate3D nodes were added.

The "OriginTransform3D" node is used to re-center the barrel model on the grid origin in the scene. This node has a Y Offset of 2.

A final "BarrelTransform3D" node is added to allow the end user to re-position the barrel. This node's transform, rotation, and scale settings were exposed in the Macro node's GUI controls using the following .setting file based code entry:

Code: Select all

				Input4 = InstanceInput {
					SourceOp = "BarrelTransform3D",
					Source = "Transform3DOp.Translate.X",
					MinScale = -12,
					MaxScale = 12,
					Default = 0,
				},
				Input5 = InstanceInput {
					SourceOp = "BarrelTransform3D",
					Source = "Transform3DOp.Translate.Y",
					MinScale = -12,
					MaxScale = 12,
					Default = 0,
				},
				Input6 = InstanceInput {
					SourceOp = "BarrelTransform3D",
					Source = "Transform3DOp.Translate.Z",
					MinScale = -12,
					MaxScale = 12,
					Default = 0,
				},
				Input7 = InstanceInput {
					SourceOp = "BarrelTransform3D",
					Source = "Transform3DOp.Rotate.RotOrder",
				},
				Input8 = InstanceInput {
					SourceOp = "BarrelTransform3D",
					Source = "Transform3DOp.Rotate.X",
					MinScale = -360,
					MaxScale = 360,
					Default = 0,
				},
				Input9 = InstanceInput {
					SourceOp = "BarrelTransform3D",
					Source = "Transform3DOp.Rotate.Y",
					MinScale = -360,
					MaxScale = 360,
					Default = 0,
				},
				Input10 = InstanceInput {
					SourceOp = "BarrelTransform3D",
					Source = "Transform3DOp.Rotate.Z",
					MinScale = -360,
					MaxScale = 360,
					Default = 0,
				},
				Input11 = InstanceInput {
					SourceOp = "BarrelTransform3D",
					Source = "Transform3DOp.Scale.X",
					Name = "Scale",
					Default = 1,
				}
Node Flow View
0-BarrelShape3D-GroupOperator.png
You can view the individual nodes in the BarrelShape3D macro by expanding the BarrelShape3D group. This gives you access to all of the nodes and settings inside the macro. To edit the values on the nodes you need to select the individual node and click the "unlock" padlock icon in the tools view.
You do not have the required permissions to view the files attached to this post.

User avatar
AndrewHazelden
Fusionator
Posts: 1001
Joined: Fri Apr 03, 2015 3:20 pm
Location: West Dover, Nova Scotia, Canada
Been thanked: 93 times
Contact:

Re: BarrelShape3D Macro

#8

Post by AndrewHazelden » Sat Jan 13, 2018 6:48 am

SirEdric wrote:
Sat Jan 13, 2018 6:27 am
Ha! This looks like fun!
A BarrelMacro Contest...:-)

Not *really* a macro, but you can control many aspects from the BarrelMain User-Tab.
Nice! It looks like you had a chance to get super fancy with the CustomVertex3D based math for the SE_BarrelMacro. :buttrock:

User avatar
Dunn
Moderator
Posts: 465
Joined: Mon Aug 04, 2014 4:27 am
Location: Hamburg, Germany
Been thanked: 16 times
Contact:

Re: BarrelShape3D Macro

#9

Post by Dunn » Sat Jan 13, 2018 8:40 am

Oh man, you really did it ! Crazy ! You Rock ! :bowdown:

User avatar
SirEdric
Fusionator
Posts: 1056
Joined: Tue Aug 05, 2014 10:04 am
Been thanked: 84 times
Contact:

Re: BarrelShape3D Macro

#10

Post by SirEdric » Sat Jan 13, 2018 9:22 am

Some Bugfixes, Improvements and lower PolyCount...:-)
SE_BarrelMacro03.comp
You do not have the required permissions to view the files attached to this post.

User avatar
AndrewHazelden
Fusionator
Posts: 1001
Joined: Fri Apr 03, 2015 3:20 pm
Location: West Dover, Nova Scotia, Canada
Been thanked: 93 times
Contact:

Re: BarrelShape3D Macro

#11

Post by AndrewHazelden » Fri Feb 02, 2018 2:49 am

BarrelShape3D is now available in Reactor. You can find it in the Reactor "Tools/3D" category.

After the "BarrelShape3D" macro is installed you can access it using the "Tools > 3D > BarrelShape3D" menu entry in Fusion. This Tools > 3D menu entry was made possible by the Reactor atom for BarrelShape3D adding a menu line in the .fu file.

BarrelShape3D Menu Screenshot
Tools-3D-BarrelShape3D Menu.png
How was the Menu Item Created?

Having the ability to put your Macro into the main Tools menu sections in Fusion is something I've wanted to do for a while and means you no longer have to go into the typical "Tools > Macros > ..." menu section which gets confusing if you don't remember later on if a tool you want to use is a Plugin, Fuse, or Macro. :)

This is what the .fu based menu entry looks like if you want to be able to do the same thing for your own macros:
Code: [Select all] [Expand/Collapse] [Download] (BarrelShape3D_menus.fu)
  1. --[[--
  2. com.AndrewHazelden.BarrelShape3D Menu Entries
  3. v1.0 2018-02-03
  4. --]]--
  5. {
  6.     Menus
  7.     {
  8.         Target = "ChildFrame",
  9.  
  10.         After "Tools\\3D\\Shape 3D"
  11.         {
  12.             "AddSetting{Name = 'BarrelShape3D', filename = 'Macros:/3D/BarrelShape3D.setting'}",
  13.         },
  14.     },
  15. }
In this .fu example the line following line of code tells Fusion to place the BarrelShape3D node in the menu right after the Background node in the Tools > 3D menu section:

Code: Select all

After "Tools\\3D\\Shape 3D"
The "AddSetting{}" part of the code creates the menu entry that will help up add a Fusion macro to the Flow view:

Code: Select all

	"AddSetting{Name = 'BarrelShape3D', filename = 'Macros:/3D/BarrelShape3D.setting'}",
	
The "Name = " gives Fusion a hint that we want to have a custom name for the menu entry.

The "Filename = " entry is used to define the PathMap location on disk where the macro file is located.

You can add multiple menu entries in the same .fu file just by adding more "AddSetting{}" lines. Make sure to add a trailing comma on each line as a .fu file is read as if it was a Lua table. :)
You do not have the required permissions to view the files attached to this post.