SAFINA3D

Mudah 4D

Description

Mudah 4D is a plugin for Cinema 4D that aims to simplify the creation and manipulation of objects in your project. It offers a simple and intuitive approach that allows users to easily and quickly create a hierarchy of objects.

For users familiar with web development, note that Mudah 4D is not an implementation of Emmet, but rather a tool created entirely from scratch. However, it shares the same concepts and syntax as Emmet, making it easy to learn.

The plugin allows users to quickly create objects using abbreviations and simple commands. It also supports the use of tags, groups, multiplications, and nomenclatures to facilitate the creation and organization of complex objects.

Mudah 4D

Installation:

Copy/Paste the Mudah 4D folder into the Maxon plugins directory. Default location :

  • Windows : C:\Program Files\MAXON\CINEMA 4D RXX\plugins\
  • Mac OS : /Applications/MAXON/CINEMA 4D RXX/plugins/

How to use ?

Note : For a better user experience, it is highly recommended to set a custom shortcut for the Mudah 4D plugin.


Documentation

BASICS

1. Single object

To create a single object, simply enter its name. (Check out the object list)

cube
Single object

IMPORTANT :
Object names should always be entered as a single word, without spaces, even for names containing multiple words.
Note that there is a more efficient way to avoid writing long names by using abbreviations, which we will cover later in the documentation.

2. Child : >

To create a parent-child relationship, use the > symbol.
You should have the form Parent > Child . This means that you need to enter the name of the parent object, followed by the > symbol, and then the name of the child object.

null>cube
child

We can also chain multiple parent-child relationships by using the > symbol several times in a row.

null>cube>sphere
child

3. Sibling : +

To create a sibling relationship, use the + symbol between object names. The sibling relationship will create objects at the same level. Similarly, you can chain more objects with the + symbol to have more sibling objects.

cube+sphere+cone
sibling

4. Multiplication : *

To create multiple copies of an object, use the * symbol followed by the desired number of copies.

cube*3
multiplication

Note that multiplication is not (yet) commutative, so the order in which you write the object and the number matters. For example, "cube*3" is correct, while "3*cube" is incorrect.

5. Grouping : ( )

To group objects, use parentheses () around the names of the objects you want to group.
Parentheses are used to group objects together so that you can perform specific operations on the entire group, rather than on each individual object.

null>(cube+sphere)
grouping

6. Combining Groups and Multiplication

Parentheses determine the order of operations. They indicate that one operation should be performed before another. In the context of multiplication and groups, they define which group is being multiplied.

null>(cube+sphere)*3
grouping3
(null>(cube+sphere))*3
grouping2

7. Naming : { }

To assign a specific name to an object, enclose the desired name in braces {} immediately following the object's type. For example, to name a cube ‘My Perfect Cube’, the command would be cube{My Perfect Cube}.

cube{My Perfect Cube}
naming_simple

8. Numbering : $

To number a sequence of objects, you can use the $ symbol in combination with multiplication. Insert this symbol into the object name, between curly braces, followed by the number of digits you want to use for the numbering.

cube{Cube $}*5
numbering

The number of $ symbols in the object name will determine the number of digits to use for the numbering and the formatting of the numbers.

cube{Cube $$}*5
numbering2

9. Attributes : [ ]

To set Position, Scale, and Rotation (PSR) attributes for an object, use brackets [] around the attribute and its value after the object name.

9.1. Position

To assign a position to your object, use the p option (for 'position') in brackets. This option allows you to set a vector value (x, y, z) corresponding to the desired position. Here is the general form: objectName[p=(x, y, z)]

cube[p=(100,200,300)]
attr_pos_2

If the components x, y, and z of the vector have the same value, it can be simply written as : objectName[p=(value)].

cube[p=(100)]
attr_pos_1
9.2. Scale

To set a scale for your object, use the s option (which stands for "scale") in brackets. This allows you to establish a vector value (x, y, z) for the scale you want. The typical format is : objectName[s=(x, y, z)]

cube[s=(3, 1, 2)]
attr_sc_2

If the components x, y, and z of the vector have the same value, it can be simply written as : objectName[s=(value)]

cube[s=(3)]
attr_sc_1
9.3. Rotation

To apply a rotation to your object, utilize the ‘r’ option (representing ‘rotation’) in brackets. This enables you to set a vector value (h, p, b) for the desired rotation in degrees. The general form is : objectName[r=(h, p, b)]

cube[r=(30, 45, 20)]
attr_rot_2

If the components x, y, and z of the vector have the same value, it can be simply written as : objectName[s=(value)]

cube[r=(45)]
attr_rot_1
9.4. Combining All Transformations : PSR

To combine all transformations (position, scale, and rotation) for an object, you can use the brackets notation to set their respective values in a single line. The general format is : objectName[p=(x, y, z), s=(x, y, z), r=(x, y, z)]. This allows you to set the position, scale, and rotation of an object simultaneously.

cube[p=(100,200,300),s=(3,1,2),r=(30,45,20)]
attr_xyz

10. Tags : .

You can assign a tag to an object using the notation objectName.tagName.
Insert . (a period) between the object name and the tag name. For example, to add the tag target to an object camera, write: camera.target (Check out the Tag list table)

camera.target
tag1

You can add multiple tags to the same object simultaneously by listing them, separated by periods.

null.target.display.xpresso
tag2

11. Abbreviations

For improved efficiency, you can use abbreviations when object or tag names are too long. Although some abbreviations are predefined, you have the freedom to modify them or create new ones as needed.

Here are a few examples:
  • c instead of cube
  • s instead of sphere
  • cam instead of camera

To access the full list of abbreviations, please consult the configuration files: db_objects.json and db_tags.json, located in the plugin's directory. Alternatively, you can refer to the tables in the documentation for more details.

{
  "cube": 5159,
  "c": "cube",
}

ADVANCED

All data used by Mudah 4D is stored in two files :

  1. db_objects : contains the list of all usable objects
  2. db_tags : contains the list of all usable tags

Both files are stored in JSON format. Each entry is defined by a comma-separated key-value pair.

  • The key is a string (in lowercase), which serves as the name you will use to generate the object or tag in Mudah 4D.
  • The value can have multiple representations, but generally, it is the identifier used in Cinema 4D for the object or tag.
{
  "cube": 5159,
  "sphere": 5160,
}

✅ Please note that you are not required to use the default object names, tags, or abbreviations suggested by the plugin. You are free to fully customize the file or limit it to only a few specific objects.

How to add a new object to the database ?

Before you begin, you will need the new Object ID. To obtain it, follow these steps:

  1. Add your object to the scene and select it.
  2. Open the console window (Shift+F10).
  3. In the Python tab, type : op.GetType()
  4. A number will be displayed; this is your Object ID.
object type

To add a new object to the db_objects.json file, follow these steps:

  • Add a comma at the end of the last existing entry (if it is not already followed by a comma).
  • Insert a new entry following this format "mynewobject": 12345 where 12345 is the unique identifier assigned to the new object.

⚠️IMPORTANT : Here are some rules regarding the name choice :

  • Make sure your name is unique
  • Type your name in quotes ex : "mynewobject"
  • All lowercase
  • Without spaces
{
    ....,
    "mynewobject": 12345,
    ....
}

To further our approach, instead of using the object’s ID as a value, we can assign an object itself. This is useful, for example, for a polygonal object that requires a default Phong tag. Here’s how to implement it :


{
    ....,
    "mynewobject": {"id": 12345, "phong": 40}
}

In this example, the value 40 represents the Phong angle.

Another useful scenario is when we want an object to have default values different from those offered by Cinema 4D. This can be achieved by using the properties property, which takes an object as its value. The keys of this object are the property IDs, and the values are the corresponding values, as shown in the following example:

    ....,
    "roundedcube": {
        "id": 5159,
        "phong": 40,
        "properties" : {
            "ID_BASEOBJECT_REL_POSITION": [100, 200, 300],
            "PRIM_CUBE_DOFILLET": true,
            "PRIM_CUBE_FRAD": 4,
            "PRIM_CUBE_SUBF": 4,
        }
    }

⚠️ Ensure each property is properly separated by a comma to avoid syntax errors..

Note: For the time being, the db_tags.json file accepts only the simple form.

How to add a new abbreviation or alias to the database ?

To add a new abbreviation or alias, follow these simple steps. Let's take the example where we have added a new object to our db_objects.json file :

{
    ....,
    "mynewobject": 12345,
    ....
}

To assign an abbreviation to this object, simply add a new entry to the file. Use the desired abbreviation as the key and the object's name as the value, both as strings. Here is an example :

{
    ....,
    "mno": "mynewobject"
    ....
}

Make sure that your abbreviation is unique within the file.


Object List Table

Cinema 4D Object Object Name to use in Mudah 4D Abbreviation
4-Side fside fsd
Arc arc  
Array array ary
Atom Array atomarray aary
Attractor attractor  
Background background bg
Bend bend bnd
Bezier bezier bz
Boole boole bl
Bulge bulge blg
Camera camera cam
Camera Deformer cameradeformer camd
Capsule capsule cap
Character character chr
Circle circle cir
Cissoid cissoid cid
Cloner cloner cl
Cloud cloud  
Cloud Group cloudgroup  
Cogwheel cogwheel cog
Component component cmp
Connect connect cnct
Cone cone cn
Correction correction corr
CMotion cmotion cmt
Cylinder cylinder cy
Cycloid cycloid cyc
Delay delay dly
Deflector deflector  
Displacer displacer dsp
Disc disc dc
Doodle Object doodleobject  
Environment environment env
Emitter emitter emt
Explosion explosion exp
Explosion FX explosionfx expf
Extrude extrude ext
Falloff falloff  
Feathers feathers  
Figure figure fig
Flower flower flw
Foreground foreground fg
Formula formula frm
Formula Effector formulaeffector frme
Formula Spline formulaspline frms
Fracture fracture fct
Friction friction  
Fur fur  
Gravity gravity  
Group    
Hair hair hr
Helix helix hlx
IGES Curve igescurve  
IGES Group igesgroup  
IGES Mapped Curve igesmappedcurve  
IGES Surface igessurface  
IGES Trimmed Surface igestrimmedsurface  
Inheritance inheritance inh
Instance instance inst
Joint joint jn
Jiggle jiggle jgl
Landscape landscape lnd
Lathe lathe lth
Legacy Polygon Reduction legacypolygonreduction  
Light light l
Loft loft lft
Mesh mesh  
Melt melt mlt
Metaball metaball mb
MoExtrude moextrude mext
MoInstance moinstance minst
Morph morph mph
Matrix matrix mx
n-Side nside  
Null null n
Oil Tank oiltank ot
Physical Sky physicalsky psky
PKHOP pkhop  
Plane plane pl
Plain plain pln
Platonic platonic pc
Point Cache pointcache ptc
PolyFX polyfx pfx
Polygon polygon poly
Profile profile prf
Python Generator pythongenerator pyg
Pyramid pyramid py
Random random rnd
Rectangle rectangle rect
Relief relief rlf
Rotation rotation  
Shatter shatter shtr
Shader shader shd
Shear shear shr
Shrink Wrap shrinkwrap shw
Skin skin  
Sky sky  
Smoothing smoothing smt
Sound sound snd
Spline spline sp
Spline Deformer splinedeformer spd
Spline Effector splineeffector spe
Spline Mask splinemask sm
Spline Rail splinerail spr
Spline Wrap splinewrap spw
Sphere sphere s
Spherify spherify sfy
Squash & Stretch squashnstretch sns
Stage stage stg
Star star str
Step stepeffector  
Subdivision Surface subdivisionsurface ss
Sweep sweep swp
Symmetry symmetry sym
Target target tgt
Taper taper  
Text text txt
Text Spline textspline txtsp
Time time tm
Torus torus tr
Tracer tracer trc
TP Geometry tpgeometry  
Tube tube tb
Turbulence turbulence  
Twist twist  
Vectorizer vectorizer vtz
Volume volume vol
Wind wind wd
Wind Deformer winddeformer wdd
Wrap wrap wp

Tag List Table

Cinema 4D Object Tag Name to use in Mudah 4D Abbreviation
ABCTempExport abctempexport abcexp
Active Morph activemorph amph
Alembic Morph alembicmorph alcm
Alembic Tag alembictag alct
Align to Path aligntopath atp
Align to Spline aligntospline atsp
Annotation annotation ann
Architectural Grass architecturalgrass archg
Bake Material bakematerial bm
Bake Particle bakeparticle bp
Base Morph basemorph bmph
C.O.F.F.E.E. coffee cof
COLLADA14EXPORTTAG strnotfound snf
COLLADA14IMPORTTAG collada14importtag ci14
COLLADA15EXPORTTAG strnotfound2 snf2
COLLADA15IMPORTTAG collada15importtag ci15
Cache Proxy Tag cacheproxytag4 cpt4
Camera Calibrator cameracalibrator cc
Camera Crane cameracrane camc
Camera Morph cameramorph camm
Camera Orientation Constraint cameraorientationconstraint camoc
Character Component charactercomponent chrc
Character Definition characterdefinition chrd
Character Solver charactersolver chrr
Compositing compositing cmg
Connector
Constraint constraint cons
DXFTemp dxftemp dxf
Data Tag datatag dt
Delta Mush deltamush dm
Display display dsp
Doodle Image doodleimage di
Driver driver dvr
Edge Selection edgeselection es
FBXExportReferenceTag fbxexportreferencetag fxrt
Face Group facegroup fg
Hair hair hr
Hair Collider haircollider hrc
Hair Material hairmaterial hrm
Hair Selection hairselection hrs
Hair Tangents hairtangents hrt
Hair Vertex hairvertex hrv
IK ik
IK-Spline ikspline iksp
Light light l
Look at Camera lookatcamera lat
Mask Constraint maskconstraint mcons
Material material mat
Metaball metaball mb
MoGraph Cache mographcache mc
MoGraph Selection mographselection ms
Morph morph2 mph2
Morph Target morphtarget mtgt
Motion Blur motionblur mob
Motion Camera motioncamera moc
Motion Graphics Color Tag motiongraphicscolortag mgct
Motion Graphics Dependance Tag motiongraphicsdependancetag mgdt
Motion Graphics Tracer Tag motiongraphicstracertag mgtt
Motion Tool Data Tag (internal)
Moves Eye moveseyetag mvet
Moves Pose Morph Helper movesposemorphhelper mvpmh
Normal normal nml
Phong phong phg
Pin Material pinmaterial pinm
Planar Constraint planarconstraint plcons
Point Cache pointcache ptc
Point Selection pointselection pts
Polygon Selection polygonselection polys
Pose Morph posemorph pm
Position Constraint positionconstraint pcons
Protection protection prtc
Pyro Emitter
Python python pyt
RS Camera rscamera rscam
RS Object rsobject rso
Render render rndr
Restriction restriction rsct
Rigid Body
Rope splinedynamics spd
Rope Belt hairconstraint hrct
SDS Weight sdsweight sdsw
SaveTemp savetemp st
Sculpt sculpt sct
SculptLinkTag sculptlinktag sctt
Sketch Render sketchrender skr
Sketch Style sketchstyle sks
Stop stop
Sun Expression sun
TUPREFSDUMMY tuprefsdummy td
Target target tgt
Tension tension tns
Track Modifier trackmodifier tm
UVW uvw
User Data userdata ud
Vector Constraint vectorconstraint vcons
Vector Import Info vectorimportinfo vii
Vertex Map vertexmap vm
Vibrate vibrate vib
Visual Selector visualselector vs
Volume Builder Tag volumebuildertag vbt
Voronoi Fracture Tag voronoifracturetag vft
Weight weight wgt
XPresso xpresso xp
XRef xref
Point
Polygon
Tangent
Particle
Segment
Line
Corner
Document
Soft Selection
hair_prefs_hidden hairprefshidden hrp
sds_tag_data sdstagdata sdst