Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. WickedP
    WickedP

    WickedP

    @WickedP

    5
    Reputation
    45
    Posts
    218
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online
    Website www.wickedp.com

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

    Best posts made by WickedP

    RE: Move an object in hierarchy

    Hi Rage,

    you could try CallCommand() with id 1019951 - calling this should delete all selected objects without deleting their children. Might also do what you're after?

    WP.

    posted in Cinema 4D SDK •
    RE: Scaling of image not working

    Hi gogeta,

    I'm not sure on ScaleBicubic(), but I noticed in your commented line:

    //bitmap->ScaleIt(scaledBitmap, defaultBrightness, true, false);

    That last 'false' flag, try changing that to true. If you're scaling in a non-proportional way that should be true (might fix your non 'squeeze' issue).

    WP.

    posted in Cinema 4D SDK •
    RE: UserArea and EditText

    Do the GeUserArea sections display anything? Or are they just spacers?

    A mock-up picture might help others to visualise.

    How about a 'global' drag and drop function? So, make separate iCustomGui/GeUserAreas for each section. Then just point each of these to the same function held in the parent dialog? That way you only have to write the main drag/catch routine once, in the parent dialog.

    Just a thought.

    WP.

    posted in Cinema 4D SDK •

    Latest posts made by WickedP

    RE: Normal tangents to world

    Hi Ferdinand,

    What's in this, what does this look like inside:

    @ferdinand said in Normal tangents to world:

    // Builds a frame, i.e., a rotation matrix/transform for the given texture normal.
    const Matrix normal_transform = BuildNormalFrame(texture_normal, upVector);

    WP

    posted in Cinema 4D SDK •
    RE: Normal tangents to world

    Thanks Ferdinand,

    I was writing a reply when your edit came through. I'll post what I was typing, but bear with me while I think about your updated edits.

    /* Original message */

    no need to rush, all good! I'm trying to get in my head what I'm wanting to ask. I'll try with some examples.

    Normal maps can be in different spaces. I'm using the term 'spaces' loosely, but I'm referring to this:

    eea0e1c9-ff70-425c-967a-6bd1c699f079-image.png

    There are three types of normal maps we can have. Tangent, Object and World.

    For example, let's say I run a mouse click in the viewport. I can capture all the information I need, like the hit object, hit polygon, the UV texture coords, etc etc and also have the phong shaded normal (in either object or world space). Let's say we have all the bits needed to do all of that.

    Now I sample the normal texture map using the UV coordinates and get the normal texture map value at the sampled location. If the sampled texture map value is in tangent 'space', how can I change it to object 'space'?

    I want to go from this (tangent):

    7b22904a-f9b2-4e1b-a7b5-ea8ad05222fb-image.png

    To this (object):

    7c18b204-16d3-4479-8c5f-179513bee398-image.png

    How can I translate the texture map tangent-based texel, to object 'space'?

    WP.

    posted in Cinema 4D SDK •
    Normal tangents to world

    Hi folks,

    I'm trying to meddle with normal maps by converting them to local (and then world) space. I'm 'printing' the map to the Picture Viewer to see the result.

    But I'm not grasping how to change from normal tangent to local space. I've read a bunch of opengl stuff but it's not helping.

    // pseudo code
    
    Matrix m = Get_ObjectRotMat(); // I've got this
    Vector normal = Get_PolyNormal(); // I've got this
    Vector norm_tang_texture = Get_NormalMapValue(); // I've got this
    
    /* I can't seem to do this */
    Vector norm_tang_to_local =  ??;
    
    /* I can do this, but is useless without the above? */
    Vector local_to_world = etc.;
    

    Would someone be so kind as to give me a lesson on this?

    WP.

    posted in Cinema 4D SDK •
    RE: Getting material 'use' flag

    Thanks Frank,

    @fwilleke80 said in Getting material 'use' flag:

    BaseMaterial* const materialPtr = textureTagPtr->GetMaterial();

    Yep, that's what I was missing. I was thinking the texture tag was the material, but it wasn't and I needed to get the link to the material from the texture tag.

    Cheers,

    WP.

    posted in Cinema 4D SDK •
    Getting material 'use' flag

    Hi folks,

    having a time trying to get simple material parameters. Would like to get the tick box next to the main options in the material window, like Color and Reflection.

    I've been around in circles with the following:

    BaseTag *tag = obj->GetFirstTag();
    BaseMaterial *texture = (BaseMaterial*)tag;
    
    if(texture->GetParameter(DescID(MATERIAL_USE_COLOR),data,DESCFLAGS_GET_0) && data == true)
    {
        // this never runs
    }
    

    A few assumptions with the above, but you get the idea. Where am I going wrong here?

    WP.

    posted in Cinema 4D SDK •
    RE: Custom register plugin

    Thanks @Filip and @kbar, I've setup a simple message system that I'm experimenting with.

    Just a question (for anyone) regarding the start up procedures for Cinema, will my plugin receive PluginMessage() messages if my main plugin is not registered yet? Asking to make sure I can receive a message from another plugin that Cinema might try to register before mine.

    WP.

    posted in Cinema 4D SDK •
    RE: Custom register plugin

    Thanks both of you. I'm still thinking this one through.

    @C4DS I hadn't thought of SpecialEventAdd, thanks for the suggestion. This had me looking into, and finding, GePluginMessage(). I'm wondering if I could call this in PluginStart(). This does seem to work. I could maybe avoid Cinema's Register system with this.

    @PluginStudent can I register a custom type using GeRegistryAdd()? Or does it have to be one of the listed types? E.g. can I register a type under my main plugin id?

    WP.

    posted in Cinema 4D SDK •
    Custom register plugin

    Hi folks,

    just doing some brainstorming and hoping someone may be able to suggest/contribute some ideas.

    I have a dialog plugin with a graphical interface. I'd like to be able to register plugins for my plugin, so that I can build them separately if needed, or perhaps so others in the future may be able to.

    Is it possible to register a custom plugin type? Or, could I piggyback off one of the Register*() functions and grab the registration in my plugin somewhere?

    WP.

    posted in Cinema 4D SDK •
    RE: Editor and viewport colours - where/how to find them?

    Thanks @C4DS, that's what I'm after!

    WP.

    posted in Cinema 4D SDK •
    Editor and viewport colours - where/how to find them?

    Hi folks,

    I want to get the editor viewport colours, so I can colour things using the same as the viewport. I'm guessing this is in the preferences.

    E.g. how do I get the viewport background colour? How about the grid and world axis colours? Selected point colours... etc.

    WP.

    posted in Cinema 4D SDK •