Set texture image to file not full path



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/04/2003 at 08:39, xxxxxxxx wrote:

    Arghh....
    I can scan every type of file format within the Poser file:
    :Runtime:Geometries:props:ball.obj
    ":Runtime:textures:male nude.tif" or NO_MAP
     ":Runtime:textures:male nude.tif" or ""
    ":wheres:the:runtime:mesh.obj"
    "D:\I\put he exture\here\oops.jpg"
    Again, this is not the issue.  If I extract the file name from the path and do this:
         bdata.SetString(BASECHANNEL_TEXTURE, "texture.jpg");
         bchannel->SetData(bdata);
    with just that, C4D does not find (and consequently) does not load the bitmap image for the texture.  If the entire path is included, it works, but then the entire path shows in the texture image text box which looks unprofessional and is messy.
    There is no method (that I can find) like GeSetCurrentPath() to change the "working directory" so that the path is unneeded.
    I have abandoned the use of CL's plugin in conjunction with mine - they jumble around the geometry facets in an indeterminate way from the ordering in the .obj file.  My plugin already parses the entire PZ3 for all information and now loads and assembles all of the geometry (including the GROUND plane), all lights, Dolly Camera, materials and sets up the latter three.  While waiting for an answer to this seemingly simple question, I am now ready to apply all of the Channels to the geometry to make a complete scene, including bone rigging the figure - all in just a month of understanding the contents of Poser files, using the C++ SDK, and a couple months of using C4D R8.
    BTW:
    x/y/zOffsetA - move object origin (see origin clause) to world origin
    rotateX/Y/Z  - perform operations relative to the new origin
    scale X/Y/Z
    translateX/Y/Z
    x/y/zOffsetB - move object origin back
    This is simply a way for Poser to perform all of the transformations and deformations on the geometry with the correct origin being referenced by offset even if the geometry is offset within the .obj file.
    initValue sets the initial transformation when the geometry is loaded.
    key 0 N sets the user-modified value (from zero-normalized initValue) applied to the geometry.
    The tough stuff is going to be interpreting the bone rigging, JCM's, and other forms of ERC.  This makes sense, since these are where all of the power lies.
    Robert



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/04/2003 at 09:02, xxxxxxxx wrote:

    ok I think i get it :o)

    Did you set up your "texture path" in C4D

    Like Path1 E:\Poser4\Runtime extures

    I thinks that's it , NO ????

    Niki



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/04/2003 at 10:42, xxxxxxxx wrote:

    Okay, thank you, now this is more to the point.  I see that CL's plugin adds the path to the Preferences->Texture Paths (Path 10).  How does one go about adding it programmatically, considering that all 10 paths may already be taken or one may already point to the Poser texture folder?  Why do I have the feeling that this will require a trip to the C4D Resource folder to find the dialog and enumerations? :0)
    Thanks, that helped!
    Robert



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/04/2003 at 10:48, xxxxxxxx wrote:

    :o)

    Well CL and the plugins is stange any way, i dont use it, for long time, I have mine own :o)

    More flexible, also give me a more fast way too,
    I export as OJB is fast and then my plugin read iut back in some seconds...

    I dont use much Poser any more, all MATS is tune in C4D and then i use my apllky poser scene to change any scene, partial scene full scene etc...

    Have fun Niki

    Hops forget, IN the SDK is an very fast way to modify channel WO need to get is Container :)



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/04/2003 at 11:46, xxxxxxxx wrote:

    That's why I'm writing my own as well.  Materials are set wrong, doesn't handle any Poser 5 stuff (yet), no bones, no morphs, no lights, no cameras, no ground.
    Here's the code that sets the Global Texture Path:

        
        
          
        // Add a texture path to poserpath:Runtime:textures:  
        void Configuration::SetTexturePath()  
        {  
         LONG i;  
         Filename filename, blankfilename;  
         Filename texturepath_Filename(poserpath+"[\Runtime\textures](file://\\Runtime\\textures)");  
         for (i = 0; i < 9; i++)  
          if ((filename = GetGlobalTexturePath(i)) == texturepath_Filename) return;  
         for (i = 0; i < 9; i++)  
         {  
          if (filename == blankfilename)  
          {  
           SetGlobalTexturePath(i, texturepath_Filename);  
           return;  
          }  
         }  
         useFullTexturePath = TRUE;  
        }  
        
    

    Note that it checks for it already being set, then checks for an empty Texture Path into which to set it.  If all else fails, I just use the full texture path for the texture images...
    Okay, I'll bite, how do you modify channel WO getting container? ;0)  I'm still learning this way-too complex SDK and expect that there is much to learn.
    Robert



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/04/2003 at 11:47, xxxxxxxx wrote:

    Here's the correct method

        
        
          
        // Add a texture path to poserpath:Runtime:textures:  
        void Configuration::SetTexturePath()  
        {  
         LONG i;  
         Filename filename, blankfilename;  
         Filename texturepath_Filename(poserpath+"[\Runtime\textures](file://\\Runtime\\textures)");  
         for (i = 0; i < 10; i++)  
          if ((filename = GetGlobalTexturePath(i)) == texturepath_Filename) return;  
         for (i = 0; i < 10; i++)  
         {  
          if ((filename = GetGlobalTexturePath(i)) == blankfilename)  
          {  
           SetGlobalTexturePath(i, texturepath_Filename);  
           return;  
          }  
         }  
         useFullTexturePath = TRUE;  
        }  
          
        
    

    Whoops.  :)
    Robert



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/04/2003 at 12:10, xxxxxxxx wrote:

    yes good

    But you dont thinks is better to let the User do this

    Liek for me I have many Poser runtime
    And also text in some other folder,,,

    I do this for priority,,, yes If I make a perssonge that is far away I desable one of the path then it take all Low res textures and if is a cloup I enable them...

    So is not a big deal to set up those path :O)

    niki



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/04/2003 at 12:40, xxxxxxxx wrote:

    No way.  Better to do as much as possible for the user - otherwise, what's the use of writing plugins? ;0)  For sanity's sake, a certain amount of standardization must be considered.  If anything goes, the plugin would never work or be so complex, that it'd be guaranteed not to work properly.  Poser expects geometries in its ":Runtime:Geometries" folder and textures in its ":Runtime:textures" folder (even though they even have some wiggle room).  I can add some wiggle room (as discussed below), but there has to be a limit (such as search all hard drives for a texture image - which would consume so much time that the plugin would be useless. Do you automatically select the first one found - correct or not - or bring up a dialog so that the user can select one of the matches?  What if it is someelse's scene file - for whatever reason - and they, as Poser user's often do, make full references to nonexistent directories - such as D:\Program Files\MetaCreations\Poser 2\Runtime extures\nevertobefoundimage.tif).
    At some point, I'll be adding a dialog so that the user can decide on which things to add or not (lights, cameras, materials, bones, etc).  Maybe then, instead of using the default locations for geometries and textures, the user can specify where to look.  The user does have to point my plugin to the Poser directory, so that's all that is really needed to do so far.
    As I noted above, if the texture is in another location (like "D:\b\l\a\h exture.bmp"), it keeps the entire path and points to it, otherwise, when ":Runtime" is included, the Poser path is prepended and the texture sought there.  If no ":Runtime" is included (such as ":zwizzles_texs:texture.jpg", it has to assume that this is a subdirectory of ":Runtime:textures" and prepends that as well.
    It's not a big deal when you eventually FIND the information.  The SDK Help file (.chm) sucks in this regard.  The index lookup only goes for the first characters matching the term while the search doesn't work at all - try searching for "TexturePath" (which should match "GetGlobalTexturePath and "SetGlobalTexturePath", even in case).  It doesn't work.  I'm getting ready to unzip the HTML SDK documentation - at least I can search that...
    You still didn't divulge how to modify the channel w/o getting the Container.  As I don't expect to find it in the docs or online or by chance, I'd like to know.
    Robert



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/04/2003 at 13:26, xxxxxxxx wrote:

    BTW, Niki, does your plugin do any bone rigging or add morph channels (ala PoseMixer) from the Poser file?  Basically, I'm only writing this plugin because I haven't found anything else that does.  There is one for LightWave, but I am not too partial to LightWave and the results still need some work after loading the Poser file.
    Robert



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/04/2003 at 08:49, xxxxxxxx wrote:

    No my plugs do not do any bones stuff

    I'm primary draw Comic book

    At the base is to use poser 5, but it dont work so I go back to C4D r8, I use to have the r7, but R8 give more then a need for lights etc...

    For me C4D is a tools, but the plugins fron CL don work so, we do our own. I i give all for free...

    But as I say C4D is not a simple Porgram and not a toy...

    So we do those plugs for what i Need...

    So i use poser only for pose amnd morph , all rest is done in C4D All MAT's etc, can be 100 tiems better in C4D...

    So we do a plug base on OBJ, Why is faster from Poser...
    PZ3 files is to slow for what i need... I any question I'm here

    For your plug If you do Bones is nice and I will be interested, but to take a way poser Need :)

    NIki



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/04/2003 at 09:23, xxxxxxxx wrote:

    These are some of the "deficiencies" of Poser about which I speak.  Lighting in Poser is very primitive, renders are not as good and slower, and although Poser rigging uses IK, it really is not the best IK.  C4D's IK and new Soft IK are much better (if not more complex to understand) especially for animation - which is the direction in which I'd like to head.  I've used Poser's animation tools, but did not find them very intuitive or stable and this can be attested to by the fact that there are so very few Poser animations out there.
    And, as you say, the plugin from CL isn't good at all.  That's why some of us are taking on this ourselves. :)
    I'm grateful for your help so far and it's great that you make your plugin available free of charge - which is amazing considering the amount of work involved, as I am finding out. ;)
    As for the PZ3 files, you'd be amazed at how fast you can parse them - even at 15MB or more.   Of course, my benchmark is on a 2.54GHz P4 w/1GB DDR memory, so it may be slightly biased! ;0)
    In my case, instead of parsing, setting, parsing, setting, I waste some memory and parse the entire file into appropriate classes (PoserScene, PoserCharacter, PoserObject (for props, actors, lights, and cameras), PoserFigure (added to PoserCharacter for rigging and hierarchy), PoserChannels (within each PoserObject), and so on).  Then all of the necessary information and, most importantly, the linkages (fields in the file that point to other actors, props) are set and available for building the scene.
    Poser, like C4D, is a tool.  In this case, I like the "extensions" (pre-configured characters) better than the tool itself.  Since these "extensions" can be fitted to work with another better tool, C4D, I am willing to spend time making the necessary adapter so that the extensions can be used there.
    Robert



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/04/2003 at 11:23, xxxxxxxx wrote:

    You like to talk about what you do right

    Is good :o)

    If you want to see et try my plugs is on my site for free any way

    I do get very well what you try to do... :(

    I mean technicaly yes, but the ending of

    Niki



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/04/2003 at 11:39, xxxxxxxx wrote:

    In all actuality, I don't expect that a plugin that loads the bones and morphs from a Poser character will cause any damage or deterioration of Poser use itself.  There is already a plugin for LightWave that does all of this for all Poser files (PZ3, CR2, HR2, PZ2, etc) and haven't see any effect on the number of users of Poser.
    I guess, this is more of a challenge to me.  In the end, my knowledge of Poser and C4D will be enhanced by the research involved.  Also, I will finally be able to work on more "professional" quality animation without having to spend thousands for premade characters (with no morphs) or spending months making them myself.  Eventually, it will probably be more gratifying to create my own rigged characters, but for now it is more hindrance than advancement.
    Robert



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/04/2003 at 11:43, xxxxxxxx wrote:

    Well ok I understand better now

    If a day you have some to show let me know , or if you want to talk about it let me know too ;-)

    Niki



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 04/04/2003 at 07:56, xxxxxxxx wrote:

    Did you have an idea how to resize a GeDialog, well I mean
    is base size is ok, but to size in it all contents ?

    Niki



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 04/04/2003 at 10:19, xxxxxxxx wrote:

    Do you mean spread the contents out so that they are not too packed together?
    If you use Groups, you can use GroupBorderSpace(...) to put some space between them.  Since GeDialog layouts are done internally and automatically (like Java), you have to give it all of the objects (Text, Buttons, Groups, etc) either in the CreateLayout() method or in a dialog resource file.
    I use Groups the same way I use JPanels in Java - to divide and conquer the dialog display space into regions and to spread things out for a more easily interpreted display for the user.
    Let me know if I understood your question correctly.
    Robert



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 04/04/2003 at 10:31, xxxxxxxx wrote:

    Well yes os true...

    But is you look the reseditor...
    You set all groups to Scale Fit etc... button etc too...

    In the resEdit it work fine
    But in the SDK i dont fineout the command that do this
    I know is a C++ standard when i use MFC is no problem
    But here I dont see how it work :(

    Niki



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/04/2003 at 08:48, xxxxxxxx wrote:

    Oh, I see.
    That's because it's called something else, of course. ;0)
    BFH_SCALEFIT
    Robert



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/04/2003 at 12:16, xxxxxxxx wrote:

    O ok but how to use it ;-)

    Niki



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/04/2003 at 12:35, xxxxxxxx wrote:

    Use it in the flags field for the resource or flags argument for the method:
    AddStaticText(4001,BFH_CENTER|BFV_CENTER,0,0,GeLoadString(ERROR_MEMORY_TEXT),BORDER_NONE);

    Check out "Dialog resource" in the Help files for using flags in a resource.
    Also check out "Description resource" for Groups, Layout Layouts, etc. for dialog resources.
    Hope that helps and let me know if you have any other Dialog questions! :)
    Robert


Log in to reply