Geoshell setup script?

MartirillaMartirilla Posts: 181
edited August 2021 in Daz Studio Discussion

Is there a script to automatically set up a geoshell on a Daz Studio figure, and thus save the user some repeated drudge-work? It would probably go like this:

1. Figure A is selected in the scene.

2. Create a geoshell from that figure. 

3. Slightly increase geoshell mesh offset, from the default.

4. Select geoshell and all its surfaces. Fix the geoshell's default 50% opacity. 

5. Apply shader B to geoshell.

6. Fix any clothing, so as not to have poke-under with the new geoshell.

I'm also looking for a lineart geoshell shader where the lines show up in the viewport, while keeping the default surfaces below perfecly visible 'through the lines'. I doubt it's possible in Daz, or it would have been done already. But it seems worth asking, and I figure if it is possible then some scripting and/or complex tehcnical stuff could be involved - and thus this seems the right place to ask.

Post edited by Richard Haseltine on

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,842
    edited August 2021

    Moved to Daz Studio Discussion as it was not about scripting but rather a request for a script.

    Have you tried saving a Wearables Preset with your desired settings? Though I'm not sure how 6 could be automated.

    Post edited by Richard Haseltine on
  • MattymanxMattymanx Posts: 6,905

    After you set up a geoshell the way you want it, you can save it as a wearable preset and use that saved wearable preset everytime instead of the create menu option.

    You could try resaving the clothes with the Geoshell set as the collision item for the smoothing modifier.

  • OmnifluxOmniflux Posts: 377

    Mattymanx's solution is probably the best way to do this, but since I've already posted a similar script, here is a modified version that does steps 1-5. I'm not sure what is involved in step 6.

    You will need to edit the script to set the desired mesh offset and shader (if Iray Uber is not the desired shader).

     

    dsa
    dsa
    Create Modified GeoShell.dsa
    5K
  • MartirillaMartirilla Posts: 181

    Thanks, OmiFlux, that's very generous of you.

    Step 6 - to remove poke-under on the clothes - would I think be done in the way Mattymanx suggests, with:

    the Geoshell set as the collision item for the smoothing modifier

  • OmnifluxOmniflux Posts: 377

    That would be a setting on the clothing, and not handled at shell creation time then so you'll have to do that one manually.

  • I see, thanks. So it sounds like there's no scriptable way to have a Daz script distinguish between bodies, hair, props and clothing - and then 'select all the clothing items'?

  • Clothing can be found in the scene heuristically and have a fairly good success rate.

    Check if metadata says it is a Wearable or check if it is fit to to a known figure (eg Genesis8Male) or has Shirt or Dress in the name, etc.

    But what I meant is it is not very sensible to do it in the same script because of the work flow

    1. Add Genesis 8 Female to scene
    2. Create Geometry shell
    3. Add dress to scene

    When the script to create the shell is run, the dress does not exist and so can not have its collision target set.

    If you change the order

    1. Add Genesis 8 Female to scene
    2. Add dress to scene
    3. Create Geometry shell

    The script can set the collision target, but then if you change your mind and delete the dress and add a different one, the setting will not follow and you will have to set it manually anyway.

    Because it cannot be guaranteed the clothing will exist before the shell, this should be done separately. It can be done in a script, but it makes more sense to have it done in a separate script (you could even have the shell creation script call the new script automatically for cases where the workflow is the first example above).

     

    As an addendum, it may be possible to use a callback to detect when something is fit to your figure and you could use that to then adjust the collision target automatically, but it is not something I am familiar with at this time.

     

  • hi @omniflux , thanks for script .

    I wanna know How to edit your script for used with another shader presets ( 3delight Geoshell Oultine ) and  auto change  value in mesh offset ?

    Thanks

  • OmnifluxOmniflux Posts: 377

    There are two lines near the beginning of the script you will need to modify.

    	var SHADER_PRESET = '/Shader Presets/Iray/DAZ Uber/!Iray Uber Base.duf';	var MESH_OFFSET = 0.1;

     

  • juvesatrianijuvesatriani Posts: 556
    edited October 2021

    Omniflux said:

    There are two lines near the beginning of the script you will need to modify.

    	var SHADER_PRESET = '/Shader Presets/Iray/DAZ Uber/!Iray Uber Base.duf';	var MESH_OFFSET = 0.1;

     

    Super Thanks !! Thats work perfectly . One more thing , if I want to set custom parameter in surface parameter , should I create custom shader first, then call it via your scripts or is possible to create new Surface parameter direct from your script ?  i.e like changing surface parameter value in  02_Z-depth Cutoff 

    Thanks again

    Post edited by juvesatriani on
  • OmnifluxOmniflux Posts: 377

    You can do it either way. I don't have that shader, so I can't give you exact instructions, but it would be something like this

    At the beginning after

    	var MESH_OFFSET = 0.1;

    add 

    	var Z_DEPTH_CUTOFF_SURFACE = 'SomeSurfaceName';	var Z_DEPTH_CUTOFF_PROPERTY = '02_Z-depth Cutoff';	// This should be the property name, not label	var Z_DEPTH_CUTOFF_VALUE = 100;	// Change material parameter	function setMaterialParameter (oNode, sMaterial, sProperty, nValue)	{		var oMaterial;		try { oMaterial = oNode.getObject().getCurrentShape().findMaterial (sMaterial) } catch (e) {}		if (oMaterial)		{			var oProperty = oMaterial.findProperty (sProperty);			if (oProperty)				oProperty.setValue (nValue);			else				 MessageBox.warning (qsTr ("Unable to find property: %1").arg (sProperty), qsTr ("Error"), qsTr ("&OK"), "");		}		else			 MessageBox.warning (qsTr ("Unable to find material: %1").arg (sMaterial), qsTr ("Error"), qsTr ("&OK"), "");	}

    And near the end after

    		// Set geometry shell mesh offset		setMeshOffset (oGeoShell);

    add

    		// Set Z-Depth Cutoff		setMaterialParameter (oGeoShell, Z_DEPTH_CUTOFF_SURFACE, Z_DEPTH_CUTOFF_PROPERTY, Z_DEPTH_CUTOFF_VALUE);

     

  • juvesatrianijuvesatriani Posts: 556
    edited October 2021

    Thanks @Omniflux , Will try your suggestion 

    Post edited by juvesatriani on
Sign In or Register to comment.