Navigation

    • Register
    • Login
    • Search
    • Categories
    1. Home
    2. hazzzel
    H
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    hazzzel

    @hazzzel

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

    hazzzel Follow

    Posts made by hazzzel

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

      Problem solved! Thank you!

      posted in Cinema 4D Development
      H
      hazzzel
    • 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 Development
      H
      hazzzel
    • 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 Development
      H
      hazzzel
    • 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 Development
      H
      hazzzel
    • RE: How to bake shader into basebitmap?

      Thanks a lot!

      posted in Cineware SDK Development
      H
      hazzzel
    • 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 Development
      H
      hazzzel