Simple Script for Scene Arrangement Information Passing?
Alright, bear with me because I only know enough about programming to (hopefully) ask the right questions.
Let us assume that, thanks to the power of the Daz Bridges, we have the Geometry of a Room (such as a broomcloset) and its Contents (which are its Children, and could be things like a mop and a broom) in two different programs. For example, Daz and Blender. They are, at the moment, arranged identically. That means that all of their Rotation, Scale, and Translation Values (which I’ll call RST Values from now on for brevity) are essentially the same. (I say “essentially” because the two programs could have differences of opinion on which way the XYZ planes go, unit sizes, etc. These differences are not enough to prevent reproducing the scene’s arrangement and are possible to account for.)
Now, suppose I were to change some of the RST Values in one program and wanted to replicate the Effective Changes (Effective, not actual, due to the previously mentioned Differences of Opinion) in the other program. Would the way to do this be something like:
1. Have user select the Parent Object (meaning the Room) in the program that was used to make the changes
2. Have a script record the Names and RST Values of the Room and its Children, and put that information into a txt file
3. Have the user launch a script in the Program that did not make the changes (meaning the Receiving Program)
4. Script (in the Receiving Program) asks the User to select the txt file, then the Target Object (meaning, in this case, the Copy of the Room in the Receiving Program) to apply the RST Values recorded in the txt file to
5. Script double checks that the names of the Selected Object its Children match what was recorded in the txt file (or at least checks if the hierarchy structure matches) and proceeds if they do
6. Script, making sure to account for the Differences of Opinion, applies the corresponding RST Values recorded in the txt file to the Selected Object and its Children. This (hopefully) achieves the goal of making the arrangement of the Rooms match again.
Is this set of instructions performable using Daz's Scripting Language (for the Daz Part of it, I mean. The other programs will require the use of whatever they have. Like Blender using Python for example.)
Comments
Redacted
Very nice!
Thank you.
Redacted
Wow! That is amazing. Thank you so much! I'm very glad I did not have to write that because that would have taken me a long time to get something anywhere near that. Definitely way longer than I would have expected. Solid advice about the JSONs, I'd forgotten about those (though I'd only barely learned about them from making a very basic mod for a video game once).
Question: Why are bones ignored? Is there a technical reason to do that or was it just simpler or maybe something like "not every program would have them" or...? (Forgive my ignorance, I'm still learning Daz too).
Redacted
Not working with bones should be fine then. Thank you again! Now I just need to figure out how to make versions of the script for Blender, Unity, and/or Unreal. With the power to send the RST values back and forth, it will be possible use one (or more, haven't really picked favorites) of those programs' VR controls to arrange a Daz scene. (Nothing against Daz's controls, in fact I like Daz's GUI a lot better than those other programs so far, it's just that when it comes to arranging a room it just feels more intuitive to use my hands.) Hopefully I'll be able to translate your script for the other programs to use.
Edit: I think I'll ask in the Blender, Unity, and Unreal parts of the Daz forum first though.
Edit Edit: Also, sorry if I'm very slow to respond, irl stuff is making it hard to devote time to this.