Navigation

    • Register
    • Login
    • Search
    1. Home
    2. hazzzel
    H

    hazzzel

    @hazzzel

    0
    Reputation
    6
    Posts
    29
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    hazzzel Follow

    Best posts made by hazzzel

    This user does not have any upvoted posts yet.

    Latest posts made by hazzzel

    RE: Using "config" plugins to modify the loading queue in R19

    Problem solved! Thank you!

    posted in Cinema 4D SDK •
    Using "config" plugins to modify the loading queue in R19

    Hi all,

    I want to use a "config" plugins to read the loading queue in R19. A QueryStartupOrder() function works well in R20 and R21, but it seems like that it is not supported in R19. So, is there a way around it? Thanks!

    posted in Cinema 4D SDK •
    RE: get bitmap of shader in r20

    Thank you for your reply, the BaseShader::Sample() helps me solve this problem. (Except that when the layer shader use transform layer, scale transformation is not automatically handled.) Anyway, thanks a lot!

    posted in Cineware SDK •
    get bitmap of shader in r20

    Hi,

    I'm working on r20, and I found I can't use BaseShader::BakeShaderIntoBaseBitmap() because it is a new feature in r21. Trying find a way around, I want to extract the bitmap of the layer shader. However, my code does not work.

    BaseBitmap* diffuseBitmap ;
    GeData gd;
    BaseShader* shader = bm->GetChannel(CHANNEL_DIFFUSION)->GetShader();
    
    if (shader->GetType() == Xlayer) {
        LayerShader* layerShader = static_cast<LayerShader*>(shader); 
        LayerShaderLayer* layerShaderLayer = layerShader->GetFirstLayer();
        while (layerShaderLayer != NULL)
        {
            if (layerShaderLayer->GetType() == LayerType::TypeShader)
    	{
    	    Bool res = layerShaderLayer->GetParameter(LAYER_S_PARAM_SHADER_LINK, gd);
    
    	    // diffuseBitmap = layerShaderLayer->GetPreview(); // this does not work, too!
    
    	    BaseLink *bl = gd.GetBaseLink(); // program stop here, and I can't see why
    	    BaseShader *thisShader = static_cast<BaseShader*>(bl->GetLinkAtom(bd));
    
    	    thisShader->InitRender(irs);
    	    diffuseBitmap = thisShader->GetBitmap();
    	    thisShader->FreeRender();
    
                break;
    	}
    	layerShaderLayer = layerShaderLayer->GetNext();
        }
    }
    else
    {
        // ...
    }
    
    ShowBitmap(diffuseBitmap); // can't see anything here when using 'layerShaderLayer->GetPreview()'
    diffuseBitmap->Save(fn, FILTER_JPG, nullptr, SAVEBIT::NONE); // fail when using 'GetPreview()'
    
    

    Could anyone kindly explain where I am doing wrong? Thanks a lot!

    posted in Cineware SDK •
    RE: How to bake shader into basebitmap?

    Thanks a lot!

    posted in Cineware SDK •
    How to bake shader into basebitmap?

    Hi all,

    I'm trying to use BaseShader::BakeShaderIntoBaseBitmap() to get a 2D representation of the shader. However, I couldn't get the correct result.

    BaseDocument* bd = GetActiveDocument();
    InitRenderStruct irs{ bd };
    BaseBitmap* bit = BaseBitmap::Alloc();
    BaseShader* shader = mat->GetChannel(CHANNEL_DIFFUSION)->GetShader();
    shader->BakeShaderIntoBaseBitmap(*bit, *bd, irs.thread, false, irs.document_colorprofile, irs.linear_workflow, true, 0, 1000, 0, 1000)
    ShowBitmap(bit);
    

    I have read 'BaseShader Manual', but I'm not sure where to get a parentThread, so I used irs.thread...

    Any ideas or examples?

    posted in Cineware SDK •