Jump to content

Recommended Posts

sorry but.. i spent my last half hour browsing the help pages... and I cant find the 'opdef' help ..... anyone knows? thanks.


try looking here : hdox://houdini/content/base/assets_contents.xml

let me know if you need more info.


Link to comment
Share on other sites

well... ok I got the -idea- behind that page... I must admit I'm not advanced yet also because I dont have anyone close to learn from ..(I know this sounds lame or stupid.. but sometimes it helps).... my problem about opdef: help was after I downloaded the particle instance scene where shader of the instanciated objects were modified using the "attribcreate" SOP which had a string attribute using opdef: ..... hence I got the reason to search for some help about that...

I did searches on odforce forum.... and on google even .. but all i find is about OTL... but I cant -link- the concept of OTL to the scene i'm talking about .. I mean .. maybe is because i dont get the hidden concept of OTL.. or maybe cause in this case.. opdef: is used in a -differnt- way.. which actually made me wonder if I can even change SOPs values that way.... and not just shaders value... which could be the answer of a test I'm doing since long time... a crowd simulation which I want to randomize properties of chars...

so.. at the end... my -problem- now is.... how to really understand that opdef: usage in the attribcreate SOP .. where to find examples.. or how to ask for help? :).. i mean .. i wont make again the direct question "how can I do this"... i wish to learn the tool to do this first..... well .. dunno.

:).... maybe I'd post this question anyway...

can I use that attribcreate with opdef: string expression .. to modify SOP operator so that every instanciated object get randomized on other properties other than shader color? :D Ok i asked it....

thanks for you help tought.. that page made me having a long weekend reading those related stuffs which I'm sure it'll be really important for me.


Link to comment
Share on other sites

others question comes to my mind the more i give some tries on that scene....

- why if i rename the attribute from wm_surface to something else it doesnt work?

- why if i change -diff- to -amb- ... it seems it doesnt work anymore? (i'm not getting randomized ambient color)

- why if i try opdef:/Sop/platonic radius $CR this doesnt affect the radius of my instanciated teapots? (i guess it somehow have to do with the -vm_surface- thing :)) ...

and more... :P i guess you have an idea on how confused I'm on this topic... and i wish to clear it out.


Link to comment
Share on other sites

You seem to be asking about a few completely separate concepts here. I'm not familiar with the file you're refering to, but I'll try to explain things in a general way that might help. For the first part of this response, forget about vm_surface, and everything else in this thread except for the "opdef:" syntax.

The "opdef:" syntax you are referring to is a method of accessing files that are stored as part of an HDA definition. Think of it like "http:", it is a guide to Houdini to tell it where to find a file. Going a little deeper, an HDA is a collection of "sections", each of which is like a separate file. There is a section that describes the parameters for the HDA, one that holds the contents, one that holds the icon, the creation script, help, etc. When building an HDA, you can also bundle arbitrary files into the HDA definition. So with your airplane HDA you may bundle the texture maps right into the HDA so you don't need to worry about moving the texture map files around with the HDA.

So once you have this texture map section in your HDA, how do you tell Houdini to read in this file, use it as a texture map, etc? That's where opdef comes in. Anywhere in Houdini where you would specify a file name, you can put a string like "opdef:Object/mycharacter?texturemap.pic". Houdini interprets this as meaning "find the section called texturemap.pic in the definition for the Object HDA called mycharacter". And then it will read this file just like any other. So the opdef syntax has one use, and one use only: to let you specify the location of a file stored as a section on an HDA. That's why al the help for opdef refers to OTLs. The opdef syntax refers directly to HDAs stored in OTLs. This is it's only use.

Now back to your questions about vm_surface. vm_surface is the name of the primitive attribute that mantra uses to figure out what SHOP to use to shade a particular primitive. This attribute is generally created by the Shader SOP, but can also be created manually with an Attribute Create SOP. If you have geometry and change the attribute name to wm_surface, mantra will no longer know what SHOP to use to shade the primitive because it looks for vm_surface.

In addition to specifying the SHOP to use to shade the primitive, this attribute also contains parameters that are passed to the SHOP. These parameters are a string representation of the parameters you see in the dialog for a SHOP. Since you have "opdef:" and vm_surface tied together in this question, I'll assume that you have a hip file where the vm_surface attribute contains a string that includes "opdef:...." in it. In this case, the opdef syntax is most likely being used to specify a texture map file that is going to be used by a SHOP. This is just one of the parameters that is being specified for the SHOP that mantra will use to shade the primitive.

I hope this helps...


Link to comment
Share on other sites

Hey Mark,

really THANKS for your really helpfull explaination.. that cleared me a lot..

i'm sorry i tought the hip file was coming from odforce but it comes from sideFx forum instead


here's the link with the hip file.

so now I got (i gotta read twice tought until I'll really get the complete thing) the point about opdef... and surely about vm_surface.... so now watching at that hip file... is there an answer to my other question ... how to handle SOP nodes of the instanciated OBJ with attributes so that every instanciated OBJ can be changed randomly? (like deleting points... or modifiying anything I like randomly for any instance... let's say, figure, props on a crowd instanciated chars.

thanks a lot again.

hope this clearify my target for this thread. :)


Link to comment
Share on other sites

  • 2 weeks later...
[one' date=Jul 3 2006, 10:13 PM' post='28963]

hm... so there's no way to modify other parameters of instanciated GEO? :( ....

would be nice to have even a "no" answer actually :D ... at least i can stop planning using that for some upcoming tasks I have.. and look for another solution ..

p.s. I'll might need to make a crowd simluation .. and modifying SOP nodes for an instanciated GEO would be definetly what I'd need...

or a turnaround/another solution ...


Link to comment
Share on other sites

im not too sure theres not answer to that because when to try alter the color or shader of ur instanced object, u right by basically adding an attribute to ur point called vm_surface, to randomise the colors

on ur instance

opdef:/Shop/v_supermat spectype phong amb 1 `rand ($PT)` 1 diff `rand ($PT)` `rand ($PT+2)` `rand ($PT-3)` spec 0.8 0.8 0.8 _shop_ /shop/v_supermat1

u could use something like that wich is very basic,


to take it one step further, u could use hscript instancing, as a procedural on the geo, u can then feed ur custom sop otl some parameters and it will build ur geometry at render time based off ur otl's settings, a bit slow, but it works really well, they mentioned it in andz city link andz city


i dont know if that helps at all, but i hope it does :-)

all the best


Link to comment
Share on other sites

Ok I found an old "Hscript instancing" mantra procedure thread here ... (well I had it saved on my disk and I found looking at my old Houdini stuffs folder..) and it seems that's close to what I'm looking for.... I'll try to find out how to handle the needed attribute of my "character OTL" ... first question that comes into my mind.. .is how to "attributize" (sorry for this ;p) ... this FILEsop String:

$HIP/geo/`char``ch("../char")``_clip``ch("../clip")`.`wrap(($F+(int(fit(stamp("../../../copy1", "offset", 0), 0, 1, ch("../start") , ch("../end")))) , ch("../start") , ch("../end")))`.bgeo

which is how I load randomly offsetted animation of a specified characted and specified clip from the HDA parameters.... since it uses a COPYsop (like most of the OTL internal stuffs..which is "copy dependent"... like shader color.. and deletion of groups).


LOL ! :) we replied at same time.. right pointing at same answer :D..

thanks a lot Aracid.. that's what I was looking for (the Hscript stuffs).. I'll keep you posted.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...