N.B. This post is now obsolete because new version of Octane Render now supports X-Particles colors.

I have been wondering that is there a way to transfer color information from X-Particles to Octane? Well, today I started to messing around and I found some kind of solution or some kind of hack.

First thing to do is generate geometry to the particles. To do that I used polygon object that contains only single vertex point. Polygon object is put under the xpGenerator that generates vertex points to particles. To hook up xpGenerator into the MoGraph cloner xpGenerator need to be put under the connect object. Remember to turn welding off. Connect object is put to cloners object slot. Now we can clones to particles.

Next thing to do is the actual color data transformation.  I used python effector (MoGraph) to transfer color data from particles to clones. I added support for the particle rotation. With this python effector this setup works already perfectly in C4D’s own render engine but for some weird reason it does not work Octane Render.

import c4d, xparticles
from c4d.modules import mograph as mo
from c4d import utils as u

def main():
    md = mo.GeGetMoData(op) # Get MoData
    if md is None: return False # If there is no MoData, stop processing
    emitter = xparticles.ToEmitter(op[c4d.ID_USERDATA,1]) # Xpemitter link (user data)
    cnt = md.GetCount() # Get clone count
    carr = md.GetArray(c4d.MODATA_COLOR) # Get MoData color
    marr = md.GetArray(c4d.MODATA_MATRIX) # Get MoData matrix
    fall = md.GetFalloffs() # Get falloffs
    for i in reversed(xrange(0, cnt)): # Iterate through clones
        m = marr[i] # Get clone's matrix
        particle = emitter.GetParticle(i) # Get particle
        carr[i] = particle.GetColor() # Get particle color
        if particle.GetRotation() != None: # If particle is rotating
            hpb = particle.GetRotation() # Get particle rotation
            marr[i] = marr[i] * u.HPBToMatrix(hpb) # Set clone rotation to match particle rotation
    md.SetArray(c4d.MODATA_COLOR, carr, True) # Set MoData color
    md.SetArray(c4d.MODATA_MATRIX, marr, True) # Set MoData matrix
    return True # Everyting is fine

To get it work in Octane I had to add empty shader effector with blending mode set to multiply or divide. Empty means that there is no any shader in shader effector, you only need to chance blending mode. Last thing to do to get this setup to work is to add material with MoGraph color shader to the cloner. Now everything should be working fine.

There’s one drawback with this hack and it’s that the colors are a little bit off from the original in the render but I can live with that. Note that X-Particles own material doesn’t work since it’s calculated separately in rendering process. Another drawback is that this setup gets really slow when you have a thousands of particles. But cool thing is that you can use MoGraph effectors with particles.


Cinema 4D, Experimental, MoGraph, Octane, Python, X-Particles

I saw a tweet from @der_flow_ where he has hooked TurbulenceFD into MoGraph weight tag. Of course, I wanted to test that too, so I built my own version and here is the result.

Xpresso setup iterates through clones and checks what is TFD container’s temperature in that specific position where the clone is. Temperature data is then range mapped to two different MoGraph weightmaps: mw-size and mw-color. Then those two weightmaps are used in effectors selection slots to scale and colorize clones.

Setup can get really slow but setup works also with render instances and multi-instances, even though only normal instance mode shows colors in view port.

Updated 25/03/2019


Cinema 4D, MoGraph, TurbulenceFD, Xpresso

I build my current desktop pc in 2012. It’s pretty old but still efficient. Only things that I have updated are graphic cards and SSDs. I mainly use my desktop computer but when I’m traveling I use 13″ MacBook Pro (mid 2014).

My computer’s specifications:
Operating System: Windows 7 Ultimate 64-bit
CPU: Intel i7 3930K @ 3.20 GHz Sandy Bridge-E 32nm
RAM: 32,0 DDR3 @ 1333 MHz
MOBO: Asus P9X79 Deluxe LGA2011
GPU: 2x Nvidia GeForce GTX 980
Storage: 2x Samsung 850 EVO 518GB SSD, 14TB Sata III HDD
PSU: Corsair AX850 – 80 Plus Gold
Case: Cooler Master Cosmos 1000
Fan: Noctua NH-D14

Other stuff on my table:
Sound Card: RME Babyface Pro
DAC: Cambridge Audio DacMagic Plus
Microphone: Shure SM7B
Headphones: Sony MDR-7506
Speakers: Genelec G Ones
Display: 2x Dell UltraSharp U2711
Pen Tablet: Wacom Intuos 3 Medium
Mouse: Logitech G900
Keyboard: Logitech K800

General Talk

This is my very first post on this my own little blog. I’m gonna post here all kind of stuff related to my interests like motion, 3D, coding, music and life. Hopefully you have a fun time with my blog and find something interesting to read. About myself, my name is Arttu Rautio. I’m a 26-year-old guy from Finland. Currently I’m working at Cocoa as post-production generalistic but my main focus is in 3D.

Everything you can find here on my blog is free to use, modify and share. You don’t have to ask any permissions and you don’t have to give a credits. It would be nice, but you don’t have to.

If you have anything to ask you can find me on Twitter (@aturtur).

Have fun!

General Talk