Wed, Nov 20, 11:23 AM CST

Renderosity Forums / DAZ|Studio



Welcome to the DAZ|Studio Forum

Forum Moderators: wheatpenny Forum Coordinators: Guardian_Angel_671, Daddyo3d

DAZ|Studio F.A.Q (Last Updated: 2024 Nov 20 6:51 am)



Subject: Saving an alternate UV Map set with a prop.


3dcheapskate ( ) posted Tue, 11 December 2012 at 2:25 AM · edited Wed, 20 November 2024 at 9:34 AM

I've got a very simple low res shield prop. I'd like to be able to load my prop and have two UV mappings automatically appear under the 'UV Map' group on the surfaces tab.

I know it's easy to load an alternate UV set from the Surfaces tab - I created two versions of my OBJ file that only differ in their UV mapping so I can do this. But I can't seem to find a way to actually save the alternate UV map as part of any DS file.

It was easy to save alternate UV maps as part of a Poser prop - I used an 'alternateGeom' channel in the PP2, as suggested here.

Indeed this works in DAZ Studio too if you load the PP2. However, it works by adding an extra parameter to the parameters tab (as I'd expect). But the 'UV Maps' group on the surfaces tab still only has one 'Default' option' (sort-of as I'd expect)

So is there a way to do something in the PP2 that will tell DS to add an alternate UV set? If not then I guess it'll have to be a DAZ Script?


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



RHaseltine ( ) posted Tue, 11 December 2012 at 8:48 AM

If you want to save an alternative UV set you will need to use File>Save as>Support Asset>Figure/Prop Asset.


3dcheapskate ( ) posted Tue, 11 December 2012 at 9:58 PM

Thanks, that's DS4 sorted. But looks like there's no 'save as' solution for DS3?


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



Bejaymac ( ) posted Wed, 12 December 2012 at 1:03 AM

If your files are Poser format and you want them to be used in DS3 then save it as a DSA material preset, it writes the Alt UV data directly into the preset, that way you only have to distribute your Poser files and the DS material presets, rather than have to also distribute a pile of DSON files.


3dcheapskate ( ) posted Wed, 12 December 2012 at 3:19 AM

I think I tried that (I usually do DAZ Studio material presets for my Poser props), and the alternate UVs weren't saved?

But I'd better go and double check... back soon...


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



3dcheapskate ( ) posted Wed, 12 December 2012 at 3:41 AM · edited Wed, 12 December 2012 at 3:42 AM

No, definitely doesn't work, at least not the way I did it. Here's what I just did:

  • loaded my S.E.Asian rectangular shield prop PP2 into DS3Adv (it automatically applies DS materials because I have a DSA materials preset with the same name as the PP2 in the same folder as the PP2)

  • applied an alternate UV Map set via the surfaces tab, and checked that I could swap UVs between the default and alternate sets. That works fine

  • saved a Materials preset DSA with all the materials for the shield in it. Checked the contents of the file and it looks promising...

DsActions.prototype.setMaterialProperties = function( oMaterial, oShape ){
    ...
    switch( sID ){
            case "Studs":
                ...
                g_oPresetHelper.setNumericProperty( "UV Set",  [ 0 ] );
                ...
                break;
            case "Handle":
                ...
                g_oPresetHelper.setNumericProperty( "UV Set",  [ 0 ] );
                ...
                break;
            case "Shield":
                ...
                g_oPresetHelper.setNumericProperty( "UV Set",  [ 1 ] );
                ...
                break;
            case "Back":
                ...
                g_oPresetHelper.setNumericProperty( "UV Set",  [ 0 ] );
                ...
                break;
        default:
            break
    }
}

  • restarted DS3 and reloaded the same prop. Applied a different texture to it so I could easily see any change

  • ran the DSA I'd just created. It changes the texture, but there's still only the default UV set in the surfaces tab, and it's definitely still using the default UV mapping

  • tried loading the shield and applying the DSA in DS4 too - same thing, only the default UVs.

 

(need to rush off now - I'll check back later)


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



RHaseltine ( ) posted Wed, 12 December 2012 at 9:36 AM

The preset doesn't include the UVs, just says which to use - since the Poser files don't have anywhere to store alternative UVs there's no way of using just presets and a pp2. For DS3 you could of course use a .daz scene file, which would also work in 4 (though as I recall there can be issues with uv references in theory, if the item was updated, as it uses an index rather than a name in DS3).


Bejaymac ( ) posted Wed, 12 December 2012 at 10:18 AM

It does for me, select the item in the scene tab, select the alt UV set in the surfaces tab, in DS3 it save as material preset, in DS4 it save as depreciated material preset, write out the file name and select the file type (DSA & DSB in DS3, only DSA in DS4), on the next window, you should see record everything with a check mark next to it, bottom left of the window you see a check box next the words "Save alternate UVs", tick it and select Accept.

Your alt UV's will now be in the DSA/DSB file and will automatically be used when you apply the preset to your item, I've been applying M4 textures to V4 (and vice versa) this way for quite some time.


Bejaymac ( ) posted Wed, 12 December 2012 at 10:38 AM

Just did some testing, the Alt UV's are saved in the Material preset, BUT presets saved in DS3 wont load the Alt UVs in DS4, and presets saved in DS4 wont load the Alt UVs in DS3.

So it looks like there's been a bit of tinkering going on under the hood and DS3's & DS4's scripting language isn't the same.


RHaseltine ( ) posted Wed, 12 December 2012 at 3:34 PM

I didn't know it would do that- and I find it surprising. I ssupect the failure may be due les to the script than to the difference in ownership of the actual geoemtry in DS3 and DS4.


3dcheapskate ( ) posted Wed, 12 December 2012 at 9:10 PM · edited Wed, 12 December 2012 at 9:10 PM

Quote - ...bottom left of the window you see a check box next the words "Save alternate UVs", tick it and select Accept...

:Facepalm:!!!

I just hate it when they hide things in plain sight! :biggrin:

Thanks Bejaymac!!


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



3dcheapskate ( ) posted Wed, 12 December 2012 at 10:03 PM

...and now that I'm actually READING what the DS3 menus say, there's actually a "Save As UV Preset"...

...although that fails when I run it ("stripSpaces" not defined). So I'll stick with the material presets since I also need to apply DS materials anyway.

I can sidestep the DS3/4 incompatibility issue by doing two separate DSAs (thanks for spotting that!).

Thanks Richard/Bejaymac - I now have one solution for DS3 and two for DS4.

 


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



Bejaymac ( ) posted Thu, 13 December 2012 at 7:30 AM

Scratch some of what I said, I forgot I made the DS4 preset on my TriAx V4, that's where the problem going from DS3 to DS4 was, loading V4 from her CR2 and my DS3 presets work as intended. However the fresh material preset I just made in DS4 with V4 doesn't work in DS3, there is a difference in the code.

DS4

setBusyCursor();
this.m_aNodes = g_oSceneHelper.collectNodes( true, true, true );
beginUndo();
for( var i = 0; i < this.m_aNodes.length; i++ ){
this.m_oNode = this.m_aNodes[ i ];
var oUV;
var oObject = this.m_oNode.getObject();
try{
var oShape = oObject.getCurrentShape();
var oGeom = oShape.getGeometry();
oUV = new DzVertexMap( 1 );

 

DS3

setBusyCursor();
this.m_aNodes = g_oSceneHelper.collectNodes( true, true, true );
beginUndo();
for( var i = 0; i < this.m_aNodes.length; i++ ){
this.m_oNode = this.m_aNodes[ i ];
var aBone, oShape, oObject, oUV;
if( !this.m_oNode.inherits( "DzSkeleton" ) ){ continue; }
aBone = this.m_oNode.findBoneByLabel( "hip" );
if( aBone )
{
try{
oObject = aBone.getObject();
oShape = oObject.getCurrentShape();
oGeom = oShape.getGeometry();
oUV = new DzVertexMap( 1 );

That's the same section of code just before the UV's are defined.


3dcheapskate ( ) posted Thu, 13 December 2012 at 8:59 PM

Thanks for the update - that's good news. So a single materials preset DSA exported from DS3 with the "Save Alternate UVs" option checked should do it for me.

P.S. Most (I think all?) of the DSA files that I've exported from DS3 seem to work fine in DS4 and they're mainly (all?) material/shader presets, or my own scripts based on DS3 material/shader presets. But I still cross my fingers every time I test one in DS4!

P.S.#2: The differences in the code snippets you gave seem to tie in with Richard's comments about different ownership in DS3/4.


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.