VPhairtrace
Attributes
-
ENGLISH NAME : HairTracer
-
NAME : VPhairtrace
-
INCLUDE : VPbase
-
PATH : hair/description/vphairtrace.res
-
PLUGIN : hair
-
MAXON online help (may not exist): VPHAIRTRACE
Elements
Example Code
The following code does not use the correct values when setting the data. You should check directly in C4D for the correct values that you should use in place of the ones that are shown.
This code is just to show you how to access the values for getting and setting the parameters.
Python
import c4d
from c4d import gui
def main():
videoPost = c4d.BaseVideoPost(c4d.VPhairtrace)
#You can set parameters two different ways.
#First way
videoPost[c4d.HAIR_RENDER_PHYSICAL_CACHE_PRIMARY] = True
videoPost[c4d.HAIR_RENDER_PHYSICAL_CACHE_SECONDARY] = True
videoPost[c4d.HAIR_RENDER_PHYSICAL_CACHE_BLURRY] = True
videoPost[c4d.HAIR_RENDER_PHYSICAL_CACHE_GI] = True
videoPost[c4d.HAIR_RENDER_PHYSICAL_GI] = c4d.HAIR_RENDER_PHYSICAL_GI_PIXEL
videoPost[c4d.HAIR_RENDER_COLOR_SAMPLING] = c4d.HAIR_RENDER_COLOR_SAMPLING_FULL
videoPost[c4d.HAIR_RENDER_PHYSICAL_GI_QUALITY] = 0.1
videoPost[c4d.HAIR_RENDER_TYPE] = c4d.HAIR_RENDER_TYPE_RASTER_8BIT
videoPost[c4d.HAIR_RENDER_AA_QUALITY] = c4d.HAIR_RENDER_AA_QUALITY_NONE
videoPost[c4d.HAIR_RENDER_AA_MODE] = c4d.HAIR_RENDER_AA_MODE_OLD
videoPost[c4d.HAIR_RENDER_AA_USER] = 0.1
videoPost[c4d.HAIR_RENDER_SHADOWS] = True
videoPost[c4d.HAIR_RENDER_TRANSPARENCY] = True
videoPost[c4d.HAIR_RENDER_TRACING] = True
videoPost[c4d.HAIR_RENDER_MEMORY_USE] = c4d.HAIR_RENDER_MEMORY_USE_LOW
videoPost[c4d.HAIR_RENDER_SHADOW_TYPE] = c4d.HAIR_RENDER_SHADOW_TYPE_NONE
videoPost[c4d.HAIR_RENDER_SHADOW_TRANS_ACCURACY] = 0.1
videoPost[c4d.HAIR_RENDER_SHADOW_DIST_ACCURACY] = 0.1
videoPost[c4d.HAIR_RENDER_SHADOW_AA_LEVEL] = c4d.HAIR_RENDER_AA_QUALITY_NONE
videoPost[c4d.HAIR_RENDER_SHADOW_AA_USER] = 0.1
videoPost[c4d.HAIR_RENDER_SHADOW_SAMPLE_SIZE] = 1
videoPost[c4d.HAIR_RENDER_SHADOWS_MAP] = c4d.HAIR_RENDER_SHADOWS_MAP_250
videoPost[c4d.HAIR_RENDER_SHADOW_CACHE_SIZE] = 1
videoPost[c4d.HAIR_RENDER_SHADOW_WIDTH] = 0.1
videoPost[c4d.HAIR_RENDER_LIGHTS_MODE] = c4d.HAIR_RENDER_MODE_INCLUDE
videoPost[c4d.HAIR_RENDER_OBJECTS_HAIR] = True
videoPost[c4d.HAIR_RENDER_OBJECTS_POLYGON] = True
videoPost[c4d.HAIR_RENDER_OBJECTS_SPLINE] = True
videoPost[c4d.HAIR_RENDER_OBJECTS_PARTICLE] = True
videoPost[c4d.HAIR_RENDER_HAIR_LENGTH] = 0.1
videoPost[c4d.HAIR_RENDER_HAIR_COUNT] = 1
videoPost[c4d.HAIR_RENDER_OBJECTS_MODE] = c4d.HAIR_RENDER_MODE_INCLUDE
videoPost[c4d.HAIR_RENDER_MP_RGB] = True
videoPost[c4d.HAIR_RENDER_MP_DEPTH] = c4d.HAIR_RENDER_MP_DEPTH_OFF
videoPost[c4d.HAIR_RENDER_MP_ALPHA] = c4d.HAIR_RENDER_MP_ALPHA_OFF
videoPost[c4d.HAIR_RENDER_MP_SPLIT_BACK] = True
videoPost[c4d.HAIR_RENDER_MP_COLOR] = True
videoPost[c4d.HAIR_RENDER_MP_DIFFUSE] = True
videoPost[c4d.HAIR_RENDER_MP_SPECULAR] = True
videoPost[c4d.HAIR_RENDER_MP_SECONDARY_SPECULAR] = True
videoPost[c4d.HAIR_RENDER_MP_RECIEVE_SHADOW] = True
videoPost[c4d.HAIR_RENDER_MP_SELF_SHADOW] = True
videoPost[c4d.HAIR_RENDER_MP_ILLUMINATION] = True
#Second way, using the base container.
bc = videoPost.GetDataInstance()
bc.SetBool(c4d.HAIR_RENDER_PHYSICAL_CACHE_PRIMARY,True)
bc.SetBool(c4d.HAIR_RENDER_PHYSICAL_CACHE_SECONDARY,True)
bc.SetBool(c4d.HAIR_RENDER_PHYSICAL_CACHE_BLURRY,True)
bc.SetBool(c4d.HAIR_RENDER_PHYSICAL_CACHE_GI,True)
bc.SetInt32(c4d.HAIR_RENDER_PHYSICAL_GI,c4d.HAIR_RENDER_PHYSICAL_GI_PIXEL)
bc.SetInt32(c4d.HAIR_RENDER_COLOR_SAMPLING,c4d.HAIR_RENDER_COLOR_SAMPLING_FULL)
bc.SetFloat(c4d.HAIR_RENDER_PHYSICAL_GI_QUALITY,0.1)
bc.SetInt32(c4d.HAIR_RENDER_TYPE,c4d.HAIR_RENDER_TYPE_RASTER_8BIT)
bc.SetInt32(c4d.HAIR_RENDER_AA_QUALITY,c4d.HAIR_RENDER_AA_QUALITY_NONE)
bc.SetInt32(c4d.HAIR_RENDER_AA_MODE,c4d.HAIR_RENDER_AA_MODE_OLD)
bc.SetFloat(c4d.HAIR_RENDER_AA_USER,0.1)
bc.SetBool(c4d.HAIR_RENDER_SHADOWS,True)
bc.SetBool(c4d.HAIR_RENDER_TRANSPARENCY,True)
bc.SetBool(c4d.HAIR_RENDER_TRACING,True)
bc.SetInt32(c4d.HAIR_RENDER_MEMORY_USE,c4d.HAIR_RENDER_MEMORY_USE_LOW)
bc.SetInt32(c4d.HAIR_RENDER_SHADOW_TYPE,c4d.HAIR_RENDER_SHADOW_TYPE_NONE)
bc.SetFloat(c4d.HAIR_RENDER_SHADOW_TRANS_ACCURACY,0.1)
bc.SetFloat(c4d.HAIR_RENDER_SHADOW_DIST_ACCURACY,0.1)
bc.SetInt32(c4d.HAIR_RENDER_SHADOW_AA_LEVEL,c4d.HAIR_RENDER_AA_QUALITY_NONE)
bc.SetFloat(c4d.HAIR_RENDER_SHADOW_AA_USER,0.1)
bc.SetInt32(c4d.HAIR_RENDER_SHADOW_SAMPLE_SIZE,1)
bc.SetInt32(c4d.HAIR_RENDER_SHADOWS_MAP,c4d.HAIR_RENDER_SHADOWS_MAP_250)
bc.SetInt32(c4d.HAIR_RENDER_SHADOW_CACHE_SIZE,1)
bc.SetFloat(c4d.HAIR_RENDER_SHADOW_WIDTH,0.1)
bc.SetInt32(c4d.HAIR_RENDER_LIGHTS_MODE,c4d.HAIR_RENDER_MODE_INCLUDE)
bc.SetBool(c4d.HAIR_RENDER_OBJECTS_HAIR,True)
bc.SetBool(c4d.HAIR_RENDER_OBJECTS_POLYGON,True)
bc.SetBool(c4d.HAIR_RENDER_OBJECTS_SPLINE,True)
bc.SetBool(c4d.HAIR_RENDER_OBJECTS_PARTICLE,True)
bc.SetFloat(c4d.HAIR_RENDER_HAIR_LENGTH,0.1)
bc.SetInt32(c4d.HAIR_RENDER_HAIR_COUNT,1)
bc.SetInt32(c4d.HAIR_RENDER_OBJECTS_MODE,c4d.HAIR_RENDER_MODE_INCLUDE)
bc.SetBool(c4d.HAIR_RENDER_MP_RGB,True)
bc.SetInt32(c4d.HAIR_RENDER_MP_DEPTH,c4d.HAIR_RENDER_MP_DEPTH_OFF)
bc.SetInt32(c4d.HAIR_RENDER_MP_ALPHA,c4d.HAIR_RENDER_MP_ALPHA_OFF)
bc.SetBool(c4d.HAIR_RENDER_MP_SPLIT_BACK,True)
bc.SetBool(c4d.HAIR_RENDER_MP_COLOR,True)
bc.SetBool(c4d.HAIR_RENDER_MP_DIFFUSE,True)
bc.SetBool(c4d.HAIR_RENDER_MP_SPECULAR,True)
bc.SetBool(c4d.HAIR_RENDER_MP_SECONDARY_SPECULAR,True)
bc.SetBool(c4d.HAIR_RENDER_MP_RECIEVE_SHADOW,True)
bc.SetBool(c4d.HAIR_RENDER_MP_SELF_SHADOW,True)
bc.SetBool(c4d.HAIR_RENDER_MP_ILLUMINATION,True)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../hair/description/vphairtrace.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseVideoPost *pVideoPost = BaseVideoPost::Alloc(VPhairtrace);
//You can set parameters two different ways.
//First way
//Some objects do not store all their data in the container. You need to use GetParameter()/SetParameter() instead.
DESCFLAGS_SET flags = DESCFLAGS_SET_PARAM_SET;
pVideoPost->SetParameter(DescID(HAIR_RENDER_PHYSICAL_CACHE_PRIMARY),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_PHYSICAL_CACHE_SECONDARY),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_PHYSICAL_CACHE_BLURRY),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_PHYSICAL_CACHE_GI),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_PHYSICAL_GI),GeData(HAIR_RENDER_PHYSICAL_GI_PIXEL),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_COLOR_SAMPLING),GeData(HAIR_RENDER_COLOR_SAMPLING_FULL),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_PHYSICAL_GI_QUALITY),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_TYPE),GeData(HAIR_RENDER_TYPE_RASTER_8BIT),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_AA_QUALITY),GeData(HAIR_RENDER_AA_QUALITY_NONE),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_AA_MODE),GeData(HAIR_RENDER_AA_MODE_OLD),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_AA_USER),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_SHADOWS),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_TRANSPARENCY),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_TRACING),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_MEMORY_USE),GeData(HAIR_RENDER_MEMORY_USE_LOW),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_SHADOW_TYPE),GeData(HAIR_RENDER_SHADOW_TYPE_NONE),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_SHADOW_TRANS_ACCURACY),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_SHADOW_DIST_ACCURACY),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_SHADOW_AA_LEVEL),GeData(HAIR_RENDER_AA_QUALITY_NONE),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_SHADOW_AA_USER),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_SHADOW_SAMPLE_SIZE),GeData(1),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_SHADOWS_MAP),GeData(HAIR_RENDER_SHADOWS_MAP_250),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_SHADOW_CACHE_SIZE),GeData(1),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_SHADOW_WIDTH),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_LIGHTS_MODE),GeData(HAIR_RENDER_MODE_INCLUDE),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_OBJECTS_HAIR),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_OBJECTS_POLYGON),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_OBJECTS_SPLINE),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_OBJECTS_PARTICLE),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_HAIR_LENGTH),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_HAIR_COUNT),GeData(1),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_OBJECTS_MODE),GeData(HAIR_RENDER_MODE_INCLUDE),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_MP_RGB),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_MP_DEPTH),GeData(HAIR_RENDER_MP_DEPTH_OFF),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_MP_ALPHA),GeData(HAIR_RENDER_MP_ALPHA_OFF),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_MP_SPLIT_BACK),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_MP_COLOR),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_MP_DIFFUSE),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_MP_SPECULAR),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_MP_SECONDARY_SPECULAR),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_MP_RECIEVE_SHADOW),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_MP_SELF_SHADOW),GeData(true),flags);
pVideoPost->SetParameter(DescID(HAIR_RENDER_MP_ILLUMINATION),GeData(true),flags);
pVideoPost->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pVideoPost->GetDataInstance();
bc->SetBool(HAIR_RENDER_PHYSICAL_CACHE_PRIMARY,true);
bc->SetBool(HAIR_RENDER_PHYSICAL_CACHE_SECONDARY,true);
bc->SetBool(HAIR_RENDER_PHYSICAL_CACHE_BLURRY,true);
bc->SetBool(HAIR_RENDER_PHYSICAL_CACHE_GI,true);
bc->SetInt32(HAIR_RENDER_PHYSICAL_GI,HAIR_RENDER_PHYSICAL_GI_PIXEL);
bc->SetInt32(HAIR_RENDER_COLOR_SAMPLING,HAIR_RENDER_COLOR_SAMPLING_FULL);
bc->SetFloat(HAIR_RENDER_PHYSICAL_GI_QUALITY,0.1);
bc->SetInt32(HAIR_RENDER_TYPE,HAIR_RENDER_TYPE_RASTER_8BIT);
bc->SetInt32(HAIR_RENDER_AA_QUALITY,HAIR_RENDER_AA_QUALITY_NONE);
bc->SetInt32(HAIR_RENDER_AA_MODE,HAIR_RENDER_AA_MODE_OLD);
bc->SetFloat(HAIR_RENDER_AA_USER,0.1);
bc->SetBool(HAIR_RENDER_SHADOWS,true);
bc->SetBool(HAIR_RENDER_TRANSPARENCY,true);
bc->SetBool(HAIR_RENDER_TRACING,true);
bc->SetInt32(HAIR_RENDER_MEMORY_USE,HAIR_RENDER_MEMORY_USE_LOW);
bc->SetInt32(HAIR_RENDER_SHADOW_TYPE,HAIR_RENDER_SHADOW_TYPE_NONE);
bc->SetFloat(HAIR_RENDER_SHADOW_TRANS_ACCURACY,0.1);
bc->SetFloat(HAIR_RENDER_SHADOW_DIST_ACCURACY,0.1);
bc->SetInt32(HAIR_RENDER_SHADOW_AA_LEVEL,HAIR_RENDER_AA_QUALITY_NONE);
bc->SetFloat(HAIR_RENDER_SHADOW_AA_USER,0.1);
bc->SetInt32(HAIR_RENDER_SHADOW_SAMPLE_SIZE,1);
bc->SetInt32(HAIR_RENDER_SHADOWS_MAP,HAIR_RENDER_SHADOWS_MAP_250);
bc->SetInt32(HAIR_RENDER_SHADOW_CACHE_SIZE,1);
bc->SetFloat(HAIR_RENDER_SHADOW_WIDTH,0.1);
bc->SetInt32(HAIR_RENDER_LIGHTS_MODE,HAIR_RENDER_MODE_INCLUDE);
bc->SetBool(HAIR_RENDER_OBJECTS_HAIR,true);
bc->SetBool(HAIR_RENDER_OBJECTS_POLYGON,true);
bc->SetBool(HAIR_RENDER_OBJECTS_SPLINE,true);
bc->SetBool(HAIR_RENDER_OBJECTS_PARTICLE,true);
bc->SetFloat(HAIR_RENDER_HAIR_LENGTH,0.1);
bc->SetInt32(HAIR_RENDER_HAIR_COUNT,1);
bc->SetInt32(HAIR_RENDER_OBJECTS_MODE,HAIR_RENDER_MODE_INCLUDE);
bc->SetBool(HAIR_RENDER_MP_RGB,true);
bc->SetInt32(HAIR_RENDER_MP_DEPTH,HAIR_RENDER_MP_DEPTH_OFF);
bc->SetInt32(HAIR_RENDER_MP_ALPHA,HAIR_RENDER_MP_ALPHA_OFF);
bc->SetBool(HAIR_RENDER_MP_SPLIT_BACK,true);
bc->SetBool(HAIR_RENDER_MP_COLOR,true);
bc->SetBool(HAIR_RENDER_MP_DIFFUSE,true);
bc->SetBool(HAIR_RENDER_MP_SPECULAR,true);
bc->SetBool(HAIR_RENDER_MP_SECONDARY_SPECULAR,true);
bc->SetBool(HAIR_RENDER_MP_RECIEVE_SHADOW,true);
bc->SetBool(HAIR_RENDER_MP_SELF_SHADOW,true);
bc->SetBool(HAIR_RENDER_MP_ILLUMINATION,true);
pVideoPost->Message(MSG_UPDATE);
}