Help in creating a “Reset All Hot Points” utility

de3ande3an Posts: 915
edited September 2016 in Carrara Discussion

I downloaded a free model in ".dae" format, which Carrara opens, but all of the Hot Points are way off in left field. I'd like to send each one to its respective object but there are umteen thousand of them and it appears that you can only send one at a time. I'll wear out my mouse before I'm done.

Does anyone know a way to send all hot points to their respective objects automatically? Perhaps there's a Carrara file text editor hack?

Thanks,
Dean

Post edited by de3an on

Comments

  • de3ande3an Posts: 915
    edited September 2016

    Well, apparently no one has a solution for this. Or my thread title was so boring that on one looked at it (only 16 views, and two or three of those were me)frown. So I retitled the thread to give it another shot.

    Since I've been bothered by this Hot Point issue many times in the past, and I’m sure that I recall others looking for the same solution, I decided to look into the text file hack approach, and this is what I have found so far.


    In a Carrara file there is the following section for any object who’s Hot Point has been moved:

    xdat {
    hp n1,n2,n3
    orie 1,0,0,0,1,0,0,0,1
    po n4,n5,n6
    }


    Where n1,n2,n3,n4,n5 and n6 are positive or negative numbers of varying lengths, with or without a decimal point.
    “hp n1,n2,n3” appears to be the hot point x,y and z offsets (in feet).
    “po n4,n5,n6” appears to be the current hot point x,y and z location (in inches).

    In order to send the hot point to the object, you must first convert n1, n2 and n3 from feet to inches, then subtract n1 from n4, n2 from n5, and n3 from n6, replacing n4, n5, and n6 with the subtraction results.
    Then set “hp n1,n2,n3” to “hp 0,0,0” or just delete the entire “hp n1,n2,n3” line.
    Then find the next occurrence of this section and repeat.

    Now, it seems clear to me that this process could be automated via some programming, but unfortunately I’m not currently fluent in any programming language.

    Would someone like to take a stab at writing a “Reset All Hot Points” utility? (Usable on a Mac smiley)

    Thanks.

    Post edited by de3an on
  • DesertDudeDesertDude Posts: 1,235

    de3an, I am most certainly guilty of looking at your problem and wanting to come up with a solution...but way beyond my capabilities. Especially if it involves programming...so,sorry for silence and good luck!

  • DartanbeckDartanbeck Posts: 21,551

    Yeah... I'm sorry too.

    I wanted to chime in right after you posted it (I think I was the first to view your thread), but it would have only been bad news.

    I just look in the Edit menu, memorize the keyboard command for Center Hotpoint, get my fingers of my left hand into position, and start working. I never thought of coming in here to ask for a utility... smart move!

    Even if it goes unanswered... at least you gave it a try. ;)

    <crossing finger for de3an, for he has been a good pal over the years - he deserves a break!!!>

  • HeadwaxHeadwax Posts: 9,987
    de3an said:

    I downloaded a free model in ".dae" format, which Carrara opens, but all of the Hot Points are way off in left field. I'd like to send each one to its respective object but there are umteen thousand of them and it appears that you can only send one at a time. I'll wear out my mouse before I'm done.

    Does anyone know a way to send all hot points to their respective objects automatically? Perhaps there's a Carrara file text editor hack?

    Thanks,
    Dean

    sorry Dean, I didn't know the answer but it appears Dart has solved the problem.

     

  • de3ande3an Posts: 915
    edited September 2016

    Thanks guys.

    Yeah, it seems like when I finally get around to posting a question it's usually something kind of weird.

    But I know that we have some talented people here with programming skills. And it's just a matter of someone having some free time to dabble with this.

    I used to do a little hobbyist programming back in the early days (Apple ][ era), and I played around with something called REALbasic (now renamed Xojo) on the Macintosh in the 1990's. I took a look at Perl and Python, but found that unless I "lived" the language I would forget the syntax pretty quickly.

    It doesn't seem like it should be too difficult to program this. Mostly string manipulations plus a little math to convert feet to inches. (Why they used two different units to describe the hot point location is beyond me.)

    The model that I downloaded has way too many parts to accomplish this manually. See the image below. The Instances list is only showing a small portion of the individual objects. Every one has its hot point placed way off to the side.

    Number-5.png
    1280 x 1024 - 465K
    Post edited by de3an on
  • StezzaStezza Posts: 8,051

    By doing it all manually No.5 will certainly make you feel alive....

     

    sorry, can't help I only knew stuff like

    10 x=10

    20 if x<100 then x=x+1 else go to 40

    30 goto 20

    40 print "good luck"

    or something like that... Been 30 years since I done that lol..

     

  • PhilWPhilW Posts: 5,145

    Just a couple of thoughts:

    - if all the hotpoints are together, can't you just select all the parts, press CapsLock and then move them all at once to the object? (You have probably tried this, or it doesn't work for some reason, but you never know!)

    - is there an option in the import to group items together so that there are fewer parts to deal with? You may not want this as you want to have maximum options for posing and animation, but thought I'd throw it in.

  • wgdjohnwgdjohn Posts: 2,634
    de3an said:

    Well, apparently no one has a solution for this. Or my thread title was so boring that on one looked at it (only 16 views, and two or three of those were me)frown. So I retitled the thread to give it another shot.

    Since I've been bothered by this Hot Point issue many times in the past, and I’m sure that I recall others looking for the same solution, I decided to look into the text file hack approach, and this is what I have found so far.


    In a Carrara file there is the following section for any object who’s Hot Point has been moved:

    xdat {
    hp n1,n2,n3
    orie 1,0,0,0,1,0,0,0,1
    po n4,n5,n6
    }


    Where n1,n2,n3,n4,n5 and n6 are positive or negative numbers of varying lengths, with or without a decimal point.
    “hp n1,n2,n3” appears to be the hot point x,y and z offsets (in feet).
    “po n4,n5,n6” appears to be the current hot point x,y and z location (in inches).

    In order to send the hot point to the object, you must first convert n1, n2 and n3 from feet to inches, then subtract n1 from n4, n2 from n5, and n3 from n6, replacing n4, n5, and n6 with the subtraction results.
    Then set “hp n1,n2,n3” to “hp 0,0,0” or just delete the entire “hp n1,n2,n3” line.
    Then find the next occurrence of this section and repeat.

    Now, it seems clear to me that this process could be automated via some programming, but unfortunately I’m not currently fluent in any programming language.

    Would someone like to take a stab at writing a “Reset All Hot Points” utility? (Usable on a Mac smiley)

    Thanks.

    de3an,  I'm very curious about this problem. I have only done programming in x,y,z for a 2d pic to shift the pen to different places to start a drawing such as a star or other things for drawing with painting tools.

    First lets break this down a bit more. I've never even bothered to peak at any .car files so I must assume that you know what the snippet of the file means.

    I'm more curious as to what  "orie 1,0,0,0,1,0,0,0,1" means... since it has 3 sets of 3. Somewhere is stated where the actual object's center is. Could orie mean "object's origin"?

    xdat {
    hp n1,n2,n3
    orie 1,0,0,0,1,0,0,0,1   ---------- ???
    po n4,n5,n6
    }

    Another question is what you used to view the .car file. I'm using UltraEdit for Windoze. I've saved 3 different single object files both as "externally" and also "internally". I can open but can't read any of them no matter what format I convert any of them to. Might just be my lack of how to use UltaEdit... I usually use it for text or html editing.

  • MarkIsSleepyMarkIsSleepy Posts: 1,496
    edited September 2016

    <sorry - ignore this post, it was an unnecessary OT rant about how hard DAZ3D makes it to get the Carrara SDK wink>

    Post edited by MarkIsSleepy on
  • MarkIsSleepyMarkIsSleepy Posts: 1,496
    edited September 2016

    Just to be clear in case anyone else is as dense as me (I read the thread twice and even read Head Wax's post where he points out that Dart solved it and still missed that it was solved), @Dartanbeck solved the problem above - the option in the edit menu that Dart mentions works for all selected objects.

    So if you have 50 objects in the scene, select them all and hit control+alt+h (on a PC) once and all of their hotpoints will be centered. I just tried it with three sphere primitives and it worked, as they say, a charm (is that how that's used?). No programming needed - Carrara already has this feature! laugh

     

    Untitled-1.jpg
    1124 x 1007 - 175K
    Post edited by MarkIsSleepy on
  • PhilWPhilW Posts: 5,145

    wgdjohn - you may be saving in compressed format, try saving uncompressed and you should be able to read it.

  • PhilWPhilW Posts: 5,145
    MDO2010 said:

    Um - I just tried putting a bunch of spheres in my scene and moving all the hotpoints all over the place.  Then I selected all of them and used the hotkey control+alt+H to center hotpoint and it worked on all of them at once. The option to center hotpoint also exists on the edit menu. Unless this is something I got from some add-in I have and not part of the base package?  Does anyone else have this option?

     

    Yes, works for me - good spot!

  • MistaraMistara Posts: 38,675

    +1  timesavingworkflowtip !! thanks heart

  • wgdjohnwgdjohn Posts: 2,634

    de3an, Thank you for asking... I'd run across the same problem awhile back... didn't have it again so hadn't thought about it since.

    Great answers Dart, MDO... sometimes it takes a screen shot to get me motivated to look in a menu. :)

    Thanks PhilW... just checked and that was exactly what I was doing. Will be able to fall asleep tonight without thinking about it...

    well almost... still want to know what all the function names mean and their parameters. This has gotten me interested in finally learning programming on Windoze. Now I can drop all this silly 3D modeling, animation, posing, etc.Yeah... dropping that will never happen :)

    hmmm..... .... ... .. .

  • de3ande3an Posts: 915
    MDO2010 said:

    Just to be clear in case anyone else is as dense as me (I read the thread twice and even read Head Wax's post where he points out that Dart solved it and still missed that it was solved), @Dartanbeck solved the problem above - the option in the edit menu that Dart mentions works for all selected objects.

    So if you have 50 objects in the scene, select them all and hit control+alt+h (on a PC) once and all of their hotpoints will be centered. I just tried it with three sphere primitives and it worked, as they say, a charm (is that how that's used?). No programming needed - Carrara already has this feature! laugh

     

    Well... I'll be a _____!

    Center Hot Point in the Edit menu is exactly what I was looking for. I had always assumed that it functioned the same way as the Send Hot Point to Object button (that is, one object at a time). From the context of Dart's post it would appear that not even he knew that it would function on many objects simultaneously.

    Thanks to MDO2010 we are now all the wiser. (Although I feel like I should have known about this after all the years I've been using Carara.) blush

    Thanks everyone!

    Now I guess it's time for me to put on the dunce cap.

     

  • PhilWPhilW Posts: 5,145

    Goes to show that there are always new things to learn (and I'm very much including myself in that), it's what keeps it interesting!

  • DartanbeckDartanbeck Posts: 21,551
    de3an said:
    MDO2010 said:

    Just to be clear in case anyone else is as dense as me (I read the thread twice and even read Head Wax's post where he points out that Dart solved it and still missed that it was solved), @Dartanbeck solved the problem above - the option in the edit menu that Dart mentions works for all selected objects.

    So if you have 50 objects in the scene, select them all and hit control+alt+h (on a PC) once and all of their hotpoints will be centered. I just tried it with three sphere primitives and it worked, as they say, a charm (is that how that's used?). No programming needed - Carrara already has this feature! laugh

     

    Well... I'll be a _____!

    Center Hot Point in the Edit menu is exactly what I was looking for. I had always assumed that it functioned the same way as the Send Hot Point to Object button (that is, one object at a time). From the context of Dart's post it would appear that not even he knew that it would function on many objects simultaneously.

    Thanks to MDO2010 we are now all the wiser. (Although I feel like I should have known about this after all the years I've been using Carara.) blush

    Thanks everyone!

    Now I guess it's time for me to put on the dunce cap.

     

    I didn't. As a matter of fact, I've thrown away (this was years ago) a few downloaded models that had the same issue. I simply didn't have the time to mess with it.

    I wonder if this is new to 8.5? I thought for sure I'd have tried that... but maybe not.

    Eventually I got tired of messing with stuff that hasn't gone through Daz3d's QA process. I do have a few select favorites from Renderosity whom I trust, but I have been finding pretty much eveything I need from Daz3d.

    Thanks for trying this out on multiple objects, MDO!!!

    One small step for an Artist, One Giant Leap for Artist-kind! ;)

  • DartanbeckDartanbeck Posts: 21,551

    Hey de3an, I've come up with a great utility for you, right within the Carrara interface!

    Simply select everything you need fixed, and go Edit > Center Hotpoint

    It'll fix everything in one shot! LOL

  • de3ande3an Posts: 915

    cheekycheekycheekycheekycheekycheekycheekycheekycheekycheekycheekycheekycheekycheekycheekycheekycheekycheekycheeky

  • DartanbeckDartanbeck Posts: 21,551

    ROTFLMAO!!!

  • DiomedeDiomede Posts: 15,168

    +1

     

    ROTFLMAO!!!

     

Sign In or Register to comment.