Jump to content

Hom...few Questions


AndrewVK

Recommended Posts

Is it possible to provide file choice dialog with the default filename???

I am trying this, but it have no effect

camName = cam.name()
defname = camName + '.jsx'
dirpath = hou.expandString('$HIP')
fname = hou.ui.selectFile( start_directory = dirpath,
	file_type = hou.fileType.Any,
	default_value = defname,
	collapse_sequences = False,
	multiple_select = False,
	image_chooser   = False)

Is it possible to prevent user from selecting objects other than camera

not only in "Scene View" but also in Net or Tree view

I am trying this

cam = viewer.selectObjects("Select a camera and press Enter",
	use_existing_selection=False,
	quick_select=True,
	allowed_types = ["cam"])[-1]

It works in scene view, but i still can select everything in net view

Link to comment
Share on other sites

problem with filename solved...

dir = hou.expandString('$HIP')
dirpath = dir + '/' + camName + '.jsx'
fname = hou.ui.selectFile( start_directory = dirpath,
		file_type = hou.fileType.Any,
		collapse_sequences = False,
		multiple_select = False,
		pattern = '*.jsx',
		image_chooser   = False)
if not fname.endswith('.jsx'):
	fname = fname + '.jsx'

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.

Guest
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...