Yes. I currently have some old DS pose scripts which change the origin + some trans values. They're from DS 1.7 and they actually work in DS 3, but I wanted to update them with the correct current syntax.

But that's just a normal Pose Preset, which doesn't help me. With the origin lines in, I keep getting the same error, and after I close DS 3, it wants to send a crash report.

I was loading the figure from a DS directory (with DS geometry in the data folder), so I tried it from a Poser folder instead, but the result is the same. The reason I tried is that the 'rc0_door2_5578' error refers to the door folder in data - ie. its vertex count.

Not sure how I use the getLabel thing. Can I paste it into the IDE window?

mac

Edit - The peculiar thing is that the old script from DS 1.5 works fine. The line in it reads
setNodeOrigin (47.25, 0, -2.26);
It also refers to case "door", but of course other functions in the script will be different from current versions. Certainly, adding that line to a current script doesn't work.

What it means is that node is an undefined item for some reason - it should, as I recall, be set at the beginning of the function, before the switch statement, butt hat's either missing or is not getting a valid value for some reason.

In the example I gave you above, I used node as the object name. You pasted those lines into your script, but perhaps aren't setting the value of node further up (as Richard said), so either you need to rename node to whatever object you're working with, or you need to set node. If you don't it always going to hiccup on that line.

I shared the other transform methods with you because they appear to be a more updated way of setting object transforms. You don't have to use them, but if you want to update the script I thought you might like to know about them.

I can't help any further now until I see a bit more of the script (for example, where g_oPresetHelper is defined). If you don't want to post the script here, PM me and I can help offline.

Well, I'm not sure how I go about defining the node, or how DS does it.

This is just a normal Pose Preset saved for the door, then edited to remove unneccessary values, (Scale, etc), and with the origin lines added (as posted above). If DS itself doesn't define a node when saving the preset (other than using case "door") how do I go about it?

I have the script on my other pc. I'll transfer it later on and post it here. But as I said, it's nothing unusual. Just an edited Pose Preset.

node is a variable name (like g_oPresetHelper) so you need to set it to something before you can use it. In the example I gave you, I used node, figuring you'd know to set it beforehand.

That was an assumption and a simplification on my part. Unfortunately I can't tell you how to set node unless I know what you want to do (impossible to dive into the middle of a script and know what happens at the beginning / end of the script). Clearly we need to take a step back and take the script from the top, otherwise I won't be able to help.

node is a variable name (like g_oPresetHelper) so you need to set it to something before you can use it. In the example I gave you, I used node, figuring you'd know to set it beforehand.

That was an assumption and a simplification on my part. Unfortunately I can't tell you how to set node unless I know what you want to do (impossible to dive into the middle of a script and know what happens at the beginning / end of the script). Clearly we need to take a step back and take the script from the top, otherwise I won't be able to help.

Just let me node (sorry!) how you want to proceed :-)

Yeah, sorry, cridgit. With me, you have to assume you're talking to an idiot 5 y.o. LOL.

Well, I should have known it was too good to be true. This script is causing a new set of problems.

I had been testing the script with a basic door (in Room Creator), which is the slimmed-down version of the main door. Today I tried applying it to the main door, which has numerous other items parented to it - crossbars, dividers, etc - and discovered that when I apply the script, all items parented to the door move a considerable distance away. (That distance appears to be the exact reverse of the distance from the center of the scene - Ztrans -595).

So what I want to know now is, is there a way to ensure all parented items behave properly? I see various oChild references, but I don't know what they mean. In this script, the final line reads
this.setProperties( oSkeleton, oChild, false );
whereas in my old 1.5 script, it reads
this.setProperties( oSkeleton, oChild, bRecurse );

I tried changing it to bRecurse, but with no luck. I'm almost ready to forget this and use the old v1.5 script which works perfectly.

Anyway, here's the latter part of the script as it stands now. (Note - I made it a Char preset so I could include the material switch as well, but that shouldn't make any difference).

I'm going through the script now, reformatting and adding comments which will hopefully help you. However, it doesn't run on my system, because a number of the variables are undefined (e.g. g_oGUI). Is this the whole script, or was there something at the top (e.g. include(X) that you left out?

I've gone through the script, reformatted to make it easier to read/understand and added comments to help. Haven't changed any code, but I did add some comments marked *** where I thought the intent wasn't clear.

Well, I should have known it was too good to be true. This script is causing a new set of problems.

I had been testing the script with a basic door (in Room Creator), which is the slimmed-down version of the main door. Today I tried applying it to the main door, which has numerous other items parented to it - crossbars, dividers, etc - and discovered that when I apply the script, all items parented to the door move a considerable distance away. (That distance appears to be the exact reverse of the distance from the center of the scene - Ztrans -595).

So what I want to know now is, is there a way to ensure all parented items behave properly? I see various oChild references, but I don't know what they mean. In this script, the final line reads
this.setProperties( oSkeleton, oChild, false );
whereas in my old 1.5 script, it reads
this.setProperties( oSkeleton, oChild, bRecurse );

I tried changing it to bRecurse, but with no luck. I'm almost ready to forget this and use the old v1.5 script which works perfectly.

Here's my understanding of the script (some of these are assumptions because I don't have the whole script):

1. You collect the selected nodes (including all their children if recurse is checked).
2. Then you run through all the collected nodes and if its name is "door" you move it and set its origin.
3. Then collect the selected surfaces and run through all of those.
4. If a surface has a material named hinge or hingback, you make it look pretty.

The this.setProperties( oSkeleton, oChild, false ) looks right to me, because if you'd checked recurse, its going to pick up all the children anyway when you collect selected nodes in #1, therefore no need to recurse again when setting the properties.

I also don't think the script is causing the children to move away from the centre, because the script is ONLY touching a node named "door". I wonder if DS is doing something to the children when the parent door moves. I'll experiment with this and let you know - you using 4.5?

Ok. Hold everything, guys!! I've solved the issue. And in the dumbest way imaginable.

I was continuing updating the other scripts I have (there are hundreds of them!) and I came across one which changes switching geometry - ie - sets it to one of the alternatives. Of course, I hadn't a clue how this would be written in DS 3, so I spent an hour going through the SDK docs and found nothing relating to alt geom (I never can find anything useful in those docs).

Anyway, to cut to the chase, on an impulse, I opened the old script in the IDE window, which of course, automatically updated it to DS 3 format. I then resaved and tested that script and it worked fine. I checked it in an editor and it all looked good, so I went back to the set origin script and did the same. Again, it updated, and again, it worked fine. (I haven't tried these in DS 4.5 yet).

So, damn it all.... after all this dorking around, the solution was right there in DS 3. And as far as I can tell, the scripts work perfectly, with no issues whatsoever., and the parented parts on the door stay exactly where they're supposed to.

@Richard: by the way, code blocks and/or comments seems to cause havoc with the page formatting. You might want to ask the web team to look into this. Not only do the comments not wrap, but the page numbering and Prev/Next buttons don't work properly on pages with code/comments.

It also seems to be doing other weird things. This post is listed in New Posts as having 22 pages. I clicked on page 22 and arrived here, which is actually the top of page 3. But when I previously came to the thread from the Developer Forum page, cridgit's post (above this one) was at the bottom of page 2.

Edit - After posting this, I arrived back at the bottom of page 2. LOL.

Yes, this forum is till displaying posts instead of pages, and if you click on the last post link it puts it at the top of a page even if it would naturally fall part way down a page. Oh well, coders should be more robust than the average user or something.

The resaved presets for switching geom don't work in DS 4.5 (Surprise!), and neither do the original ones. I'm now trying to figure out what the code could possibly be. Or is it just broken? I know DS 4.5 has had issues with alt geom from the beginning.

Is the geometry switching working on the figures? We found the other day that some very old items (Anton's Victoria Changing Ponytail for example) was showing a drop-down list instead of a slider, and wasn't applying materials or morphs to the alternative forms. A more recent item I made, on the other hand, is working tvia slider and is applying materials correctly. So it looks as if there may be subtle differences in how different items are handled.

Bear in mind that all these figures are being opened from the Poser directory. One of the reasons for this Room Creator upgrade is to remove all .daz scenes and data so the user will only have a Poser install with .DSAs, plus the folders of DS presets (Materials & Poses, plus Toolbar). That's why I'm opening everything from the Poser dirs.

So these are normal .cr2s and they all use menus for alt geom. What difference that makes, I don't know, but it doesn't seem like that's the issue.

Both of the items I was using were CR2s - there just seems to be a slight difference. However, when I checked I had the morphs from the base shape showing on all shapes which isn't how it should work so even the one that was showing and responding to a slider wasn't fully functional.