You are on page 1of 31

C4D XPRESSO 1

Introduction to Visual Scripting in C4D

Rigging
1
OBJECTIVES
1. Understand how to work with Xpresso in C4D
2. Able to do simple rigs with Xpresso

Rigging
2
LESSON CONTENT
1. About Xpresso
2. Working with Xpresso
3. Xpresso Nodes
4. User Data

Rigging
ABOUT XPRESSO
What is Xpresso?
● Expressions for C4D
○ A visual form of creating expressions
○ Visually joining data from one property
to another
○ Full node-based workflow

● Relatively easy to learn and use


○ No need for writing code

● Coding knowledge is useful


○ Fundamentals in programming
○ Working with data types
○ Manipulating data
○ Maths operation

Rigging
4
WORKING WITH XPRESSO
How to use Xpresso?
● Working with Xpresso needs an Xpresso Tag
○ The expression set up is stored inside the tag
■ Can have many expressions set up inside the tag
○ The tag can be applied on any object
■ Not necessary to be on the object that is involved in the expression
● An object can have any number of Xpresso tags

Rigging
5
WORKING WITH XPRESSO
Xpresso Editor
● The main window where all the Xpresso set up is done
● 3 areas to use for working
○ X-Pool → Library of available node
○ Work area → Linking nodes
○ Properties panel → Changing node options

X-Pool Work Area Properties Panel

Rigging
6
WORKING WITH XPRESSO
Adding Nodes
● 2 ways
○ Drag and drop from the X-Pool library
○ Right-click to open a menu
■ Can search and filter too

Rigging
7
WORKING WITH XPRESSO
Linking Data in Xpresso
● Node flow
○ Data flows from left to right

● For each node


○ Data input → Left side in blue
○ Data output → Right side in red
○ Each node can take in only 1 input
○ Each output can link to multiple nodes Data flow

Rigging
8
WORKING WITH XPRESSO
Exposing Ports in Xpresso
● Input & Output ports
○ To link data in and out of the node,
have to export the port for linking
● Click on the corners to display all the
available ports
○ Blue corner for inputs
○ Red corner for outputs

● Alternate way
○ Bring the object in as a node
○ Select the object in the object
manager
○ Drag the respective property onto the
object node in the Xpresso editor

Rigging
9
DEMO

Linking Properties
01 Linking Properties.c4d

Rigging
10
WORKING WITH XPRESSO
Data Type in C4D
● C4D have different data types
○ Integer
○ Float (Real)
○ String
○ Matrix
○ Object
○ etc

● When linking, make sure to use the correct data types


● Can see the data type when hovering over the port
○ Bottom info bar
○ Pop up tool tip

Rigging
11
WORKING WITH XPRESSO
Data Type Mismatch
● If the wrong data is linked up
○ The receiving node will turn yellow.
○ The whole Xpresso will stop working!
■ Including the rest that are linked correctly

Rigging
12
XPRESSO NODES
Common Xpresso Nodes
● There’s a lot of available nodes to use in Xpresso
○ For various purposes & needs
○ All available in the X-Pool
○ Including presets

● Most of the time you will use a few common ones


○ Result
○ FloatMath
○ Remark
○ Degree

Rigging
13
XPRESSO NODES
Result Node
● A basic node
● Shows the output of the connected node
● Important to match the display to the incoming data type
○ Eg. Float, Vector, Matrix, etc

Rigging
14
XPRESSO NODES
FloatMath Node
● This node is useful for basic maths calculation
○ Addition, subtraction, multiplication, division
● Only takes in 2 inputs
● Switch data type if needed
○ Usually between float and integer

Rigging
15
DEMO

FloatMath Node
01 xxx.c4d

Rigging
16
XPRESSO NODES
Remark Node
● A simple node for writing comments / documenting the set up
● Can change the title bar colour for easier recognition

Rigging
17
XPRESSO NODES
Degree Node
● Main purpose is to convert Radians to Degrees
○ Only useful for Rotation values

● C4D works in Radians


○ But it’s easier for us to work in Degrees

● So we do calculations in degrees
○ Use the Degree node to convert to Radians for C4D
○ Change to Degree to Radians

Rigging
18
DEMO

Degree Node
02 Degree Node.c4d

Rigging
19
WORKING WITH ANGLES
What are radians?
● A common unit for measuring angles in Maths
● Calculated around 𝛑 (pi)
○ Eg 180° rotation is 1𝛑
○ 360° rotation is 2𝛑
● C4D uses radians internally
○ Degrees is easier to understand
○ So we work in degree and C4D converts

Rigging
20
WORKING WITH ANGLES
Be careful with angles
● If connect angle output to angle input, it will work as expected.
● But let’s say you do manual calculation with non-angle numbers to create an angle
○ Eg Multiply 45 by 2 for 90, expected result of 90° when input to rotation
○ But the output in degrees will be wildly off!
● C4D will take the input number 90, as 90 radians or 5156°!

Rigging
21
WORKING WITH ANGLES
Convert to Degree values to Radians
● Use the Degree node to convert to Radians
○ The results will then be correct

Note the 90 is converted


to 1.571 radians

Rigging
22
USER DATA

23
DEMO

User Data
03 User Controls.c4d

Rigging
24
USER DATA
Controlling Xpresso
● Using Xpresso is more useful when you
can control the expressions with your
own custom data → User data

● A special section on each object


○ Create custom controls
○ Use your own data
○ Link with Xpresso
○ Can be animated

Rigging 25
USER DATA
Common Xpresso Controls
● 2 Common controls
○ Slider
○ Quick Tabs
● Set using the Manage User Data window

Rigging 26
USER DATA
Adding Controls
● Controls can be added to any objects
● Select Object
○ Go to User Data menu
○ Add User Data command

Rigging 27
USER DATA
Controls Settings Layout
● Name
○ Name of the property that appears on the object
● Animatable
○ If the property can be keyframed
● Data Type
○ What data the property will output
○ Float, Integer, String, etc
● Interface
○ What type of control to adjust the data
○ Number input, Slider input, etc
● Unit
○ What unit of data
○ Length, Percentage, Number, etc
● Step
○ What’s the default increment on the control
● Limit Min & Max
○ Cap the value on the control
● Default Value This area previews how the control
○ Set the default number of the control when applied will look like when applied

Rigging 28
USER DATA
Float Control
● Control that outputs a Float (Real) number
● Can be represented in 3 different UI
○ Number, Slider, Slider without Editfield

Float UI Float Slider UI Float Slider without Editfield UI

Rigging 29
USER DATA
Quick Tab Control
● Only applicable with an Integer data output
● Select Quicktab Radio for the interface
○ This creates selectable buttons
○ Only 1 option can be selected
● Manually enter the option in the Cycle Option
○ Need to follow syntax rule
■ Value ; String
■ Output number ; Option Display Name
○ When user select the Option Name
■ The control outputs the number

Rigging 30
THANK YOU!

Rigging 31

You might also like