Getting values and fcurves for the port parameters of an ICE node


ICE nodes have ports, and the ports have parameters. It’s the parameters that you work with in an ICE node PPG.

For simple types such as float, integer and boolean, you can access the port parameter value through ICENodeInputPort.Value. However, for more complex types, like a 3D vector, you need to go through the ICENodeInputPort.Parameters.

In either case (simple or complex types), to get an Fcurve, you get a parameter and then use Parameter.Source.

For example, suppose you have a Scalar node:
ports_params_Scalar
To get the value from a Scalar node, you’d do this:

si = Application
node = si.Dictionary.GetObject( "pointcloud.pointcloud.ICETree.ScalarNode" )
port = node.InputPorts(0)

# For scalars, you can just use the port.Value property
print port.Value

# Or you could go through the Parameters
print port.Parameters(0).Value
# 0.428628623486
# 0.428628623486

# It's a little confusing because the port and the parameter have the same name:
print port.FullName
print port.Parameters(0).FullName
# pointcloud.pointcloud.ICETree.ScalarNode.value
# pointcloud.pointcloud.ICETree.ScalarNode.value


# Now get the Fcurve
fcv = param.Source

Now consider the case of a 3D Vector node, where you have one port (value) and three parameters (value_x, value_y, and value_z):
ports_params_3DVector
In this case, you cannot use ICENodeInputPort.Value, so you have to go through the parameters collection:

si = Application
node = si.Dictionary.GetObject( "pointcloud.pointcloud.ICETree.3DVectorNode" )
port = node.InputPorts(0)
print port.FullName # pointcloud.pointcloud.ICETree.3DVectorNode.value
param = port.Parameters( 0 )
print param.FullName # pointcloud.pointcloud.ICETree.3DVectorNode.value_x
print param.Value # 0.933080613613

# Now get the Fcurve
fcv = param.Source

hat tip: Alan Fregtman

Scripting: Toggling the constraint compensation mode


Here’s one way, using the not operator.

si = Application
si.SetUserPref( "SI3D_CONSTRAINT_COMPENSATION_MODE", not si.GetUserPref("SI3D_CONSTRAINT_COMPENSATION_MODE") )

The “problem” with this approach is that you’re toggling between 0 and -1, not between 0 and 1 (when you click the CnsComp button in the UI, you set the pref to either 0 or 1). The -1 happens because not 0 is -1.

Application.LogMessage( True == 1 )
Application.LogMessage( False == 0 )
Application.LogMessage( not False == -1 )
# INFO : True
# INFO : True
# INFO : True

So here’s a couple of other ways to toggle the preference value:

si = Application
si.SetUserPref( "SI3D_CONSTRAINT_COMPENSATION_MODE", 0 if si.GetUserPref("SI3D_CONSTRAINT_COMPENSATION_MODE") else 1 )
si = Application
toggle = [1,0]
si.SetUserPref( "SI3D_CONSTRAINT_COMPENSATION_MODE", toggle[si.GetUserPref("SI3D_CONSTRAINT_COMPENSATION_MODE")] )

Linking an ICE compound to a help page


The short answer is that you can’t do it, not really. The best you can do is provide a URL in the compound properties
Compound_URL
and then right-click the compound and click Open Netview on URL.
Compound_Open_URL_in_Netview

For ICE compounds, a CompoundNode property is loaded into the PPG when you inspect the compound.
C3DCompoundNode
This CompoundNode is like a proxy container for the actual compound, and it takes care of populating the PPG with the required controls, and finding the right help page. To do that, it just takes the name of the compound and constructs a URL like http://download.autodesk.com/global/docs/softimage2014/en_us/userguide/files/iceref_MyCompound.htm. (Hmm, having just said that, I figure if you had a local version of the help, then you could stick your own help page there, and Softimage would find it.)

For shader compounds it’s a little better, because you can put something like this in your PPG Logic, and it will work.

#ppg logic start
from win32com.client import constants

def OnInit():
    Application.LogMessage( "OnInit" )
    PPG.PPGLayout.SetAttribute( constants.siUIHelpFile, "http://lmgtfy.ca" )
#ppg logic end

hat tip: everybody on this thread

Screenshots of the week


Arnold shader “OSO” in emTools version 1.910
by Mootzoid
Shader_emToolsArnold_OSO

A script that applies fur via ICE. And Compression Matting on the fur

feathers and script improvements

Compression Matting on fur controlled by texture map

UV to position
by Mathaeus
uv_to_position

Transform UVs in the render tree
by NNois
Capture

Select in Array until Max Sum

Read color information of a texture map
by face
color

Friday Flashback #146


SOFTIMAGE|3D had a Effect > GC_Displace command (written with the C++ GDK) that displaced the vertices of a polygon mesh object based on an applied texture map. Using GC_Displace, you could “sculpt a terrain, a craggy moon surface, or even a face.”

I came across a screenshot of GC_Displace the other day, so for fun I re-created the basic effect in ICE:

ICE_GC_Displace

Friday Flashback #145


Screenshot of Wam!Net ROD Render in SOFTIMAGE|3D. From the Softimage web site back in 2000/2001.
Soft_website_ad_pic-liter1

Press release from April 2000:

Softimage Works With WAM!NET to Offer High-Speed Rendering to the Animation and 3-D Special Effects Industries

NAB2000

LAS VEGAS–(BUSINESS WIRE)–April 9, 2000

Softimage Co., a subsidiary of Avid Technology, Inc. (NASDAQ: AVID), and WAM!NET Inc. today announced that WAM!NET has joined the Softimage Developer program as a Gold Level Partner to provide its ROD!(TM)service (Render On Demand). ROD! is designed to give SOFTIMAGE(R)|3D and SOFTIMAGE(R)|XSI(TM) artists and animators a strong alternative to traditional rendering and asset management.

This relationship will give digital content creators an option to farm out the rendering process using the WAM!NET(R) ROD! service. Studios and small production facilities alike can reduce production costs and accurately estimate projects with the ROD! service, which provides the much-needed computing power for larger projects. This additional “as-needed” computing power allows animation and special effects studios to reduce overhead costs and accurately estimate project requirements, enabling them to remain competitive in the growing animation and special effects industry.

“Softimage is one of the top innovators in three-dimensional and two-dimensional graphics technology,” said Keith Elzia, vice president of strategic development at WAM!NET. “WAM!NET is an e-services company that believes in providing best-of-breed technology to its subscribers. Softimage is a technology leader in the animation and special effects industry. As a Gold Level Partner, our joint marketing and sales effort with Softimage will help build a stronger ROD! service for the animation industry with the two popular Softimage software applications available on ROD!.”

“WAM!NET has provided a powerful and cost-effective rendering service that is an excellent alternative for all of our customers regardless of size,” said David Miller, director of business development at Softimage. “The benefit of the WAM!NET ROD! service is that it is available on an ‘as-needed’ basis to provide added coverage and economic flexibility for the ebbs and flows of animation and special effects projects.”

WAM!NET’s ROD! service provides high-speed, wide-area rendering services and offers an effective way for all studios to do high-speed rendering and bid with confidence on large projects that require tremendous rendering power and asset management capabilities. WAM!NET’s services eliminate the need to upgrade or add to existing hardware and software to access high-speed, on-demand rendering.

The Benefits of WAM!NET

WAM!NET provides many benefits to SOFTIMAGE|3D, SOFTIMAGE|XSI and mental ray(R) customers, including:

–The ability to offload computer-intensive, time consuming rendering functions to WAM!NET’s high-speed, wide-area media network to save both money and time on projects;

–Asset management features and offsite archives provide an efficient method of storing and managing their rendering workflow;

–Access to WAM!NET’s distributed rendering on a high-speed, privately managed and secure network;

–The ability to utilize the WAM!NET ROD! service to outsource their computer-intensive rendering needs and enjoy increased profits and improved productivity as artists free up their workstations for more projects; and

–Most importantly, large or small studios alike will be able to enjoy WAM!NET’s ROD! service and confidently pursue larger projects with the processing power to meet tight deadlines on a pay-as-you-go basis.

About WAM!NET Inc.

WAM!NET Inc., with its digital media management service, sets the industry standard for electronic collaboration in the graphic arts, advertising, marketing and entertainment industries. WAM!NET’s Industry Smart(TM) high-speed transportation network, on-line archiving service and production workflow application software allow subscribers to digitally collaborate with thousands of global trading partners with one simple connection. Since its incorporation in the state of Minnesota in 1994, WAM!NET has attracted more than 1,900 users of direct services and over 6,800 users of its dial-up and Internet Gateway service. WAM!NET services are available throughout America, Europe and Japan.

WAM!NET is headquartered in Eagan, Minnesota, with offices throughout North America, Europe and Japan. The company has benefited from strategic relationships with SGI, MCI WorldCom and Winstar Communications. For more information about WAM!NET, call 800.611.9006, or visit WAM!NET’s Web site at http://www.wamnet.com.

WAM!NET(R) is a registered trademark and Industry Smart(TM) and ROD!(TM) are trademarks of WAM!NET Inc. All other trademarks and registered trademarks are the property of their respective companies.

About Avid Technology, Inc.

Avid Technology, Inc., of which Softimage Co. is a subsidiary, is an international, industry-leading provider of digital audio and video tools for information and entertainment applications. Avid’s products are used by a variety of customers worldwide including film, television and interactive content producers, TV news broadcasters, corporate communicators and consumers. For more information, visit the Softimage site at http://www.softimage.com or Avid’s Web site at http://www.avid.com.

(c)2000 Avid Technology, Inc. All rights reserved. Product specifications are subject to change without notice. Avid and Softimage are registered trademarks and XSI is a trademark of Avid Technology, Inc. WAM!NET is a registered trademark and Industry Smart and ROD! are trademarks of WAM!NET Inc. mental ray and mental images are registered trademarks of mental images GmbH & Co. KG in the USA and/or other countries. All other trademarks contained herein are the property of their respective owners.

Objects and default properties


Here’s a scripting question from the mailing list:

Why do I get “None” when I print ChainRoot.Children and
ChainRoot.Bones?

si = Application
chainRoot = si.Create2DSkeleton(0, 0, 0, 10, 0, 0, -90, 0, 0, 4)

print chainRoot
print chainRoot.Children # Not working
print chainRoot.Bones # Not working
print chainRoot.Effector

# root1
# None
# None
# eff1

The answer is that ChainRoot.Children and ChainRoot.Bones are objects that don’t have a default property, so (in Python) you get the string representation of those objects, which is “None”.

ChainRoot and ChainRoot.Effector, being types of SIObject, and they do have a default property: the Name property.

ChainRoot.Children is an X3DObjectCollection, and ChainRoot.Bones is a ChainBoneCollection, and for whatever reason, those two collections don’t have Item as their default property (for some collections, like ISIVTCollection and LinktabRuleCollection, the Item property is the default property).

So the above Python is equivalent to this:

si = Application
chainRoot = si.Create2DSkeleton(0, 0, 0, 10, 0, 0, -90, 0, 0, 4)

print chainRoot.Name
print str( chainRoot.Children )
print chainRoot.Bones.__str__()
print chainRoot.Effector.Name

# root1
# None
# None
# eff1

Note that in JScript and VBScript, you’d get a “Type mismatch” error instead of the string “None” (in the original snippet).

Finding hidden objects


Here’s a little Python snippet that finds all 3d objects that have View Visibility turned off. After you run the snippet, those hidden objects are selected, so you can open the Explorer and press E to see them.

import win32com.client
viewvis = win32com.client.Dispatch( "XSI.Collection" )
hidden = win32com.client.Dispatch( "XSI.Collection" )

si = Application

viewvis.Items = '*.visibility.viewvis'
for o in viewvis:
	if o.Value == False and si.ClassName( o.Parent3DObject ) == "X3DObject" :
		hidden.Add( o.Parent3DObject )

si.SelectObj( hidden )
for o in hidden:
	print o